53 Init(
tree,0,
name,classname,addobj,basketsize,splitlevel,compress,isptrptr);
62 Init(0,parent,
name,classname,addobj,basketsize,splitlevel,compress,isptrptr);
78 Error(
"TBranchObject",
"Cannot find class:%s", classname);
89 char** apointer = (
char**) addobj;
98 tree->BuildStreamerInfo(cl, obj);
108 if ((compress == -1) &&
tree->GetDirectory()) {
109 TFile* bfile =
tree->GetDirectory()->GetFile();
114 if (basketsize < 100) {
134 tree->GetListOfLeaves()->Add(leaf);
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);
316 for (
Int_t i = 0; i < nbranches; ++i) {
346 char** ppointer = (
char**) add;
356 for (
Int_t i = 0; i < nbranches; ++i) {
363 if (ppointer && !obj) {
364 obj = (
char*) cl->
New();
376 Error(
"SetAddress",
"Pointer to TClonesArray is null");
393 char* fullname =
new char[200];
398 if (bname[strlen(bname)-1] ==
'.') {
412 const char* rdname = rd->
GetName();
420 pointer = obj + offset;
430 snprintf(fullname,200,
"%s%s", bname, &rdname[1]);
432 snprintf(fullname,200,
"%s", &rdname[1]);
444 snprintf(fullname,200,
"%s%s", bname, &rdname[0]);
446 snprintf(fullname,200,
"%s", &rdname[0]);
453 snprintf(fullname,200,
"%s%s", bname, &rdname[0]);
455 snprintf(fullname,200,
"%s", &rdname[0]);
460 for (cursor = 0, pos = 0; cursor < strlen(fullname); ++cursor) {
461 if (fullname[cursor] !=
'*') {
462 fullname[pos++] = fullname[cursor];
465 fullname[pos] =
'\0';
472 snprintf(fullname,200,
"%s%s", bname, &rdname[1]);
474 snprintf(fullname,200,
"%s", &rdname[1]);
482 snprintf(fullname,200,
"%s%s", bname, &rdname[0]);
484 snprintf(fullname,200,
"%s", &rdname[0]);
522 for (
Int_t i=0;i<nbranches;i++) {
536 for (
Int_t i = 0; i < nbranches; ++i) {
545void TBranchObject::Streamer(
TBuffer& R__b)
578 const char* motherFileName = treeFileName;
579 if (mother && (mother !=
this)) {
617 void** ppointer = (
void**)
fAddress;
A Branch for the case of an object.
virtual void SetBasketSize(Int_t buffsize)
Reset basket size for all subbranches of this branch.
virtual void SetupAddresses()
– If the branch address is not set, we set all addresses starting with the top level parent branch.
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 ~TBranchObject()
Destructor for a BranchObject.
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all leaves of this branch to fill Basket buffer.
TObject * fOldObject
!Pointer to old object
Bool_t IsFolder() const
Return TRUE if more than one leaf or if fBrowsables, FALSE otherwise.
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch after a Merge operation (drop data but keep customizations)
virtual void Print(Option_t *option="") const
Print TBranch parameters.
virtual Int_t GetExpectedType(TClass *&clptr, EDataType &type)
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
TString fClassName
Class name of referenced object.
virtual void Browse(TBrowser *b)
Browse the branch content.
virtual void UpdateAddress()
Update branch addresses if a new object was created.
virtual void SetAutoDelete(Bool_t autodel=kTRUE)
Set the AutoDelete bit.
TBranchObject()
Default constructor for BranchObject.
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 void Reset(Option_t *option="")
Reset a branch.
virtual void SetAddress(void *addobj)
Set address of this branch.
A TTree is a list of TBranches.
virtual void SetAutoDelete(Bool_t autodel=kTRUE)
Set the automatic delete bit.
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.
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
virtual void SetAddress(void *add)
Set address of this branch.
Int_t fNleaves
! Number of leaves
Int_t * fBasketBytes
[fMaxBaskets] Length of baskets on file
virtual void Print(Option_t *option="") const
Print TBranch parameters.
TObjArray fBranches
-> List of Branches of this branch
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
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.
virtual void SetBasketSize(Int_t buffsize)
Set the basket size The function makes sure that the basket size is greater than fEntryOffsetlen.
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.
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=0)=0
virtual void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
The ROOT global object gROOT contains a list of all defined classes.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
void BuildRealData(void *pointer=0, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
TList * GetListOfRealData() const
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Bool_t InheritsFrom(const char *cl) const
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.
An array of clone (identical) objects.
TClass * GetClass() const
void Browse(TBrowser *b)
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 type of data member, e,g.: "class TDirectory*" -> "TDirectory".
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 TFile * GetFile() const
virtual Int_t WriteTObject(const TObject *obj, const char *name=0, Option_t *="", Int_t=0)
See TDirectoryFile::WriteTObject for details.
virtual Bool_t IsWritable() const
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
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=0)
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Int_t GetEntriesFast() const
TObject * UncheckedAt(Int_t i) const
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
TObject * At(Int_t idx) const
Mother of all ROOT objects.
R__ALWAYS_INLINE 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.
The TRealData class manages the effective list of all data members for a given class.
TDataMember * GetDataMember() const
virtual const char * GetName() const
Returns name of object.
Long_t GetThisOffset() const
const char * Data() const
A TTree object has a header with a name and a title.
TDirectory * GetDirectory() const