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)
121 std::string sFullBranchName = fullBranchName;
122 std::string::size_type pos = sFullBranchName.rfind(branch->
GetName());
123 if (pos != std::string::npos) {
124 sFullBranchName.erase(pos);
125 sFullBranchName += branch->
GetName();
127 return sFullBranchName;
133 fDirector(boss), fInitialized(false), fIsMember(membername != 0 && membername[0]), fIsClone(false), fIsaPointer(false),
134 fHasLeafCount(false), fBranchName(
GetFriendBranchName(boss->GetTree(), branch, branchname)), fParent(0), fDataMember(membername),
135 fClassName(
""), fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
136 fBranch(0), fBranchCount(0),
138 fRead(-1), fWhere(0),fCollection(0)
148 if (fNotify.IsLinked() && fDirector && fDirector->GetTree())
149 fNotify.RemoveLink(*(fDirector->GetTree()));
166 fInitialized =
false;
167 fHasLeafCount =
false;
176 std::cout <<
"fBranchName " << fBranchName << std::endl;
178 std::cout <<
"fBranch " << fBranch << std::endl;
179 if (fBranchCount) std::cout <<
"fBranchCount " << fBranchCount << std::endl;
188 if (!fDirector->GetTree()) {
191 if (!fNotify.IsLinked()) {
192 fNotify.PrependLink(*fDirector->GetTree());
196 if (!fParent->Setup()) {
206 Int_t i = fDirector->GetReadEntry();
207 if (i<0) fDirector->SetReadEntry(0);
208 if (fParent->Read()) {
209 if (i<0) fDirector->SetReadEntry(i);
214 if (clones) pcl = clones->
GetClass();
219 if (fCollection)
delete fCollection;
221 pcl = fCollection->GetValueClass();
224 Error(
"Setup",
"Not finding TClass for collecion for the data member %s seems no longer be in class %s",fDataMember.Data(),fParent->GetClass()->GetName());
232 fClass = fElement->GetClassPointer();
233 fMemberOffset = fElement->GetOffset();
234 fArrayLength = fElement->GetArrayLength();
236 Error(
"Setup",
"Data member %s seems no longer be in class %s",fDataMember.Data(),pcl->
GetName());
242 fWhere = fParent->fWhere;
244 if (fParent->IsaPointer()) {
258 fBranch = fDirector->GetTree()->GetBranch(fBranchName.Data());
272 TLeaf *leaf = (
TLeaf*) fBranch->GetListOfLeaves()->At(0);
290 fWhere = (
double*)fBranch->GetAddress();
294 TLeaf *leaf2 =
nullptr;
295 if (fDataMember.Length()) {
296 leaf2 = fBranch->GetLeaf(fDataMember);
297 }
else if (!fWhere) {
298 leaf2 = (
TLeaf*)fBranch->GetListOfLeaves()->At(0);
303 fArrayLength = leaf2->
GetLen();
306 fHasLeafCount =
true;
313 fWhere = (
double*)fBranch->GetAddress();
324 fClassName =
"TClonesArray";
329 fIsaPointer = fElement->IsaPointer();
330 fClass = fElement->GetClassPointer();
341 if ( fIsMember && be->
GetType()==3 ) {
343 }
else if (fIsaPointer) {
344 clones = (
TClonesArray*)*(
void**)((
char*)fWhere+fOffset);
348 if (!fIsMember) fIsClone =
true;
350 }
else if (fClass && fClass->GetCollectionProxy()) {
357 if (fClass) fClassName = fClass->
GetName();
366 if (!fIsMember) fIsClone =
true;
383 }
else if (be->
GetType()==41) {
389 }
else if (be->
GetType()==31) {
402 fWhere = ((
unsigned char*)be->
GetObject()) + fOffset;
406 fClassName = fBranch->GetClassName();
448 member = fDataMember;
451 fMemberOffset = fClass->GetDataMemberOffset(member);
453 if (fMemberOffset<0) {
454 Error(
"Setup",
"%s",
Form(
"Negative offset %d for %s in %s",
455 fMemberOffset,fBranch->
GetName(),
456 bcount?bcount->
GetName():
"unknown"));
462 fClass->GetStreamerInfo()->GetElements()->FindObject(fDataMember);
464 fMemberOffset = fElement->GetOffset();
470 member += fDataMember;
471 fMemberOffset = fClass->GetDataMemberOffset(member);
479 Error(
"Setup",
"%s",
Form(
"Missing TClass object for %s\n",fClassName.Data()));
485 fOffset = fMemberOffset;
489 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.
TClass instances represent classes, structs and namespaces in the ROOT type system.
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
TString & Remove(Ssiz_t pos)
A TTree represents a columnar dataset.
virtual Long64_t GetReadEntry() const
virtual TTree * GetTree() 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)