70 const char *bracket = strchr(
name,
'[');
81 fLenType(lf.fLenType),
83 fIsRange(lf.fIsRange),
84 fIsUnsigned(lf.fIsUnsigned),
85 fLeafCount(lf.fLeafCount),
87 fLeafCountValues(nullptr)
142 if (!
name.EndsWith(
"."))
name +=
".";
178 if (!countValues || ((
Int_t)countValues->size()) < events) {
179 Error(
"GenerateOffsetArrayBase",
"The leaf %s could not retrieve enough entries from its branch count (%s), ask for %d and got %ld",
186 for (
Int_t idx = 0, offset = base; idx < events; idx++) {
187 retval[idx] = offset;
188 len = (*countValues)[idx];
202 if (branchname.
Length() && (branchname[branchname.
Length()-1] ==
'.'))
205 return branchname +
"." +
GetName();
228 char* bleft = (
char*) strchr(
name,
'[');
233 Int_t nch = strlen(bleft);
234 char* countname =
new char[nch+1];
235 strcpy(countname, bleft);
236 char* bright = (
char*) strchr(countname,
']');
243 char *bleft2 = (
char*) strchr(countname,
'[');
245 nch = strlen(countname);
249 Error(
"GetLeafCounter",
"TLeaf %s is not setup properly, fBranch is null.",
GetName());
266 if (!leaf && strchr(
GetName(),
'.')) {
267 char* withdot =
new char[strlen(
GetName())+strlen(countname)+1];
269 char* lastdot = strrchr(withdot,
'.');
270 strcpy(lastdot, countname);
275 if (!leaf && strchr(countname,
'.')) {
285 sscanf(bleft2,
"[%d]", &i);
291 bleft = (
char*) strchr(bleft2,
'[');
295 sscanf(bleft,
"[%d]", &i);
304 for (i = 0; i < nch; i++) {
305 if (!isdigit(countname[i])) {
312 sscanf(countname,
"%d", &countval);
314 sscanf(bleft2,
"[%d]", &i);
320 bleft = (
char*) strchr(bleft2,
'[');
324 sscanf(bleft,
"[%d]", &i);
366 Long64_t orig_leaf_entry = branch->GetReadEntry();
367 for (
Long64_t idx = 0; idx < len; ++idx) {
368 branch->GetEntry(start + idx);
372 branch->GetEntry(orig_leaf_entry);
416 if (!calledFromDestructor) {
471 b.CheckByteCount(R__s, R__c, TLeaf::IsA());
#define R__unlikely(expr)
A TTree is a list of TBranches.
virtual TString GetFullName() const
Return the 'full' name of the branch.
Long64_t GetReadEntry() const
TObjArray * GetListOfLeaves()
Using a TBrowser one can browse all ROOT objects.
Buffer base class used for serializing objects.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual Double_t GetValue(Int_t i=0) const
virtual Bool_t IsRange() const
Int_t fLenType
Number of bytes for this data type.
virtual const Counts_t * GetLeafCountValues(Long64_t start, Long64_t len)
If this branch is a branch count, return the set of collection size for the entry range requested sta...
virtual Int_t GetMaximum() const
virtual void Browse(TBrowser *b)
Browse the content of this leaf.
Int_t fLen
Number of fixed length elements in the leaf's data.
Int_t fNdata
! Number of elements in fAddress data buffer.
virtual Int_t GetLen() const
Return the number of effective elements of this leaf, for the current entry.
Bool_t fIsUnsigned
(=kTRUE if unsigned, kFALSE otherwise)
virtual ~TLeaf()
Destructor.
TLeaf & operator=(const TLeaf &)
Assignment operator.
virtual void SetAddress(void *add=0)
virtual TLeaf * GetLeafCounter(Int_t &countval) const
Return a pointer to the counter of this leaf (if any) or store the number of elements that the leaf c...
virtual void SetRange(Bool_t range=kTRUE)
Int_t * GenerateOffsetArrayBase(Int_t base, Int_t events) const
If the class supports it, generate an offset array base.
virtual void FillBasket(TBuffer &b)
Pack leaf elements in Basket output buffer.
TBranch * GetBranch() const
Int_t fOffset
Offset in ClonesArray object (if one)
virtual Int_t GetOffsetHeaderSize() const
TBranch * fBranch
! Pointer to supporting branch (we do not own the branch)
TLeaf * fLeafCount
Pointer to Leaf count if variable length (we do not own the counter)
Bool_t fIsRange
(=kTRUE if leaf has a range, kFALSE otherwise). This is equivalent to being a 'leafcount'....
@ kNewValue
Set if we own the value buffer and so must delete it ourselves.
virtual void SetLeafCount(TLeaf *leaf)
Set the leaf count of this leaf.
virtual TString GetFullName() const
Return the full name (including the parent's branch names) of the leaf.
LeafCountValues * fLeafCountValues
! Cache of collection/array sizes
std::vector< Int_t > Counts_t
Int_t ResetAddress(void *add, Bool_t destructor=kFALSE)
Helper routine for TLeafX::SetAddress.
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetTitle() const
Returns title of object.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
virtual const char * GetName() const
Returns name of object.
Int_t GetEntries() const
Return the number of objects in array (i.e.
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
Int_t GetLast() const
Return index of last object in array.
virtual TObject * Remove(TObject *obj)
Remove object from array.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
@ kZombie
object ctor failed
R__ALWAYS_INLINE Bool_t IsZombie() const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TString & ReplaceAll(const TString &s1, const TString &s2)
A TTree represents a columnar dataset.
virtual TObjArray * GetListOfLeaves()
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
virtual TLeaf * FindLeaf(const char *name)
Find leaf..
Long64_t fStartEntry
! entry number of corresponding to element 0 of the vector.