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.");
64 size_t GetSize(ROOT::Detail::TBranchProxy *proxy)
override
66 TClonesArray *myClonesArray = GetCA(proxy);
72 void *At(ROOT::Detail::TBranchProxy *proxy,
size_t idx)
override
74 TClonesArray *myClonesArray = GetCA(proxy);
81 bool IsContiguous(ROOT::Detail::TBranchProxy *)
override {
return false; }
83 std::size_t GetValueSize(ROOT::Detail::TBranchProxy *proxy)
override
88 Error(
"TClonesReader::GetValueSize()",
"Read error in TBranchProxy.");
96bool IsCPContiguous(
const TVirtualCollectionProxy &cp)
104 default:
return false;
108UInt_t GetCPValueSize(
const TVirtualCollectionProxy &cp)
113 auto &&eDataType = cp.
GetType();
115 return tDataType ? tDataType->Size() : 0;
121 ~TSTLReader()
override {}
122 TVirtualCollectionProxy *GetCP(ROOT::Detail::TBranchProxy *proxy)
124 if (!proxy->
Read()) {
127 Error(
"TSTLReader::GetCP()",
"Read error in TBranchProxy.");
131 Error(
"TSTLReader::GetCP()",
"Logic error, proxy object not set in TBranchProxy.");
138 size_t GetSize(ROOT::Detail::TBranchProxy *proxy)
override
140 TVirtualCollectionProxy *myCollectionProxy = GetCP(proxy);
141 if (!myCollectionProxy)
143 return myCollectionProxy->
Size();
146 void *At(ROOT::Detail::TBranchProxy *proxy,
size_t idx)
override
148 TVirtualCollectionProxy *myCollectionProxy = GetCP(proxy);
149 if (!myCollectionProxy)
152 return *(
void **)myCollectionProxy->
At(idx);
154 return myCollectionProxy->
At(idx);
158 bool IsContiguous(ROOT::Detail::TBranchProxy *proxy)
override
160 auto cp = GetCP(proxy);
161 return IsCPContiguous(*cp);
164 std::size_t GetValueSize(ROOT::Detail::TBranchProxy *proxy)
override
166 auto cp = GetCP(proxy);
167 return GetCPValueSize(*cp);
173 TVirtualCollectionProxy *fLocalCollection;
176 TCollectionLessSTLReader(TVirtualCollectionProxy *proxy) : fLocalCollection(proxy) {}
178 TVirtualCollectionProxy *GetCP(ROOT::Detail::TBranchProxy *proxy)
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;
194 size_t GetSize(ROOT::Detail::TBranchProxy *proxy)
override
196 TVirtualCollectionProxy *myCollectionProxy = GetCP(proxy);
197 if (!myCollectionProxy)
203 return myCollectionProxy->
Size();
206 void *At(ROOT::Detail::TBranchProxy *proxy,
size_t idx)
override
208 TVirtualCollectionProxy *myCollectionProxy = GetCP(proxy);
209 if (!myCollectionProxy)
217 return *(
void **)myCollectionProxy->
At(idx);
219 return myCollectionProxy->
At(idx);
223 bool IsContiguous(ROOT::Detail::TBranchProxy *proxy)
override
225 auto cp = GetCP(proxy);
226 return IsCPContiguous(*cp);
229 std::size_t GetValueSize(ROOT::Detail::TBranchProxy *proxy)
override
231 auto cp = GetCP(proxy);
232 return GetCPValueSize(*cp);
240 Int_t fBasicTypeSize;
243 TObjectArrayReader() : fBasicTypeSize(-1) {}
244 ~TObjectArrayReader()
override {}
245 TVirtualCollectionProxy *GetCP(ROOT::Detail::TBranchProxy *proxy)
247 if (!proxy->
Read()) {
250 Error(
"TObjectArrayReader::GetCP()",
"Read error in TBranchProxy.");
256 size_t GetSize(ROOT::Detail::TBranchProxy *proxy)
override
258 TVirtualCollectionProxy *myCollectionProxy = GetCP(proxy);
259 if (!myCollectionProxy)
261 return myCollectionProxy->
Size();
263 void *At(ROOT::Detail::TBranchProxy *proxy,
size_t idx)
override
269 void *array = (
void *)proxy->
GetStart();
271 if (fBasicTypeSize == -1) {
272 TClass *myClass = proxy->
GetClass();
274 Error(
"TObjectArrayReader::At()",
"Cannot get class info from branch proxy.");
279 objectSize = fBasicTypeSize;
281 return (
void *)((
Byte_t *)array + (objectSize * idx));
286 bool IsContiguous(ROOT::Detail::TBranchProxy *)
override {
return true; }
288 std::size_t GetValueSize(ROOT::Detail::TBranchProxy *proxy)
override
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 {
310 TTreeReaderValue<T> fSizeReader;
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;
325 TLeaf *sizeLeaf = treeReader->
GetTree()->FindLeaf(foundLeafName.c_str());
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.",
385 size_t GetSize(ROOT::Detail::TBranchProxy * )
override {
return fSizeReader->GetSize(); }
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) {}
404 size_t GetSize(ROOT::Detail::TBranchProxy * )
override {
return fSize; }
409 ~TBasicTypeArrayReader()
override {}
411 TVirtualCollectionProxy *GetCP(ROOT::Detail::TBranchProxy *proxy)
413 if (!proxy->
Read()) {
416 Error(
"TBasicTypeArrayReader::GetCP()",
"Read error in TBranchProxy.");
423 size_t GetSize(ROOT::Detail::TBranchProxy *proxy)
override
425 TVirtualCollectionProxy *myCollectionProxy = GetCP(proxy);
426 if (!myCollectionProxy)
428 return myCollectionProxy->
Size();
431 void *At(ROOT::Detail::TBranchProxy *proxy,
size_t idx)
override
433 TVirtualCollectionProxy *myCollectionProxy = GetCP(proxy);
434 if (!myCollectionProxy)
439 bool IsContiguous(ROOT::Detail::TBranchProxy *)
override {
return false; }
441 std::size_t GetValueSize(ROOT::Detail::TBranchProxy *proxy)
override
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;
467 void *At(ROOT::Detail::TBranchProxy *proxy,
size_t idx)
override
469 TClonesArray *myClonesArray = GetCA(proxy);
472 return (
Byte_t *)myClonesArray->
At(idx) + fOffset;
478 TTreeReaderValueBase *fValueReader;
482 TLeafReader(TTreeReaderValueBase *valueReaderArg) : fValueReader(valueReaderArg), fElementSize(-1) {}
484 size_t GetSize(ROOT::Detail::TBranchProxy * )
override
486 TLeaf *myLeaf = fValueReader->
GetLeaf();
487 return myLeaf ? myLeaf->
GetLen() : 0;
490 void *At(ROOT::Detail::TBranchProxy * ,
size_t idx)
override
494 if (fElementSize == -1) {
495 TLeaf *myLeaf = fValueReader->
GetLeaf();
500 return (
Byte_t *)address + (fElementSize * idx);
503 bool IsContiguous(ROOT::Detail::TBranchProxy *)
override {
return true; }
505 std::size_t GetValueSize(ROOT::Detail::TBranchProxy *)
override
507 auto *leaf = fValueReader->
GetLeaf();
512 void ProxyRead() { fValueReader->
ProxyRead(); }
515class TLeafParameterSizeReader :
public TDynamicArrayReader<TLeafReader> {
517 TLeafParameterSizeReader(TTreeReader *treeReader,
const char *leafName, TTreeReaderValueBase *valueReaderArg)
518 : TDynamicArrayReader<TLeafReader>(treeReader, leafName, valueReaderArg)
522 size_t GetSize(ROOT::Detail::TBranchProxy *proxy)
override
525 return TDynamicArrayReader<TLeafReader>::GetSize(proxy);
542 Error(
"TTreeReaderArrayBase::CreateProxy()",
"TTreeReader object not set / available for branch %s!",
549 const char *brDataType =
"{UNDETERMINED}";
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.",
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());
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();
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();
638 std::make_unique<TNamedBranchProxy>(director, branch,
fBranchName, membername, suppressErrorsForThisBranch));
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);
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());
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>",
792 bool suppressErrorsForMissingBranch)
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.",
810 TRegexp leafNameExpression(
"\\.[a-zA-Z0-9_]+$");
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.",
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.",
840 Error(
"TTreeReaderArrayBase::GetBranchAndLeaf()",
"Failed to get the dictionary for %s.", myLeaf->
GetTypeName());
849 branchActualType =
fDict;
856 Error(
"TTreeReaderArrayBase::GetBranchAndLeaf()",
"Leaf of type %s cannot be read by TTreeReaderValue<%s>.",
882 fImpl = std::make_unique<TLeafReader>(
this);
905 if (branchElement->
GetType() == 31) {
906 Error(
"TTreeReaderArrayBase::SetImpl",
"STL Collection nested in a TClonesArray not yet supported");
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());
929 fImpl = std::make_unique<TBasicTypeArrayReader>();
931 fImpl = std::make_unique<TBasicTypeClonesReader>(element->
GetOffset());
934 ((TObjectArrayReader *)
fImpl.get())->SetBasicTypeSize(
sizeof(
Int_t));
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",
958 Error(
"TTreeReaderArrayBase::SetImpl",
"Failed to get the top leaf from the branch");
967 fImpl = std::make_unique<TArrayFixedSizeReader>(topLeaf->GetLenStatic());
973 Error(
"TTreeReaderArrayBase::SetImpl",
"Support for branches of type TBranchClones not implemented");
976 Error(
"TTreeReaderArrayBase::SetImpl",
"Support for branches of type TBranchObject not implemented");
979 Error(
"TTreeReaderArrayBase::SetImpl",
"Support for branches of type TBranchSTL not implemented");
980 fImpl = std::make_unique<TSTLReader>();
983 Error(
"TTreeReaderArrayBase::SetImpl",
"Support for branches of type TBranchRef not implemented");
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}";
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();
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");
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");
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).
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
if(err< fMinRelativeError)
Binding & operator=(OUT(*fun)(void))
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.
std::unique_ptr< TVirtualCollectionReader > fImpl
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.
@ kSetupInternalError
Some other error - hopefully the error message helps.
@ kSetupMissingBranch
The specified branch cannot be found.
@ kSetupNotACollection
The branch class type is not a collection.
@ kSetupMissingDictionary
To read this branch, we need a dictionary.
@ kSetupMismatch
Mismatch of branch type and reader template type.
@ kSetupTreeDestructed
The TTreeReader has been destructed / not set.
@ kSetupMatchLeaf
This branch (or TLeaf, really) has been set up, reading should succeed.
@ kSetupMatch
This branch has been set up, branch data type and reader template type match, reading should succeed.
bool fHaveLeaf
Whether the data is in a leaf.
void * GetAddress()
Returns the memory address of the object being read.
@ kReadError
Problem reading data.
@ kReadSuccess
Data read okay.
ESetupStatus fSetupStatus
Setup status of this data access.
virtual const char * GetDerivedTypeName() const =0
TString fBranchName
Name of the branch to read data from.
TTreeReader * fTreeReader
Tree reader we belong to.
TDictionary * fDict
Type that the branch should contain.
TLeaf * GetLeaf()
If we are reading a leaf, return the corresponding TLeaf.
Detail::TBranchProxy * fProxy
Proxy for this branch, owned by TTreeReader.
static const char * GetBranchDataType(TBranch *branch, TDictionary *&dict, TDictionary const *curDict)
Retrieve the type of data stored by branch; put its dictionary into dict, return its type name.
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
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
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 fArrayCumulativeLength
std::array< int, 5 > fArrayDims
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