36bool AreThereSubBranches(std::string_view parentBrName,
TTree &tree)
38 const std::string prefix = [&parentBrName]() {
39 if (parentBrName.back() ==
'.')
40 return std::string(parentBrName);
41 return std::string(parentBrName) +
'.';
48 if (prefix.compare(0, prefix.size(), leaf->GetName(), prefix.size()) == 0)
80 ((TString&)fBranchName).Append(
".");
154 std::string sFullBranchName = fullBranchName;
155 std::string::size_type
pos = sFullBranchName.rfind(branch->
GetFullName());
156 if (
pos != std::string::npos) {
157 sFullBranchName.erase(
pos);
160 return sFullBranchName;
168 const char *membername,
bool suppressMissingBranchError)
171 fIsMember(membername != nullptr && membername[0]),
232 std::cout <<
"fBranchName " <<
fBranchName << std::endl;
234 std::cout <<
"fBranch " <<
fBranch << std::endl;
236 std::cout <<
"fLeafCount " <<
fLeafCount << std::endl;
238 std::cout <<
"fBranchCount " <<
fBranchCount << std::endl;
275 if (clones) pcl = clones->
GetClass();
283 if (pcl ==
nullptr) {
285 Error(
"Setup",
"Not finding TClass for collection for the data member %s seems no longer be in class %s",
fDataMember.Data(),
fParent->GetClass()->GetName());
329 auto *tree =
fDirector->GetTree()->GetTree();
330 Error(
"TBranchProxy::Setup()",
"%s",
331 Form(
"Branch '%s' is not available from tree '%s' in file '%s'.",
fBranchName.Data(),
350 TLeaf *leaf2 =
nullptr;
450 }
else if (be->
GetType()==41) {
456 }
else if (be->
GetType()==31) {
524 Error(
"Setup",
"%s",
Form(
"Negative offset %d for %s in %s",
526 bcount?bcount->
GetName():
"unknown"));
530 Form(
"Missing data member in a TClonesArray, %s in %s and %s",
fDataMember.Data(),
int Int_t
Signed integer 4 bytes (int).
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...
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Base class for all the proxy object.
TNotifyLink< TBranchProxy > fNotify
Internal::TBranchProxyDirector * fDirector
TVirtualCollectionProxy * fCollection
const TString fBranchName
bool fSuppressMissingBranchError
TBranchElement * fBranchCount
const TString fDataMember
bool Setup()
Initialize/cache the necessary information.
void Reset()
Completely reset the object.
TBranchProxy()
Constructor.
virtual void Print()
Display the content of the object.
TStreamerElement * fElement
virtual ~TBranchProxy()
Typical Destructor.
void Attach(Detail::TBranchProxy *p)
Attach a TBranchProxy object to this director.
A Branch for the case of an object.
TBranchElement * GetBranchCount() const
const char * GetClassName() const override
Return the name of the user class whose content is stored in this branch, if any.
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
TVirtualCollectionProxy * GetCollectionProxy()
Return the collection proxy describing the branch content, if any.
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
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 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.
Int_t Size() const
Return size of object of this class.
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 GetLenType() 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
const char * GetName() const override
Returns name of object.
TObject * At(Int_t idx) const override
Describe one element (data member) to be Streamed.
Describes a persistent version of a class.
Int_t GetElementOffset(Int_t id) const override
TObjArray * GetElements() const override
const char * Data() const
TString & Remove(Ssiz_t pos)
A TTree represents a columnar dataset.
virtual TObjArray * GetListOfLeaves()
virtual Long64_t GetReadEntry() const
virtual TTree * GetTree() const
virtual TVirtualCollectionProxy * Generate() const =0
Returns a clean object of the actual class that derives from TVirtualCollectionProxy.
virtual TStreamerElement * GetStreamerElement(const char *datamember, Int_t &offset) const =0
std::vector< std::string > GetTreeFullPaths(const TTree &tree)
Retrieve the full path(s) to a TTree or the trees in a TChain.
std::vector< std::string > GetFileNamesFromTree(const TTree &tree)
Get and store the file names associated with the input tree.
TRangeCast< T, false > TRangeStaticCast
TRangeStaticCast is an adapter class that allows the typed iteration through a TCollection.
if(pos!=-1) leafTypeName.Remove(pos)