Logo ROOT  
Reference Guide
TTreeReaderArray.cxx
Go to the documentation of this file.
1 // @(#)root/treeplayer:$Id$
2 // Author: Axel Naumann, 2011-09-28
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers and al. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #include "TTreeReaderArray.h"
13 
14 #include "TBranchClones.h"
15 #include "TBranchElement.h"
16 #include "TBranchRef.h"
17 #include "TBranchSTL.h"
18 #include "TBranchObject.h"
19 #include "TBranchProxyDirector.h"
20 #include "TClassEdit.h"
21 #include "TFriendElement.h"
22 #include "TFriendProxy.h"
23 #include "TLeaf.h"
24 #include "TList.h"
25 #include "TROOT.h"
26 #include "TStreamerInfo.h"
27 #include "TStreamerElement.h"
28 #include "TTreeReader.h"
29 #include "TGenCollectionProxy.h"
30 #include "TRegexp.h"
31 #include "ROOT/RMakeUnique.hxx"
32 
33 #include <memory>
34 
35 // pin vtable
37 
38 namespace {
39  using namespace ROOT::Internal;
40 
41  // Reader interface for clones arrays
42  class TClonesReader: public TVirtualCollectionReader {
43  public:
44  ~TClonesReader() {}
46  if (!proxy->Read()){
48  Error("TClonesReader::GetCA()", "Read error in TBranchProxy.");
49  return 0;
50  }
52  return (TClonesArray*) proxy->GetWhere();
53  }
54  virtual size_t GetSize(ROOT::Detail::TBranchProxy* proxy) {
55  TClonesArray *myClonesArray = GetCA(proxy);
56  if (myClonesArray){
57  return myClonesArray->GetEntries();
58  }
59  else return 0;
60  }
61  virtual void* At(ROOT::Detail::TBranchProxy* proxy, size_t idx) {
62  TClonesArray *myClonesArray = GetCA(proxy);
63  if (myClonesArray){
64  return myClonesArray->UncheckedAt(idx);
65  }
66  else return 0;
67  }
68  };
69 
70  // Reader interface for STL
71  class TSTLReader final: public TVirtualCollectionReader {
72  public:
73  ~TSTLReader() {}
75  if (!proxy->Read()) {
77  Error("TSTLReader::GetCP()", "Read error in TBranchProxy.");
78  return 0;
79  }
80  if (!proxy->GetWhere()) {
81  Error("TSTLReader::GetCP()", "Logic error, proxy object not set in TBranchProxy.");
82  return 0;
83  }
85  return (TVirtualCollectionProxy*) proxy->GetCollection();
86  }
87 
88  virtual size_t GetSize(ROOT::Detail::TBranchProxy* proxy) {
89  TVirtualCollectionProxy *myCollectionProxy = GetCP(proxy);
90  if (!myCollectionProxy) return 0;
91  return myCollectionProxy->Size();
92  }
93 
94  virtual void* At(ROOT::Detail::TBranchProxy* proxy, size_t idx) {
95  TVirtualCollectionProxy *myCollectionProxy = GetCP(proxy);
96  if (!myCollectionProxy) return 0;
97  if (myCollectionProxy->HasPointers()){
98  return *(void**)myCollectionProxy->At(idx);
99  }
100  else {
101  return myCollectionProxy->At(idx);
102  }
103  }
104  };
105 
106  class TCollectionLessSTLReader final: public TVirtualCollectionReader {
107  private:
108  TVirtualCollectionProxy *fLocalCollection;
109  public:
110  TCollectionLessSTLReader(TVirtualCollectionProxy *proxy) : fLocalCollection(proxy) {}
111 
113  if (!proxy->Read()) {
114  fReadStatus = TTreeReaderValueBase::kReadError;
115  Error("TCollectionLessSTLReader::GetCP()", "Read error in TBranchProxy.");
116  return 0;
117  }
118  if (!proxy->GetWhere()) {
119  Error("TCollectionLessSTLReader::GetCP()", "Logic error, proxy object not set in TBranchProxy.");
120  return 0;
121  }
123  return fLocalCollection;
124  }
125 
126  virtual size_t GetSize(ROOT::Detail::TBranchProxy* proxy) {
127  TVirtualCollectionProxy *myCollectionProxy = GetCP(proxy);
128  if (!myCollectionProxy) return 0;
129  /// In the case of std::vector<bool> `PushProxy` also creates a temporary bool variable the address of which
130  /// is returned from these calls.
131  myCollectionProxy->PopProxy();
132  myCollectionProxy->PushProxy(proxy->GetWhere());
133  return myCollectionProxy->Size();
134  }
135 
136  virtual void* At(ROOT::Detail::TBranchProxy* proxy, size_t idx) {
137  TVirtualCollectionProxy *myCollectionProxy = GetCP(proxy);
138  if (!myCollectionProxy) return 0;
139  // Here we do not use a RAII but we empty the proxy to then fill it.
140  // This is done because we are returning a pointer and we need to keep
141  // alive the memory it points to.
142  myCollectionProxy->PopProxy();
143  myCollectionProxy->PushProxy(proxy->GetWhere());
144  if (myCollectionProxy->HasPointers()){
145  return *(void**)myCollectionProxy->At(idx);
146  } else {
147  return myCollectionProxy->At(idx);
148  }
149  }
150  };
151 
152 
153  // Reader interface for leaf list
154  // SEE TTreeProxyGenerator.cxx:1319: '//We have a top level raw type'
155  class TObjectArrayReader: public TVirtualCollectionReader {
156  private:
157  Int_t fBasicTypeSize;
158  public:
159  TObjectArrayReader() : fBasicTypeSize(-1) { }
160  ~TObjectArrayReader() {}
162  if (!proxy->Read()){
163  fReadStatus = TTreeReaderValueBase::kReadError;
164  Error("TObjectArrayReader::GetCP()", "Read error in TBranchProxy.");
165  return 0;
166  }
168  return (TVirtualCollectionProxy*) proxy->GetCollection();
169  }
170  virtual size_t GetSize(ROOT::Detail::TBranchProxy* proxy) {
171  TVirtualCollectionProxy *myCollectionProxy = GetCP(proxy);
172  if (!myCollectionProxy) return 0;
173  return myCollectionProxy->Size();
174  }
175  virtual void* At(ROOT::Detail::TBranchProxy* proxy, size_t idx) {
176  if (!proxy->Read()) return 0;
177 
178  Int_t objectSize;
179  void *array = (void*)proxy->GetStart();
180 
181  if (fBasicTypeSize == -1){
182  TClass *myClass = proxy->GetClass();
183  if (!myClass){
184  Error("TObjectArrayReader::At()", "Cannot get class info from branch proxy.");
185  return 0;
186  }
187  objectSize = myClass->GetClassSize();
188  }
189  else {
190  objectSize = fBasicTypeSize;
191  }
192  return (void*)((Byte_t*)array + (objectSize * idx));
193  }
194 
195  void SetBasicTypeSize(Int_t size){
196  fBasicTypeSize = size;
197  }
198  };
199 
200  template <class BASE>
201  class TUIntOrIntReader: public BASE {
202  private:
203  // The index can be of type int or unsigned int.
204  std::unique_ptr<TTreeReaderValueBase> fSizeReader;
205  bool fIsUnsigned = false;
206 
207  protected:
208  template <class T>
209  TTreeReaderValue<T>& GetSizeReader() {
210  return *static_cast<TTreeReaderValue<T>*>(fSizeReader.get());
211  }
212 
213  public:
214  template <class... ARGS>
215  TUIntOrIntReader(TTreeReader *treeReader, const char *leafName,
216  ARGS&&... args):
217  BASE(std::forward<ARGS>(args)...)
218  {
219  std::string foundLeafName = leafName;
220  TLeaf* sizeLeaf = treeReader->GetTree()->FindLeaf(foundLeafName.c_str());
221 
222  if (!sizeLeaf) {
223  // leafName might be "top.currentParent.N". But "N" might really be "top.N"!
224  // Strip parents until we find the leaf.
225  std::string leafNameNoParent = leafName;
226  std::string parent;
227  auto posLastDot = leafNameNoParent.rfind('.');
228  if (posLastDot != leafNameNoParent.npos) {
229  parent = leafNameNoParent.substr(0, posLastDot);
230  leafNameNoParent.erase(0, posLastDot + 1);
231  }
232 
233  do {
234  if (!sizeLeaf && !parent.empty()) {
235  auto posLastDotParent = parent.rfind('.');
236  if (posLastDotParent != parent.npos)
237  parent = parent.substr(0, posLastDot);
238  else
239  parent.clear();
240  }
241 
242  foundLeafName = parent;
243  if (!parent.empty())
244  foundLeafName += ".";
245  foundLeafName += leafNameNoParent;
246  sizeLeaf = treeReader->GetTree()->FindLeaf(foundLeafName.c_str());
247  } while (!sizeLeaf && !parent.empty());
248  }
249 
250  if (!sizeLeaf) {
251  Error("TUIntOrIntReader", "Cannot find leaf count for %s or any parent branch!", leafName);
252  return;
253  }
254 
255  fIsUnsigned = sizeLeaf->IsUnsigned();
256  if (fIsUnsigned) {
257  fSizeReader.reset(new TTreeReaderValue<UInt_t>(*treeReader, foundLeafName.c_str()));
258  } else {
259  fSizeReader.reset(new TTreeReaderValue<Int_t>(*treeReader, foundLeafName.c_str()));
260  }
261  }
262 
263  size_t GetSize(ROOT::Detail::TBranchProxy* /*proxy*/) override {
264  if (fIsUnsigned)
265  return *GetSizeReader<UInt_t>();
266  return *GetSizeReader<Int_t>();
267  }
268  };
269 
270  class TArrayParameterSizeReader: public TUIntOrIntReader<TObjectArrayReader> {
271  public:
272  TArrayParameterSizeReader(TTreeReader *treeReader, const char *branchName):
273  TUIntOrIntReader<TObjectArrayReader>(treeReader, branchName) {}
274  };
275 
276  // Reader interface for fixed size arrays
277  class TArrayFixedSizeReader : public TObjectArrayReader {
278  private:
279  Int_t fSize;
280 
281  public:
282  TArrayFixedSizeReader(Int_t sizeArg) : fSize(sizeArg) {}
283 
284  virtual size_t GetSize(ROOT::Detail::TBranchProxy* /*proxy*/) { return fSize; }
285  };
286 
287  class TBasicTypeArrayReader final: public TVirtualCollectionReader {
288  public:
289  ~TBasicTypeArrayReader() {}
290 
292  if (!proxy->Read()){
293  fReadStatus = TTreeReaderValueBase::kReadError;
294  Error("TBasicTypeArrayReader::GetCP()", "Read error in TBranchProxy.");
295  return 0;
296  }
298  return (TVirtualCollectionProxy*) proxy->GetCollection();
299  }
300 
301  virtual size_t GetSize(ROOT::Detail::TBranchProxy* proxy){
302  TVirtualCollectionProxy *myCollectionProxy = GetCP(proxy);
303  if (!myCollectionProxy) return 0;
304  return myCollectionProxy->Size();
305  }
306 
307  virtual void* At(ROOT::Detail::TBranchProxy* proxy, size_t idx){
308  TVirtualCollectionProxy *myCollectionProxy = GetCP(proxy);
309  if (!myCollectionProxy) return 0;
310  return (Byte_t*)myCollectionProxy->At(idx) + proxy->GetOffset();
311  }
312  };
313 
314  class TBasicTypeClonesReader final: public TClonesReader {
315  private:
316  Int_t fOffset;
317  public:
318  TBasicTypeClonesReader(Int_t offsetArg) : fOffset(offsetArg) {}
319 
320  virtual void* At(ROOT::Detail::TBranchProxy* proxy, size_t idx){
321  TClonesArray *myClonesArray = GetCA(proxy);
322  if (!myClonesArray) return 0;
323  return (Byte_t*)myClonesArray->At(idx) + fOffset;
324  }
325  };
326 
327  class TLeafReader : public TVirtualCollectionReader {
328  private:
329  TTreeReaderValueBase *fValueReader;
330  Int_t fElementSize;
331  public:
332  TLeafReader(TTreeReaderValueBase *valueReaderArg) : fValueReader(valueReaderArg), fElementSize(-1) {}
333 
334  virtual size_t GetSize(ROOT::Detail::TBranchProxy* /*proxy*/){
335  TLeaf *myLeaf = fValueReader->GetLeaf();
336  return myLeaf ? myLeaf->GetLen() : 0; // Error will be printed by GetLeaf
337  }
338 
339  virtual void* At(ROOT::Detail::TBranchProxy* /*proxy*/, size_t idx){
340  ProxyRead();
341  void *address = fValueReader->GetAddress();
342  if (fElementSize == -1){
343  TLeaf *myLeaf = fValueReader->GetLeaf();
344  if (!myLeaf) return 0; // Error will be printed by GetLeaf
345  fElementSize = myLeaf->GetLenType();
346  }
347  return (Byte_t*)address + (fElementSize * idx);
348  }
349 
350  protected:
351  void ProxyRead(){
352  fValueReader->ProxyRead();
353  }
354  };
355 
356  class TLeafParameterSizeReader: public TUIntOrIntReader<TLeafReader> {
357  public:
358  TLeafParameterSizeReader(TTreeReader *treeReader, const char *leafName,
359  TTreeReaderValueBase *valueReaderArg) :
360  TUIntOrIntReader<TLeafReader>(treeReader, leafName, valueReaderArg) {}
361 
362  size_t GetSize(ROOT::Detail::TBranchProxy* proxy) override {
363  ProxyRead();
364  return TUIntOrIntReader<TLeafReader>::GetSize(proxy);
365  }
366  };
367 }
368 
369 
370 
372 
373 ////////////////////////////////////////////////////////////////////////////////
374 /// Create the proxy object for our branch.
375 
377 {
378  if (fProxy) {
379  return;
380  }
381 
382  fSetupStatus = kSetupInternalError; // Fallback; set to something concrete below.
383  if (!fTreeReader) {
384  Error("TTreeReaderArrayBase::CreateProxy()", "TTreeReader object not set / available for branch %s!",
385  fBranchName.Data());
386  fSetupStatus = kSetupTreeDestructed;
387  return;
388  }
389  if (!fDict) {
390  TBranch* br = fTreeReader->GetTree()->GetBranch(fBranchName);
391  const char* brDataType = "{UNDETERMINED}";
392  if (br) {
393  TDictionary* dictUnused = 0;
394  brDataType = GetBranchDataType(br, dictUnused, fDict);
395  }
396  Error("TTreeReaderArrayBase::CreateProxy()", "The template argument type T of %s accessing branch %s (which contains data of type %s) is not known to ROOT. You will need to create a dictionary for it.",
397  GetDerivedTypeName(), fBranchName.Data(), brDataType);
398  fSetupStatus = kSetupMissingDictionary;
399  return;
400  }
401 
402  // Access a branch's collection content (not the collection itself)
403  // through a proxy.
404  // Search for the branchname, determine what it contains, and wire the
405  // TBranchProxy representing it to us so we can access its data.
406 
407  TDictionary* branchActualType = 0;
408  TBranch* branch = nullptr;
409  TLeaf *myLeaf = nullptr;
410  if (!GetBranchAndLeaf(branch, myLeaf, branchActualType))
411  return;
412 
413  if (!fDict) {
414  Error("TTreeReaderArrayBase::CreateProxy()",
415  "No dictionary for branch %s.", fBranchName.Data());
416  return;
417  }
418 
419  TNamedBranchProxy* namedProxy = fTreeReader->FindProxy(fBranchName);
420  if (namedProxy) {
421  if (namedProxy->GetContentDict() == fDict) {
422  fSetupStatus = kSetupMatch;
423  fProxy = namedProxy->GetProxy();
424  SetImpl(branch, myLeaf);
425  return;
426  }
427 
428  // Update named proxy's dictionary
429  if (!namedProxy->GetContentDict()) {
430  namedProxy->SetContentDict(fDict);
431  fProxy = namedProxy->GetProxy();
432  if (fProxy)
433  fSetupStatus = kSetupMatch;
434  } else {
435  Error("TTreeReaderArrayBase::CreateProxy()",
436  "Type ambiguity (want %s, have %s) for branch %s.",
437  fDict->GetName(), namedProxy->GetContentDict()->GetName(), fBranchName.Data());
438  }
439  }
440  else {
441  TString membername;
442 
443  bool isTopLevel = branch->GetMother() == branch;
444  if (!isTopLevel) {
445  membername = strrchr(branch->GetName(), '.');
446  if (membername.IsNull()) {
447  membername = branch->GetName();
448  }
449  }
450  auto director = fTreeReader->fDirector;
451  // Determine if the branch is actually in a Friend TTree and if so which.
452  if (branch->GetTree() != fTreeReader->GetTree()->GetTree()) {
453  // It is in a friend, let's find the 'index' in the list of friend ...
454  int index = -1;
455  int current = 0;
456  for(auto fe : TRangeDynCast<TFriendElement>( fTreeReader->GetTree()->GetTree()->GetListOfFriends())) {
457  if (branch->GetTree() == fe->GetTree()) {
458  index = current;
459  }
460  ++current;
461  }
462  if (index == -1) {
463  Error("TTreeReaderArrayBase::CreateProxy()", "The branch %s is contained in a Friend TTree that is not directly attached to the main.\n"
464  "This is not yet supported by TTreeReader.",
465  fBranchName.Data());
466  return;
467  }
468  TFriendProxy *feproxy = nullptr;
469  if ((size_t)index < fTreeReader->fFriendProxies.size()) {
470  feproxy = fTreeReader->fFriendProxies.at(index);
471  }
472  if (!feproxy) {
473  feproxy = new ROOT::Internal::TFriendProxy(director, fTreeReader->GetTree(), index);
474  fTreeReader->fFriendProxies.resize(index+1);
475  fTreeReader->fFriendProxies.at(index) = feproxy;
476  }
477  director = feproxy->GetDirector();
478  }
479  namedProxy = new TNamedBranchProxy(director, branch, fBranchName, membername);
480  fTreeReader->AddProxy(namedProxy);
481  fProxy = namedProxy->GetProxy();
482  if (fProxy)
483  fSetupStatus = kSetupMatch;
484  else
485  fSetupStatus = kSetupMismatch;
486  }
487 
488  if (!myLeaf){
489  TString branchActualTypeName;
490  const char* nonCollTypeName = GetBranchContentDataType(branch, branchActualTypeName, branchActualType);
491  if (nonCollTypeName) {
492  Error("TTreeReaderArrayBase::CreateContentProxy()", "The branch %s contains data of type %s, which should be accessed through a TTreeReaderValue< %s >.",
493  fBranchName.Data(), nonCollTypeName, nonCollTypeName);
494  if (fSetupStatus == kSetupInternalError)
495  fSetupStatus = kSetupNotACollection;
496  fProxy = 0;
497  return;
498  }
499  if (!branchActualType) {
500  if (branchActualTypeName.IsNull()) {
501  Error("TTreeReaderArrayBase::CreateContentProxy()", "Cannot determine the type contained in the collection of branch %s. That's weird - please report!",
502  fBranchName.Data());
503  } else {
504  Error("TTreeReaderArrayBase::CreateContentProxy()", "The branch %s contains data of type %s, which does not have a dictionary.",
505  fBranchName.Data(), branchActualTypeName.Data());
506  if (fSetupStatus == kSetupInternalError)
507  fSetupStatus = kSetupMissingDictionary;
508  }
509  fProxy = 0;
510  return;
511  }
512 
513  if (fDict != branchActualType) {
514  Error("TTreeReaderArrayBase::CreateContentProxy()", "The branch %s contains data of type %s. It cannot be accessed by a TTreeReaderArray<%s>",
515  fBranchName.Data(), branchActualType->GetName(), fDict->GetName());
516  if (fSetupStatus == kSetupInternalError || fSetupStatus >= 0)
517  fSetupStatus = kSetupMismatch;
518 
519  // Update named proxy's dictionary
520  if (!namedProxy->GetContentDict()) {
521  namedProxy->SetContentDict(fDict);
522  }
523 
524  // fProxy = 0;
525  // return;
526  }
527  }
528 
529  SetImpl(branch, myLeaf);
530 }
531 
532 ////////////////////////////////////////////////////////////////////////////////
533 /// Determine the branch / leaf and its type; reset fProxy / fSetupStatus on error.
534 
536  TDictionary* &branchActualType) {
537  myLeaf = nullptr;
538  branch = fTreeReader->GetTree()->GetBranch(fBranchName);
539  if (branch)
540  return true;
541 
542  if (!fBranchName.Contains(".")) {
543  Error("TTreeReaderArrayBase::GetBranchAndLeaf()", "The tree does not have a branch called %s. You could check with TTree::Print() for available branches.", fBranchName.Data());
544  fSetupStatus = kSetupMissingBranch;
545  fProxy = 0;
546  return false;
547  }
548 
549  TRegexp leafNameExpression ("\\.[a-zA-Z0-9_]+$");
550  TString leafName (fBranchName(leafNameExpression));
551  TString branchName = fBranchName(0, fBranchName.Length() - leafName.Length());
552  branch = fTreeReader->GetTree()->GetBranch(branchName);
553  if (!branch){
554  Error("TTreeReaderArrayBase::GetBranchAndLeaf()", "The tree does not have a branch called %s. You could check with TTree::Print() for available branches.", fBranchName.Data());
555  fSetupStatus = kSetupMissingBranch;
556  fProxy = 0;
557  return false;
558  }
559 
560  myLeaf = branch->GetLeaf(TString(leafName(1, leafName.Length())));
561  if (!myLeaf){
562  Error("TTreeReaderArrayBase::GetBranchAndLeaf()", "The tree does not have a branch, nor a sub-branch called %s. You could check with TTree::Print() for available branches.", fBranchName.Data());
563  fSetupStatus = kSetupMissingBranch;
564  fProxy = 0;
565  return false;
566  }
567 
568  TDictionary *tempDict = TDictionary::GetDictionary(myLeaf->GetTypeName());
569  if (!tempDict){
570  Error("TTreeReaderArrayBase::GetBranchAndLeaf()", "Failed to get the dictionary for %s.", myLeaf->GetTypeName());
571  fSetupStatus = kSetupMissingDictionary;
572  fProxy = 0;
573  return false;
574  }
575 
576  if (tempDict->IsA() == TDataType::Class() && TDictionary::GetDictionary(((TDataType*)tempDict)->GetTypeName()) == fDict){
577  //fLeafOffset = myLeaf->GetOffset() / 4;
578  branchActualType = fDict;
579  fLeaf = myLeaf;
580  fBranchName = branchName;
581  fLeafName = leafName(1, leafName.Length());
582  fHaveLeaf = (fLeafName.Length() > 0);
583  fSetupStatus = kSetupMatchLeaf;
584  }
585  else {
586  Error("TTreeReaderArrayBase::GetBranchAndLeaf()", "Leaf of type %s cannot be read by TTreeReaderValue<%s>.", myLeaf->GetTypeName(), fDict->GetName());
587  fProxy = 0;
588  fSetupStatus = kSetupMismatch;
589  return false;
590  }
591  return true;
592 }
593 
594 
595 
596 
597 ////////////////////////////////////////////////////////////////////////////////
598 /// Create the TVirtualCollectionReader object for our branch.
599 
601 {
602  if (fImpl)
603  return;
604 
605  // Access a branch's collection content (not the collection itself)
606  // through a proxy.
607  // Search for the branchname, determine what it contains, and wire the
608  // TBranchProxy representing it to us so we can access its data.
609  // A proxy for branch must not have been created before (i.e. check
610  // fProxies before calling this function!)
611 
612  if (myLeaf){
613  if (!myLeaf->GetLeafCount()){
614  fImpl = std::make_unique<TLeafReader>(this);
615  }
616  else {
617  TString leafFullName = myLeaf->GetBranch()->GetName();
618  leafFullName += ".";
619  leafFullName += myLeaf->GetLeafCount()->GetName();
620  fImpl = std::make_unique<TLeafParameterSizeReader>(fTreeReader, leafFullName.Data(), this);
621  }
622  fSetupStatus = kSetupMatchLeaf;
623  }
624  else if (branch->IsA() == TBranchElement::Class()) {
625  TBranchElement* branchElement = ((TBranchElement*)branch);
626 
627  TStreamerInfo *streamerInfo = branchElement->GetInfo();
628  Int_t id = branchElement->GetID();
629 
630  if (id >= 0){ // Not root node?
631  // Int_t offset = streamerInfo->GetOffsets()[id];
632  TStreamerElement *element = (TStreamerElement*)streamerInfo->GetElements()->At(id);
633  // Bool_t isPointer = element->IsaPointer();
634  // TClass *classPointer = element->GetClassPointer();
635 
636  if (fSetupStatus == kSetupInternalError)
637  fSetupStatus = kSetupMatch;
638  if (element->IsA() == TStreamerSTL::Class()){
639  fImpl = std::make_unique<TSTLReader>();
640  }
641  else if (element->IsA() == TStreamerObject::Class()){
642  //fImpl = new TObjectArrayReader(); // BArray[12]
643 
644  if (element->GetClass() == TClonesArray::Class()){
645  fImpl = std::make_unique<TClonesReader>();
646  }
647  else if (branchElement->GetType() == TBranchElement::kSTLMemberNode){
648  fImpl = std::make_unique<TBasicTypeArrayReader>();
649  }
650  else if (branchElement->GetType() == TBranchElement::kClonesMemberNode){
651  // TBasicTypeClonesReader should work for object
652  fImpl = std::make_unique<TBasicTypeClonesReader>(element->GetOffset());
653  }
654  else {
655  fImpl = std::make_unique<TArrayFixedSizeReader>(element->GetArrayLength());
656  }
657  }
658  else if (element->IsA() == TStreamerLoop::Class()) {
659  fImpl = std::make_unique<TArrayParameterSizeReader>(fTreeReader, branchElement->GetBranchCount()->GetName());
660  }
661  else if (element->IsA() == TStreamerBasicType::Class()){
662  if (branchElement->GetType() == TBranchElement::kSTLMemberNode){
663  fImpl = std::make_unique<TBasicTypeArrayReader>();
664  }
665  else if (branchElement->GetType() == TBranchElement::kClonesMemberNode){
666  fImpl = std::make_unique<TBasicTypeClonesReader>(element->GetOffset());
667  }
668  else {
669  fImpl = std::make_unique<TArrayFixedSizeReader>(element->GetArrayLength());
670  ((TObjectArrayReader*)fImpl.get())->SetBasicTypeSize(((TDataType*)fDict)->Size());
671  }
672  }
673  else if (element->IsA() == TStreamerBasicPointer::Class()) {
674  fImpl = std::make_unique<TArrayParameterSizeReader>(fTreeReader, branchElement->GetBranchCount()->GetName());
675  ((TArrayParameterSizeReader*)fImpl.get())->SetBasicTypeSize(((TDataType*)fDict)->Size());
676  }
677  else if (element->IsA() == TStreamerBase::Class()){
678  fImpl = std::make_unique<TClonesReader>();
679  } else {
680  Error("TTreeReaderArrayBase::SetImpl()",
681  "Cannot read branch %s: unhandled streamer element type %s",
682  fBranchName.Data(), element->IsA()->GetName());
683  fSetupStatus = kSetupInternalError;
684  }
685  }
686  else { // We are at root node?
687  if (branchElement->GetClass()->GetCollectionProxy()){
688  fImpl = std::make_unique<TCollectionLessSTLReader>(branchElement->GetClass()->GetCollectionProxy());
689  }
690  }
691  } else if (branch->IsA() == TBranch::Class()) {
692  auto topLeaf = branch->GetLeaf(branch->GetName());
693  if (!topLeaf) {
694  Error("TTreeReaderArrayBase::SetImpl", "Failed to get the top leaf from the branch");
695  fSetupStatus = kSetupMissingBranch;
696  return;
697  }
698  // We could have used GetLeafCounter, but it does not work well with Double32_t and Float16_t: ROOT-10149
699  auto sizeLeaf = topLeaf->GetLeafCount();
700  if (fSetupStatus == kSetupInternalError)
701  fSetupStatus = kSetupMatch;
702  if (!sizeLeaf) {
703  fImpl = std::make_unique<TArrayFixedSizeReader>(topLeaf->GetLenStatic());
704  }
705  else {
706  fImpl = std::make_unique<TArrayParameterSizeReader>(fTreeReader, sizeLeaf->GetName());
707  }
708  ((TObjectArrayReader*)fImpl.get())->SetBasicTypeSize(((TDataType*)fDict)->Size());
709  } else if (branch->IsA() == TBranchClones::Class()) {
710  Error("TTreeReaderArrayBase::SetImpl", "Support for branches of type TBranchClones not implemented");
711  fSetupStatus = kSetupInternalError;
712  } else if (branch->IsA() == TBranchObject::Class()) {
713  Error("TTreeReaderArrayBase::SetImpl", "Support for branches of type TBranchObject not implemented");
714  fSetupStatus = kSetupInternalError;
715  } else if (branch->IsA() == TBranchSTL::Class()) {
716  Error("TTreeReaderArrayBase::SetImpl", "Support for branches of type TBranchSTL not implemented");
717  fImpl = std::make_unique<TSTLReader>();
718  fSetupStatus = kSetupInternalError;
719  } else if (branch->IsA() == TBranchRef::Class()) {
720  Error("TTreeReaderArrayBase::SetImpl", "Support for branches of type TBranchRef not implemented");
721  fSetupStatus = kSetupInternalError;
722  }
723 }
724 
725 ////////////////////////////////////////////////////////////////////////////////
726 /// Access a branch's collection content (not the collection itself)
727 /// through a proxy.
728 /// Retrieve the type of data contained in the collection stored by branch;
729 /// put its dictionary into dict, If there is no dictionary, put its type
730 /// name into contentTypeName.
731 /// The contentTypeName is set to NULL if the branch does not
732 /// contain a collection; in that case, the type of the branch is returned.
733 /// In all other cases, NULL is returned.
734 
736  TString& contentTypeName,
737  TDictionary* &dict)
738 {
739  dict = nullptr;
740  contentTypeName = "";
741  if (branch->IsA() == TBranchElement::Class()) {
742  TBranchElement* brElement = (TBranchElement*)branch;
743  if (brElement->GetType() == 4
744  || brElement->GetType() == 3) {
745  TVirtualCollectionProxy* collProxy = brElement->GetCollectionProxy();
746  if (collProxy) {
747  TClass *myClass = collProxy->GetValueClass();
748  if (!myClass){
749  Error("TTreeReaderArrayBase::GetBranchContentDataType()", "Could not get value class.");
750  return 0;
751  }
752  dict = TDictionary::GetDictionary(myClass->GetName());
753  if (!dict) dict = TDataType::GetDataType(collProxy->GetType());
754  }
755  if (!dict) {
756  // We don't know the dictionary, thus we need the content's type name.
757  // Determine it.
758  if (brElement->GetType() == 3) {
759  contentTypeName = brElement->GetClonesName();
760  dict = TDictionary::GetDictionary(brElement->GetClonesName());
761  return 0;
762  }
763  // STL:
764  TClassEdit::TSplitType splitType(brElement->GetClassName());
765  int isSTLCont = splitType.IsSTLCont();
766  if (!isSTLCont) {
767  Error("TTreeReaderArrayBase::GetBranchContentDataType()", "Cannot determine STL collection type of %s stored in branch %s", brElement->GetClassName(), branch->GetName());
768  return brElement->GetClassName();
769  }
770  bool isMap = isSTLCont == ROOT::kSTLmap
771  || isSTLCont == ROOT::kSTLmultimap;
772  if (isMap) contentTypeName = "std::pair< ";
773  contentTypeName += splitType.fElements[1];
774  if (isMap) {
775  contentTypeName += splitType.fElements[2];
776  contentTypeName += " >";
777  }
778  return 0;
779  }
780  return 0;
781  } else if (brElement->GetType() == 31
782  || brElement->GetType() == 41) {
783  // it's a member, extract from GetClass()'s streamer info
784  TClass* clData = 0;
785  EDataType dtData = kOther_t;
786  int ExpectedTypeRet = brElement->GetExpectedType(clData, dtData);
787  if (ExpectedTypeRet == 0) {
788  dict = clData;
789  if (!dict) {
790  dict = TDataType::GetDataType(dtData);
791  }
792  if (!dict) {
793  Error("TTreeReaderArrayBase::GetBranchContentDataType()", "The branch %s contains a data type %d for which the dictionary cannot be retrieved.",
794  branch->GetName(), (int)dtData);
795  contentTypeName = TDataType::GetTypeName(dtData);
796  return 0;
797  }
798  return 0;
799  } else if (ExpectedTypeRet == 1) {
800  int brID = brElement->GetID();
801  if (brID == -1) {
802  // top
803  Error("TTreeReaderArrayBase::GetBranchContentDataType()", "The branch %s contains data of type %s for which the dictionary does not exist. It's needed.",
804  branch->GetName(), brElement->GetClassName());
805  contentTypeName = brElement->GetClassName();
806  return 0;
807  }
808  // Either the data type name doesn't have an EDataType entry
809  // or the streamer info doesn't have a TClass* attached.
810  TStreamerElement* element =
811  (TStreamerElement*) brElement->GetInfo()->GetElement(brID);
812  contentTypeName = element->GetTypeName();
813  return 0;
814  }
815  /* else (ExpectedTypeRet == 2)*/
816  // The streamer info entry cannot be found.
817  // TBranchElement::GetExpectedType() has already complained.
818  return "{CANNOT DETERMINE TBranchElement DATA TYPE}";
819  }
820  else if (brElement->GetType() == TBranchElement::kLeafNode){
821  TStreamerInfo *streamerInfo = brElement->GetInfo();
822  Int_t id = brElement->GetID();
823 
824  if (id >= 0){
825  TStreamerElement *element = (TStreamerElement*)streamerInfo->GetElements()->At(id);
826 
827  if (element->IsA() == TStreamerSTL::Class()){
828  TClass *myClass = brElement->GetCurrentClass();
829  if (!myClass){
830  Error("TTreeReaderArrayBase::GetBranchDataType()", "Could not get class from branch element.");
831  return 0;
832  }
833  TVirtualCollectionProxy *myCollectionProxy = myClass->GetCollectionProxy();
834  if (!myCollectionProxy){
835  Error("TTreeReaderArrayBase::GetBranchDataType()", "Could not get collection proxy from STL class");
836  return 0;
837  }
838  // Try getting the contained class
839  dict = myCollectionProxy->GetValueClass();
840  // If it fails, try to get the contained type as a primitive type
841  if (!dict) dict = TDataType::GetDataType(myCollectionProxy->GetType());
842  if (!dict){
843  Error("TTreeReaderArrayBase::GetBranchDataType()", "Could not get valueClass from collectionProxy.");
844  return 0;
845  }
846  contentTypeName = dict->GetName();
847  return 0;
848  }
849  else if (element->IsA() == TStreamerObject::Class() && !strcmp(element->GetTypeName(), "TClonesArray")){
850  if (!fProxy->Setup() || !fProxy->Read()){
851  Error("TTreeReaderArrayBase::GetBranchContentDataType()", "Failed to get type from proxy, unable to check type");
852  contentTypeName = "UNKNOWN";
853  dict = 0;
854  return contentTypeName;
855  }
856  TClonesArray *myArray = (TClonesArray*)fProxy->GetWhere();
857  dict = myArray->GetClass();
858  contentTypeName = dict->GetName();
859  return 0;
860  }
861  else {
862  dict = brElement->GetCurrentClass();
863  if (!dict) {
864  TDictionary *myDataType = TDictionary::GetDictionary(brElement->GetTypeName());
865  dict = TDataType::GetDataType((EDataType)((TDataType*)myDataType)->GetType());
866  }
867  contentTypeName = brElement->GetTypeName();
868  return 0;
869  }
870  }
871  if (brElement->GetCurrentClass() == TClonesArray::Class()){
872  contentTypeName = "TClonesArray";
873  Warning("TTreeReaderArrayBase::GetBranchContentDataType()", "Not able to check type correctness, ignoring check");
874  dict = fDict;
875  fSetupStatus = kSetupNoCheck;
876  }
877  else if (!dict && (branch->GetSplitLevel() == 0 || brElement->GetClass()->GetCollectionProxy())){
878  // Try getting the contained class
879  dict = brElement->GetClass()->GetCollectionProxy()->GetValueClass();
880  // If it fails, try to get the contained type as a primitive type
881  if (!dict) dict = TDataType::GetDataType(brElement->GetClass()->GetCollectionProxy()->GetType());
882  if (dict) contentTypeName = dict->GetName();
883  return 0;
884  }
885  else if (!dict){
886  dict = brElement->GetClass();
887  contentTypeName = dict->GetName();
888  return 0;
889  }
890 
891  return 0;
892  }
893  return 0;
894  } else if (branch->IsA() == TBranch::Class()
895  || branch->IsA() == TBranchObject::Class()
896  || branch->IsA() == TBranchSTL::Class()) {
897  const char* dataTypeName = branch->GetClassName();
898  if ((!dataTypeName || !dataTypeName[0])
899  && branch->IsA() == TBranch::Class()) {
900  auto myLeaf = branch->GetLeaf(branch->GetName());
901  if (myLeaf){
902  auto myDataType = TDictionary::GetDictionary(myLeaf->GetTypeName());
903  if (myDataType && myDataType->IsA() == TDataType::Class()){
904  auto typeEnumConstant = EDataType(((TDataType*)myDataType)->GetType());
905  // We need to consider Double32_t and Float16_t as dounle and float respectively
906  // since this is the type the user uses to instantiate the TTreeReaderArray template.
907  if (typeEnumConstant == kDouble32_t) typeEnumConstant = kDouble_t;
908  else if (typeEnumConstant == kFloat16_t) typeEnumConstant = kFloat_t;
909  dict = TDataType::GetDataType(typeEnumConstant);
910  contentTypeName = myLeaf->GetTypeName();
911  return 0;
912  }
913  }
914 
915  // leaflist. Can't represent.
916  Error("TTreeReaderArrayBase::GetBranchContentDataType()", "The branch %s was created using a leaf list and cannot be represented as a C++ type. Please access one of its siblings using a TTreeReaderArray:", branch->GetName());
917  TIter iLeaves(branch->GetListOfLeaves());
918  TLeaf* leaf = 0;
919  while ((leaf = (TLeaf*) iLeaves())) {
920  Error("TTreeReaderArrayBase::GetBranchContentDataType()", " %s.%s", branch->GetName(), leaf->GetName());
921  }
922  return 0;
923  }
924  if (dataTypeName) dict = TDictionary::GetDictionary(dataTypeName);
925  if (branch->IsA() == TBranchSTL::Class()){
926  Warning("TTreeReaderArrayBase::GetBranchContentDataType()", "Not able to check type correctness, ignoring check");
927  dict = fDict;
928  fSetupStatus = kSetupNoCheck;
929  return 0;
930  }
931  return dataTypeName;
932  } else if (branch->IsA() == TBranchClones::Class()) {
933  dict = TClonesArray::Class();
934  return "TClonesArray";
935  } else if (branch->IsA() == TBranchRef::Class()) {
936  // Can't represent.
937  Error("TTreeReaderArrayBase::GetBranchContentDataType()", "The branch %s is a TBranchRef and cannot be represented as a C++ type.", branch->GetName());
938  return 0;
939  } else {
940  Error("TTreeReaderArrayBase::GetBranchContentDataType()", "The branch %s is of type %s - something that is not handled yet.", branch->GetName(), branch->IsA()->GetName());
941  return 0;
942  }
943 
944  return 0;
945 }
TLeaf::IsUnsigned
virtual Bool_t IsUnsigned() const
Definition: TLeaf.h:149
ROOT::Detail::TBranchProxy::GetWhere
void * GetWhere() const
Definition: TBranchProxy.h:397
kDouble_t
@ kDouble_t
Definition: TDataType.h:31
TBranchElement::GetClonesName
virtual const char * GetClonesName() const
Definition: TBranchElement.h:188
ROOT::Detail::TBranchProxy::GetOffset
Int_t GetOffset()
Definition: TBranchProxy.h:513
TStreamerInfo::GetElement
TStreamerElement * GetElement(Int_t id) const
Definition: TStreamerInfo.h:212
TBranchElement::GetType
Int_t GetType() const
Definition: TBranchElement.h:203
ROOT::Internal::TVirtualCollectionReader::~TVirtualCollectionReader
virtual ~TVirtualCollectionReader()
Definition: TTreeReaderArray.cxx:36
TClass::GetCollectionProxy
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Definition: TClass.cxx:2861
TBranch::GetLeaf
virtual TLeaf * GetLeaf(const char *name) const
Return pointer to the 1st Leaf named name in thisBranch.
Definition: TBranch.cxx:1963
TBranchElement::GetID
Int_t GetID() const
Definition: TBranchElement.h:195
Warning
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition: TError.cxx:231
TVirtualCollectionProxy::PushProxy
virtual void PushProxy(void *objectstart)=0
TStreamerElement::GetTypeName
const char * GetTypeName() const
Definition: TStreamerElement.h:123
TStreamerInfo.h
TBranchRef.h
TBranchElement
A Branch for the case of an object.
Definition: TBranchElement.h:39
TBranch::GetSplitLevel
Int_t GetSplitLevel() const
Definition: TBranch.h:246
TBranchElement::GetCurrentClass
TClass * GetCurrentClass()
Return a pointer to the current type of the data member corresponding to branch element.
Definition: TBranchElement.cxx:2514
ROOT::Internal::TFriendProxy::GetDirector
TBranchProxyDirector * GetDirector()
Definition: TFriendProxy.h:31
TString::Data
const char * Data() const
Definition: TString.h:369
ROOT::Internal::TTreeReaderArrayBase::GetBranchAndLeaf
bool GetBranchAndLeaf(TBranch *&branch, TLeaf *&myLeaf, TDictionary *&branchActualType)
Determine the branch / leaf and its type; reset fProxy / fSetupStatus on error.
Definition: TTreeReaderArray.cxx:535
TTreeReaderValue
An interface for reading values stored in ROOT columnar datasets.
Definition: TTreeReaderValue.h:146
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
ROOT::Internal::TTreeReaderArrayBase::SetImpl
void SetImpl(TBranch *branch, TLeaf *myLeaf)
Create the TVirtualCollectionReader object for our branch.
Definition: TTreeReaderArray.cxx:600
TStreamerElement.h
ROOT::Detail::TBranchProxy::GetStart
virtual void * GetStart(UInt_t=0)
Definition: TBranchProxy.h:408
TBranchElement::GetTypeName
virtual const char * GetTypeName() const
Return type name of element in the branch.
Definition: TBranchElement.cxx:2819
TLeaf::GetTypeName
virtual const char * GetTypeName() const
Definition: TLeaf.h:138
ROOT::Internal::TTreeReaderValueBase::kReadError
@ kReadError
Definition: TTreeReaderValue.h:70
ROOT::Internal::TTreeReaderValueBase::kReadSuccess
@ kReadSuccess
Definition: TTreeReaderValue.h:68
ROOT::Internal::TTreeReaderArrayBase
Base class of TTreeReaderArray.
Definition: TTreeReaderArray.h:29
TBranchElement::GetBranchCount
TBranchElement * GetBranchCount() const
Definition: TBranchElement.h:182
Byte_t
unsigned char Byte_t
Definition: RtypesCore.h:64
TObjArray::GetEntries
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:523
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
TVirtualCollectionProxy::GetValueClass
virtual TClass * GetValueClass() const =0
TClassEdit::TSplitType::IsSTLCont
int IsSTLCont(int testAlloc=0) const
type : type name: vector<list<classA,allocator>,allocator> testAlloc: if true, we test allocator,...
Definition: TClassEdit.cxx:189
ROOT::Internal
Definition: TErrorDefaultHandler.hxx:16
TList.h
ROOT::Internal::TNamedBranchProxy::GetContentDict
TDictionary * GetContentDict() const
Definition: TTreeReaderUtils.h:59
TRangeDynCast
TRangeDynCast is an adaptater class that allows the typed iteration through a TCollection.
Definition: TCollection.h:411
TObjArray::UncheckedAt
TObject * UncheckedAt(Int_t i) const
Definition: TObjArray.h:90
TObjArray::At
TObject * At(Int_t idx) const
Definition: TObjArray.h:166
TFriendElement.h
TClassEdit::TSplitType
Definition: TClassEdit.h:137
TBranch::GetClassName
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
Definition: TBranch.cxx:1311
TLeaf::GetLenType
virtual Int_t GetLenType() const
Definition: TLeaf.h:132
TString
Basic string class.
Definition: TString.h:136
TGenCollectionProxy.h
ROOT::Internal::TTreeReaderValueBase::GetLeaf
TLeaf * GetLeaf()
If we are reading a leaf, return the corresponding TLeaf.
Definition: TTreeReaderValue.h:90
ROOT::Detail::TBranchProxy::GetCollection
TVirtualCollectionProxy * GetCollection()
Definition: TBranchProxy.h:405
TBranchElement::kLeafNode
@ kLeafNode
Definition: TBranchElement.h:239
TDataType::GetDataType
static TDataType * GetDataType(EDataType type)
Given a EDataType type, get the TDataType* that represents it.
Definition: TDataType.cxx:440
kFloat16_t
@ kFloat16_t
Definition: TDataType.h:33
ROOT::kSTLmap
@ kSTLmap
Definition: ESTLType.h:33
TStreamerElement::GetOffset
Int_t GetOffset() const
Definition: TStreamerElement.h:120
TROOT.h
ROOT::Internal::TTreeReaderArrayBase::GetBranchContentDataType
const char * GetBranchContentDataType(TBranch *branch, TString &contentTypeName, TDictionary *&dict)
Access a branch's collection content (not the collection itself) through a proxy.
Definition: TTreeReaderArray.cxx:735
TClassEdit::TSplitType::fElements
std::vector< std::string > fElements
Definition: TClassEdit.h:140
TTree::GetTree
virtual TTree * GetTree() const
Definition: TTree.h:512
TVirtualCollectionProxy::GetType
virtual EDataType GetType() const =0
ROOT::Detail::TBranchProxy::GetClass
TClass * GetClass()
Definition: TBranchProxy.h:384
TVirtualCollectionProxy::HasPointers
virtual Bool_t HasPointers() const =0
TBranchElement::GetInfo
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
Definition: TBranchElement.cxx:1020
TBranch
A TTree is a list of TBranches.
Definition: TBranch.h:89
TTree::GetBranch
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
Definition: TTree.cxx:5214
TRegexp.h
kDouble32_t
@ kDouble32_t
Definition: TDataType.h:31
TTreeReader.h
TBranchElement::GetClass
virtual TClass * GetClass() const
Definition: TBranchElement.h:187
TBranchElement.h
TLeaf.h
TTreeReader::GetTree
TTree * GetTree() const
Definition: TTreeReader.h:173
TDataType
Basic data type descriptor (datatype information is obtained from CINT).
Definition: TDataType.h:44
TStreamerInfo::GetElements
TObjArray * GetElements() const
Definition: TStreamerInfo.h:210
TStreamerInfo
Describe Streamer information for one class version.
Definition: TStreamerInfo.h:44
TLeaf
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:57
TBranchElement::GetCollectionProxy
TVirtualCollectionProxy * GetCollectionProxy()
Return the collection proxy describing the branch content, if any.
Definition: TBranchElement.cxx:2439
TTreeReaderArray.h
TStreamerElement::GetClass
TClass * GetClass() const
Definition: TStreamerElement.h:109
ROOT::Internal::TNamedBranchProxy::GetProxy
const Detail::TBranchProxy * GetProxy() const
Definition: TTreeReaderUtils.h:55
TLeaf::GetLeafCount
virtual TLeaf * GetLeafCount() const
If this leaf stores a variable-sized array or a multi-dimensional array whose last dimension has vari...
Definition: TLeaf.h:120
ROOT::Internal::TNamedBranchProxy::SetContentDict
void SetContentDict(TDictionary *dict)
Definition: TTreeReaderUtils.h:60
ROOT::Internal::TTreeReaderArrayBase::CreateProxy
virtual void CreateProxy()
Create the proxy object for our branch.
Definition: TTreeReaderArray.cxx:376
ROOT::Detail::TBranchProxy::Read
Bool_t Read()
Definition: TBranchProxy.h:137
TBranchSTL.h
TBranchElement::GetClassName
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
Definition: TBranchElement.h:186
TTreeReader
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
Definition: TTreeReader.h:44
TClonesArray::GetClass
TClass * GetClass() const
Definition: TClonesArray.h:53
ROOT::Internal::TFriendProxy
Definition: TFriendProxy.h:22
TClass::GetClassSize
Int_t GetClassSize() const
Definition: TClass.h:386
TVirtualCollectionProxy::At
virtual void * At(UInt_t idx)=0
ROOT::kSTLmultimap
@ kSTLmultimap
Definition: ESTLType.h:34
ROOT::Internal::TTreeReaderValueBase::ProxyRead
EReadStatus ProxyRead()
Definition: TTreeReaderValue.h:73
TBranchProxyDirector.h
TBranchClones.h
TStreamerElement::GetArrayLength
Int_t GetArrayLength() const
Definition: TStreamerElement.h:107
kFloat_t
@ kFloat_t
Definition: TDataType.h:31
TTree::FindLeaf
virtual TLeaf * FindLeaf(const char *name)
Find leaf..
Definition: TTree.cxx:4839
TDictionary
This class defines an abstract interface that must be implemented by all classes that contain diction...
Definition: TDictionary.h:167
kOther_t
@ kOther_t
Definition: TDataType.h:32
TRegexp
Regular expression class.
Definition: TRegexp.h:31
ROOT::Detail::TBranchProxy
Base class for all the proxy object.
Definition: TBranchProxy.h:69
xmlio::Size
const char * Size
Definition: TXMLSetup.cxx:56
TLeaf::GetLen
virtual Int_t GetLen() const
Return the number of effective elements of this leaf, for the current entry.
Definition: TLeaf.cxx:381
TBranch::GetMother
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Definition: TBranch.cxx:2035
TLeaf::GetBranch
TBranch * GetBranch() const
Definition: TLeaf.h:115
TString::IsNull
Bool_t IsNull() const
Definition: TString.h:407
TClassEdit.h
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
ROOT::Internal::TTreeReaderValueBase::GetAddress
void * GetAddress()
Returns the memory address of the object being read.
Definition: TTreeReaderValue.cxx:252
EDataType
EDataType
Definition: TDataType.h:28
TMVA::DNN::forward
void forward(const LAYERDATA &prevLayerData, LAYERDATA &currLayerData)
apply the weights (and functions) in forward direction of the DNN
Definition: NeuralNet.icc:546
TDataType::GetTypeName
TString GetTypeName()
Get basic type of typedef, e,g.
Definition: TDataType.cxx:149
TBranchObject.h
TIter
Definition: TCollection.h:233
TVirtualCollectionProxy::PopProxy
virtual void PopProxy()=0
fSize
size_t fSize
Definition: DeclareConverters.h:342
ROOT::Internal::TVirtualCollectionReader
Definition: TTreeReaderUtils.h:70
ROOT::Internal::TTreeReaderValueBase
Base class of TTreeReaderValue.
Definition: TTreeReaderValue.h:44
ROOT::Internal::TNamedBranchProxy
Definition: TTreeReaderUtils.h:43
TBranchElement::GetExpectedType
virtual Int_t GetExpectedType(TClass *&clptr, EDataType &type)
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
Definition: TBranchElement.cxx:2718
RMakeUnique.hxx
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
ARGS
#define ARGS(alist)
Definition: gifencode.c:10
Class
void Class()
Definition: Class.C:29
TBranch::GetListOfLeaves
TObjArray * GetListOfLeaves()
Definition: TBranch.h:243
TBranch::GetTree
TTree * GetTree() const
Definition: TBranch.h:248
TFriendProxy.h
TDictionary::GetDictionary
static TDictionary * GetDictionary(const char *name)
Definition: TDictionary.cxx:84
RooStats::HistFactory::Constraint::GetType
Type GetType(const std::string &Name)
Definition: Systematics.cxx:34
TClonesArray
An array of clone (identical) objects.
Definition: TClonesArray.h:29
TStreamerElement
Definition: TStreamerElement.h:33
TBranchElement::kSTLMemberNode
@ kSTLMemberNode
Definition: TBranchElement.h:249
TBranchElement::kClonesMemberNode
@ kClonesMemberNode
Definition: TBranchElement.h:248
TVirtualCollectionProxy
Definition: TVirtualCollectionProxy.h:38
TVirtualCollectionProxy::Size
virtual UInt_t Size() const =0
int
Error
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition: TError.cxx:187