92 const char *bracket = strchr(
name,
'[');
93 if (bracket)
fName.ReplaceAll(bracket,
"");
161 if ((
fBranch->GetListOfLeaves()->GetEntries() > 1) ||
164 if (!
name.EndsWith(
"."))
name +=
".";
166 fBranch->GetTree()->Draw(
name,
"",
b ?
b->GetDrawOption() :
"");
199 const std::vector<Int_t> *countValues =
fLeafCount->GetLeafCountValues(orig_entry, events);
201 if (!countValues || ((
Int_t)countValues->size()) < events) {
202 Error(
"GenerateOffsetArrayBase",
"The leaf %s could not retrieve enough entries from its branch count (%s), ask for %d and got %ld",
203 GetName(),
fLeafCount->GetName(), events, (
long)(countValues ? countValues->size() : -1));
210 for (
Int_t idx = 0, offset = base; idx < events; idx++) {
211 retval[idx] = offset;
212 len = (*countValues)[idx];
226 if (branchname.
Length() && (branchname[branchname.
Length()-1] ==
'.'))
229 return branchname +
"." +
GetName();
254 char* bleft = (
char*) strchr(
name,
'[');
259 Int_t nch = strlen(bleft);
260 char* countname =
new char[nch+1];
261 strlcpy(countname, bleft, nch+1);
262 char* bright = (
char*) strchr(countname,
']');
269 char *bleft2 = (
char*) strchr(countname,
'[');
271 nch = strlen(countname);
275 Error(
"GetLeafCounter",
"TLeaf %s is not setup properly, fBranch is null.",
GetName());
279 if (
fBranch->GetTree() ==
nullptr) {
280 Error(
"GetLeafCounter",
"For Leaf %s, the TBranch %s is not setup properly, fTree is null.",
GetName(),
fBranch->GetName());
287 if (leaf ==
nullptr) {
292 if (!leaf && strchr(
GetName(),
'.')) {
293 char* withdot =
new char[strlen(
GetName())+strlen(countname)+1];
295 char* lastdot = strrchr(withdot,
'.');
296 strcpy(lastdot, countname);
301 if (!leaf && strchr(countname,
'.')) {
311 sscanf(bleft2,
"[%d]", &i);
317 bleft = (
char*) strchr(bleft2,
'[');
321 sscanf(bleft,
"[%d]", &i);
330 for (i = 0; i < nch; i++) {
331 if (!isdigit(countname[i])) {
338 sscanf(countname,
"%d", &countval);
340 sscanf(bleft2,
"[%d]", &i);
346 bleft = (
char*) strchr(bleft2,
'[');
350 sscanf(bleft,
"[%d]", &i);
392 Long64_t orig_leaf_entry = branch->GetReadEntry();
393 for (
Long64_t idx = 0; idx < len; ++idx) {
394 branch->GetEntry(
start + idx);
398 branch->GetEntry(orig_leaf_entry);
411 Error(
"GetLen",
"Leaf counter is greater than maximum! leaf: '%s' len: %d max: %d",
GetName(), len,
fLeafCount->GetMaximum());
435 bool deleteValue =
false;
442 if (!calledFromDestructor) {
#define R__unlikely(expr)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
short Version_t
Class version identifier (short).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
long long Long64_t
Portable signed long integer 8 bytes.
A TTree is a list of TBranches.
virtual TString GetFullName() const
Return the 'full' name of the branch.
TObjArray * GetListOfLeaves()
Using a TBrowser one can browse all ROOT objects.
Buffer base class used for serializing objects.
virtual Double_t GetValue(Int_t i=0) const
TLeaf(const TLeaf &)
Copy constructor.
Int_t fLenType
Number of bytes for this data type.
bool fIsRange
(=true if leaf has a range, false otherwise). This is equivalent to being a 'leafcount'....
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...
~TLeaf() override
Destructor.
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.
Int_t ResetAddress(void *add, bool calledFromDestructor=false)
Helper routine for TLeafX::SetAddress.
TClass * IsA() const override
void Streamer(TBuffer &) override
Stream a class object.
TLeaf & operator=(const TLeaf &)
Assignment operator.
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...
Int_t * GenerateOffsetArrayBase(Int_t base, Int_t events) const
If the class supports it, generate an offset array base.
virtual void SetAddress(void *add=nullptr)
void Browse(TBrowser *b) override
Browse the content of this leaf.
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)
bool fIsUnsigned
(=true if unsigned, false otherwise)
TLeaf * fLeafCount
Pointer to Leaf count if variable length (we do not own the counter).
@ 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
virtual void SetRange(bool range=true)
std::vector< Int_t > Counts_t
virtual bool IsRange() const
const char * GetName() const override
Returns name of object.
void Streamer(TBuffer &) override
Stream an object of class TObject.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
TObject * Remove(TObject *obj) override
Remove object from array.
TObject * FindObject(const char *name) const override
Find an object in this collection using its name.
Int_t GetLast() const override
Return index of last object in array.
Bool_t TestBit(UInt_t f) const
@ kZombie
object ctor failed
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.
static constexpr Ssiz_t kNPOS
const char * Data() const
A TTree represents a columnar dataset.
virtual TObjArray * GetListOfLeaves()
virtual TLeaf * FindLeaf(const char *name)
Find first leaf containing searchname.