50 Init(tree,0,name,classname,addobj,basketsize,splitlevel,compress,isptrptr);
59 Init(0,parent,name,classname,addobj,basketsize,splitlevel,compress,isptrptr);
67 if (tree==0 && parent!=0) tree = parent->
GetTree();
75 Error(
"TBranchObject",
"Cannot find class:%s", classname);
86 char** apointer = (
char**) addobj;
111 if (basketsize < 100) {
176 for (
Int_t i = 0; i < nbranches; ++i) {
217 for (
Int_t i = 0; i < nbranches; ++i) {
220 nb = branch->
GetEntry(entry, getall);
245 Error(
"GetExpectedType",
"Did not find any leaves in %s",
GetName());
259 if (nbranches >= 1) {
265 return browsables && browsables->
GetSize();
277 Printf(
"*............................................................................*");
278 for (
Int_t i = 0; i < nbranches; ++i) {
281 branch->
Print(option);
300 for (
Int_t i = 0; i < nbranches; ++i) {
302 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] ==
'.') {
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) {
544 void TBranchObject::Streamer(
TBuffer& R__b)
574 const char* motherFileName = treeFileName;
575 if (mother && (mother !=
this)) {
613 void** ppointer = (
void**)
fAddress;
Bool_t IsFolder() const
Return TRUE if more than one leaf or if fBrowsables, FALSE otherwise.
virtual const char * GetTitle() const
Returns title of object.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
TStreamerInfo * BuildStreamerInfo(TClass *cl, void *pointer=0, Bool_t canOptimize=kTRUE)
Build StreamerInfo for class cl.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void SetAddress(void *add)
Set address of this branch.
A Branch for the case of an object.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
virtual Int_t Fill()
Loop on all leaves of this branch to fill Basket buffer.
Long64_t fEntries
Pointer to the current basket.
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
All ROOT classes may have RTTI (run time type identification) support added.
A TLeaf for a general object derived from TObject.
virtual void SetName(const char *name)
Change (i.e.
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual void Print(Option_t *option="") const
Print TBranch parameters.
Buffer base class used for serializing objects.
Bool_t IsPersistent() const
void Init(TTree *tree, TBranch *parent, const char *name, const char *classname, void *addobj, Int_t basketsize, Int_t splitlevel, Int_t compress, Bool_t isptrptr)
Pointer to old object.
virtual Int_t WriteTObject(const TObject *obj, const char *name=0, Option_t *="", Int_t=0)
See TDirectoryFile::WriteTObject for details.
virtual Int_t GetExpectedType(TClass *&clptr, EDataType &type)
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
virtual void Print(Option_t *option="") const
Print TBranch parameters.
TDataType * GetDataType() const
Bool_t IsaPointer() const
Return true if data member is a pointer.
virtual void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force)=0
Int_t GetEntriesFast() const
virtual void Browse(TBrowser *b)
Browse the branch content.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
const char * GetArrayIndex() const
If the data member is pointer and has a valid array size in its comments GetArrayIndex returns a stri...
virtual TList * GetBrowsables()
Returns (and, if 0, creates) browsable objects for this branch See TVirtualBranchBrowsable::FillListO...
TList * GetListOfRealData() const
const char * Data() const
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
virtual void SetupAddresses()
– If the branch address is not set, we set all addresses starting with the top level parent branch...
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
const Int_t kDoNotProcess
virtual void SetAutoDelete(Bool_t autodel=kTRUE)
Set the AutoDelete bit.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void SetAddress(void *add=0)
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of a BranchObject and return total number of bytes.
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
virtual TFile * GetFile() const
virtual Int_t Fill()
Loop on all leaves of this branch to fill Basket buffer.
TObject * UncheckedAt(Int_t i) const
void BuildRealData(void *pointer=0, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
Using a TBrowser one can browse all ROOT objects.
virtual void Reset(Option_t *option="")
Reset a branch.
const char * GetTypeName() const
Get type of data member, e,g.: "class TDirectory*" -> "TDirectory".
virtual void SetAddress(void *addobj)
Set address of this branch.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
virtual void UpdateAddress()
Update branch addresses if a new object was created.
Basic data type descriptor (datatype information is obtained from CINT).
TDirectory * GetDirectory() const
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Bool_t TestBit(UInt_t f) const
The TRealData class manages the effective list of all data members for a given class.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
virtual const char * GetName() const
Returns name of object.
The ROOT global object gROOT contains a list of all defined classes.
virtual void SetBasketSize(Int_t buffsize)
Reset basket size for all subbranches of this branch.
Int_t GetCompressionSettings() const
virtual void SetBasketSize(Int_t buffsize)
Set the basket size The function makes sure that the basket size is greater than fEntryOffsetlen.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Int_t GetSize() const
TClass * GetClass() const
Describe directory structure in memory.
TClass * GetClass() const
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
ClassImp(TBranchObject) TBranchObject
Default constructor for BranchObject.
TObjArray * GetListOfLeaves()
TDirectory * fDirectory
Address of 1st leaf (variable or object)
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.
const char * GetFileName() const
Mother of all ROOT objects.
An array of clone (identical) objects.
virtual void Reset(Option_t *option="")
Reset a Branch.
virtual Bool_t IsWritable() const
Long64_t fReadEntry
Current basket number when reading.
TBranch * fMother
Pointer to Tree header.
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
A TTree object has a header with a name and a title.
TDataMember * GetDataMember() const
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
TObject * At(Int_t idx) const
A TTree is a list of TBranches.
Int_t fCompress
branch counter
Long_t GetThisOffset() const
virtual const char * GetName() const
Returns name of object.
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
TString fFileName
Pointer to directory where this branch buffers are stored.
TBranch * fParent
Pointer to top-level parent branch in the tree.
virtual void ResetAfterMerge(TFileMergeInfo *)
virtual ~TBranchObject()
Destructor for a BranchObject.
virtual TObjArray * GetListOfLeaves()
virtual void SetAutoDelete(Bool_t autodel=kTRUE)
Set the automatic delete bit.
char * fAddress
Pointer to parent branch.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.