Logo ROOT   6.08/02
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  fBranchName(branchname),
44  fTreeReader(reader),
45  fDict(dict),
46  fProxy(NULL),
47  fLeaf(NULL),
48  fSetupStatus(kSetupNotSetup),
49  fReadStatus(kReadNothingYet)
50 {
51  RegisterWithTreeReader();
52 }
53 
54 ////////////////////////////////////////////////////////////////////////////////
55 /// Copy-construct.
56 
58  fBranchName(rhs.fBranchName),
59  fLeafName(rhs.fLeafName),
60  fTreeReader(rhs.fTreeReader),
61  fDict(rhs.fDict),
62  fProxy(rhs.fProxy),
63  fLeaf(rhs.fLeaf),
64  fSetupStatus(rhs.fSetupStatus),
65  fReadStatus(rhs.fReadStatus),
66  fStaticClassOffsets(rhs.fStaticClassOffsets)
67 {
69 }
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 /// Copy-assign.
73 
76  if (&rhs != this) {
77  fBranchName = rhs.fBranchName;
78  fLeafName = rhs.fLeafName;
79  if (fTreeReader != rhs.fTreeReader) {
80  if (fTreeReader)
81  fTreeReader->DeregisterValueReader(this);
82  fTreeReader = rhs.fTreeReader;
83  RegisterWithTreeReader();
84  }
85  fDict = rhs.fDict;
86  fProxy = rhs.fProxy;
87  fLeaf = rhs.fLeaf;
88  fSetupStatus = rhs.fSetupStatus;
89  fReadStatus = rhs.fReadStatus;
90  fStaticClassOffsets = rhs.fStaticClassOffsets;
91  }
92  return *this;
93 }
94 
95 ////////////////////////////////////////////////////////////////////////////////
96 /// Unregister from tree reader, cleanup.
97 
99 {
100  if (fTreeReader) fTreeReader->DeregisterValueReader(this);
101 }
102 
103 ////////////////////////////////////////////////////////////////////////////////
104 /// Register with tree reader.
105 
107  if (fTreeReader) {
108  if (!fTreeReader->RegisterValueReader(this)) {
109  fTreeReader = nullptr;
110  }
111  }
112 }
113 
114 ////////////////////////////////////////////////////////////////////////////////
115 /// Try to read the value from the TBranchProxy, returns
116 /// the status of the read.
117 
120  if (!fProxy) return kReadNothingYet;
121  if (fProxy->Read()) {
122  fReadStatus = kReadSuccess;
123  } else {
124  fReadStatus = kReadError;
125  }
126  return fReadStatus;
127 }
128 
129 ////////////////////////////////////////////////////////////////////////////////
130 /// Stringify the template argument.
131 std::string ROOT::Internal::TTreeReaderValueBase::GetElementTypeName(const std::type_info& ti) {
132  int err;
133  char* buf = TClassEdit::DemangleTypeIdName(ti, err);
134  std::string ret = buf;
135  free(buf);
136  return ret;
137 }
138 
139 ////////////////////////////////////////////////////////////////////////////////
140 /// The TTreeReader has switched to a new TTree. Update the leaf.
141 
143  if (fLeafName.Length() == 0)
144  return;
145 
146  TBranch *myBranch = newTree->GetBranch(fBranchName);
147 
148  if (!myBranch) {
149  fReadStatus = kReadError;
150  Error("TTreeReaderValueBase::GetLeaf()", "Unable to get the branch from the tree");
151  return;
152  }
153 
154  fLeaf = myBranch->GetLeaf(fLeafName);
155  if (!fLeaf) {
156  Error("TTreeReaderValueBase::GetLeaf()", "Failed to get the leaf from the branch");
157  }
158 }
159 
160 ////////////////////////////////////////////////////////////////////////////////
161 /// Returns the memory address of the object being read.
162 
164  if (ProxyRead() != kReadSuccess) return 0;
165 
166  if (fLeafName.Length() > 0){
167  if (GetLeaf()){
168  return fLeaf->GetValuePointer();
169  }
170  else {
171  fReadStatus = kReadError;
172  Error("TTreeReaderValueBase::GetAddress()", "Unable to get the leaf");
173  return 0;
174  }
175  }
176  if (!fStaticClassOffsets.empty()){ // Follow all the pointers
177  Byte_t *address = (Byte_t*)fProxy->GetWhere();
178 
179  for (unsigned int i = 0; i < fStaticClassOffsets.size() - 1; ++i){
180  address = *(Byte_t**)(address + fStaticClassOffsets[i]);
181  }
182 
183  return address + fStaticClassOffsets.back();
184  }
185  return fProxy ? (Byte_t*)fProxy->GetWhere() : 0;
186 }
187 
188 ////////////////////////////////////////////////////////////////////////////////
189 /// Create the proxy object for our branch.
190 
192  if (fProxy) {
193  return;
194  }
195 
196  fSetupStatus = kSetupInternalError; // Fallback; set to something concrete below.
197  if (!fTreeReader) {
198  Error("TTreeReaderValueBase::CreateProxy()", "TTreeReader object not set / available for branch %s!",
199  fBranchName.Data());
200  fSetupStatus = kSetupTreeDestructed;
201  return;
202  }
203  if (!fDict) {
204  TBranch* br = fTreeReader->GetTree()->GetBranch(fBranchName);
205  const char* brDataType = "{UNDETERMINED}";
206  if (br) {
207  TDictionary* brDictUnused = 0;
208  brDataType = GetBranchDataType(br, brDictUnused);
209  }
210  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.",
211  GetDerivedTypeName(), fBranchName.Data(), brDataType);
212  fSetupStatus = kSetupMissingDictionary;
213  return;
214  }
215 
216  // Search for the branchname, determine what it contains, and wire the
217  // TBranchProxy representing it to us so we can access its data.
218 
219  TNamedBranchProxy* namedProxy
220  = (TNamedBranchProxy*)fTreeReader->FindObject(fBranchName);
221  if (namedProxy && namedProxy->GetDict() == fDict) {
222  fProxy = namedProxy->GetProxy();
223  fSetupStatus = kSetupMatch;
224  return;
225  }
226 
227  TBranch* branch = fTreeReader->GetTree()->GetBranch(fBranchName);
228  TLeaf *myLeaf = NULL;
229  TDictionary* branchActualType = 0;
230 
231  if (!branch) {
232  if (fBranchName.Contains(".")){
233  TRegexp leafNameExpression ("\\.[a-zA-Z0-9_]+$");
234  TString leafName (fBranchName(leafNameExpression));
235  TString branchName = fBranchName(0, fBranchName.Length() - leafName.Length());
236  branch = fTreeReader->GetTree()->GetBranch(branchName);
237  if (!branch){
238  std::vector<TString> nameStack;
239  nameStack.push_back(TString()); //Trust me
240  nameStack.push_back(leafName.Strip(TString::kBoth, '.'));
241  leafName = branchName(leafNameExpression);
242  branchName = branchName(0, branchName.Length() - leafName.Length());
243 
244  branch = fTreeReader->GetTree()->GetBranch(branchName);
245  if (!branch) branch = fTreeReader->GetTree()->GetBranch(branchName + ".");
246  if (leafName.Length()) nameStack.push_back(leafName.Strip(TString::kBoth, '.'));
247 
248  while (!branch && branchName.Contains(".")){
249  leafName = branchName(leafNameExpression);
250  branchName = branchName(0, fBranchName.Length() - leafName.Length());
251  branch = fTreeReader->GetTree()->GetBranch(branchName);
252  if (!branch) branch = fTreeReader->GetTree()->GetBranch(branchName + ".");
253  nameStack.push_back(leafName.Strip(TString::kBoth, '.'));
254  }
255 
256  if (branch && branch->IsA() == TBranchElement::Class()){
257  TBranchElement *myBranchElement = (TBranchElement*)branch;
258 
259  TString traversingBranch = nameStack.back();
260  nameStack.pop_back();
261 
262  bool found = true;
263 
264  TDataType *finalDataType = 0;
265 
266  std::vector<Long64_t> offsets;
267  Long64_t offset = 0;
268  TClass *elementClass = 0;
269 
270  TObjArray *myObjArray = myBranchElement->GetInfo()->GetElements();
271  TVirtualStreamerInfo *myInfo = myBranchElement->GetInfo();
272 
273  while (nameStack.size() && found){
274  found = false;
275 
276  for (int i = 0; i < myObjArray->GetEntries(); ++i){
277 
278  TStreamerElement *tempStreamerElement = (TStreamerElement*)myObjArray->At(i);
279 
280  if (!strcmp(tempStreamerElement->GetName(), traversingBranch.Data())){
281  offset += myInfo->GetElementOffset(i);
282 
283  traversingBranch = nameStack.back();
284  nameStack.pop_back();
285 
286  elementClass = tempStreamerElement->GetClass();
287  if (elementClass) {
288  myInfo = elementClass->GetStreamerInfo(0);
289  myObjArray = myInfo->GetElements();
290  // FIXME: this is odd, why is 'i' not also reset????
291  }
292  else {
293  finalDataType = TDataType::GetDataType((EDataType)tempStreamerElement->GetType());
294  if (!finalDataType) {
295  TDictionary* seType = TDictionary::GetDictionary(tempStreamerElement->GetTypeName());
296  if (seType && seType->IsA() == TDataType::Class()) {
297  finalDataType = TDataType::GetDataType((EDataType)((TDataType*)seType)->GetType());
298  }
299  }
300  }
301 
302  if (tempStreamerElement->IsaPointer()){
303  offsets.push_back(offset);
304  offset = 0;
305  }
306 
307  found = true;
308  break;
309  }
310  }
311  }
312 
313  offsets.push_back(offset);
314 
315  if (found){
316  fStaticClassOffsets = offsets;
317 
318  if (fDict != finalDataType && fDict != elementClass){
319  Error("TTreeReaderValueBase::CreateProxy", "Wrong data type %s", finalDataType ? finalDataType->GetName() : elementClass ? elementClass->GetName() : "UNKNOWN");
320  fSetupStatus = kSetupMismatch;
321  fProxy = 0;
322  return;
323  }
324  }
325  }
326 
327 
328  if (!fStaticClassOffsets.size()) {
329  Error("TTreeReaderValueBase::CreateProxy()", "The tree does not have a branch called %s. You could check with TTree::Print() for available branches.", fBranchName.Data());
330  fSetupStatus = kSetupMissingBranch;
331  fProxy = 0;
332  return;
333  }
334  }
335  else {
336  myLeaf = branch->GetLeaf(TString(leafName(1, leafName.Length())));
337  if (!myLeaf){
338  Error("TTreeReaderValueBase::CreateProxy()",
339  "The tree does not have a branch, nor a sub-branch called %s. You could check with TTree::Print() for available branches.", fBranchName.Data());
340  fSetupStatus = kSetupMissingBranch;
341  fProxy = 0;
342  return;
343  }
344  else {
345  TDictionary *tempDict = TDictionary::GetDictionary(myLeaf->GetTypeName());
346  if (tempDict && tempDict->IsA() == TDataType::Class() && TDictionary::GetDictionary(((TDataType*)tempDict)->GetTypeName()) == fDict){
347  //fLeafOffset = myLeaf->GetOffset() / 4;
348  branchActualType = fDict;
349  fLeaf = myLeaf;
350  fBranchName = branchName;
351  fLeafName = leafName(1, leafName.Length());
352  fSetupStatus = kSetupMatchLeaf;
353  }
354  else {
355  Error("TTreeReaderValueBase::CreateProxy()",
356  "Leaf of type %s cannot be read by TTreeReaderValue<%s>.", myLeaf->GetTypeName(), fDict->GetName());
357  fSetupStatus = kSetupMismatch;
358  }
359  }
360  }
361  }
362  else {
363  Error("TTreeReaderValueBase::CreateProxy()", "The tree does not have a branch called %s. You could check with TTree::Print() for available branches.", fBranchName.Data());
364  fProxy = 0;
365  return;
366  }
367  }
368 
369  if (!myLeaf && !fStaticClassOffsets.size()) {
370  const char* branchActualTypeName = GetBranchDataType(branch, branchActualType);
371 
372  if (!branchActualType) {
373  Error("TTreeReaderValueBase::CreateProxy()", "The branch %s contains data of type %s, which does not have a dictionary.",
374  fBranchName.Data(), branchActualTypeName ? branchActualTypeName : "{UNDETERMINED TYPE}");
375  fProxy = 0;
376  return;
377  }
378 
379  if (fDict != branchActualType) {
380  TDataType *dictdt = dynamic_cast<TDataType*>(fDict);
381  TDataType *actualdt = dynamic_cast<TDataType*>(branchActualType);
382  if (dictdt && actualdt && dictdt->GetType()>0
383  && dictdt->GetType() == actualdt->GetType()) {
384  // Same numerical type but different TDataType, likely Long64_t
385  } else {
386  Error("TTreeReaderValueBase::CreateProxy()",
387  "The branch %s contains data of type %s. It cannot be accessed by a TTreeReaderValue<%s>",
388  fBranchName.Data(), branchActualType->GetName(),
389  fDict->GetName());
390  return;
391  }
392  }
393  }
394 
395 
396  // Update named proxy's dictionary
397  if (namedProxy && !namedProxy->GetDict()) {
398  namedProxy->SetDict(fDict);
399  fProxy = namedProxy->GetProxy();
400  if (fProxy)
401  fSetupStatus = kSetupMatch;
402  return;
403  }
404 
405  // Search for the branchname, determine what it contains, and wire the
406  // TBranchProxy representing it to us so we can access its data.
407  // A proxy for branch must not have been created before (i.e. check
408  // fProxies before calling this function!)
409 
410  TString membername;
411 
412  bool isTopLevel = branch->GetMother() == branch;
413  if (!isTopLevel) {
414  membername = strrchr(branch->GetName(), '.');
415  if (membername.IsNull()) {
416  membername = branch->GetName();
417  }
418  }
419  namedProxy = new TNamedBranchProxy(fTreeReader->fDirector, branch, membername);
420  fTreeReader->GetProxies()->Add(namedProxy);
421  fProxy = namedProxy->GetProxy();
422  if (fProxy) {
423  fSetupStatus = kSetupMatch;
424  } else {
425  fSetupStatus = kSetupMismatch;
426  }
427 }
428 
429 ////////////////////////////////////////////////////////////////////////////////
430 /// Retrieve the type of data stored by branch; put its dictionary into
431 /// dict, return its type name. If no dictionary is available, at least
432 /// its type name should be returned.
433 
435  TDictionary* &dict) const
436 {
437  dict = 0;
438  if (branch->IsA() == TBranchElement::Class()) {
439  TBranchElement* brElement = (TBranchElement*)branch;
440  if (brElement->GetType() == TBranchElement::kSTLNode ||
441  brElement->GetType() == TBranchElement::kLeafNode ||
442  brElement->GetType() == TBranchElement::kObjectNode) {
443 
444  TStreamerInfo *streamerInfo = brElement->GetInfo();
445  Int_t id = brElement->GetID();
446 
447  if (id >= 0){
448  TStreamerElement *element = (TStreamerElement*)streamerInfo->GetElements()->At(id);
449  if (element->IsA() == TStreamerSTL::Class()){
450  TStreamerSTL *myStl = (TStreamerSTL*)element;
451  dict = myStl->GetClass();
452  return 0;
453  }
454  }
455 
456  if (brElement->GetType() == 3 || brElement->GetType() == 4) {
457  dict = brElement->GetCurrentClass();
458  return brElement->GetTypeName();
459  }
460 
461  if (brElement->GetTypeName()) dict = TDictionary::GetDictionary(brElement->GetTypeName());
462  if (dict && dict->IsA() == TDataType::Class()) {
463  // Resolve the typedef.
464  dict = TDictionary::GetDictionary(((TDataType*)dict)->GetTypeName());
465  if (dict->IsA() != TDataType::Class()) {
466  // Might be a class.
467  if (dict != fDict) {
468  dict = TClass::GetClass(brElement->GetTypeName());
469  }
470  if (dict != fDict) {
471  dict = brElement->GetCurrentClass();
472  }
473  }
474  }
475  else if (!dict) {
476  dict = brElement->GetCurrentClass();
477  }
478 
479  return brElement->GetTypeName();
480  } else if (brElement->GetType() == TBranchElement::kClonesNode) {
481  dict = TClonesArray::Class();
482  return "TClonesArray";
483  } else if (brElement->GetType() == 31
484  || brElement->GetType() == 41) {
485  // it's a member, extract from GetClass()'s streamer info
486  Error("TTreeReaderValueBase::GetBranchDataType()", "Must use TTreeReaderArray to access a member of an object that is stored in a collection.");
487  }
488  else {
489  Error("TTreeReaderValueBase::GetBranchDataType()", "Unknown type and class combination: %i, %s", brElement->GetType(), brElement->GetClassName());
490  }
491  return 0;
492  } else if (branch->IsA() == TBranch::Class()
493  || branch->IsA() == TBranchObject::Class()
494  || branch->IsA() == TBranchSTL::Class()) {
495  if (branch->GetTree()->IsA() == TNtuple::Class()){
497  return dict->GetName();
498  }
499  const char* dataTypeName = branch->GetClassName();
500  if ((!dataTypeName || !dataTypeName[0])
501  && branch->IsA() == TBranch::Class()) {
502  TLeaf *myLeaf = branch->GetLeaf(branch->GetName());
503  if (myLeaf){
504  TDictionary *myDataType = TDictionary::GetDictionary(myLeaf->GetTypeName());
505  if (myDataType && myDataType->IsA() == TDataType::Class()){
506  dict = TDataType::GetDataType((EDataType)((TDataType*)myDataType)->GetType());
507  return myLeaf->GetTypeName();
508  }
509  }
510 
511 
512  // leaflist. Can't represent.
513  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());
514  TIter iLeaves(branch->GetListOfLeaves());
515  TLeaf* leaf = 0;
516  while ((leaf = (TLeaf*) iLeaves())) {
517  Error("TTreeReaderValueBase::GetBranchDataType()", " %s.%s", branch->GetName(), leaf->GetName());
518  }
519  return 0;
520  }
521  if (dataTypeName) dict = TDictionary::GetDictionary(dataTypeName);
522  return dataTypeName;
523  } else if (branch->IsA() == TBranchClones::Class()) {
524  dict = TClonesArray::Class();
525  return "TClonesArray";
526  } else if (branch->IsA() == TBranchRef::Class()) {
527  // Can't represent.
528  Error("TTreeReaderValueBase::GetBranchDataType()", "The branch %s is a TBranchRef and cannot be represented as a C++ type.", branch->GetName());
529  return 0;
530  } else {
531  Error("TTreeReaderValueBase::GetBranchDataType()", "The branch %s is of type %s - something that is not handled yet.", branch->GetName(), branch->IsA()->GetName());
532  return 0;
533  }
534 
535  return 0;
536 }
537 
Describe Streamer information for one class version.
Definition: TStreamerInfo.h:47
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:37
An array of TObjects.
Definition: TObjArray.h:39
static TDataType * GetDataType(EDataType type)
Given a EDataType type, get the TDataType* that represents it.
Definition: TDataType.cxx:440
long long Long64_t
Definition: RtypesCore.h:69
Int_t GetID() const
virtual TLeaf * GetLeaf(const char *name) const
Return pointer to the 1st Leaf named name in thisBranch.
Definition: TBranch.cxx:1478
const char * GetTypeName() const
TTreeReader is a simple, robust and fast interface to read values from a TTree, TChain or TNtuple...
Definition: TTreeReader.h:48
Int_t GetType() const
Definition: TDataType.h:70
Ssiz_t Length() const
Definition: TString.h:390
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...
virtual ~TTreeReaderValueBase()
Unregister from tree reader, cleanup.
Regular expression class.
Definition: TRegexp.h:35
static TDictionary * GetDictionary(const char *name)
Definition: TDictionary.cxx:84
Basic string class.
Definition: TString.h:137
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
const char * Class
Definition: TXMLSetup.cxx:64
const Detail::TBranchProxy * GetProxy() const
const char * Data() const
Definition: TString.h:349
unsigned char Byte_t
Definition: RtypesCore.h:60
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
virtual Bool_t IsaPointer() 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:4868
void SetDict(TDictionary *dict)
void RegisterWithTreeReader()
Register with tree reader.
virtual const char * GetTypeName() const
Definition: TLeaf.h:81
TObjArray * GetElements() const
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:4346
Basic data type descriptor (datatype information is obtained from CINT).
Definition: TDataType.h:46
This class defines an abstract interface that must be implemented by all classes that contain diction...
Definition: TDictionary.h:162
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Definition: TBranch.cxx:1551
virtual void CreateProxy()
Create the proxy object for our branch.
TClass * GetCurrentClass()
Return a pointer to the current type of the data member corresponding to branch element.
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
void * GetAddress()
Returns the memory address of the object being read.
TSubString Strip(EStripType s=kTrailing, char c= ' ') const
Return a substring of self stripped at beginning and/or end.
Definition: TString.cxx:1070
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
Bool_t IsNull() const
Definition: TString.h:387
TTree * GetTree() const
Definition: TBranch.h:184
A Branch for the case of an object.
virtual const char * GetTypeName() const
Return type name of element in the branch.
static std::string GetElementTypeName(const std::type_info &ti)
Stringify the template argument.
#define ClassImp(name)
Definition: Rtypes.h:279
virtual TObjArray * GetElements() const =0
#define free
Definition: civetweb.c:821
EDataType
Definition: TDataType.h:30
TObjArray * GetListOfLeaves()
Definition: TBranch.h:179
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:494
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
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:2872
TClass * GetClass() const
Int_t GetType() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:567
#define NULL
Definition: Rtypes.h:82
TTreeReaderValueBase(TTreeReader *reader=0, const char *branchname=0, TDictionary *dict=0)
Construct a tree value reader and register it with the reader object.
void NotifyNewTree(TTree *newTree)
The TTreeReader has switched to a new TTree. Update the leaf.
Int_t GetType() const
A TTree object has a header with a name and a title.
Definition: TTree.h:98
TObject * At(Int_t idx) const
Definition: TObjArray.h:167
A TTree is a list of TBranches.
Definition: TBranch.h:58
Abstract Interface class describing Streamer information for one class.
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
Definition: TBranch.cxx:1182
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
Definition: TObject.cxx:380
TDictionary * GetDict() const
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.