46 TClonesReader() =
default;
47 ~TClonesReader()
override =
default;
48 TClonesReader(
const TClonesReader &) =
delete;
49 TClonesReader &operator=(
const TClonesReader &) =
delete;
50 TClonesReader(TClonesReader &&) =
delete;
51 TClonesReader &operator=(TClonesReader &&) =
delete;
58 Error(
"TClonesReader::GetCA()",
"Read error in TBranchProxy.");
88 Error(
"TClonesReader::GetValueSize()",
"Read error in TBranchProxy.");
104 default:
return false;
113 auto &&eDataType = cp.
GetType();
115 return tDataType ? tDataType->Size() : 0;
121 ~TSTLReader()
override {}
124 if (!proxy->
Read()) {
127 Error(
"TSTLReader::GetCP()",
"Read error in TBranchProxy.");
131 Error(
"TSTLReader::GetCP()",
"Logic error, proxy object not set in TBranchProxy.");
141 if (!myCollectionProxy)
143 return myCollectionProxy->
Size();
149 if (!myCollectionProxy)
152 return *(
void **)myCollectionProxy->
At(idx);
154 return myCollectionProxy->
At(idx);
160 auto cp = GetCP(proxy);
161 return IsCPContiguous(*cp);
166 auto cp = GetCP(proxy);
167 return GetCPValueSize(*cp);
180 if (!proxy->
Read()) {
183 Error(
"TCollectionLessSTLReader::GetCP()",
"Read error in TBranchProxy.");
187 Error(
"TCollectionLessSTLReader::GetCP()",
"Logic error, proxy object not set in TBranchProxy.");
191 return fLocalCollection;
197 if (!myCollectionProxy)
203 return myCollectionProxy->
Size();
209 if (!myCollectionProxy)
217 return *(
void **)myCollectionProxy->
At(idx);
219 return myCollectionProxy->
At(idx);
225 auto cp = GetCP(proxy);
226 return IsCPContiguous(*cp);
231 auto cp = GetCP(proxy);
232 return GetCPValueSize(*cp);
240 Int_t fBasicTypeSize;
243 TObjectArrayReader() : fBasicTypeSize(-1) {}
244 ~TObjectArrayReader()
override {}
247 if (!proxy->
Read()) {
250 Error(
"TObjectArrayReader::GetCP()",
"Read error in TBranchProxy.");
259 if (!myCollectionProxy)
261 return myCollectionProxy->
Size();
269 void *array = (
void *)proxy->
GetStart();
271 if (fBasicTypeSize == -1) {
274 Error(
"TObjectArrayReader::At()",
"Cannot get class info from branch proxy.");
279 objectSize = fBasicTypeSize;
281 return (
void *)((
Byte_t *)array + (objectSize * idx));
290 auto cp = GetCP(proxy);
292 return GetCPValueSize(*cp);
299class TDynamicArrayReader :
public BASE {
302 class TVirtualSizeReaderImpl {
304 virtual ~TVirtualSizeReaderImpl() =
default;
305 virtual size_t GetSize() = 0;
308 template <
typename T>
309 class TSizeReaderImpl final :
public TVirtualSizeReaderImpl {
313 TSizeReaderImpl(
TTreeReader &
r,
const char *leafName) : fSizeReader(
r, leafName) {}
314 size_t GetSize() final {
return *fSizeReader; }
317 std::unique_ptr<TVirtualSizeReaderImpl> fSizeReader;
320 template <
class... ARGS>
321 TDynamicArrayReader(
TTreeReader *treeReader,
const char *leafName, ARGS &&...args)
322 : BASE(std::
forward<ARGS>(args)...)
324 std::string foundLeafName = leafName;
330 std::string leafNameNoParent = leafName;
332 auto posLastDot = leafNameNoParent.rfind(
'.');
333 if (posLastDot != leafNameNoParent.npos) {
334 parent = leafNameNoParent.substr(0, posLastDot);
335 leafNameNoParent.erase(0, posLastDot + 1);
339 if (!sizeLeaf && !parent.empty()) {
340 auto posLastDotParent = parent.rfind(
'.');
341 if (posLastDotParent != parent.npos)
342 parent = parent.substr(0, posLastDot);
347 foundLeafName = parent;
349 foundLeafName +=
".";
350 foundLeafName += leafNameNoParent;
352 }
while (!sizeLeaf && !parent.empty());
356 Error(
"TDynamicArrayReader ",
"Cannot find leaf count for %s or any parent branch!", leafName);
360 SetSizeReader(*treeReader, *sizeLeaf, foundLeafName.c_str());
365 template <
class... ARGS>
366 TDynamicArrayReader(
TTreeReader *treeReader,
TLeaf *sizeLeaf,
const char *sizeBranchName, ARGS &&...args)
367 : BASE(std::
forward<ARGS>(args)...)
369 SetSizeReader(*treeReader, *sizeLeaf, sizeBranchName);
373 void SetSizeReader(
TTreeReader &treeReader,
TLeaf &sizeLeaf,
const char *sizeBranchName)
375 const std::string leafType = sizeLeaf.
GetTypeName();
376 if (leafType ==
"Int_t") {
377 fSizeReader.reset(
new TSizeReaderImpl<Int_t>(treeReader, sizeBranchName));
378 }
else if (leafType ==
"UInt_t") {
379 fSizeReader.reset(
new TSizeReaderImpl<UInt_t>(treeReader, sizeBranchName));
380 }
else if (leafType ==
"Short_t") {
381 fSizeReader.reset(
new TSizeReaderImpl<Short_t>(treeReader, sizeBranchName));
382 }
else if (leafType ==
"UShort_t") {
383 fSizeReader.reset(
new TSizeReaderImpl<UShort_t>(treeReader, sizeBranchName));
384 }
else if (leafType ==
"Long_t") {
385 fSizeReader.reset(
new TSizeReaderImpl<Long_t>(treeReader, sizeBranchName));
386 }
else if (leafType ==
"ULong_t") {
387 fSizeReader.reset(
new TSizeReaderImpl<ULong_t>(treeReader, sizeBranchName));
388 }
else if (leafType ==
"Long64_t") {
389 fSizeReader.reset(
new TSizeReaderImpl<Long64_t>(treeReader, sizeBranchName));
390 }
else if (leafType ==
"ULong64_t") {
391 fSizeReader.reset(
new TSizeReaderImpl<ULong64_t>(treeReader, sizeBranchName));
393 Error(
"TDynamicArrayReader ",
394 "Unsupported size type for leaf %s. Supported types are int, short int, long int, long long int and "
395 "their unsigned counterparts.",
404class TArrayParameterSizeReader :
public TDynamicArrayReader<TObjectArrayReader> {
406 TArrayParameterSizeReader(
TTreeReader *treeReader,
const char *branchName)
407 : TDynamicArrayReader<TObjectArrayReader>(treeReader, branchName)
414 : TDynamicArrayReader<TObjectArrayReader>(treeReader, static_cast<
TLeaf *>(sizeBranch->GetListOfLeaves()->At(0)),
421class TArrayFixedSizeReader :
public TObjectArrayReader {
426 TArrayFixedSizeReader(
Int_t sizeArg) :
fSize(sizeArg) {}
433 ~TBasicTypeArrayReader()
override {}
437 if (!proxy->
Read()) {
440 Error(
"TBasicTypeArrayReader::GetCP()",
"Read error in TBranchProxy.");
450 if (!myCollectionProxy)
452 return myCollectionProxy->
Size();
458 if (!myCollectionProxy)
467 if (!proxy->
Read()) {
470 Error(
"TBasicTypeArrayReader::GetValueSize()",
"Read error in TBranchProxy.");
478class TBasicTypeClonesReader final :
public TClonesReader {
483 TBasicTypeClonesReader(
Int_t offsetArg) : fOffset(offsetArg) {}
485 ~TBasicTypeClonesReader() final = default;
486 TBasicTypeClonesReader(const TBasicTypeClonesReader &) = delete;
487 TBasicTypeClonesReader &operator=(const TBasicTypeClonesReader &) = delete;
488 TBasicTypeClonesReader(TBasicTypeClonesReader &&) = delete;
489 TBasicTypeClonesReader &operator=(TBasicTypeClonesReader &&) = delete;
496 return (
Byte_t *)myClonesArray->
At(idx) + fOffset;
506 TLeafReader(
TTreeReaderValueBase *valueReaderArg) : fValueReader(valueReaderArg), fElementSize(-1) {}
511 return myLeaf ? myLeaf->
GetLen() : 0;
518 if (fElementSize == -1) {
524 return (
Byte_t *)address + (fElementSize * idx);
531 auto *leaf = fValueReader->
GetLeaf();
536 void ProxyRead() { fValueReader->
ProxyRead(); }
539class TLeafParameterSizeReader :
public TDynamicArrayReader<TLeafReader> {
542 : TDynamicArrayReader<TLeafReader>(treeReader, leafName, valueReaderArg)
549 return TDynamicArrayReader<TLeafReader>::GetSize(proxy);
564 fSetupStatus = kSetupInternalError;
566 Error(
"TTreeReaderArrayBase::CreateProxy()",
"TTreeReader object not set / available for branch %s!",
568 fSetupStatus = kSetupTreeDestructed;
573 const char *brDataType =
"{UNDETERMINED}";
576 brDataType = GetBranchDataType(br, dictUnused, fDict);
578 Error(
"TTreeReaderArrayBase::CreateProxy()",
579 "The template argument type T of %s accessing branch %s (which contains data of type %s) is not known to "
580 "ROOT. You will need to create a dictionary for it.",
581 GetDerivedTypeName(), fBranchName.Data(), brDataType);
582 fSetupStatus = kSetupMissingDictionary;
593 const bool suppressErrorsForThisBranch = (fTreeReader->fSuppressErrorsForMissingBranches.find(fBranchName.Data()) !=
594 fTreeReader->fSuppressErrorsForMissingBranches.cend());
598 TLeaf *myLeaf =
nullptr;
599 if (!GetBranchAndLeaf(branch, myLeaf, branchActualType, suppressErrorsForThisBranch))
603 Error(
"TTreeReaderArrayBase::CreateProxy()",
"No dictionary for branch %s.", fBranchName.Data());
610 fSetupStatus = kSetupMatch;
612 SetImpl(branch, myLeaf);
621 fSetupStatus = kSetupMatch;
623 Error(
"TTreeReaderArrayBase::CreateProxy()",
"Type ambiguity (want %s, have %s) for branch %s.",
629 bool isTopLevel = branch->
GetMother() == branch;
631 membername = strrchr(branch->
GetName(),
'.');
632 if (membername.
IsNull()) {
633 membername = branch->
GetName();
636 auto *director = fTreeReader->fDirector.get();
640 std::optional<std::size_t>
index;
641 std::size_t current{};
642 auto &&friends = fTreeReader->GetTree()->GetTree()->GetListOfFriends();
650 if (!
index.has_value()) {
651 Error(
"TTreeReaderArrayBase::CreateProxy()",
652 "The branch %s is contained in a Friend TTree that is not directly attached to the main.\n"
653 "This is not yet supported by TTreeReader.",
658 auto &&friendProxy = fTreeReader->AddFriendProxy(
index.value());
659 director = friendProxy.GetDirector();
661 fTreeReader->AddProxy(
662 std::make_unique<TNamedBranchProxy>(director, branch, fBranchName, membername, suppressErrorsForThisBranch));
664 namedProxy = fTreeReader->FindProxy(fBranchName);
667 fSetupStatus = kSetupMatch;
669 fSetupStatus = kSetupMismatch;
675 const char *nonCollTypeName = GetBranchContentDataType(branch, branchActualTypeName, branchActualType, arrInfo);
676 if (nonCollTypeName) {
677 Error(
"TTreeReaderArrayBase::CreateContentProxy()",
678 "The branch %s contains data of type %s, which should be accessed through a TTreeReaderValue< %s >.",
679 fBranchName.Data(), nonCollTypeName, nonCollTypeName);
680 if (fSetupStatus == kSetupInternalError)
681 fSetupStatus = kSetupNotACollection;
685 if (!branchActualType) {
686 if (branchActualTypeName.
IsNull()) {
687 Error(
"TTreeReaderArrayBase::CreateContentProxy()",
688 "Cannot determine the type contained in the collection of branch %s. That's weird - please report!",
691 Error(
"TTreeReaderArrayBase::CreateContentProxy()",
692 "The branch %s contains data of type %s, which does not have a dictionary.", fBranchName.Data(),
693 branchActualTypeName.
Data());
694 if (fSetupStatus == kSetupInternalError)
695 fSetupStatus = kSetupMissingDictionary;
709 auto cl =
dynamic_cast<TClass *
>(requestedDict);
716 auto streamerElements = streamerInfo->
GetElements();
717 if (!streamerElements)
723 if (streamerElements->GetEntries() > 1)
726 auto streamerElement =
dynamic_cast<TStreamerElement *
>(streamerElements->At(0));
727 if (!streamerElement)
731 if (
auto *dataType =
gROOT->GetType(streamerElement->GetTypeNameBasic()))
732 dataTypeCode = dataType->
GetType();
734 auto checkArrayDims = [&]() {
735 for (
int i = 0; i < info.fArrayNDims; i++) {
736 if (info.fArrayDims[i] != streamerElement->GetMaxIndex(i))
742 return streamerElement->GetArrayDim() == info.fArrayNDims &&
743 streamerElement->GetArrayLength() == info.fArrayCumulativeLength && checkArrayDims() &&
744 dataTypeCode == info.fTDataTypeCode;
753 auto left_datatype =
dynamic_cast<TDataType *
>(left);
754 auto right_datatype =
dynamic_cast<TDataType *
>(right);
755 auto left_enum =
dynamic_cast<TEnum *
>(left);
756 auto right_enum =
dynamic_cast<TEnum *
>(right);
758 if ((left_datatype && left_datatype->GetType() ==
kInt_t && right_enum) ||
759 (right_datatype && right_datatype->GetType() ==
kInt_t && left_enum))
761 if ((left_datatype && right_enum && left_datatype->GetType() == right_enum->GetUnderlyingType()) ||
762 (right_datatype && left_enum && right_datatype->GetType() == left_enum->GetUnderlyingType()))
768 if (matchingArrayInfo(left, info))
775 auto typeCode = left_datatype->GetType();
776 if (typeCode > 0 && typeCode == info.fTDataTypeCode)
780 if (!left_datatype || !right_datatype)
782 auto l = left_datatype->GetType();
783 auto r = right_datatype->GetType();
791 if (!matchingDataType(fDict, branchActualType, arrInfo)) {
792 Error(
"TTreeReaderArrayBase::CreateContentProxy()",
793 "The branch %s contains data of type %s. It cannot be accessed by a TTreeReaderArray<%s>",
794 fBranchName.Data(), branchActualType->
GetName(), fDict->GetName());
795 if (fSetupStatus == kSetupInternalError || fSetupStatus >= 0)
796 fSetupStatus = kSetupMismatch;
808 SetImpl(branch, myLeaf);
816 bool suppressErrorsForMissingBranch)
823 if (!fBranchName.Contains(
".")) {
824 if (!suppressErrorsForMissingBranch) {
825 Error(
"TTreeReaderArrayBase::GetBranchAndLeaf()",
826 "The tree does not have a branch called %s. You could check with TTree::Print() for available branches.",
829 fSetupStatus = kSetupMissingBranch;
834 TRegexp leafNameExpression(
"\\.[a-zA-Z0-9_]+$");
835 TString leafName(fBranchName(leafNameExpression));
836 TString branchName = fBranchName(0, fBranchName.Length() - leafName.
Length());
839 if (!suppressErrorsForMissingBranch) {
840 Error(
"TTreeReaderArrayBase::GetBranchAndLeaf()",
841 "The tree does not have a branch called %s. You could check with TTree::Print() for available branches.",
844 fSetupStatus = kSetupMissingBranch;
851 if (!suppressErrorsForMissingBranch) {
852 Error(
"TTreeReaderArrayBase::GetBranchAndLeaf()",
853 "The tree does not have a branch, nor a sub-branch called %s. You could check with TTree::Print() for "
854 "available branches.",
857 fSetupStatus = kSetupMissingBranch;
864 Error(
"TTreeReaderArrayBase::GetBranchAndLeaf()",
"Failed to get the dictionary for %s.", myLeaf->
GetTypeName());
865 fSetupStatus = kSetupMissingDictionary;
873 branchActualType = fDict;
875 fBranchName = branchName;
876 fLeafName = leafName(1, leafName.
Length());
877 fHaveLeaf = (fLeafName.Length() > 0);
878 fSetupStatus = kSetupMatchLeaf;
880 Error(
"TTreeReaderArrayBase::GetBranchAndLeaf()",
"Leaf of type %s cannot be read by TTreeReaderValue<%s>.",
883 fSetupStatus = kSetupMismatch;
906 fImpl = std::make_unique<TLeafReader>(
this);
911 fImpl = std::make_unique<TLeafParameterSizeReader>(fTreeReader, leafFullName.
Data(),
this);
913 fSetupStatus = kSetupMatchLeaf;
926 if (fSetupStatus == kSetupInternalError)
927 fSetupStatus = kSetupMatch;
929 if (branchElement->
GetType() == 31) {
930 Error(
"TTreeReaderArrayBase::SetImpl",
"STL Collection nested in a TClonesArray not yet supported");
931 fSetupStatus = kSetupInternalError;
934 fImpl = std::make_unique<TSTLReader>();
939 fImpl = std::make_unique<TClonesReader>();
941 fImpl = std::make_unique<TBasicTypeArrayReader>();
944 fImpl = std::make_unique<TBasicTypeClonesReader>(element->
GetOffset());
946 fImpl = std::make_unique<TArrayFixedSizeReader>(element->
GetArrayLength());
949 fImpl = std::make_unique<TArrayParameterSizeReader>(fTreeReader, branchElement->
GetBranchCount());
952 fImpl = std::make_unique<TBasicTypeArrayReader>();
954 fImpl = std::make_unique<TBasicTypeClonesReader>(element->
GetOffset());
956 fImpl = std::make_unique<TArrayFixedSizeReader>(element->
GetArrayLength());
957 ((TObjectArrayReader *)fImpl.get())->SetBasicTypeSize(
sizeof(
Int_t));
959 fImpl = std::make_unique<TArrayFixedSizeReader>(element->
GetArrayLength());
960 ((TObjectArrayReader *)fImpl.get())->SetBasicTypeSize(((
TDataType *)fDict)->Size());
963 fImpl = std::make_unique<TArrayParameterSizeReader>(fTreeReader, branchElement->
GetBranchCount());
964 ((TArrayParameterSizeReader *)fImpl.get())->SetBasicTypeSize(((
TDataType *)fDict)->Size());
966 fImpl = std::make_unique<TClonesReader>();
968 Error(
"TTreeReaderArrayBase::SetImpl()",
"Cannot read branch %s: unhandled streamer element type %s",
969 fBranchName.Data(), element->
IsA()->
GetName());
970 fSetupStatus = kSetupInternalError;
980 Error(
"TTreeReaderArrayBase::SetImpl",
"Failed to get the top leaf from the branch");
981 fSetupStatus = kSetupMissingBranch;
986 if (fSetupStatus == kSetupInternalError)
987 fSetupStatus = kSetupMatch;
989 fImpl = std::make_unique<TArrayFixedSizeReader>(topLeaf->GetLenStatic());
991 fImpl = std::make_unique<TArrayParameterSizeReader>(fTreeReader, sizeLeaf->
GetName());
993 ((TObjectArrayReader *)fImpl.get())->SetBasicTypeSize(((
TDataType *)fDict)->Size());
995 Error(
"TTreeReaderArrayBase::SetImpl",
"Support for branches of type TBranchClones not implemented");
996 fSetupStatus = kSetupInternalError;
998 Error(
"TTreeReaderArrayBase::SetImpl",
"Support for branches of type TBranchObject not implemented");
999 fSetupStatus = kSetupInternalError;
1001 Error(
"TTreeReaderArrayBase::SetImpl",
"Support for branches of type TBranchSTL not implemented");
1002 fImpl = std::make_unique<TSTLReader>();
1003 fSetupStatus = kSetupInternalError;
1005 Error(
"TTreeReaderArrayBase::SetImpl",
"Support for branches of type TBranchRef not implemented");
1006 fSetupStatus = kSetupInternalError;
1020 arrInfo.fTDataTypeCode = datatype->GetType();
1022 for (
int i = 0; i < arrInfo.fArrayNDims; ++i)
1043 contentTypeName =
"";
1051 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
"Could not get value class.");
1061 if (brElement->
GetType() == 3) {
1070 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1071 "Cannot determine STL collection type of %s stored in branch %s", brElement->
GetClassName(),
1077 contentTypeName =
"std::pair< ";
1078 contentTypeName += splitType.
fElements[1];
1080 contentTypeName += splitType.
fElements[2];
1081 contentTypeName +=
" >";
1086 }
else if (brElement->
GetType() == 31 || brElement->
GetType() == 41) {
1088 TClass *clData =
nullptr;
1091 if (ExpectedTypeRet == 0) {
1103 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1104 "The branch %s contains a data type %d for which the dictionary cannot be retrieved.",
1105 branch->
GetName(), (
int)dtData);
1112 }
else if (ExpectedTypeRet == 1) {
1113 int brID = brElement->
GetID();
1116 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1117 "The branch %s contains data of type %s for which the dictionary does not exist. It's needed.",
1131 return "{CANNOT DETERMINE TBranchElement DATA TYPE}";
1139 arrInfo = FillStreamerElementArrayInfo(element);
1143 Error(
"TTreeReaderArrayBase::GetBranchDataType()",
"Could not get class from branch element.");
1147 if (!myCollectionProxy) {
1148 Error(
"TTreeReaderArrayBase::GetBranchDataType()",
"Could not get collection proxy from STL class");
1157 Error(
"TTreeReaderArrayBase::GetBranchDataType()",
"Could not get valueClass from collectionProxy.");
1160 contentTypeName = dict->
GetName();
1163 if (!fProxy->Setup() || !fProxy->Read()) {
1164 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1165 "Failed to get type from proxy, unable to check type");
1166 contentTypeName =
"UNKNOWN";
1168 return contentTypeName;
1172 contentTypeName = dict->
GetName();
1185 contentTypeName =
"TClonesArray";
1186 Warning(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1187 "Not able to check type correctness, ignoring check");
1189 fSetupStatus = kSetupNoCheck;
1197 contentTypeName = dict->
GetName();
1201 contentTypeName = dict->
GetName();
1230 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1231 "The branch %s was created using a leaf list and cannot be represented as a C++ type. Please access one "
1232 "of its siblings using a TTreeReaderArray:",
1235 TLeaf *leaf =
nullptr;
1236 while ((leaf = (
TLeaf *)iLeaves())) {
1237 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
" %s.%s", branch->
GetName(), leaf->
GetName());
1244 Warning(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1245 "Not able to check type correctness, ignoring check");
1247 fSetupStatus = kSetupNoCheck;
1250 return dataTypeName;
1253 return "TClonesArray";
1256 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1257 "The branch %s is a TBranchRef and cannot be represented as a C++ type.", branch->
GetName());
1260 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1261 "The branch %s is of type %s - something that is not handled yet.", branch->
GetName(),
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
unsigned char Byte_t
Byte (8 bits) (unsigned char)
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Base class for all the proxy object.
virtual void * GetStart(UInt_t=0)
std::size_t GetValueSize() const
bool GetSuppressErrorsForMissingBranch() const
TVirtualCollectionProxy * GetCollection()
const Detail::TBranchProxy * GetProxy() const
TDictionary * GetContentDict() const
void SetContentDict(TDictionary *dict)
void CreateProxy() override
Create the proxy object for our branch.
bool GetBranchAndLeaf(TBranch *&branch, TLeaf *&myLeaf, TDictionary *&branchActualType, bool suppressErrorsForMissingBranch=false)
Determine the branch / leaf and its type; reset fProxy / fSetupStatus on error.
StreamerElementArrayInfo FillStreamerElementArrayInfo(TStreamerElement *elem)
const char * GetBranchContentDataType(TBranch *branch, TString &contentTypeName, TDictionary *&dict, StreamerElementArrayInfo &arrInfo)
Access a branch's collection content (not the collection itself) through a proxy.
void SetImpl(TBranch *branch, TLeaf *myLeaf)
Create the TVirtualCollectionReader object for our branch.
Base class of TTreeReaderValue.
void * GetAddress()
Returns the memory address of the object being read.
@ kReadError
Problem reading data.
@ kReadSuccess
Data read okay.
TLeaf * GetLeaf()
If we are reading a leaf, return the corresponding TLeaf.
virtual ~TVirtualCollectionReader()
A Branch for the case of an object.
TBranchElement * GetBranchCount() const
const char * GetClassName() const override
Return the name of the user class whose content is stored in this branch, if any.
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
TVirtualCollectionProxy * GetCollectionProxy()
Return the collection proxy describing the branch content, if any.
TClass * GetCurrentClass()
Return a pointer to the current type of the data member corresponding to branch element.
virtual const char * GetTypeName() const
Return type name of element in the branch.
virtual const char * GetClonesName() const
virtual TClass * GetClass() const
Int_t GetExpectedType(TClass *&clptr, EDataType &type) override
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
A TTree is a list of TBranches.
virtual TLeaf * GetLeaf(const char *name) const
Return pointer to the 1st Leaf named name in thisBranch.
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
Int_t GetSplitLevel() const
TClass * IsA() const override
TObjArray * GetListOfLeaves()
TBranch * GetMother() const
Get our top-level parent branch in the tree.
TClass instances represent classes, structs and namespaces in the ROOT type system.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Int_t GetClassSize() const
TClass * IsA() const override
An array of clone (identical) objects.
TClass * GetClass() const
Basic data type descriptor (datatype information is obtained from CINT).
TString GetTypeName()
Get basic type of typedef, e,g.: "class TDirectory*" -> "TDirectory".
static TDataType * GetDataType(EDataType type)
Given a EDataType type, get the TDataType* that represents it.
This class defines an abstract interface that must be implemented by all classes that contain diction...
TClass * IsA() const override
static TDictionary * GetDictionary(const char *name)
Retrieve the type (class, fundamental type, typedef etc) named "name".
The TEnum class implements the enum type.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual Int_t GetLenType() const
virtual const char * GetTypeName() const
virtual Int_t GetLen() const
Return the number of effective elements of this leaf, for the current entry.
virtual TLeaf * GetLeafCount() const
If this leaf stores a variable-sized array or a multi-dimensional array whose last dimension has vari...
TBranch * GetBranch() const
const char * GetName() const override
Returns name of object.
Int_t GetEntries() const override
Return the number of objects in array (i.e.
TObject * At(Int_t idx) const override
TObject * UncheckedAt(Int_t i) const
Regular expression class.
Describe one element (data member) to be Streamed.
Int_t GetArrayDim() const
Int_t GetArrayLength() const
Int_t GetMaxIndex(Int_t i) const
const char * GetTypeName() const
TClass * GetClass() const
TClass * IsA() const override
const char * GetTypeNameBasic() const
Return type name of this element in case the type name is not a standard basic type,...
Describes a persistent version of a class.
TStreamerElement * GetElement(Int_t id) const override
TObjArray * GetElements() const override
const char * Data() const
An interface for reading values stored in ROOT columnar datasets.
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
virtual TTree * GetTree() const
virtual TLeaf * FindLeaf(const char *name)
Find first leaf containing searchname.
Defines a common interface to inspect/change the contents of an object that represents a collection.
virtual Int_t GetProperties() const
Return miscallenous properties of the proxy (see TVirtualCollectionProxy::EProperty)
virtual void PushProxy(void *objectstart)=0
Set the address of the container being proxied and keep track of the previous one.
virtual EDataType GetType() const =0
If the value type is a fundamental data type, return its type (see enumeration EDataType).
virtual void PopProxy()=0
Reset the address of the container being proxied to the previous container.
virtual TClass * GetValueClass() const =0
If the value type is a user-defined class, return a pointer to the TClass representing the value type...
virtual void * At(UInt_t idx)=0
Return the address of the value at index idx
virtual Int_t GetCollectionType() const =0
Return the type of the proxied collection (see enumeration TClassEdit::ESTLType)
virtual UInt_t Size() const =0
Return the current number of elements in the container.
virtual Bool_t HasPointers() const =0
Return true if the content is of type 'pointer to'.
virtual TObjArray * GetElements() const =0
void forward(const LAYERDATA &prevLayerData, LAYERDATA &currLayerData)
apply the weights (and functions) in forward direction of the DNN
std::string GetFullName(TCppScope_t)
int IsSTLCont(int testAlloc=0) const
type : type name: vector<list<classA,allocator>,allocator> testAlloc: if true, we test allocator,...
std::vector< std::string > fElements