28 fDirector(0), fInitialized(false), fIsMember(false), fIsClone(false), fIsaPointer(false),
29 fHasLeafCount(false), fBranchName(
""), fParent(0), fDataMember(
""),
30 fClassName(
""), fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
31 fBranch(0), fBranchCount(0),
33 fRead(-1), fWhere(0),fCollection(0)
40 fDirector(boss), fInitialized(false), fIsMember(false), fIsClone(false), fIsaPointer(false),
41 fHasLeafCount(false), fBranchName(top), fParent(0), fDataMember(
""),
42 fClassName(
""), fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
43 fBranch(0), fBranchCount(0),
45 fRead(-1), fWhere(0),fCollection(0)
57 fDirector(boss), fInitialized(false), fIsMember(true), fIsClone(false), fIsaPointer(false),
58 fHasLeafCount(false), fBranchName(top), fParent(0), fDataMember(membername),
59 fClassName(
""), fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
60 fBranch(0), fBranchCount(0),
62 fRead(-1), fWhere(0),fCollection(0)
77 fDirector(boss), fInitialized(false), fIsMember(true), fIsClone(false), fIsaPointer(false),
78 fHasLeafCount(false), fBranchName(top), fParent(parent), fDataMember(membername),
79 fClassName(
""), fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
80 fBranch(0), fBranchCount(0),
82 fRead(-1), fWhere(0),fCollection(0)
96 fDirector(boss), fInitialized(false), fIsMember(membername != 0 && membername[0]), fIsClone(false), fIsaPointer(false),
97 fHasLeafCount(false), fBranchName(branch->
GetName()), fParent(0), fDataMember(membername),
98 fClassName(
""), fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
99 fBranch(0), fBranchCount(0),
101 fRead(-1), fWhere(0),fCollection(0)
119 std::string sFullBranchName = fullBranchName;
120 std::string::size_type pos = sFullBranchName.rfind(branch->
GetFullName());
121 if (pos != std::string::npos) {
122 sFullBranchName.erase(pos);
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());
270 TLeaf *leaf = (
TLeaf*) fBranch->GetListOfLeaves()->At(0);
288 fWhere = (
double*)fBranch->GetAddress();
292 TLeaf *leaf2 =
nullptr;
293 if (fDataMember.Length()) {
294 leaf2 = fBranch->GetLeaf(fDataMember);
295 }
else if (!fWhere) {
296 leaf2 = (
TLeaf*)fBranch->GetListOfLeaves()->At(0);
301 fArrayLength = leaf2->
GetLen();
304 fHasLeafCount =
true;
311 fWhere = (
double*)fBranch->GetAddress();
322 fClassName =
"TClonesArray";
327 fIsaPointer = fElement->IsaPointer();
328 fClass = fElement->GetClassPointer();
339 if ( fIsMember && be->
GetType()==3 ) {
341 }
else if (fIsaPointer) {
342 clones = (
TClonesArray*)*(
void**)((
char*)fWhere+fOffset);
346 if (!fIsMember) fIsClone =
true;
348 }
else if (fClass && fClass->GetCollectionProxy()) {
355 if (fClass) fClassName = fClass->
GetName();
364 if (!fIsMember) fIsClone =
true;
381 }
else if (be->
GetType()==41) {
387 }
else if (be->
GetType()==31) {
400 fWhere = ((
unsigned char*)be->
GetObject()) + fOffset;
404 fClassName = fBranch->GetClassName();
446 member = fDataMember;
449 fMemberOffset = fClass->GetDataMemberOffset(member);
451 if (fMemberOffset<0) {
452 Error(
"Setup",
"%s",
Form(
"Negative offset %d for %s in %s",
453 fMemberOffset,fBranch->
GetName(),
454 bcount?bcount->
GetName():
"unknown"));
460 fClass->GetStreamerInfo()->GetElements()->FindObject(fDataMember);
462 fMemberOffset = fElement->GetOffset();
468 member += fDataMember;
469 fMemberOffset = fClass->GetDataMemberOffset(member);
477 Error(
"Setup",
"%s",
Form(
"Missing TClass object for %s\n",fClassName.Data()));
483 fOffset = fMemberOffset;
487 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 TString GetFullName() const
Return the 'full' name of the branch.
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
const char * Data() 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)