Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TFormLeafInfo.h
Go to the documentation of this file.
1// @(#)root/treeplayer:$Id$
2// Author: Philippe Canal 01/06/2004
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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#ifndef ROOT_TFormLeafInfo
13#define ROOT_TFormLeafInfo
14
15#include "TObject.h"
16
17#include "TLeafElement.h"
18
19#include "TArrayI.h"
20#include "TDataType.h"
21#include "TStreamerInfo.h"
22#include "TStreamerElement.h"
23
24
25// declare the extra versions of GetValue() plus templated implementation
26#define DECLARE_GETVAL(VIRTUAL, OVERRIDE) \
27 VIRTUAL Double_t GetValue(TLeaf *leaf, Int_t instance = 0) OVERRIDE \
28 { return GetValueImpl<Double_t>(leaf, instance); } \
29 VIRTUAL Long64_t GetValueLong64(TLeaf *leaf, Int_t instance = 0) OVERRIDE \
30 { return GetValueImpl<Long64_t>(leaf, instance); } \
31 VIRTUAL LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t instance = 0) OVERRIDE \
32 { return GetValueImpl<LongDouble_t>(leaf, instance); } \
33 template<typename T> T GetValueImpl(TLeaf *leaf, Int_t instance = 0) // no semicolon
34
35
36// declare the extra versions of ReadValue() plus templated implementation
37#define DECLARE_READVAL(VIRTUAL, OVERRIDE) \
38 VIRTUAL Double_t ReadValue(char *where, Int_t instance = 0) OVERRIDE \
39 { return ReadValueImpl<Double_t>(where, instance); } \
40 VIRTUAL Long64_t ReadValueLong64(char *where, Int_t instance = 0) OVERRIDE \
41 { return ReadValueImpl<Long64_t>(where, instance); } \
42 VIRTUAL LongDouble_t ReadValueLongDouble(char *where, Int_t instance = 0) OVERRIDE \
43 { return ReadValueImpl<LongDouble_t>(where, instance); } \
44 template<typename T> T ReadValueImpl(char *where, Int_t instance = 0) // no semicolon
45
46
47class TFormLeafInfo : public TObject {
48public:
49 // Constructors
50 TFormLeafInfo(TClass* classptr = nullptr, Longptr_t offset = 0,
51 TStreamerElement* element = nullptr);
52 TFormLeafInfo(const TFormLeafInfo& orig);
53 virtual TFormLeafInfo* DeepCopy() const;
54 ~TFormLeafInfo() override;
55
56 void Swap(TFormLeafInfo &other);
58
59 // Data Members
60 TClass *fClass; ///<! This is the class of the data pointed to
61 //TStreamerInfo *fInfo; ///<! == fClass->GetStreamerInfo()
62 Longptr_t fOffset; ///<! Offset of the data pointed inside the class fClass
63 TStreamerElement *fElement; ///<! Descriptor of the data pointed to.
64 //Warning, the offset in fElement is NOT correct because it does not take into
65 //account base classes and nested objects (which fOffset does).
67 TFormLeafInfo *fNext; ///< follow this to grab the inside information
70
71protected:
73public:
74
75 virtual void AddOffset(Int_t offset, TStreamerElement* element);
76
77 virtual Int_t GetArrayLength();
78 virtual TClass* GetClass() const;
79 virtual Int_t GetCounterValue(TLeaf* leaf);
80 virtual Int_t ReadCounterValue(char *where);
81
83
85
86 // Currently only implemented in TFormLeafInfoCast
87 Int_t GetNdata(TLeaf* leaf);
88 virtual Int_t GetNdata();
89
90 virtual void *GetValuePointer(TLeaf *leaf, Int_t instance = 0);
91 virtual void *GetValuePointer(char *from, Int_t instance = 0);
92 virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
93 virtual void *GetLocalValuePointer( char *from, Int_t instance = 0);
94
95 virtual bool HasCounter() const;
96 virtual bool IsString() const;
97
98 virtual bool IsInteger() const;
99 virtual bool IsReference() const { return false; }
100
101 // Method for multiple variable dimensions.
102 virtual Int_t GetPrimaryIndex();
103 virtual Int_t GetVarDim();
104 virtual Int_t GetVirtVarDim();
105 virtual Int_t GetSize(Int_t index);
106 virtual Int_t GetSumOfSizes();
107 virtual void LoadSizes(TBranch* branch);
108 virtual void SetPrimaryIndex(Int_t index);
109 virtual void SetSecondaryIndex(Int_t index);
110 virtual void SetSize(Int_t index, Int_t val);
111 virtual void SetBranch(TBranch* br) { if ( fNext ) fNext->SetBranch(br); }
112 virtual void UpdateSizes(TArrayI *garr);
113
114 virtual bool Update();
115
116 DECLARE_GETVAL(virtual,);
118
119 template <typename T> struct ReadValueHelper {
120 static T Exec(TFormLeafInfo *leaf, char *where, Int_t instance) {
121 return leaf->ReadValue(where, instance);
122 }
123 };
124 template <typename T > T ReadTypedValue(char *where, Int_t instance = 0) {
125 return ReadValueHelper<T>::Exec(this, where, instance);
126 }
127
128 template <typename T> struct GetValueHelper {
129 static T Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance) {
130 return linfo->GetValue(leaf, instance);
131 }
132 };
133 template <typename T > T GetTypedValue(TLeaf *leaf, Int_t instance = 0) {
134 return GetValueHelper<T>::Exec(this, leaf, instance);
135 }
136};
137
138
140 static Long64_t Exec(TFormLeafInfo *leaf, char *where, Int_t instance) { return leaf->ReadValueLong64(where, instance); }
141};
143 static ULong64_t Exec(TFormLeafInfo *leaf, char *where, Int_t instance) { return (ULong64_t)leaf->ReadValueLong64(where, instance); }
144};
146 static LongDouble_t Exec(TFormLeafInfo *leaf, char *where, Int_t instance) { return leaf->ReadValueLongDouble(where, instance); }
147};
148
150 static Long64_t Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance) { return linfo->GetValueLong64(leaf, instance); }
151};
153 static ULong64_t Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance) { return (ULong64_t)linfo->GetValueLong64(leaf, instance); }
154};
156 static LongDouble_t Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance) { return linfo->GetValueLongDouble(leaf, instance); }
157};
158
159// TFormLeafInfoDirect is a small helper class to implement reading a data
160// member on an object stored in a TTree.
161
163public:
165 // The implicit default constructor's implementation is correct.
166
167 TFormLeafInfo* DeepCopy() const override;
168
169 DECLARE_GETVAL( , override);
170 void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0) override;
171 void *GetLocalValuePointer(char *thisobj, Int_t instance = 0) override;
172
173 Double_t ReadValue(char * /*where*/, Int_t /*instance*/= 0) override;
174 Long64_t ReadValueLong64(char *where, Int_t i= 0) override { return ReadValue(where, i); }
175 LongDouble_t ReadValueLongDouble(char *where, Int_t i= 0) override { return ReadValue(where, i); }
176
177};
178
179// TFormLeafInfoNumerical is a small helper class to implement reading a
180// numerical value inside a collection
181
185public:
189
190 TFormLeafInfo* DeepCopy() const override;
191 void Swap(TFormLeafInfoNumerical &other);
193
194 ~TFormLeafInfoNumerical() override;
195
196 bool IsString() const override;
197 bool Update() override;
198};
199
200// TFormLeafInfoCollectionObject
201// This class is used when we are interested by the collection it self and
202// it is split.
203
205 bool fTop; //If true, it indicates that the branch itself contains
206public:
207 TFormLeafInfoCollectionObject(TClass* classptr = nullptr, bool fTop = true);
209
212
213 TFormLeafInfo* DeepCopy() const override {
214 return new TFormLeafInfoCollectionObject(*this);
215 }
216
217 DECLARE_GETVAL( , override);
218 Int_t GetCounterValue(TLeaf* leaf) override;
219 Double_t ReadValue(char *where, Int_t instance = 0) override;
220 Long64_t ReadValueLong64(char *where, Int_t i= 0) override { return ReadValue(where, i); }
221 LongDouble_t ReadValueLongDouble(char *where, Int_t i= 0) override { return ReadValue(where, i); }
222 void *GetValuePointer(TLeaf *leaf, Int_t instance = 0) override;
223 void *GetValuePointer(char *thisobj, Int_t instance = 0) override;
224 void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0) override;
225 void *GetLocalValuePointer(char *thisobj, Int_t instance = 0) override;
226};
227
228// TFormLeafInfoClones is a small helper class to implement reading a data
229// member on a TClonesArray object stored in a TTree.
230
232 bool fTop; //If true, it indicates that the branch itself contains
233public:
234 //either the clonesArrays or something inside the clonesArray
235 TFormLeafInfoClones(TClass* classptr = nullptr, Longptr_t offset = 0);
236 TFormLeafInfoClones(TClass* classptr, Longptr_t offset, bool top);
238 bool top = false);
240
241 void Swap(TFormLeafInfoClones &other);
243
244 TFormLeafInfo* DeepCopy() const override {
245 return new TFormLeafInfoClones(*this);
246 }
247
248 DECLARE_GETVAL( , override);
249 DECLARE_READVAL( , override);
250 Int_t GetCounterValue(TLeaf* leaf) override;
251 Int_t ReadCounterValue(char *where) override;
252 void *GetValuePointer(TLeaf *leaf, Int_t instance = 0) override;
253 void *GetValuePointer(char *thisobj, Int_t instance = 0) override;
254 void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0) override;
255 void *GetLocalValuePointer(char *thisobj, Int_t instance = 0) override;
256};
257
258// TFormLeafInfoCollection is a small helper class to implement reading a data member
259// on a generic collection object stored in a TTree.
260
262 bool fTop; //If true, it indicates that the branch itself contains
263 //either the clonesArrays or something inside the clonesArray
268public:
269
272 TStreamerElement* element,
273 bool top = false);
274
275 TFormLeafInfoCollection(TClass* motherclassptr,
276 Longptr_t offset = 0,
277 TClass* elementclassptr = nullptr,
278 bool top = false);
279
282
283 ~TFormLeafInfoCollection() override;
284
285 void Swap(TFormLeafInfoCollection &other);
287
288 TFormLeafInfo* DeepCopy() const override;
289
290 bool Update() override;
291
292 DECLARE_GETVAL( , override);
293 DECLARE_READVAL( , override);
294 Int_t GetCounterValue(TLeaf* leaf) override;
295 Int_t ReadCounterValue(char* where) override;
296 virtual Int_t GetCounterValue(TLeaf* leaf, Int_t instance);
297 bool HasCounter() const override;
298 void *GetValuePointer(TLeaf *leaf, Int_t instance = 0) override;
299 void *GetValuePointer(char *thisobj, Int_t instance = 0) override;
300 void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0) override;
301 void *GetLocalValuePointer(char *thisobj, Int_t instance = 0) override;
302};
303
304// TFormLeafInfoCollectionSize is used to return the size of a collection
305
310public:
315
317
320
321 TFormLeafInfo* DeepCopy() const override;
322
323 bool Update() override;
324
325 void *GetValuePointer(TLeaf *leaf, Int_t instance = 0) override;
326 void *GetValuePointer(char *from, Int_t instance = 0) override;
327 void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0) override;
328 void *GetLocalValuePointer( char *from, Int_t instance = 0) override;
329 Double_t ReadValue(char *where, Int_t instance = 0) override;
330 Long64_t ReadValueLong64(char *where, Int_t i= 0) override { return ReadValue(where, i); }
331 LongDouble_t ReadValueLongDouble(char *where, Int_t i= 0) override { return ReadValue(where, i); }
332};
333
334// TFormLeafInfoPointer is a small helper class to implement reading a data
335// member by following a pointer inside a branch of TTree.
336
338public:
339 TFormLeafInfoPointer(TClass* classptr = nullptr, Longptr_t offset = 0,
340 TStreamerElement* element = nullptr);
341 // The default copy constructor is the right implementation.
342
343 TFormLeafInfo* DeepCopy() const override;
344
345 DECLARE_GETVAL( , override);
346 DECLARE_READVAL( , override);
347};
348
349// TFormLeafInfoMethod is a small helper class to implement executing a method
350// of an object stored in a TTree
351
353
362
363public:
364 static TClass *ReturnTClass(TMethodCall *mc);
365
366 TFormLeafInfoMethod(TClass* classptr = nullptr, TMethodCall *method = nullptr);
368 ~TFormLeafInfoMethod() override;
369
370 void Swap(TFormLeafInfoMethod &other);
372
373 TFormLeafInfo* DeepCopy() const override;
374
375 DECLARE_READVAL( , override);
376 TClass* GetClass() const override;
377 void *GetLocalValuePointer( TLeaf *from, Int_t instance = 0) override;
378 void *GetLocalValuePointer(char *from, Int_t instance = 0) override;
379 bool IsInteger() const override;
380 bool IsString() const override;
381 bool Update() override;
382};
383
384// TFormLeafInfoMultiVarDim is a small helper class to implement reading a
385// data member on a variable size array inside a TClonesArray object stored in
386// a TTree. This is the version used when the data member is inside a
387// non-split object.
388
390public:
392 TArrayI fSizes; // Array of sizes of the variable dimension
393 TFormLeafInfo *fCounter2; // Information on how to read the secondary dimensions
394 Int_t fSumOfSizes; // Sum of the content of fSizes
395 Int_t fDim; // physical number of the dimension that is variable
396 Int_t fVirtDim; // number of the virtual dimension to which this object correspond.
397 Int_t fPrimaryIndex; // Index of the dimensions that is indexing the second dimension's size
398 Int_t fSecondaryIndex; // Index of the second dimension
399
400protected:
402 TStreamerElement* element) : TFormLeafInfo(classptr,offset,element),fNsize(0),fSizes(),fCounter2(nullptr),fSumOfSizes(0),fDim(0),fVirtDim(0),fPrimaryIndex(-1),fSecondaryIndex(-1) {}
403
404public:
406 TStreamerElement* element, TFormLeafInfo* parent);
409 ~TFormLeafInfoMultiVarDim() override;
410
411 void Swap(TFormLeafInfoMultiVarDim &other);
413
414 TFormLeafInfo* DeepCopy() const override;
415
416 /* The proper indexing and unwinding of index is done by prior leafinfo in the chain. */
417 //virtual Double_t ReadValue(char *where, Int_t instance = 0) {
418 // return TFormLeafInfo::ReadValue(where,instance);
419 //}
420
421 void LoadSizes(TBranch* branch) override;
422 Int_t GetPrimaryIndex() override;
423 void SetPrimaryIndex(Int_t index) override;
424 void SetSecondaryIndex(Int_t index) override;
425 void SetSize(Int_t index, Int_t val) override;
426 Int_t GetSize(Int_t index) override;
427 Int_t GetSumOfSizes() override;
428 Double_t GetValue(TLeaf * /*leaf*/, Int_t /*instance*/ = 0) override;
429 Long64_t GetValueLong64(TLeaf *leaf, Int_t i= 0) override { return GetValue(leaf, i); }
430 LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t i= 0) override { return GetValue(leaf, i); }
431 Int_t GetVarDim() override;
432 Int_t GetVirtVarDim() override;
433 bool Update() override;
434 void UpdateSizes(TArrayI *garr) override;
435};
436
437// TFormLeafInfoMultiVarDimDirect is a small helper class to implement reading
438// a data member on a variable size array inside a TClonesArray object stored
439// in a TTree. This is the version used for split access
440
442public:
443 // The default constructor are the correct implementation.
444
445 TFormLeafInfo* DeepCopy() const override;
446
447 DECLARE_GETVAL( , override);
448 Double_t ReadValue(char * /*where*/, Int_t /*instance*/ = 0) override;
449 Long64_t ReadValueLong64(char *where, Int_t i= 0) override { return ReadValue(where, i); }
450 LongDouble_t ReadValueLongDouble(char *where, Int_t i= 0) override { return ReadValue(where, i); }
451};
452
453// TFormLeafInfoMultiVarDimCollection is a small helper class to implement reading
454// a data member which is a collection inside a TClonesArray or collection object
455// stored in a TTree. This is the version used for split access
456//
458public:
460 TClass* elementclassptr, TFormLeafInfo *parent);
462 TStreamerElement* element, TFormLeafInfo* parent);
463 // The default copy constructor is the right implementation.
464
465 TFormLeafInfo* DeepCopy() const override;
466
467 Int_t GetArrayLength() override { return 0; }
468 void LoadSizes(TBranch* branch) override;
469 Double_t GetValue(TLeaf *leaf, Int_t instance = 0) override;
470 Long64_t GetValueLong64(TLeaf *leaf, Int_t i= 0) override { return GetValue(leaf, i); }
471 LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t i= 0) override { return GetValue(leaf, i); }
472 DECLARE_READVAL( , override);
473};
474
475// TFormLeafInfoMultiVarDimClones is a small helper class to implement reading
476// a data member which is a TClonesArray inside a TClonesArray or collection object
477// stored in a TTree. This is the version used for split access
478//
480public:
482 TClass* elementclassptr, TFormLeafInfo *parent);
484 TStreamerElement* element, TFormLeafInfo* parent);
485 // The default copy constructor is the right implementation.
486
487 TFormLeafInfo* DeepCopy() const override;
488
489 Int_t GetArrayLength() override { return 0; }
490 void LoadSizes(TBranch* branch) override;
491 Double_t GetValue(TLeaf *leaf, Int_t instance = 0) override;
492 Long64_t GetValueLong64(TLeaf *leaf, Int_t i= 0) override { return GetValue(leaf, i); }
493 LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t i= 0) override { return GetValue(leaf, i); }
494 DECLARE_READVAL( , override);
495};
496
497// TFormLeafInfoCast is a small helper class to implement casting an object to
498// a different type (equivalent to dynamic_cast)
499
501public:
502 TClass *fCasted; //! Pointer to the class we are trying to case to
503 TString fCastedName; //! Name of the class we are casting to.
504 bool fGoodCast; //! Marked by ReadValue.
505 bool fIsTObject; //! Indicated whether the fClass inherits from TObject.
506
507 TFormLeafInfoCast(TClass* classptr = nullptr, TClass* casted = nullptr);
509 ~TFormLeafInfoCast() override;
510
511 void Swap(TFormLeafInfoCast &other);
513
514 TFormLeafInfo* DeepCopy() const override;
515
516 DECLARE_READVAL( , override);
517 // Currently only implemented in TFormLeafInfoCast
518 Int_t GetNdata() override;
519 bool Update() override;
520};
521
522// TFormLeafInfoTTree is a small helper class to implement reading
523// from the containing TTree object itself.
524
529
530public:
531 TFormLeafInfoTTree(TTree *tree = nullptr, const char *alias = nullptr, TTree *current = nullptr);
533
536
537 TFormLeafInfo* DeepCopy() const override;
538
541
542 DECLARE_GETVAL( , override);
543 DECLARE_READVAL( , override);
544 void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0) override;
545 bool Update() override;
546};
547
548
549#endif /* ROOT_TFormLeafInfo */
550
static Roo_reg_AGKInteg1D instance
int Int_t
Definition RtypesCore.h:45
long Longptr_t
Definition RtypesCore.h:75
double Double_t
Definition RtypesCore.h:59
long double LongDouble_t
Definition RtypesCore.h:61
long long Long64_t
Definition RtypesCore.h:69
unsigned long long ULong64_t
Definition RtypesCore.h:70
EDataType
Definition TDataType.h:28
#define DECLARE_READVAL(VIRTUAL, OVERRIDE)
#define DECLARE_GETVAL(VIRTUAL, OVERRIDE)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Array of integers (32 bits per element).
Definition TArrayI.h:27
A Branch for the case of an object.
A TTree is a list of TBranches.
Definition TBranch.h:93
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
A small helper class to implement casting an object to a different type (equivalent to dynamic_cast)
bool fIsTObject
Marked by ReadValue.
TString fCastedName
Pointer to the class we are trying to case to.
~TFormLeafInfoCast() override
Destructor.
bool Update() override
We reloading all cached information in case the underlying class information has changed (for example...
Int_t GetNdata() override
Get the number of element in the entry.
bool fGoodCast
Name of the class we are casting to.
TFormLeafInfo * DeepCopy() const override
Copy the object and all its content.
TFormLeafInfoCast & operator=(const TFormLeafInfoCast &orig)
Exception safe assignment operator.
A small helper class to implement reading a data member on a TClonesArray object stored in a TTree.
TFormLeafInfo * DeepCopy() const override
Make a complete copy of this FormLeafInfo and all its content.
Int_t ReadCounterValue(char *where) override
Return the current size of the TClonesArray.
Int_t GetCounterValue(TLeaf *leaf) override
Return the current size of the TClonesArray.
void * GetLocalValuePointer(TLeaf *leaf, Int_t instance=0) override
Return the pointer to the clonesArray.
TFormLeafInfoClones & operator=(const TFormLeafInfoClones &orig)
Exception safe assignment operator.
void * GetValuePointer(TLeaf *leaf, Int_t instance=0) override
Return the pointer to the clonesArray.
A small helper class to implement reading a data member on a TClonesArray object stored in a TTree.
TFormLeafInfo * DeepCopy() const override
Make a complete copy of this FormLeafInfo and all its content.
Long64_t ReadValueLong64(char *where, Int_t i=0) override
void * GetLocalValuePointer(TLeaf *leaf, Int_t instance=0) override
Return the pointer to the clonesArray.
Int_t GetCounterValue(TLeaf *leaf) override
Return the current size of the TClonesArray.
void * GetValuePointer(TLeaf *leaf, Int_t instance=0) override
Return the pointer to the clonesArray.
LongDouble_t ReadValueLongDouble(char *where, Int_t i=0) override
TFormLeafInfoCollectionObject & operator=(const TFormLeafInfoCollectionObject &orig)
Exception safe assignment operator.
Double_t ReadValue(char *where, Int_t instance=0) override
Return the value of the underlying data member inside the clones array.
Used to return the size of a collection.
LongDouble_t ReadValueLongDouble(char *where, Int_t i=0) override
TVirtualCollectionProxy * fCollProxy
Double_t ReadValue(char *where, Int_t instance=0) override
Return the value of the underlying pointer data member.
void * GetLocalValuePointer(TLeaf *leaf, Int_t instance=0) override
Not implemented.
TFormLeafInfoCollectionSize()
Constructor.
Long64_t ReadValueLong64(char *where, Int_t i=0) override
void * GetValuePointer(TLeaf *leaf, Int_t instance=0) override
Not implemented.
~TFormLeafInfoCollectionSize() override
Destructor.
TFormLeafInfo * DeepCopy() const override
Copy the object and all of its content.
TFormLeafInfoCollectionSize & operator=(const TFormLeafInfoCollectionSize &orig)
Exception safe assignment operator.
bool Update() override
We reloading all cached information in case the underlying class information has changed (for example...
A small helper class to implement reading a data member on a generic collection object stored in a TT...
TVirtualCollectionProxy * fCollProxy
Int_t GetCounterValue(TLeaf *leaf) override
Return the current size of the TClonesArray.
TFormLeafInfoCollection()
Constructor.
void * GetValuePointer(TLeaf *leaf, Int_t instance=0) override
Return the pointer to the clonesArray.
bool HasCounter() const override
Return true if the underlying data has a array size counter.
TFormLeafInfo * DeepCopy() const override
Copy of the object and its content.
~TFormLeafInfoCollection() override
Destructor.
Int_t ReadCounterValue(char *where) override
Return the size of the underlying array for the current entry in the TTree.
void * GetLocalValuePointer(TLeaf *leaf, Int_t instance=0) override
Return the pointer to the clonesArray.
bool Update() override
We reloading all cached information in case the underlying class information has changed (for example...
TStreamerElement * fLocalElement
TFormLeafInfoCollection & operator=(const TFormLeafInfoCollection &orig)
Exception safe assignment operator.
A small helper class to implement reading a data member on an object stored in a TTree.
LongDouble_t ReadValueLongDouble(char *where, Int_t i=0) override
Long64_t ReadValueLong64(char *where, Int_t i=0) override
void * GetLocalValuePointer(TLeaf *leaf, Int_t instance=0) override
Return the address of the underlying value.
Double_t ReadValue(char *, Int_t=0) override
Read the value at the given memory location.
TFormLeafInfo * DeepCopy() const override
Copy this object and its content.
Asmall helper class to implement executing a method of an object stored in a TTree.
static TClass * ReturnTClass(TMethodCall *mc)
Return the TClass corresponding to the return type of the function if it is an object type or if the ...
TFormLeafInfoMethod & operator=(const TFormLeafInfoMethod &orig)
Exception safe assignment operator.
bool IsInteger() const override
Return true if the return value is integral.
TFormLeafInfo * DeepCopy() const override
Copy the object and all its content.
bool IsString() const override
Return true if the return value is a string.
TMethodCall * fMethod
void * GetLocalValuePointer(TLeaf *from, Int_t instance=0) override
This is implemented here because some compiler want ALL the signature of an overloaded function to be...
TClass * GetClass() const override
Return the type of the underlying return value.
bool Update() override
We reloading all cached information in case the underlying class information has changed (for example...
~TFormLeafInfoMethod() override
Destructor.
A small helper class to implement reading a data member on a variable size array inside a TClonesArra...
Long64_t GetValueLong64(TLeaf *leaf, Int_t i=0) override
Double_t GetValue(TLeaf *leaf, Int_t instance=0) override
void LoadSizes(TBranch *branch) override
Load the current array sizes.
LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t i=0) override
Int_t GetArrayLength() override
Return the current length of the array.
TFormLeafInfo * DeepCopy() const override
Copy the object and all its data.
A small helper class to implement reading a data member on a variable size array inside a TClonesArra...
TFormLeafInfo * DeepCopy() const override
Copy the object and all its content.
Double_t GetValue(TLeaf *leaf, Int_t instance=0) override
void LoadSizes(TBranch *branch) override
Load the current array sizes.
Long64_t GetValueLong64(TLeaf *leaf, Int_t i=0) override
Int_t GetArrayLength() override
Return the current length of the array.
LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t i=0) override
A small helper class to implement reading a data member on a variable size array inside a TClonesArra...
Long64_t ReadValueLong64(char *where, Int_t i=0) override
TFormLeafInfo * DeepCopy() const override
Copy the object and all its content.
LongDouble_t ReadValueLongDouble(char *where, Int_t i=0) override
Double_t ReadValue(char *, Int_t=0) override
Not implemented.
A helper class to implement reading a data member on a variable size array inside a TClonesArray obje...
Int_t GetSize(Int_t index) override
Return the size of the requested sub-array.
LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t i=0) override
void UpdateSizes(TArrayI *garr) override
Update the sizes of the arrays.
TFormLeafInfoMultiVarDim()
Constructor.
TFormLeafInfo * fCounter2
void SetPrimaryIndex(Int_t index) override
Set the current value of the primary index.
TFormLeafInfo * DeepCopy() const override
Copy the object and all its content.
TFormLeafInfoMultiVarDim(TClass *classptr, Longptr_t offset, TStreamerElement *element)
Long64_t GetValueLong64(TLeaf *leaf, Int_t i=0) override
TFormLeafInfoMultiVarDim & operator=(const TFormLeafInfoMultiVarDim &orig)
Exception safe assignment operator.
Int_t GetPrimaryIndex() override
Return the index value of the primary index.
Int_t GetVarDim() override
Return the index of the dimension which varies for each elements of an enclosing array (typically a T...
Int_t GetSumOfSizes() override
Get the total size.
Double_t GetValue(TLeaf *, Int_t=0) override
Int_t GetVirtVarDim() override
Return the virtual index (for this expression) of the dimension which varies for each elements of an ...
void LoadSizes(TBranch *branch) override
Load the current array sizes.
void SetSecondaryIndex(Int_t index) override
Set the current value of the primary index.
bool Update() override
We reloading all cached information in case the underlying class information has changed (for example...
void SetSize(Int_t index, Int_t val) override
Set the sizes of the sub-array.
~TFormLeafInfoMultiVarDim() override
Destructor.
A small helper class to implement reading a numerical value inside a collection.
TFormLeafInfoNumerical & operator=(const TFormLeafInfoNumerical &orig)
Exception safe assignment operator.
bool IsString() const override
Return true if the underlying data is a string.
~TFormLeafInfoNumerical() override
Destructor.
TFormLeafInfo * DeepCopy() const override
Copy the object and all its content.
bool Update() override
We reloading all cached information in case the underlying class information has changed (for example...
A small helper class to implement reading a data member by following a pointer inside a branch of TTr...
TFormLeafInfo * DeepCopy() const override
Copy the object and all of its content.
A small helper class to implement reading from the containing TTree object itself.
void Swap(TFormLeafInfoTTree &other)
void * GetLocalValuePointer(TLeaf *leaf, Int_t instance=0) override
returns the address of the value pointed to by the TFormLeafInfo.
TFormLeafInfo * DeepCopy() const override
Copy the object and all its content.
bool Update() override
Update after a change of file in a chain.
TFormLeafInfoTTree & operator=(const TFormLeafInfoTTree &orig)
This class is a small helper class to implement reading a data member on an object stored in a TTree.
virtual Int_t GetVarDim()
Return the index of the dimension which varies for each elements of an enclosing array (typically a T...
virtual void * GetValuePointer(TLeaf *leaf, Int_t instance=0)
returns the address of the value pointed to by the serie of TFormLeafInfo.
virtual void SetBranch(TBranch *br)
TFormLeafInfo * fCounter
virtual Int_t GetNdata()
Get the number of element in the entry.
TClass * fClass
! This is the class of the data pointed to
char * GetObjectAddress(TLeafElement *leaf, Int_t &instance)
Returns the location of the object pointed to.
virtual LongDouble_t ReadValueLongDouble(char *where, Int_t instance=0)
TString fElementName
virtual bool Update()
We reloading all cached information in case the underlying class information has changed (for example...
virtual Int_t GetPrimaryIndex()
Method for multiple variable dimensions.
virtual void SetSize(Int_t index, Int_t val)
Set the current size of the arrays.
virtual Double_t ReadValue(char *where, Int_t instance=0)
virtual Long64_t GetValueLong64(TLeaf *leaf, Int_t instance=0)
~TFormLeafInfo() override
Delete this object and all its content.
virtual TClass * GetClass() const
Get the class of the underlying data.
TStreamerElement * fElement
! Descriptor of the data pointed to.
virtual bool IsString() const
Return true if the underlying data is a string.
TFormLeafInfo * fNext
follow this to grab the inside information
virtual Int_t GetVirtVarDim()
Return the virtual index (for this expression) of the dimension which varies for each elements of an ...
virtual void SetSecondaryIndex(Int_t index)
Set the primary index value.
virtual bool IsInteger() const
Return true if the underlying data is an integral value.
virtual void LoadSizes(TBranch *branch)
Load the current array sizes.
virtual Int_t GetSumOfSizes()
Total all the elements that are available for the current entry for the secondary variable dimension.
virtual Int_t GetArrayLength()
Return the current length of the array.
TFormLeafInfo & operator=(const TFormLeafInfo &orig)
Exception safe assignment operator.
virtual Long64_t ReadValueLong64(char *where, Int_t instance=0)
T ReadTypedValue(char *where, Int_t instance=0)
virtual Int_t ReadCounterValue(char *where)
Return the size of the underlying array for the current entry in the TTree.
virtual bool IsReference() const
virtual bool HasCounter() const
Return true if any of underlying data has a array size counter.
virtual Int_t GetCounterValue(TLeaf *leaf)
Return the size of the underlying array for the current entry in the TTree.
T GetTypedValue(TLeaf *leaf, Int_t instance=0)
virtual void UpdateSizes(TArrayI *garr)
Set the current sizes of the arrays.
virtual LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t instance=0)
virtual Int_t GetSize(Int_t index)
For the current entry, and the value 'index' for the main array, return the size of the secondary var...
virtual void SetPrimaryIndex(Int_t index)
Set the primary index value.
virtual void AddOffset(Int_t offset, TStreamerElement *element)
Increase the offset of this element.
virtual Double_t GetValue(TLeaf *leaf, Int_t instance=0)
Int_t GetMultiplicity()
Reminder of the meaning of fMultiplicity:
Longptr_t fOffset
! Offset of the data pointed inside the class fClass
virtual void * GetLocalValuePointer(TLeaf *leaf, Int_t instance=0)
returns the address of the value pointed to by the TFormLeafInfo.
TString fClassName
virtual TFormLeafInfo * DeepCopy() const
Make a complete copy of this FormLeafInfo and all its content.
A TLeaf for the general case when using the branches created via a TStreamerInfo (i....
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition TLeaf.h:57
Method or function calling interface.
Definition TMethodCall.h:37
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:139
A TTree represents a columnar dataset.
Definition TTree.h:79
Defines a common interface to inspect/change the contents of an object that represents a collection.
#define Swap(a, b)
Definition geom.c:201
static Long64_t Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance)
static LongDouble_t Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance)
static ULong64_t Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance)
static T Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance)
static Long64_t Exec(TFormLeafInfo *leaf, char *where, Int_t instance)
static LongDouble_t Exec(TFormLeafInfo *leaf, char *where, Int_t instance)
static ULong64_t Exec(TFormLeafInfo *leaf, char *where, Int_t instance)
static T Exec(TFormLeafInfo *leaf, char *where, Int_t instance)