32 std::string expr2 = expr +
">>htemp_tree_draw";
34 ttree->
Draw(expr2.c_str(),
"",
"goff");
39 auto htemp =
dynamic_cast<TH1*
>(
gDirectory->FindObject(
"htemp_tree_draw"));
45 htemp->SetName(hname.c_str());
54 auto tleaf = obj->get_object<
TLeaf>();
58 return DrawTree(tleaf->GetBranch()->GetTree(), tleaf->GetName(), tleaf->GetName());
63 auto tbranch = obj->get_object<
TBranch>();
68 if (tbranch->GetNleaves() > 1)
85 if (tbranch->GetListOfBranches()->GetEntriesFast() > 0)
95 if (tbranch->GetMother()) {
96 TString mothername = tbranch->GetMother()->GetName();
97 pos = mothername.
First(
'[');
103 if (mothername(len-1) !=
'.') {
108 TString doublename = mothername;
110 Int_t isthere = (
name.Index(doublename) == 0);
112 name.Prepend(doublename);
114 if (tbranch->GetMother()->FindBranch(mothername)) {
115 doublename.
Append(mothername);
116 isthere = (
name.Index(doublename) == 0);
137 return DrawTree(tbranch->GetTree(),
name.Data(), tbranch->GetName());
148 bool can_draw = (!cl || (cl->GetCollectionProxy() && cl->GetCollectionProxy()->GetType() > 0));
152 auto br = browsable->GetBranch();
157 browsable->GetScope(
name);
165 return DrawTree(br->GetTree(),
name.Data(), browsable->GetName());
Provider of different browsing methods for supported classes.
A Branch for the case of an object.
A TTree is a list of TBranches.
TH1 is the base class of all histogram classes in ROOT.
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
Provider for drawing of branches / leafs in the TTree.
TH1 * DrawBranch(std::unique_ptr< RHolder > &obj)
TH1 * DrawBranchBrowsable(std::unique_ptr< RHolder > &obj)
TH1 * DrawBranchElement(std::unique_ptr< RHolder > &obj)
TH1 * DrawTree(TTree *ttree, const std::string &expr, const std::string &hname)
TH1 * DrawLeaf(std::unique_ptr< RHolder > &obj)
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Ssiz_t First(char c) const
Find first occurrence of a character c.
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Prepend(const char *cs)
TString & Remove(Ssiz_t pos)
TString & Append(const char *cs)
A TTree represents a columnar dataset.
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
TVirtualBranchBrowsable is a base class (not really abstract, but useless by itself) for helper objec...
TClass * GetClassType() const
return the type of this browsable object