29 fDirector(0), fInitialized(false), fIsMember(false), fIsClone(false), fIsaPointer(false),
30 fHasLeafCount(false), fBranchName(
""), fParent(0), fDataMember(
""),
31 fClassName(
""),
fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
32 fBranch(0), fBranchCount(0),
34 fRead(-1), fWhere(0),fCollection(0)
41 fDirector(boss), fInitialized(false), fIsMember(false), fIsClone(false), fIsaPointer(false),
42 fHasLeafCount(false), fBranchName(top), fParent(0), fDataMember(
""),
43 fClassName(
""),
fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
44 fBranch(0), fBranchCount(0),
46 fRead(-1), fWhere(0),fCollection(0)
58 fDirector(boss), fInitialized(false), fIsMember(true), fIsClone(false), fIsaPointer(false),
59 fHasLeafCount(false), fBranchName(top), fParent(0), fDataMember(membername),
60 fClassName(
""),
fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
61 fBranch(0), fBranchCount(0),
63 fRead(-1), fWhere(0),fCollection(0)
78 fDirector(boss), fInitialized(false), fIsMember(true), fIsClone(false), fIsaPointer(false),
79 fHasLeafCount(false), fBranchName(top), fParent(parent), fDataMember(membername),
80 fClassName(
""),
fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
81 fBranch(0), fBranchCount(0),
83 fRead(-1), fWhere(0),fCollection(0)
97 fDirector(boss), fInitialized(false), fIsMember(membername != 0 && membername[0]), fIsClone(false), fIsaPointer(false),
98 fHasLeafCount(false), fBranchName(branch->GetName()), fParent(0), fDataMember(membername),
99 fClassName(
""),
fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
100 fBranch(0), fBranchCount(0),
102 fRead(-1), fWhere(0),fCollection(0)
120 std::string sFullBranchName = fullBranchName;
121 std::string::size_type pos = sFullBranchName.rfind(branch->
GetFullName());
122 if (pos != std::string::npos) {
123 sFullBranchName.erase(pos);
126 return sFullBranchName;
132 fDirector(boss), fInitialized(false), fIsMember(membername != 0 && membername[0]), fIsClone(false), fIsaPointer(false),
133 fHasLeafCount(false), fBranchName(
GetFriendBranchName(boss->GetTree(), branch, branchname)), fParent(0), fDataMember(membername),
134 fClassName(
""),
fClass(0), fElement(0), fMemberOffset(0), fOffset(0), fArrayLength(1),
135 fBranch(0), fBranchCount(0),
137 fRead(-1), fWhere(0),fCollection(0)
147 if (fNotify.IsLinked() && fDirector && fDirector->GetTree())
148 fNotify.RemoveLink(*(fDirector->GetTree()));
165 fInitialized =
false;
166 fHasLeafCount =
false;
175 std::cout <<
"fBranchName " << fBranchName << std::endl;
177 std::cout <<
"fBranch " << fBranch << std::endl;
178 if (fBranchCount) std::cout <<
"fBranchCount " << fBranchCount << std::endl;
187 if (!fDirector->GetTree()) {
190 if (!fNotify.IsLinked()) {
191 fNotify.PrependLink(*fDirector->GetTree());
195 if (!fParent->Setup()) {
205 Int_t i = fDirector->GetReadEntry();
206 if (i<0) fDirector->SetReadEntry(0);
207 if (fParent->Read()) {
208 if (i<0) fDirector->SetReadEntry(i);
213 if (clones) pcl = clones->
GetClass();
218 if (fCollection)
delete fCollection;
220 pcl = fCollection->GetValueClass();
223 Error(
"Setup",
"Not finding TClass for collecion for the data member %s seems no longer be in class %s",fDataMember.Data(),fParent->GetClass()->GetName());
231 fClass = fElement->GetClassPointer();
232 fMemberOffset = fElement->GetOffset();
233 fArrayLength = fElement->GetArrayLength();
235 Error(
"Setup",
"Data member %s seems no longer be in class %s",fDataMember.Data(),pcl->
GetName());
241 fWhere = fParent->fWhere;
243 if (fParent->IsaPointer()) {
257 fBranch = fDirector->GetTree()->GetBranch(fBranchName.Data());
271 TLeaf *leaf = (
TLeaf*) fBranch->GetListOfLeaves()->At(0);
289 fWhere = (
double*)fBranch->GetAddress();
293 TLeaf *leaf2 =
nullptr;
294 if (fDataMember.Length()) {
295 leaf2 = fBranch->GetLeaf(fDataMember);
296 }
else if (!fWhere) {
297 leaf2 = (
TLeaf*)fBranch->GetListOfLeaves()->At(0);
302 fArrayLength = leaf2->
GetLen();
305 fHasLeafCount =
true;
311 fBranch->SetupAddresses();
312 fWhere = (
double*)fBranch->GetAddress();
323 fClassName =
"TClonesArray";
328 fIsaPointer = fElement->IsaPointer();
329 fClass = fElement->GetClassPointer();
340 if ( fIsMember && be->
GetType()==3 ) {
342 }
else if (fIsaPointer) {
343 clones = (
TClonesArray*)*(
void**)((
char*)fWhere+fOffset);
347 if (!fIsMember) fIsClone =
true;
351 fCollection =
fClass->GetCollectionProxy()->Generate();
352 fClass = fCollection->GetValueClass();
365 if (!fIsMember) fIsClone =
true;
382 }
else if (be->
GetType()==41) {
388 }
else if (be->
GetType()==31) {
401 fWhere = ((
unsigned char*)be->
GetObject()) + fOffset;
406 fClassName = fBranch->GetClassName();
409 fClassName = fBranch->GetClassName();
450 member = fDataMember;
453 fMemberOffset =
fClass->GetDataMemberOffset(member);
455 if (fMemberOffset<0) {
456 Error(
"Setup",
"%s",
Form(
"Negative offset %d for %s in %s",
457 fMemberOffset,fBranch->
GetName(),
458 bcount?bcount->
GetName():
"unknown"));
464 fClass->GetStreamerInfo()->GetElements()->FindObject(fDataMember);
466 fMemberOffset = fElement->GetOffset();
472 member += fDataMember;
473 fMemberOffset =
fClass->GetDataMemberOffset(member);
481 Error(
"Setup",
"%s",
Form(
"Missing TClass object for %s\n",fClassName.Data()));
487 fOffset = fMemberOffset;
491 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, Bool_t isTransient=kFALSE) 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...
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 TVirtualCollectionProxy * Generate() const =0
virtual TStreamerElement * GetStreamerElement(const char *datamember, Int_t &offset) const =0