53 Init(tree,0,name,classname,addobj,basketsize,splitlevel,compress,isptrptr);
62 Init(0,parent,name,classname,addobj,basketsize,splitlevel,compress,isptrptr);
70 if (tree==0 && parent!=0) tree = parent->
GetTree();
78 Error(
"TBranchObject",
"Cannot find class:%s", classname);
89 char** apointer = (
char**) addobj;
114 if (basketsize < 100) {
179 for (
Int_t i = 0; i < nbranches; ++i) {
220 for (
Int_t i = 0; i < nbranches; ++i) {
223 nb = branch->
GetEntry(entry, getall);
248 Error(
"GetExpectedType",
"Did not find any leaves in %s",
GetName());
262 if (nbranches >= 1) {
268 return browsables && browsables->
GetSize();
280 Printf(
"*............................................................................*");
281 for (
Int_t i = 0; i < nbranches; ++i) {
284 branch->
Print(option);
303 for (
Int_t i = 0; i < nbranches; ++i) {
305 branch->
Reset(option);
318 for (
Int_t i = 0; i < nbranches; ++i) {
348 char** ppointer = (
char**) add;
358 for (
Int_t i = 0; i < nbranches; ++i) {
365 if (ppointer && !obj) {
366 obj = (
char*) cl->
New();
378 Error(
"SetAddress",
"Pointer to TClonesArray is null");
395 char* fullname =
new char[200];
400 if (bname[strlen(bname)-1] ==
'.') {
414 const char* rdname = rd->
GetName();
422 pointer = obj + offset;
432 snprintf(fullname,200,
"%s%s", bname, &rdname[1]);
434 snprintf(fullname,200,
"%s", &rdname[1]);
446 snprintf(fullname,200,
"%s%s", bname, &rdname[0]);
448 snprintf(fullname,200,
"%s", &rdname[0]);
455 snprintf(fullname,200,
"%s%s", bname, &rdname[0]);
457 snprintf(fullname,200,
"%s", &rdname[0]);
462 for (cursor = 0, pos = 0; cursor < strlen(fullname); ++cursor) {
463 if (fullname[cursor] !=
'*') {
464 fullname[pos++] = fullname[cursor];
467 fullname[pos] =
'\0';
474 snprintf(fullname,200,
"%s%s", bname, &rdname[1]);
476 snprintf(fullname,200,
"%s", &rdname[1]);
484 snprintf(fullname,200,
"%s%s", bname, &rdname[0]);
486 snprintf(fullname,200,
"%s", &rdname[0]);
524 for (
Int_t i=0;i<nbranches;i++) {
538 for (
Int_t i = 0; i < nbranches; ++i) {
547 void TBranchObject::Streamer(
TBuffer& R__b)
577 const char* motherFileName = treeFileName;
578 if (mother && (mother !=
this)) {
616 void** ppointer = (
void**)
fAddress;
TObject * fOldObject
!Pointer to old object
TClass * GetClass() const
virtual const char * GetName() const
Returns name of object.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual void Print(Option_t *option="") const
Print TBranch parameters.
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.
virtual Int_t Fill()
Loop on all leaves of this branch to fill Basket buffer.
Long64_t fEntries
Number of entries.
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.
Bool_t TestBit(UInt_t f) const
virtual void SetName(const char *name)
Set the name of the TNamed.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
const char * GetTypeName() const
Get type of data member, e,g.: "class TDirectory*" -> "TDirectory".
Buffer base class used for serializing objects.
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)
Initialization routine (run from the constructor so do not make this function virtual) ...
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 ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force)=0
Int_t fNleaves
! Number of leaves
TObjArray fLeaves
-> List of leaves of this branch
Long64_t * fBasketSeek
[fMaxBaskets] Addresses of baskets on file
TObject * At(Int_t idx) 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.
Int_t * fBasketBytes
[fMaxBaskets] Length of baskets on file
virtual TList * GetBrowsables()
Returns (and, if 0, creates) browsable objects for this branch See TVirtualBranchBrowsable::FillListO...
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
virtual Bool_t IsWritable() 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...
const Int_t kDoNotProcess
virtual void SetAutoDelete(Bool_t autodel=kTRUE)
Set the AutoDelete bit.
Long_t GetThisOffset() const
TDataType * GetDataType() const
Int_t fMaxBaskets
Maximum number of Baskets so far.
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 TFile * GetFile() const
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
virtual Int_t Fill()
Loop on all leaves of this branch to fill Basket buffer.
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.
virtual void SetAddress(void *addobj)
Set address of this branch.
Int_t fBasketSize
Initial Size of Basket Buffer.
Bool_t IsFolder() const
Return TRUE if more than one leaf or if fBrowsables, FALSE otherwise.
virtual void UpdateAddress()
Update branch addresses if a new object was created.
Basic data type descriptor (datatype information is obtained from CINT).
TDataMember * GetDataMember() const
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
TBranchObject()
Default constructor for BranchObject.
Int_t GetEntriesFast() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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.
The ROOT global object gROOT contains a list of all defined classes.
const char * GetFileName() const
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
virtual void SetBasketSize(Int_t buffsize)
Reset basket size for all subbranches of this branch.
virtual void SetBasketSize(Int_t buffsize)
Set the basket size The function makes sure that the basket size is greater than fEntryOffsetlen.
TString fClassName
Class name of referenced object.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
TObject * UncheckedAt(Int_t i) const
Describe directory structure in memory.
TDirectory * GetDirectory() const
TList * GetListOfRealData() const
TTree * fTree
! Pointer to Tree header
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
TObjArray * GetListOfLeaves()
TDirectory * fDirectory
! Pointer to directory where this branch buffers are stored
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.
Bool_t IsPersistent() const
TClass * GetClass() const
Mother of all ROOT objects.
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
An array of clone (identical) objects.
Long64_t * fBasketEntry
[fMaxBaskets] Table of first entry in each basket
const char * GetArrayIndex() const
If the data member is pointer and has a valid array size in its comments GetArrayIndex returns a stri...
virtual void Reset(Option_t *option="")
Reset a Branch.
Long64_t fReadEntry
! Current entry number when reading
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
TBranch * fMother
! Pointer to top-level parent branch in the tree.
A TTree object has a header with a name and a title.
TObjArray fBranches
-> List of Branches of this branch
virtual Int_t GetSize() const
A TTree is a list of TBranches.
virtual const char * GetName() const
Returns name of object.
Int_t fCompress
Compression level and algorithm.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Bool_t IsaPointer() const
Return true if data member is a pointer.
virtual void Print(Option_t *option="") const
Print TBranch parameters.
TString fFileName
Name of file where buffers are stored ("" if in same file as Tree header)
TBranch * fParent
! Pointer to parent branch.
TBranch * GetMother() const
Get our top-level parent branch in the tree.
virtual void ResetAfterMerge(TFileMergeInfo *)
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Int_t GetCompressionSettings() const
virtual const char * GetTitle() const
Returns title of object.
virtual ~TBranchObject()
Destructor for a BranchObject.
virtual TObjArray * GetListOfLeaves()
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
const char * Data() const
virtual void SetAutoDelete(Bool_t autodel=kTRUE)
Set the automatic delete bit.
char * fAddress
! Address of 1st leaf (variable or object)