52 Init(tree,
nullptr,
name,classname,addobj,basketsize,splitlevel,compress,isptrptr);
61 Init(
nullptr,parent,
name,classname,addobj,basketsize,splitlevel,compress,isptrptr);
69 if (tree==
nullptr && parent!=
nullptr) tree = parent->
GetTree();
77 Error(
"TBranchObject",
"Cannot find class:%s", classname);
88 char** apointer = (
char**) addobj;
113 if (basketsize < 100) {
178 for (
Int_t i = 0; i < nbranches; ++i) {
219 for (
Int_t i = 0; i < nbranches; ++i) {
222 nb = branch->
GetEntry(entry, getall);
243 expectedClass =
nullptr;
247 Error(
"GetExpectedType",
"Did not find any leaves in %s",
GetName());
261 if (nbranches >= 1) {
267 return browsables && browsables->
GetSize();
279 Printf(
"*............................................................................*");
280 for (
Int_t i = 0; i < nbranches; ++i) {
283 branch->
Print(option);
302 for (
Int_t i = 0; i < nbranches; ++i) {
304 branch->
Reset(option);
315 for (
Int_t i = 0; i < nbranches; ++i) {
345 char** ppointer = (
char**) add;
355 for (
Int_t i = 0; i < nbranches; ++i) {
362 if (ppointer && !obj) {
363 obj = (
char*) cl->
New();
375 Error(
"SetAddress",
"Pointer to TClonesArray is null");
392 char* fullname =
new char[200];
397 if (bname[strlen(bname)-1] ==
'.') {
401 char* pointer =
nullptr;
411 const char* rdname = rd->
GetName();
419 pointer = obj + offset;
429 snprintf(fullname,200,
"%s%s", bname, &rdname[1]);
431 snprintf(fullname,200,
"%s", &rdname[1]);
443 snprintf(fullname,200,
"%s%s", bname, &rdname[0]);
445 snprintf(fullname,200,
"%s", &rdname[0]);
452 snprintf(fullname,200,
"%s%s", bname, &rdname[0]);
454 snprintf(fullname,200,
"%s", &rdname[0]);
459 for (cursor = 0, pos = 0; cursor < strlen(fullname); ++cursor) {
460 if (fullname[cursor] !=
'*') {
461 fullname[pos++] = fullname[cursor];
464 fullname[pos] =
'\0';
471 snprintf(fullname,200,
"%s%s", bname, &rdname[1]);
473 snprintf(fullname,200,
"%s", &rdname[1]);
481 snprintf(fullname,200,
"%s%s", bname, &rdname[0]);
483 snprintf(fullname,200,
"%s", &rdname[0]);
521 for (
Int_t i=0;i<nbranches;i++) {
535 for (
Int_t i = 0; i < nbranches; ++i) {
577 const char* motherFileName = treeFileName;
578 if (mother && (mother !=
this)) {
616 void** ppointer = (
void**)
fAddress;
int Int_t
Signed integer 4 bytes (int).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char).
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
A helper class for managing IMT work during TTree:Fill operations.
void SetAddress(void *addobj) override
Set address of this branch.
void ResetAfterMerge(TFileMergeInfo *) override
Reset a Branch after a Merge operation (drop data but keep customizations).
TObject * fOldObject
!Pointer to old object
bool IsFolder() const override
Return TRUE if more than one leaf or if fBrowsables, FALSE otherwise.
void SetBasketSize(Int_t bufsize) override
Reset basket size for all subbranches of this branch.
void SetupAddresses() override
– If the branch address is not set, we set all addresses starting with the top level parent branch.
Int_t GetExpectedType(TClass *&clptr, EDataType &type) override
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
void UpdateAddress() override
Update branch addresses if a new object was created.
void Init(TTree *tree, TBranch *parent, const char *name, const char *classname, void *addobj, Int_t basketsize, Int_t splitlevel, Int_t compress, bool isptrptr)
Initialization routine (run from the constructor so do not make this function virtual).
void SetAutoDelete(bool autodel=true) override
Set the AutoDelete bit.
void Streamer(TBuffer &) override
Stream an object of class TBranchObject.
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
Read all branches of a BranchObject and return total number of bytes.
TString fClassName
Class name of referenced object.
~TBranchObject() override
Destructor for a BranchObject.
TBranchObject()
Default constructor for BranchObject.
void Print(Option_t *option="") const override
Print TBranch parameters.
Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *) override
Loop on all leaves of this branch to fill Basket buffer.
void Reset(Option_t *option="") override
Reset a branch.
void Browse(TBrowser *b) override
Browse the branch content.
TString fFileName
Name of file where buffers are stored ("" if in same file as Tree header).
Int_t fMaxBaskets
Maximum number of Baskets so far.
@ kDoNotProcess
Active bit for branches.
TObjArray fLeaves
-> List of leaves of this branch
char * fAddress
! Address of 1st leaf (variable or object)
virtual TList * GetBrowsables()
Returns (and, if 0, creates) browsable objects for this branch See TVirtualBranchBrowsable::FillListO...
Long64_t * fBasketEntry
[fMaxBaskets] Table of first entry in each basket
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
const char * GetFileName() const
Long64_t fReadEntry
! Current entry number when reading
void Print(Option_t *option="") const override
Print TBranch parameters.
virtual void SetAddress(void *add)
Set address of this branch.
virtual void SetAutoDelete(bool autodel=true)
Set the automatic delete bit.
Int_t fNleaves
! Number of leaves
Int_t * fBasketBytes
[fMaxBaskets] Length of baskets on file
TObjArray fBranches
-> List of Branches of this branch
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
TBranch(const TBranch &)=delete
TDirectory * fDirectory
! Pointer to directory where this branch buffers are stored
TBranch * fMother
! Pointer to top-level parent branch in the tree.
TBranch * fParent
! Pointer to parent branch.
Long64_t * fBasketSeek
[fMaxBaskets] Addresses of baskets on file
TObjArray * GetListOfLeaves()
Int_t fBasketSize
Initial Size of Basket Buffer.
virtual void Reset(Option_t *option="")
Reset a Branch.
virtual void SetBasketSize(Int_t bufsize)
Set the basket size The function makes sure that the basket size is greater than fEntryOffsetlen.
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Int_t fCompress
Compression level and algorithm.
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all leaves of this branch to fill Basket buffer.
Long64_t fEntries
Number of entries.
TTree * fTree
! Pointer to Tree header
Using a TBrowser one can browse all ROOT objects.
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TClass instances represent classes, structs and namespaces in the ROOT type system.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
void BuildRealData(void *pointer=nullptr, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
TList * GetListOfRealData() const
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
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.
TClass * GetClass() const
void Browse(TBrowser *b) override
Browse this collection (called by TBrowser).
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
All ROOT classes may have RTTI (run time type identification) support added.
Bool_t IsPersistent() const
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
Bool_t IsaPointer() const
Return true if data member is a pointer.
TDataType * GetDataType() const
const char * GetTypeName() const
Get the decayed type name of this data member, removing const and volatile qualifiers,...
const char * GetArrayIndex() const
If the data member is pointer and has a valid array size in its comments GetArrayIndex returns a stri...
Basic data type descriptor (datatype information is obtained from CINT).
Describe directory structure in memory.
virtual Int_t WriteTObject(const TObject *obj, const char *name=nullptr, Option_t *="", Int_t=0)
virtual TFile * GetFile() const
virtual Bool_t IsWritable() const
A class to pass information from the TFileMerger to the objects being merged.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
Int_t GetCompressionSettings() const
A TLeaf for a general object derived from TObject.
TClass * GetClass() const
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual void SetAddress(void *add=nullptr)
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
TObject * At(Int_t idx) const override
void Add(TObject *obj) override
friend class TClonesArray
Bool_t TestBit(UInt_t f) const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
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.
TObject()
TObject constructor.
The TRealData class manages the effective list of all data members for a given class.
const char * GetName() const override
Returns name of object.
TDataMember * GetDataMember() const
Long_t GetThisOffset() const
TStreamerInfo * BuildStreamerInfo(TClass *cl, void *pointer=nullptr, bool canOptimize=true)
Build StreamerInfo for class cl.
virtual TObjArray * GetListOfLeaves()
TDirectory * GetDirectory() const