25 using namespace ROOT::Internal;
28 fDirector(0), fInitialized(
false), fBranchName(
""), fParent(0),
29 fDataMember(
""), fIsMember(
false), fIsClone(
false), fIsaPointer(0),
30 fClassName(
""),
fClass(0), fElement(0), fMemberOffset(0), fOffset(0),
31 fBranch(0), fBranchCount(0),
32 fLastTree(0), fRead(-1), fWhere(0),fCollection(0), fCurrentTreeNumber(-1)
39 fDirector(boss), fInitialized(
false), fBranchName(top), fParent(0),
41 fClassName(
""),
fClass(0), fElement(0), fMemberOffset(0), fOffset(0),
42 fBranch(0), fBranchCount(0),
43 fLastTree(0), fRead(-1), fWhere(0),fCollection(0), fCurrentTreeNumber(-1)
55 fDirector(boss), fInitialized(
false), fBranchName(top), fParent(0),
56 fDataMember(membername), fIsMember(true), fIsClone(
false), fIsaPointer(
false),
57 fClassName(
""),
fClass(0), fElement(0), fMemberOffset(0), fOffset(0),
58 fBranch(0), fBranchCount(0),
59 fLastTree(0), fRead(-1), fWhere(0),fCollection(0), fCurrentTreeNumber(-1)
63 if (name && strlen(name)) {
74 fDirector(boss), fInitialized(
false), fBranchName(top), fParent(parent),
75 fDataMember(membername), fIsMember(true), fIsClone(
false), fIsaPointer(
false),
76 fClassName(
""),
fClass(0), fElement(0), fMemberOffset(0), fOffset(0),
77 fBranch(0), fBranchCount(0),
78 fLastTree(0), fRead(-1), fWhere(0),fCollection(0), fCurrentTreeNumber(-1)
82 if (name && strlen(name)) {
92 fDirector(boss), fInitialized(
false), fBranchName(branch->GetName()), fParent(0),
93 fDataMember(membername), fIsMember(membername != 0 && membername[0]), fIsClone(
false), fIsaPointer(
false),
94 fClassName(
""),
fClass(0), fElement(0), fMemberOffset(0), fOffset(0),
95 fBranch(0), fBranchCount(0),
96 fLastTree(0), fRead(-1), fWhere(0),fCollection(0), fCurrentTreeNumber(-1)
120 fInitialized =
false;
124 fCurrentTreeNumber = -1;
131 std::cout <<
"fBranchName " << fBranchName << std::endl;
133 std::cout <<
"fBranch " << fBranch << std::endl;
134 if (fBranchCount) std::cout <<
"fBranchCount " << fBranchCount << std::endl;
143 if (!fDirector->GetTree()) {
148 if (!fParent->Setup()) {
158 Int_t i = fDirector->GetReadEntry();
159 if (i<0) fDirector->SetReadEntry(0);
160 if (fParent->Read()) {
161 if (i<0) fDirector->SetReadEntry(i);
166 if (clones) pcl = clones->
GetClass();
171 if (fCollection)
delete fCollection;
173 pcl = fCollection->GetValueClass();
176 Error(
"Setup",
"Not finding TClass for collecion for the data member %s seems no longer be in class %s",fDataMember.Data(),fParent->GetClass()->GetName());
183 Error(
"Setup",
"Data member %s seems no longer be in class %s",fDataMember.Data(),pcl->
GetName());
187 fIsaPointer = fElement->IsaPointer();
188 fClass = fElement->GetClassPointer();
193 fOffset = fMemberOffset = fElement->GetOffset();
195 fWhere = fParent->fWhere;
197 if (fParent->IsaPointer()) {
207 }
else if (!fBranch || fCurrentTreeNumber != fDirector->GetTree()->GetTreeNumber() || fLastTree != fDirector->GetTree()) {
211 fBranch = fDirector->GetTree()->GetBranch(fBranchName.Data());
212 if (!fBranch)
return false;
216 TLeaf *leaf = (
TLeaf*) fBranch->GetListOfLeaves()->At(0);
234 fWhere = (
double*)fBranch->GetAddress();
239 if (fDataMember.Length()) {
240 leaf2 = fBranch->GetLeaf(fDataMember);
242 }
else if (!fWhere) {
243 leaf2 = (
TLeaf*)fBranch->GetListOfLeaves()->At(0);
249 fBranch->SetAddress(0);
250 fWhere = (
double*)fBranch->GetAddress();
263 fIsaPointer = fElement->IsaPointer();
264 fClass = fElement->GetClassPointer();
275 if ( fIsMember && be->
GetType()==3 ) {
277 }
else if (fIsaPointer) {
278 clones = (
TClonesArray*)*(
void**)((
char*)fWhere+fOffset);
282 if (!fIsMember) fIsClone =
true;
287 fClass = fCollection->GetValueClass();
300 if (!fIsMember) fIsClone =
true;
317 }
else if (be->
GetType()==41) {
323 }
else if (be->
GetType()==31) {
336 fWhere = ((
unsigned char*)be->
GetObject()) + fOffset;
340 fClassName = fBranch->GetClassName();
378 TString bname = fBranch->GetName();
382 member = fDataMember;
387 if (fMemberOffset<0) {
388 Error(
"Setup",
"%s",
Form(
"Negative offset %d for %s in %s",
389 fMemberOffset,fBranch->GetName(),
390 bcount?bcount->
GetName():
"unknown"));
398 fMemberOffset = fElement->GetOffset();
404 member += fDataMember;
413 Error(
"Setup",
"%s",
Form(
"Missing TClass object for %s\n",fClassName.Data()));
419 fOffset = fMemberOffset;
423 fWhere = ((
unsigned char*)fWhere) + fMemberOffset;
431 fCollection->PushProxy( *(
void**)fWhere );
433 fCollection->PushProxy( fWhere );
436 fLastTree = fDirector->GetTree();
437 fCurrentTreeNumber = fLastTree->GetTreeNumber();
Describe Streamer information for one class version.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
TVirtualCollectionProxy * GetCollectionProxy()
Return the collection proxy describing the branch content, if any.
virtual void SetAddress(void *add)
Set address of this branch.
virtual Long64_t GetReadEntry() const
char * GetObject() const
Return a pointer to our object.
TBranch * GetBranch() const
ClassImp(TIterator) Bool_t TIterator return false
Compare two iterator objects.
Int_t GetElementOffset(Int_t id) const
TBranchElement * GetBranchCount() const
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
const TString fBranchName
TClass * fClass
pointer to the foreign object
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of a BranchElement and return total number of bytes.
ClassImp(ROOT::Detail::TBranchProxy)
virtual char * GetAddress() const
TObjArray * GetElements() const
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
TBranch * GetMother() const
Get our top-level parent branch in the tree.
char * Form(const char *fmt,...)
virtual const char * GetName() const
Returns name of object.
The ROOT global object gROOT contains a list of all defined classes.
virtual TLeaf * GetLeafCount() const
A Branch for the case of an object.
TString & Remove(Ssiz_t pos)
virtual TObjArray * GetElements() const =0
TClass * GetClass() const
Long_t GetDataMemberOffset(const char *membername) const
return offset for member name.
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
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.
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
An array of clone (identical) objects.
virtual void * GetValuePointer() const
TObject * At(Int_t idx) const
A TTree is a list of TBranches.
void Error(ErrorHandler_t func, int code, const char *va_(fmt),...)
Write error message and call a handler, if required.
virtual TVirtualCollectionProxy * Generate() const =0
void Attach(Detail::TBranchProxy *p)