Logo ROOT   6.12/07
Reference Guide
TTreeReaderValue.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 "TTreeReaderValue.h"
13 
14 #include "TTreeReader.h"
15 #include "TBranchClones.h"
16 #include "TBranchElement.h"
17 #include "TBranchRef.h"
18 #include "TBranchSTL.h"
19 #include "TBranchProxyDirector.h"
20 #include "TClassEdit.h"
21 #include "TLeaf.h"
22 #include "TTreeProxyGenerator.h"
23 #include "TTreeReaderValue.h"
24 #include "TRegexp.h"
25 #include "TStreamerInfo.h"
26 #include "TStreamerElement.h"
27 #include "TNtuple.h"
28 #include <vector>
29 
30 /** \class TTreeReaderValue
31 
32 Extracts data from a TTree.
33 */
34 
36 
37 ////////////////////////////////////////////////////////////////////////////////
38 /// Construct a tree value reader and register it with the reader object.
39 
41  const char* branchname /*= 0*/,
42  TDictionary* dict /*= 0*/):
43  fHaveLeaf(0),
44  fHaveStaticClassOffsets(0),
45  fReadStatus(kReadNothingYet),
46  fBranchName(branchname),
47  fTreeReader(reader),
48  fDict(dict)
49 {
51 }
52 
53 ////////////////////////////////////////////////////////////////////////////////
54 /// Copy-construct.
55 
57  fHaveLeaf(rhs.fHaveLeaf),
62  fLeafName(rhs.fLeafName),
64  fDict(rhs.fDict),
65  fProxy(rhs.fProxy),
66  fLeaf(rhs.fLeaf),
68 {
70 }
71 
72 ////////////////////////////////////////////////////////////////////////////////
73 /// Copy-assign.
74 
77  if (&rhs != this) {
78  fHaveLeaf = rhs.fHaveLeaf;
81  fLeafName = rhs.fLeafName;
82  if (fTreeReader != rhs.fTreeReader) {
83  if (fTreeReader)
87  }
88  fDict = rhs.fDict;
89  fProxy = rhs.fProxy;
90  fLeaf = rhs.fLeaf;
94  }
95  return *this;
96 }
97 
98 ////////////////////////////////////////////////////////////////////////////////
99 /// Unregister from tree reader, cleanup.
100 
102 {
104  R__ASSERT((fLeafName.Length() == 0 ) == !fHaveLeaf
105  && "leafness disagreement");
107  && "static class offset disagreement");
108 }
109 
110 ////////////////////////////////////////////////////////////////////////////////
111 /// Register with tree reader.
112 
114  if (fTreeReader) {
115  if (!fTreeReader->RegisterValueReader(this)) {
116  fTreeReader = nullptr;
117  }
118  }
119 }
120 
121 ////////////////////////////////////////////////////////////////////////////////
122 /// Try to read the value from the TBranchProxy, returns
123 /// the status of the read.
124 
127  if (!fProxy) return kReadNothingYet;
128  if (fProxy->Read()) {
130  } else {
132  }
133  return fReadStatus;
134 }
135 
136 ////////////////////////////////////////////////////////////////////////////////
137 /// Stringify the template argument.
138 std::string ROOT::Internal::TTreeReaderValueBase::GetElementTypeName(const std::type_info& ti) {
139  int err;
140  char* buf = TClassEdit::DemangleTypeIdName(ti, err);
141  std::string ret = buf;
142  free(buf);
143  return ret;
144 }
145 
146 ////////////////////////////////////////////////////////////////////////////////
147 /// The TTreeReader has switched to a new TTree. Update the leaf.
148 
150  if (!fHaveLeaf)
151  return;
152 
153  TBranch *myBranch = newTree->GetBranch(fBranchName);
154 
155  if (!myBranch) {
157  Error("TTreeReaderValueBase::GetLeaf()", "Unable to get the branch from the tree");
158  return;
159  }
160 
161  fLeaf = myBranch->GetLeaf(fLeafName);
162  if (!fLeaf) {
163  Error("TTreeReaderValueBase::GetLeaf()", "Failed to get the leaf from the branch");
164  }
165 }
166 
167 ////////////////////////////////////////////////////////////////////////////////
168 /// Returns the memory address of the object being read.
169 
171  if (ProxyRead() != kReadSuccess) return 0;
172 
173  if (fHaveLeaf){
174  if (GetLeaf()){
175  return fLeaf->GetValuePointer();
176  }
177  else {
179  Error("TTreeReaderValueBase::GetAddress()", "Unable to get the leaf");
180  return 0;
181  }
182  }
183  if (fHaveStaticClassOffsets){ // Follow all the pointers
184  Byte_t *address = (Byte_t*)fProxy->GetWhere();
185 
186  for (unsigned int i = 0; i < fStaticClassOffsets.size() - 1; ++i){
187  address = *(Byte_t**)(address + fStaticClassOffsets[i]);
188  }
189 
190  return address + fStaticClassOffsets.back();
191  }
192  return (Byte_t*)fProxy->GetWhere();
193 }
194 
195 ////////////////////////////////////////////////////////////////////////////////
196 /// Create the proxy object for our branch.
197 
199  if (fProxy) {
200  return;
201  }
202 
203  fSetupStatus = kSetupInternalError; // Fallback; set to something concrete below.
204  if (!fTreeReader) {
205  Error("TTreeReaderValueBase::CreateProxy()", "TTreeReader object not set / available for branch %s!",
206  fBranchName.Data());
208  return;
209  }
210  if (!fDict) {
212  const char* brDataType = "{UNDETERMINED}";
213  if (br) {
214  TDictionary* brDictUnused = 0;
215  brDataType = GetBranchDataType(br, brDictUnused);
216  }
217  Error("TTreeReaderValueBase::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.",
218  GetDerivedTypeName(), fBranchName.Data(), brDataType);
220  return;
221  }
222 
223  // Search for the branchname, determine what it contains, and wire the
224  // TBranchProxy representing it to us so we can access its data.
225 
227  if (namedProxy && namedProxy->GetDict() == fDict) {
228  fProxy = namedProxy->GetProxy();
230  return;
231  }
232 
233  // This allows to support names such as v.a where the branch was created with
234  // this syntax:
235  // myTree->Branch("v", &v, "a/I:b:/I")
236  // if the branch is not found, the fBranchName is chopped to the top level branch
237  // by this very method.
238  std::string originalBranchName = fBranchName.Data();
239 
241  TLeaf *myLeaf = NULL;
242  TDictionary* branchActualType = 0;
243 
244  if (!branch) {
245  if (fBranchName.Contains(".")){
246  TRegexp leafNameExpression ("\\.[a-zA-Z0-9_]+$");
247  TString leafName (fBranchName(leafNameExpression));
248  TString branchName = fBranchName(0, fBranchName.Length() - leafName.Length());
249  branch = fTreeReader->GetTree()->GetBranch(branchName);
250  if (!branch){
251  std::vector<TString> nameStack;
252  nameStack.push_back(TString()); //Trust me
253  nameStack.push_back(leafName.Strip(TString::kBoth, '.'));
254  leafName = branchName(leafNameExpression);
255  branchName = branchName(0, branchName.Length() - leafName.Length());
256 
257  branch = fTreeReader->GetTree()->GetBranch(branchName);
258  if (!branch) branch = fTreeReader->GetTree()->GetBranch(branchName + ".");
259  if (leafName.Length()) nameStack.push_back(leafName.Strip(TString::kBoth, '.'));
260 
261  while (!branch && branchName.Contains(".")){
262  leafName = branchName(leafNameExpression);
263  branchName = branchName(0, fBranchName.Length() - leafName.Length());
264  branch = fTreeReader->GetTree()->GetBranch(branchName);
265  if (!branch) branch = fTreeReader->GetTree()->GetBranch(branchName + ".");
266  nameStack.push_back(leafName.Strip(TString::kBoth, '.'));
267  }
268 
269  if (branch && branch->IsA() == TBranchElement::Class()){
270  TBranchElement *myBranchElement = (TBranchElement*)branch;
271 
272  TString traversingBranch = nameStack.back();
273  nameStack.pop_back();
274 
275  bool found = true;
276 
277  TDataType *finalDataType = 0;
278 
279  std::vector<Long64_t> offsets;
280  Long64_t offset = 0;
281  TClass *elementClass = 0;
282 
283  TObjArray *myObjArray = myBranchElement->GetInfo()->GetElements();
284  TVirtualStreamerInfo *myInfo = myBranchElement->GetInfo();
285 
286  while (nameStack.size() && found){
287  found = false;
288 
289  for (int i = 0; i < myObjArray->GetEntries(); ++i){
290 
291  TStreamerElement *tempStreamerElement = (TStreamerElement*)myObjArray->At(i);
292 
293  if (!strcmp(tempStreamerElement->GetName(), traversingBranch.Data())){
294  offset += myInfo->GetElementOffset(i);
295 
296  traversingBranch = nameStack.back();
297  nameStack.pop_back();
298 
299  elementClass = tempStreamerElement->GetClass();
300  if (elementClass) {
301  myInfo = elementClass->GetStreamerInfo(0);
302  myObjArray = myInfo->GetElements();
303  // FIXME: this is odd, why is 'i' not also reset????
304  }
305  else {
306  finalDataType = TDataType::GetDataType((EDataType)tempStreamerElement->GetType());
307  if (!finalDataType) {
308  TDictionary* seType = TDictionary::GetDictionary(tempStreamerElement->GetTypeName());
309  if (seType && seType->IsA() == TDataType::Class()) {
310  finalDataType = TDataType::GetDataType((EDataType)((TDataType*)seType)->GetType());
311  }
312  }
313  }
314 
315  if (tempStreamerElement->IsaPointer()){
316  offsets.push_back(offset);
317  offset = 0;
318  }
319 
320  found = true;
321  break;
322  }
323  }
324  }
325 
326  offsets.push_back(offset);
327 
328  if (found){
329  fStaticClassOffsets = offsets;
331 
332  if (fDict != finalDataType && fDict != elementClass){
333  Error("TTreeReaderValueBase::CreateProxy", "Wrong data type %s", finalDataType ? finalDataType->GetName() : elementClass ? elementClass->GetName() : "UNKNOWN");
335  fProxy = 0;
336  return;
337  }
338  }
339  }
340 
341 
343  Error("TTreeReaderValueBase::CreateProxy()", "The tree does not have a branch called %s. You could check with TTree::Print() for available branches.", fBranchName.Data());
345  fProxy = 0;
346  return;
347  }
348  }
349  else {
350  myLeaf = branch->GetLeaf(TString(leafName(1, leafName.Length())));
351  if (!myLeaf){
352  Error("TTreeReaderValueBase::CreateProxy()",
353  "The tree does not have a branch, nor a sub-branch called %s. You could check with TTree::Print() for available branches.", fBranchName.Data());
355  fProxy = 0;
356  return;
357  }
358  else {
359  TDictionary *tempDict = TDictionary::GetDictionary(myLeaf->GetTypeName());
360  if (tempDict && tempDict->IsA() == TDataType::Class() && TDictionary::GetDictionary(((TDataType*)tempDict)->GetTypeName()) == fDict){
361  //fLeafOffset = myLeaf->GetOffset() / 4;
362  branchActualType = fDict;
363  fLeaf = myLeaf;
365  fLeafName = leafName(1, leafName.Length());
366  fHaveLeaf = fLeafName.Length() > 0;
368  }
369  else {
370  Error("TTreeReaderValueBase::CreateProxy()",
371  "Leaf of type %s cannot be read by TTreeReaderValue<%s>.", myLeaf->GetTypeName(), fDict->GetName());
373  }
374  }
375  }
376  }
377  else {
378  Error("TTreeReaderValueBase::CreateProxy()", "The tree does not have a branch called %s. You could check with TTree::Print() for available branches.", fBranchName.Data());
379  fProxy = 0;
380  return;
381  }
382  }
383 
384  if (!myLeaf && !fHaveStaticClassOffsets) {
385  const char* branchActualTypeName = GetBranchDataType(branch, branchActualType);
386 
387  if (!branchActualType) {
388  Error("TTreeReaderValueBase::CreateProxy()", "The branch %s contains data of type %s, which does not have a dictionary.",
389  fBranchName.Data(), branchActualTypeName ? branchActualTypeName : "{UNDETERMINED TYPE}");
390  fProxy = 0;
391  return;
392  }
393 
394  if (fDict != branchActualType) {
395  TDataType *dictdt = dynamic_cast<TDataType*>(fDict);
396  TDataType *actualdt = dynamic_cast<TDataType*>(branchActualType);
397  bool complainAboutMismatch = true;
398  if (dictdt && actualdt) {
399  if (dictdt->GetType() > 0 && dictdt->GetType() == actualdt->GetType()) {
400  // Same numerical type but different TDataType, likely Long64_t
401  complainAboutMismatch = false;
402  } else if ((actualdt->GetType() == kDouble32_t && dictdt->GetType() == kDouble_t)
403  || (actualdt->GetType() == kFloat16_t && dictdt->GetType() == kFloat_t)) {
404  // Double32_t and Float16_t never "decay" to their underlying type;
405  // we need to identify them manually here (ROOT-8731).
406  complainAboutMismatch = false;
407  }
408  }
409  if (complainAboutMismatch) {
410  Error("TTreeReaderValueBase::CreateProxy()",
411  "The branch %s contains data of type %s. It cannot be accessed by a TTreeReaderValue<%s>",
412  fBranchName.Data(), branchActualType->GetName(),
413  fDict->GetName());
414  return;
415  }
416  }
417  }
418 
419 
420  // Update named proxy's dictionary
421  if (namedProxy && !namedProxy->GetDict()) {
422  namedProxy->SetDict(fDict);
423  fProxy = namedProxy->GetProxy();
424  if (fProxy)
426  return;
427  }
428 
429  // Search for the branchname, determine what it contains, and wire the
430  // TBranchProxy representing it to us so we can access its data.
431  // A proxy for branch must not have been created before (i.e. check
432  // fProxies before calling this function!)
433 
434  TString membername;
435 
436  bool isTopLevel = branch->GetMother() == branch;
437  if (!isTopLevel) {
438  membername = strrchr(branch->GetName(), '.');
439  if (membername.IsNull()) {
440  membername = branch->GetName();
441  }
442  }
443  namedProxy = new TNamedBranchProxy(fTreeReader->fDirector, branch, originalBranchName.c_str(), membername);
444  fTreeReader->AddProxy(namedProxy);
445  fProxy = namedProxy->GetProxy();
446  if (fProxy) {
448  } else {
450  }
451 }
452 
453 ////////////////////////////////////////////////////////////////////////////////
454 /// Retrieve the type of data stored by branch; put its dictionary into
455 /// dict, return its type name. If no dictionary is available, at least
456 /// its type name should be returned.
457 
459  TDictionary* &dict) const
460 {
461  dict = 0;
462  if (branch->IsA() == TBranchElement::Class()) {
463  TBranchElement* brElement = (TBranchElement*)branch;
464 
465  auto ResolveTypedef = [&]() -> void {
466  if (dict->IsA() != TDataType::Class())
467  return;
468  // Resolve the typedef.
469  dict = TDictionary::GetDictionary(((TDataType*)dict)->GetTypeName());
470  if (dict->IsA() != TDataType::Class()) {
471  // Might be a class.
472  if (dict != fDict) {
473  dict = TClass::GetClass(brElement->GetTypeName());
474  }
475  if (dict != fDict) {
476  dict = brElement->GetCurrentClass();
477  }
478  }
479  };
480 
481  if (brElement->GetType() == TBranchElement::kSTLNode ||
482  brElement->GetType() == TBranchElement::kLeafNode ||
483  brElement->GetType() == TBranchElement::kObjectNode) {
484 
485  TStreamerInfo *streamerInfo = brElement->GetInfo();
486  Int_t id = brElement->GetID();
487 
488  if (id >= 0){
489  TStreamerElement *element = (TStreamerElement*)streamerInfo->GetElements()->At(id);
490  if (element->IsA() == TStreamerSTL::Class()){
491  TStreamerSTL *myStl = (TStreamerSTL*)element;
492  dict = myStl->GetClass();
493  return 0;
494  }
495  }
496 
497  if (brElement->GetType() == 3 || brElement->GetType() == 4) {
498  dict = brElement->GetCurrentClass();
499  return brElement->GetTypeName();
500  }
501 
502  if (brElement->GetTypeName())
503  dict = TDictionary::GetDictionary(brElement->GetTypeName());
504 
505  if (dict)
506  ResolveTypedef();
507  else
508  dict = brElement->GetCurrentClass();
509 
510  return brElement->GetTypeName();
511  } else if (brElement->GetType() == TBranchElement::kClonesNode) {
512  dict = TClonesArray::Class();
513  return "TClonesArray";
514  } else if (brElement->GetType() == 31
515  || brElement->GetType() == 41) {
516  // it's a member, extract from GetClass()'s streamer info
517  Error("TTreeReaderValueBase::GetBranchDataType()", "Must use TTreeReaderArray to access a member of an object that is stored in a collection.");
518  } else if (brElement->GetType() == -1 && brElement->GetTypeName()) {
519  dict = TDictionary::GetDictionary(brElement->GetTypeName());
520  ResolveTypedef();
521  return brElement->GetTypeName();
522  } else {
523  Error("TTreeReaderValueBase::GetBranchDataType()", "Unknown type and class combination: %i, %s", brElement->GetType(), brElement->GetClassName());
524  }
525  return 0;
526  } else if (branch->IsA() == TBranch::Class()
527  || branch->IsA() == TBranchObject::Class()
528  || branch->IsA() == TBranchSTL::Class()) {
529  if (branch->GetTree()->IsA() == TNtuple::Class()){
531  return dict->GetName();
532  }
533  const char* dataTypeName = branch->GetClassName();
534  if ((!dataTypeName || !dataTypeName[0])
535  && branch->IsA() == TBranch::Class()) {
536  TLeaf *myLeaf = branch->GetLeaf(branch->GetName());
537  if (myLeaf){
538  TDictionary *myDataType = TDictionary::GetDictionary(myLeaf->GetTypeName());
539  if (myDataType && myDataType->IsA() == TDataType::Class()){
540  dict = TDataType::GetDataType((EDataType)((TDataType*)myDataType)->GetType());
541  return myLeaf->GetTypeName();
542  }
543  }
544 
545 
546  // leaflist. Can't represent.
547  Error("TTreeReaderValueBase::GetBranchDataType()", "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());
548  TIter iLeaves(branch->GetListOfLeaves());
549  TLeaf* leaf = 0;
550  while ((leaf = (TLeaf*) iLeaves())) {
551  Error("TTreeReaderValueBase::GetBranchDataType()", " %s.%s", branch->GetName(), leaf->GetName());
552  }
553  return 0;
554  }
555  if (dataTypeName) dict = TDictionary::GetDictionary(dataTypeName);
556  return dataTypeName;
557  } else if (branch->IsA() == TBranchClones::Class()) {
558  dict = TClonesArray::Class();
559  return "TClonesArray";
560  } else if (branch->IsA() == TBranchRef::Class()) {
561  // Can't represent.
562  Error("TTreeReaderValueBase::GetBranchDataType()", "The branch %s is a TBranchRef and cannot be represented as a C++ type.", branch->GetName());
563  return 0;
564  } else {
565  Error("TTreeReaderValueBase::GetBranchDataType()", "The branch %s is of type %s - something that is not handled yet.", branch->GetName(), branch->IsA()->GetName());
566  return 0;
567  }
568 
569  return 0;
570 }
571 
ROOT::Internal::TNamedBranchProxy * FindProxy(const char *branchname) const
Definition: TTreeReader.h:227
Describe Streamer information for one class version.
Definition: TStreamerInfo.h:43
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
Definition: TBranch.cxx:1266
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:32
An array of TObjects.
Definition: TObjArray.h:37
static TDataType * GetDataType(EDataType type)
Given a EDataType type, get the TDataType* that represents it.
Definition: TDataType.cxx:440
To read this branch, we need a dictionary.
long long Long64_t
Definition: RtypesCore.h:69
Int_t GetType() const
TTreeReader is a simple, robust and fast interface to read values from a TTree, TChain or TNtuple...
Definition: TTreeReader.h:43
The branch class type is not a collection.
virtual const char * GetTypeName() const
Definition: TLeaf.h:82
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
Definition: TClass.cxx:4420
virtual ~TTreeReaderValueBase()
Unregister from tree reader, cleanup.
Regular expression class.
Definition: TRegexp.h:31
static TDictionary * GetDictionary(const char *name)
Definition: TDictionary.cxx:84
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
#define R__ASSERT(e)
Definition: TError.h:96
Basic string class.
Definition: TString.h:125
EReadStatus ProxyRead()
Try to read the value from the TBranchProxy, returns the status of the read.
int Int_t
Definition: RtypesCore.h:41
std::vector< Long64_t > fStaticClassOffsets
Type GetType(const std::string &Name)
Definition: Systematics.cxx:34
The array cannot find its counter branch: Array[CounterBranch].
TObject * At(Int_t idx) const
Definition: TObjArray.h:165
Bool_t RegisterValueReader(ROOT::Internal::TTreeReaderValueBase *reader)
TTree * GetTree() const
Definition: TTreeReader.h:162
const Detail::TBranchProxy * GetProxy() const
void Class()
Definition: Class.C:29
unsigned char Byte_t
Definition: RtypesCore.h:60
virtual TLeaf * GetLeaf(const char *name) const
Return pointer to the 1st Leaf named name in thisBranch.
Definition: TBranch.cxx:1636
std::string ResolveTypedef(const char *tname, bool resolveAll=false)
Int_t GetID() const
char * DemangleTypeIdName(const std::type_info &ti, int &errorCode)
Demangle in a portable way the type id name.
TTreeReaderValueBase & operator=(const TTreeReaderValueBase &)
Copy-assign.
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
Definition: TTree.cxx:4985
Int_t GetType() const
Definition: TDataType.h:68
virtual const char * GetTypeName() const
Return type name of element in the branch.
void SetDict(TDictionary *dict)
void RegisterWithTreeReader()
Register with tree reader.
ROOT::Internal::TBranchProxyDirector * fDirector
proxying director, owned
Definition: TTreeReader.h:269
TTreeReaderValueBase(TTreeReader *reader, const char *branchname, TDictionary *dict)
Construct a tree value reader and register it with the reader object.
Basic data type descriptor (datatype information is obtained from CINT).
Definition: TDataType.h:44
This class defines an abstract interface that must be implemented by all classes that contain diction...
Definition: TDictionary.h:158
void AddProxy(ROOT::Internal::TNamedBranchProxy *p)
Definition: TTreeReader.h:233
virtual void CreateProxy()
Create the proxy object for our branch.
Some other error - hopefully the error message helps.
Ssiz_t Length() const
Definition: TString.h:386
TClass * GetCurrentClass()
Return a pointer to the current type of the data member corresponding to branch element.
virtual void * GetValuePointer() const
Definition: TLeaf.h:81
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Definition: TString.cxx:1080
void * GetAddress()
Returns the memory address of the object being read.
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:75
A Branch for the case of an object.
static std::string GetElementTypeName(const std::type_info &ti)
Stringify the template argument.
#define ClassImp(name)
Definition: Rtypes.h:359
virtual TObjArray * GetElements() const =0
virtual Bool_t IsaPointer() const
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
#define free
Definition: civetweb.c:821
EDataType
Definition: TDataType.h:28
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:570
void DeregisterValueReader(ROOT::Internal::TTreeReaderValueBase *reader)
TObjArray * GetListOfLeaves()
Definition: TBranch.h:195
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition: TClass.cxx:2887
Bool_t IsNull() const
Definition: TString.h:383
TLeaf * GetLeaf()
If we are reading a leaf, return the corresponding TLeaf.
TObjArray * GetElements() const
const char * GetTypeName() const
virtual const char * GetDerivedTypeName() const =0
void NotifyNewTree(TTree *newTree)
The TTreeReader has switched to a new TTree. Update the leaf.
TTree * GetTree() const
Definition: TBranch.h:200
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:522
A TTree object has a header with a name and a title.
Definition: TTree.h:70
A TTree is a list of TBranches.
Definition: TBranch.h:59
Abstract Interface class describing Streamer information for one class.
Int_t GetType() const
const char * GetBranchDataType(TBranch *branch, TDictionary *&dict) const
Retrieve the type of data stored by branch; put its dictionary into dict, return its type name...
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Definition: TBranch.cxx:1709
virtual Int_t GetElementOffset(Int_t id) const =0
void Error(ErrorHandler_t func, int code, const char *va_(fmt),...)
Write error message and call a handler, if required.
TClass * GetClass() const
const char * Data() const
Definition: TString.h:345