|
ROOT
Reference Guide |
|
Go to the documentation of this file.
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 +=
".";
179 if (!countValues || ((
Int_t)countValues->size()) < events) {
180 Error(
"GenerateOffsetArrayBase",
"The leaf %s could not retrieve enough entries from its branch count (%s), ask for %d and got %ld",
188 for (
Int_t idx = 0, offset = base; idx < events; idx++) {
189 retval[idx] = offset;
190 len = (*countValues)[idx];
204 if (branchname.
Length() && (branchname[branchname.
Length()-1] ==
'.'))
207 return branchname +
"." +
GetName();
230 char* bleft = (
char*) strchr(
name,
'[');
235 Int_t nch = strlen(bleft);
236 char* countname =
new char[nch+1];
237 strcpy(countname, bleft);
238 char* bright = (
char*) strchr(countname,
']');
245 char *bleft2 = (
char*) strchr(countname,
'[');
247 nch = strlen(countname);
251 Error(
"GetLeafCounter",
"TLeaf %s is not setup properly, fBranch is null.",
GetName());
268 if (!leaf && strchr(
GetName(),
'.')) {
269 char* withdot =
new char[strlen(
GetName())+strlen(countname)+1];
271 char* lastdot = strrchr(withdot,
'.');
272 strcpy(lastdot, countname);
277 if (!leaf && strchr(countname,
'.')) {
287 sscanf(bleft2,
"[%d]", &i);
293 bleft = (
char*) strchr(bleft2,
'[');
297 sscanf(bleft,
"[%d]", &i);
306 for (i = 0; i < nch; i++) {
307 if (!isdigit(countname[i])) {
314 sscanf(countname,
"%d", &countval);
316 sscanf(bleft2,
"[%d]", &i);
322 bleft = (
char*) strchr(bleft2,
'[');
326 sscanf(bleft,
"[%d]", &i);
368 Long64_t orig_leaf_entry = branch->GetReadEntry();
369 for (
Long64_t idx = 0; idx < len; ++idx) {
370 branch->GetEntry(start + idx);
374 branch->GetEntry(orig_leaf_entry);
418 if (!calledFromDestructor) {
473 b.CheckByteCount(R__s, R__c, TLeaf::IsA());
Using a TBrowser one can browse all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
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...
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
virtual void SetRange(Bool_t range=kTRUE)
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 TObject * Remove(TObject *obj)
Remove object from array.
virtual const char * GetTitle() const
Returns title of object.
std::vector< Int_t > Counts_t
Long64_t GetReadEntry() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
A TTree represents a columnar dataset.
virtual Int_t GetOffsetHeaderSize() const
Int_t GetEntries() const
Return the number of objects in array (i.e.
virtual void SetAddress(void *add=0)
virtual Double_t GetValue(Int_t i=0) const
Buffer base class used for serializing objects.
virtual TString GetFullName() const
Return the full name (including the parent's branch names) of the leaf.
Int_t * GenerateOffsetArrayBase(Int_t base, Int_t events) const
If the class supports it, generate an offset array base.
TString & ReplaceAll(const TString &s1, const TString &s2)
Long64_t fStartEntry
! entry number of corresponding to element 0 of the vector.
Int_t fLenType
Number of bytes for this data type.
A TTree is a list of TBranches.
Int_t GetLast() const
Return index of last object in array.
virtual void FillBasket(TBuffer &b)
Pack leaf elements in Basket output buffer.
@ kNewValue
Set if we own the value buffer and so must delete it ourselves.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Int_t fLen
Number of fixed length elements in the leaf's data.
LeafCountValues * fLeafCountValues
! Cache of collection/array sizes
The TNamed class is the base class for all named ROOT classes.
#define R__unlikely(expr)
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
virtual void SetLeafCount(TLeaf *leaf)
Set the leaf count of this leaf.
virtual Bool_t IsRange() const
Bool_t fIsRange
(=kTRUE if leaf has a range, kFALSE otherwise). This is equivalent to being a 'leafcount'....
Bool_t fIsUnsigned
(=kTRUE if unsigned, kFALSE otherwise)
Int_t ResetAddress(void *add, Bool_t destructor=kFALSE)
Helper routine for TLeafX::SetAddress.
virtual TLeaf * FindLeaf(const char *name)
Find leaf..
Int_t fOffset
Offset in ClonesArray object (if one)
R__ALWAYS_INLINE Bool_t IsZombie() const
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.
TBranch * GetBranch() const
virtual Int_t GetMaximum() const
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
@ kZombie
object ctor failed
TLeaf * fLeafCount
Pointer to Leaf count if variable length (we do not own the counter)
TLeaf & operator=(const TLeaf &)
Assignment operator.
virtual const char * GetName() const
Returns name of object.
virtual TString GetFullName() const
Return the 'full' name of the branch.
TObjArray * GetListOfLeaves()
virtual void Browse(TBrowser *b)
Browse the content of this leaf.
virtual TObjArray * GetListOfLeaves()
TBranch * fBranch
! Pointer to supporting branch (we do not own the branch)
virtual ~TLeaf()
Destructor.