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 const std::string leafType = sizeLeaf->
GetTypeName();
361 if (leafType ==
"Int_t") {
362 fSizeReader.reset(
new TSizeReaderImpl<Int_t>(*treeReader, foundLeafName.c_str()));
363 }
else if (leafType ==
"UInt_t") {
364 fSizeReader.reset(
new TSizeReaderImpl<UInt_t>(*treeReader, foundLeafName.c_str()));
365 }
else if (leafType ==
"Short_t") {
366 fSizeReader.reset(
new TSizeReaderImpl<Short_t>(*treeReader, foundLeafName.c_str()));
367 }
else if (leafType ==
"UShort_t") {
368 fSizeReader.reset(
new TSizeReaderImpl<UShort_t>(*treeReader, foundLeafName.c_str()));
369 }
else if (leafType ==
"Long_t") {
370 fSizeReader.reset(
new TSizeReaderImpl<Long_t>(*treeReader, foundLeafName.c_str()));
371 }
else if (leafType ==
"ULong_t") {
372 fSizeReader.reset(
new TSizeReaderImpl<ULong_t>(*treeReader, foundLeafName.c_str()));
373 }
else if (leafType ==
"Long64_t") {
374 fSizeReader.reset(
new TSizeReaderImpl<Long64_t>(*treeReader, foundLeafName.c_str()));
375 }
else if (leafType ==
"ULong64_t") {
376 fSizeReader.reset(
new TSizeReaderImpl<ULong64_t>(*treeReader, foundLeafName.c_str()));
378 Error(
"TDynamicArrayReader ",
379 "Unsupported size type for leaf %s. Supported types are int, short int, long int, long long int and "
380 "their unsigned counterparts.",
388class TArrayParameterSizeReader :
public TDynamicArrayReader<TObjectArrayReader> {
390 TArrayParameterSizeReader(
TTreeReader *treeReader,
const char *branchName)
391 : TDynamicArrayReader<TObjectArrayReader>(treeReader, branchName)
397class TArrayFixedSizeReader :
public TObjectArrayReader {
402 TArrayFixedSizeReader(
Int_t sizeArg) :
fSize(sizeArg) {}
409 ~TBasicTypeArrayReader()
override {}
413 if (!proxy->
Read()) {
416 Error(
"TBasicTypeArrayReader::GetCP()",
"Read error in TBranchProxy.");
426 if (!myCollectionProxy)
428 return myCollectionProxy->
Size();
434 if (!myCollectionProxy)
443 if (!proxy->
Read()) {
446 Error(
"TBasicTypeArrayReader::GetValueSize()",
"Read error in TBranchProxy.");
454class TBasicTypeClonesReader final :
public TClonesReader {
459 TBasicTypeClonesReader(
Int_t offsetArg) : fOffset(offsetArg) {}
461 ~TBasicTypeClonesReader() final = default;
462 TBasicTypeClonesReader(const TBasicTypeClonesReader &) = delete;
463 TBasicTypeClonesReader &operator=(const TBasicTypeClonesReader &) = delete;
464 TBasicTypeClonesReader(TBasicTypeClonesReader &&) = delete;
465 TBasicTypeClonesReader &operator=(TBasicTypeClonesReader &&) = delete;
472 return (
Byte_t *)myClonesArray->
At(idx) + fOffset;
482 TLeafReader(
TTreeReaderValueBase *valueReaderArg) : fValueReader(valueReaderArg), fElementSize(-1) {}
487 return myLeaf ? myLeaf->
GetLen() : 0;
494 if (fElementSize == -1) {
500 return (
Byte_t *)address + (fElementSize * idx);
507 auto *leaf = fValueReader->
GetLeaf();
512 void ProxyRead() { fValueReader->
ProxyRead(); }
515class TLeafParameterSizeReader :
public TDynamicArrayReader<TLeafReader> {
518 : TDynamicArrayReader<TLeafReader>(treeReader, leafName, valueReaderArg)
525 return TDynamicArrayReader<TLeafReader>::GetSize(proxy);
540 fSetupStatus = kSetupInternalError;
542 Error(
"TTreeReaderArrayBase::CreateProxy()",
"TTreeReader object not set / available for branch %s!",
544 fSetupStatus = kSetupTreeDestructed;
549 const char *brDataType =
"{UNDETERMINED}";
552 brDataType = GetBranchDataType(br, dictUnused, fDict);
554 Error(
"TTreeReaderArrayBase::CreateProxy()",
555 "The template argument type T of %s accessing branch %s (which contains data of type %s) is not known to "
556 "ROOT. You will need to create a dictionary for it.",
557 GetDerivedTypeName(), fBranchName.Data(), brDataType);
558 fSetupStatus = kSetupMissingDictionary;
569 const bool suppressErrorsForThisBranch = (fTreeReader->fSuppressErrorsForMissingBranches.find(fBranchName.Data()) !=
570 fTreeReader->fSuppressErrorsForMissingBranches.cend());
574 TLeaf *myLeaf =
nullptr;
575 if (!GetBranchAndLeaf(branch, myLeaf, branchActualType, suppressErrorsForThisBranch))
579 Error(
"TTreeReaderArrayBase::CreateProxy()",
"No dictionary for branch %s.", fBranchName.Data());
586 fSetupStatus = kSetupMatch;
588 SetImpl(branch, myLeaf);
597 fSetupStatus = kSetupMatch;
599 Error(
"TTreeReaderArrayBase::CreateProxy()",
"Type ambiguity (want %s, have %s) for branch %s.",
605 bool isTopLevel = branch->
GetMother() == branch;
607 membername = strrchr(branch->
GetName(),
'.');
608 if (membername.
IsNull()) {
609 membername = branch->
GetName();
612 auto *director = fTreeReader->fDirector.get();
616 std::optional<std::size_t>
index;
617 std::size_t current{};
618 auto &&friends = fTreeReader->GetTree()->GetTree()->GetListOfFriends();
626 if (!
index.has_value()) {
627 Error(
"TTreeReaderArrayBase::CreateProxy()",
628 "The branch %s is contained in a Friend TTree that is not directly attached to the main.\n"
629 "This is not yet supported by TTreeReader.",
634 auto &&friendProxy = fTreeReader->AddFriendProxy(
index.value());
635 director = friendProxy.GetDirector();
637 fTreeReader->AddProxy(
638 std::make_unique<TNamedBranchProxy>(director, branch, fBranchName, membername, suppressErrorsForThisBranch));
640 namedProxy = fTreeReader->FindProxy(fBranchName);
643 fSetupStatus = kSetupMatch;
645 fSetupStatus = kSetupMismatch;
651 const char *nonCollTypeName = GetBranchContentDataType(branch, branchActualTypeName, branchActualType, arrInfo);
652 if (nonCollTypeName) {
653 Error(
"TTreeReaderArrayBase::CreateContentProxy()",
654 "The branch %s contains data of type %s, which should be accessed through a TTreeReaderValue< %s >.",
655 fBranchName.Data(), nonCollTypeName, nonCollTypeName);
656 if (fSetupStatus == kSetupInternalError)
657 fSetupStatus = kSetupNotACollection;
661 if (!branchActualType) {
662 if (branchActualTypeName.
IsNull()) {
663 Error(
"TTreeReaderArrayBase::CreateContentProxy()",
664 "Cannot determine the type contained in the collection of branch %s. That's weird - please report!",
667 Error(
"TTreeReaderArrayBase::CreateContentProxy()",
668 "The branch %s contains data of type %s, which does not have a dictionary.", fBranchName.Data(),
669 branchActualTypeName.
Data());
670 if (fSetupStatus == kSetupInternalError)
671 fSetupStatus = kSetupMissingDictionary;
685 auto cl =
dynamic_cast<TClass *
>(requestedDict);
692 auto streamerElements = streamerInfo->
GetElements();
693 if (!streamerElements)
699 if (streamerElements->GetEntries() > 1)
702 auto streamerElement =
dynamic_cast<TStreamerElement *
>(streamerElements->At(0));
703 if (!streamerElement)
707 if (
auto *dataType =
gROOT->GetType(streamerElement->GetTypeNameBasic()))
708 dataTypeCode = dataType->
GetType();
710 auto checkArrayDims = [&]() {
711 for (
int i = 0; i < info.fArrayNDims; i++) {
712 if (info.fArrayDims[i] != streamerElement->GetMaxIndex(i))
718 return streamerElement->GetArrayDim() == info.fArrayNDims &&
719 streamerElement->GetArrayLength() == info.fArrayCumulativeLength && checkArrayDims() &&
720 dataTypeCode == info.fTDataTypeCode;
729 auto left_datatype =
dynamic_cast<TDataType *
>(left);
730 auto right_datatype =
dynamic_cast<TDataType *
>(right);
731 auto left_enum =
dynamic_cast<TEnum *
>(left);
732 auto right_enum =
dynamic_cast<TEnum *
>(right);
734 if ((left_datatype && left_datatype->GetType() ==
kInt_t && right_enum) ||
735 (right_datatype && right_datatype->GetType() ==
kInt_t && left_enum))
737 if ((left_datatype && right_enum && left_datatype->GetType() == right_enum->GetUnderlyingType()) ||
738 (right_datatype && left_enum && right_datatype->GetType() == left_enum->GetUnderlyingType()))
744 if (matchingArrayInfo(left, info))
751 auto typeCode = left_datatype->GetType();
752 if (typeCode > 0 && typeCode == info.fTDataTypeCode)
756 if (!left_datatype || !right_datatype)
758 auto l = left_datatype->GetType();
759 auto r = right_datatype->GetType();
767 if (!matchingDataType(fDict, branchActualType, arrInfo)) {
768 Error(
"TTreeReaderArrayBase::CreateContentProxy()",
769 "The branch %s contains data of type %s. It cannot be accessed by a TTreeReaderArray<%s>",
770 fBranchName.Data(), branchActualType->
GetName(), fDict->GetName());
771 if (fSetupStatus == kSetupInternalError || fSetupStatus >= 0)
772 fSetupStatus = kSetupMismatch;
784 SetImpl(branch, myLeaf);
792 bool suppressErrorsForMissingBranch)
799 if (!fBranchName.Contains(
".")) {
800 if (!suppressErrorsForMissingBranch) {
801 Error(
"TTreeReaderArrayBase::GetBranchAndLeaf()",
802 "The tree does not have a branch called %s. You could check with TTree::Print() for available branches.",
805 fSetupStatus = kSetupMissingBranch;
810 TRegexp leafNameExpression(
"\\.[a-zA-Z0-9_]+$");
811 TString leafName(fBranchName(leafNameExpression));
812 TString branchName = fBranchName(0, fBranchName.Length() - leafName.
Length());
815 if (!suppressErrorsForMissingBranch) {
816 Error(
"TTreeReaderArrayBase::GetBranchAndLeaf()",
817 "The tree does not have a branch called %s. You could check with TTree::Print() for available branches.",
820 fSetupStatus = kSetupMissingBranch;
827 if (!suppressErrorsForMissingBranch) {
828 Error(
"TTreeReaderArrayBase::GetBranchAndLeaf()",
829 "The tree does not have a branch, nor a sub-branch called %s. You could check with TTree::Print() for "
830 "available branches.",
833 fSetupStatus = kSetupMissingBranch;
840 Error(
"TTreeReaderArrayBase::GetBranchAndLeaf()",
"Failed to get the dictionary for %s.", myLeaf->
GetTypeName());
841 fSetupStatus = kSetupMissingDictionary;
849 branchActualType = fDict;
851 fBranchName = branchName;
852 fLeafName = leafName(1, leafName.
Length());
853 fHaveLeaf = (fLeafName.Length() > 0);
854 fSetupStatus = kSetupMatchLeaf;
856 Error(
"TTreeReaderArrayBase::GetBranchAndLeaf()",
"Leaf of type %s cannot be read by TTreeReaderValue<%s>.",
859 fSetupStatus = kSetupMismatch;
882 fImpl = std::make_unique<TLeafReader>(
this);
887 fImpl = std::make_unique<TLeafParameterSizeReader>(fTreeReader, leafFullName.
Data(),
this);
889 fSetupStatus = kSetupMatchLeaf;
902 if (fSetupStatus == kSetupInternalError)
903 fSetupStatus = kSetupMatch;
905 if (branchElement->
GetType() == 31) {
906 Error(
"TTreeReaderArrayBase::SetImpl",
"STL Collection nested in a TClonesArray not yet supported");
907 fSetupStatus = kSetupInternalError;
910 fImpl = std::make_unique<TSTLReader>();
915 fImpl = std::make_unique<TClonesReader>();
917 fImpl = std::make_unique<TBasicTypeArrayReader>();
920 fImpl = std::make_unique<TBasicTypeClonesReader>(element->
GetOffset());
922 fImpl = std::make_unique<TArrayFixedSizeReader>(element->
GetArrayLength());
926 std::make_unique<TArrayParameterSizeReader>(fTreeReader, branchElement->
GetBranchCount()->
GetName());
929 fImpl = std::make_unique<TBasicTypeArrayReader>();
931 fImpl = std::make_unique<TBasicTypeClonesReader>(element->
GetOffset());
933 fImpl = std::make_unique<TArrayFixedSizeReader>(element->
GetArrayLength());
934 ((TObjectArrayReader *)fImpl.get())->SetBasicTypeSize(
sizeof(
Int_t));
936 fImpl = std::make_unique<TArrayFixedSizeReader>(element->
GetArrayLength());
937 ((TObjectArrayReader *)fImpl.get())->SetBasicTypeSize(((
TDataType *)fDict)->Size());
941 std::make_unique<TArrayParameterSizeReader>(fTreeReader, branchElement->
GetBranchCount()->
GetName());
942 ((TArrayParameterSizeReader *)fImpl.get())->SetBasicTypeSize(((
TDataType *)fDict)->Size());
944 fImpl = std::make_unique<TClonesReader>();
946 Error(
"TTreeReaderArrayBase::SetImpl()",
"Cannot read branch %s: unhandled streamer element type %s",
947 fBranchName.Data(), element->
IsA()->
GetName());
948 fSetupStatus = kSetupInternalError;
958 Error(
"TTreeReaderArrayBase::SetImpl",
"Failed to get the top leaf from the branch");
959 fSetupStatus = kSetupMissingBranch;
964 if (fSetupStatus == kSetupInternalError)
965 fSetupStatus = kSetupMatch;
967 fImpl = std::make_unique<TArrayFixedSizeReader>(topLeaf->GetLenStatic());
969 fImpl = std::make_unique<TArrayParameterSizeReader>(fTreeReader, sizeLeaf->
GetName());
971 ((TObjectArrayReader *)fImpl.get())->SetBasicTypeSize(((
TDataType *)fDict)->Size());
973 Error(
"TTreeReaderArrayBase::SetImpl",
"Support for branches of type TBranchClones not implemented");
974 fSetupStatus = kSetupInternalError;
976 Error(
"TTreeReaderArrayBase::SetImpl",
"Support for branches of type TBranchObject not implemented");
977 fSetupStatus = kSetupInternalError;
979 Error(
"TTreeReaderArrayBase::SetImpl",
"Support for branches of type TBranchSTL not implemented");
980 fImpl = std::make_unique<TSTLReader>();
981 fSetupStatus = kSetupInternalError;
983 Error(
"TTreeReaderArrayBase::SetImpl",
"Support for branches of type TBranchRef not implemented");
984 fSetupStatus = kSetupInternalError;
998 arrInfo.fTDataTypeCode = datatype->GetType();
1000 for (
int i = 0; i < arrInfo.fArrayNDims; ++i)
1021 contentTypeName =
"";
1029 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
"Could not get value class.");
1039 if (brElement->
GetType() == 3) {
1048 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1049 "Cannot determine STL collection type of %s stored in branch %s", brElement->
GetClassName(),
1055 contentTypeName =
"std::pair< ";
1056 contentTypeName += splitType.
fElements[1];
1058 contentTypeName += splitType.
fElements[2];
1059 contentTypeName +=
" >";
1064 }
else if (brElement->
GetType() == 31 || brElement->
GetType() == 41) {
1066 TClass *clData =
nullptr;
1069 if (ExpectedTypeRet == 0) {
1081 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1082 "The branch %s contains a data type %d for which the dictionary cannot be retrieved.",
1083 branch->
GetName(), (
int)dtData);
1090 }
else if (ExpectedTypeRet == 1) {
1091 int brID = brElement->
GetID();
1094 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1095 "The branch %s contains data of type %s for which the dictionary does not exist. It's needed.",
1109 return "{CANNOT DETERMINE TBranchElement DATA TYPE}";
1117 arrInfo = FillStreamerElementArrayInfo(element);
1121 Error(
"TTreeReaderArrayBase::GetBranchDataType()",
"Could not get class from branch element.");
1125 if (!myCollectionProxy) {
1126 Error(
"TTreeReaderArrayBase::GetBranchDataType()",
"Could not get collection proxy from STL class");
1135 Error(
"TTreeReaderArrayBase::GetBranchDataType()",
"Could not get valueClass from collectionProxy.");
1138 contentTypeName = dict->
GetName();
1141 if (!fProxy->Setup() || !fProxy->Read()) {
1142 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1143 "Failed to get type from proxy, unable to check type");
1144 contentTypeName =
"UNKNOWN";
1146 return contentTypeName;
1150 contentTypeName = dict->
GetName();
1163 contentTypeName =
"TClonesArray";
1164 Warning(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1165 "Not able to check type correctness, ignoring check");
1167 fSetupStatus = kSetupNoCheck;
1175 contentTypeName = dict->
GetName();
1179 contentTypeName = dict->
GetName();
1208 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1209 "The branch %s was created using a leaf list and cannot be represented as a C++ type. Please access one "
1210 "of its siblings using a TTreeReaderArray:",
1213 TLeaf *leaf =
nullptr;
1214 while ((leaf = (
TLeaf *)iLeaves())) {
1215 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
" %s.%s", branch->
GetName(), leaf->
GetName());
1222 Warning(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1223 "Not able to check type correctness, ignoring check");
1225 fSetupStatus = kSetupNoCheck;
1228 return dataTypeName;
1231 return "TClonesArray";
1234 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1235 "The branch %s is a TBranchRef and cannot be represented as a C++ type.", branch->
GetName());
1238 Error(
"TTreeReaderArrayBase::GetBranchContentDataType()",
1239 "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
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