30 fDirector(0), fInitialized(false), fIsMember(false), fIsClone(false), fIsaPointer(false),
31 fHasLeafCount(false), fBranchName(
""), fParent(0), fDataMember(
""),
32 fClassName(
""), fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
33 fBranch(0), fBranchCount(0),
35 fRead(-1), fWhere(0),fCollection(0)
42 fDirector(boss), fInitialized(false), fIsMember(false), fIsClone(false), fIsaPointer(false),
43 fHasLeafCount(false), fBranchName(top), fParent(0), fDataMember(
""),
44 fClassName(
""), fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
45 fBranch(0), fBranchCount(0),
47 fRead(-1), fWhere(0),fCollection(0)
59 fDirector(boss), fInitialized(false), fIsMember(true), fIsClone(false), fIsaPointer(false),
60 fHasLeafCount(false), fBranchName(top), fParent(0), fDataMember(membername),
61 fClassName(
""), fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
62 fBranch(0), fBranchCount(0),
64 fRead(-1), fWhere(0),fCollection(0)
79 fDirector(boss), fInitialized(false), fIsMember(true), fIsClone(false), fIsaPointer(false),
80 fHasLeafCount(false), fBranchName(top), fParent(parent), fDataMember(membername),
81 fClassName(
""), fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
82 fBranch(0), fBranchCount(0),
84 fRead(-1), fWhere(0),fCollection(0)
98 fDirector(boss), fInitialized(false), fIsMember(membername != 0 && membername[0]), fIsClone(false), fIsaPointer(false),
99 fHasLeafCount(false), fBranchName(branch->
GetName()), fParent(0), fDataMember(membername),
100 fClassName(
""), fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
101 fBranch(0), fBranchCount(0),
103 fRead(-1), fWhere(0),fCollection(0)
115 if (directorTree == branch->
GetTree())
119 std::string sFullBranchName = fullBranchName;
120 std::string::size_type pos = sFullBranchName.rfind(branch->
GetName());
121 if (pos != std::string::npos) {
122 sFullBranchName.erase(pos);
123 sFullBranchName += branch->
GetName();
125 return sFullBranchName;
131 fDirector(boss), fInitialized(false), fIsMember(membername != 0 && membername[0]), fIsClone(false), fIsaPointer(false),
132 fHasLeafCount(false), fBranchName(
GetFriendBranchName(boss->GetTree(), branch, branchname)), fParent(0), fDataMember(membername),
133 fClassName(
""), fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
134 fBranch(0), fBranchCount(0),
136 fRead(-1), fWhere(0),fCollection(0)
146 if (fNotify.IsLinked() && fDirector && fDirector->GetTree())
147 fNotify.RemoveLink(*(fDirector->GetTree()));
164 fInitialized =
false;
165 fHasLeafCount =
false;
174 std::cout <<
"fBranchName " << fBranchName << std::endl;
176 std::cout <<
"fBranch " << fBranch << std::endl;
177 if (fBranchCount) std::cout <<
"fBranchCount " << fBranchCount << std::endl;
186 if (!fDirector->GetTree()) {
189 if (!fNotify.IsLinked()) {
190 fNotify.PrependLink(*fDirector->GetTree());
194 if (!fParent->Setup()) {
204 Int_t i = fDirector->GetReadEntry();
205 if (i<0) fDirector->SetReadEntry(0);
206 if (fParent->Read()) {
207 if (i<0) fDirector->SetReadEntry(i);
212 if (clones) pcl = clones->
GetClass();
217 if (fCollection)
delete fCollection;
219 pcl = fCollection->GetValueClass();
222 Error(
"Setup",
"Not finding TClass for collecion for the data member %s seems no longer be in class %s",fDataMember.Data(),fParent->GetClass()->GetName());
230 fClass = fElement->GetClassPointer();
231 fMemberOffset = fElement->GetOffset();
232 fArrayLength = fElement->GetArrayLength();
234 Error(
"Setup",
"Data member %s seems no longer be in class %s",fDataMember.Data(),pcl->
GetName());
240 fWhere = fParent->fWhere;
242 if (fParent->IsaPointer()) {
256 fBranch = fDirector->GetTree()->GetBranch(fBranchName.Data());
257 if (!fBranch)
return false;
261 TLeaf *leaf = (
TLeaf*) fBranch->GetListOfLeaves()->At(0);
279 fWhere = (
double*)fBranch->GetAddress();
283 TLeaf *leaf2 =
nullptr;
284 if (fDataMember.Length()) {
285 leaf2 = fBranch->GetLeaf(fDataMember);
286 }
else if (!fWhere) {
287 leaf2 = (
TLeaf*)fBranch->GetListOfLeaves()->At(0);
292 fArrayLength = leaf2->
GetLen();
295 fHasLeafCount =
true;
302 fWhere = (
double*)fBranch->GetAddress();
313 fClassName =
"TClonesArray";
318 fIsaPointer = fElement->IsaPointer();
319 fClass = fElement->GetClassPointer();
330 if ( fIsMember && be->
GetType()==3 ) {
332 }
else if (fIsaPointer) {
333 clones = (
TClonesArray*)*(
void**)((
char*)fWhere+fOffset);
337 if (!fIsMember) fIsClone =
true;
339 }
else if (fClass && fClass->GetCollectionProxy()) {
346 if (fClass) fClassName = fClass->
GetName();
355 if (!fIsMember) fIsClone =
true;
372 }
else if (be->
GetType()==41) {
378 }
else if (be->
GetType()==31) {
391 fWhere = ((
unsigned char*)be->
GetObject()) + fOffset;
395 fClassName = fBranch->GetClassName();
433 TString bname = fBranch->
GetName();
434 TString bcname = bcount->
GetName();
435 member = bname.Remove(0,bcname.Length()+1);
437 member = fDataMember;
440 fMemberOffset = fClass->GetDataMemberOffset(member);
442 if (fMemberOffset<0) {
443 Error(
"Setup",
"%s",
Form(
"Negative offset %d for %s in %s",
444 fMemberOffset,fBranch->
GetName(),
445 bcount?bcount->
GetName():
"unknown"));
451 fClass->GetStreamerInfo()->GetElements()->FindObject(fDataMember);
453 fMemberOffset = fElement->GetOffset();
459 member += fDataMember;
460 fMemberOffset = fClass->GetDataMemberOffset(member);
468 Error(
"Setup",
"%s",
Form(
"Missing TClass object for %s\n",fClassName.Data()));
474 fOffset = fMemberOffset;
478 fWhere = ((
unsigned char*)fWhere) + fMemberOffset;
static std::string GetFriendBranchName(TTree *directorTree, TBranch *branch, const char *fullBranchName)
For a fullBranchName that might contain a leading friend tree path (but access elements designating a...
void Error(const char *location, const char *msgfmt,...)
char * Form(const char *fmt,...)
Base class for all the proxy object.
const TString fBranchName
void Attach(Detail::TBranchProxy *p)
A Branch for the case of an object.
TBranchElement * GetBranchCount() const
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
TVirtualCollectionProxy * GetCollectionProxy()
Return the collection proxy describing the branch content, if any.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of a BranchElement and return total number of bytes.
char * GetObject() const
Return a pointer to our object.
A TTree is a list of TBranches.
virtual char * GetAddress() const
virtual void SetAddress(void *add)
Set address of this branch.
TBranch * GetMother() const
Get our top-level parent branch in the tree.
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,...
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (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.
An array of clone (identical) objects.
TClass * GetClass() const
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual void * GetValuePointer() const
virtual Int_t GetLen() const
Return the number of effective elements of this leaf, for the current entry.
virtual TLeaf * GetLeafCount() const
If this leaf stores a variable-sized array or a multi-dimensional array whose last dimension has vari...
virtual void SetAddress(void *add=0)
TBranch * GetBranch() const
virtual const char * GetName() const
Returns name of object.
TObject * At(Int_t idx) const
virtual Bool_t IsaPointer() const
Describe Streamer information for one class version.
TObjArray * GetElements() const
Int_t GetElementOffset(Int_t id) const
virtual TClass * GetValueClass() const =0
virtual TVirtualCollectionProxy * Generate() const =0
virtual TStreamerElement * GetStreamerElement(const char *datamember, Int_t &offset) const =0
std::string GetName(const std::string &scope_name)