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());
47 auto FixTitle = [](
TNamed *obj) {
48 TString title = obj->GetTitle();
51 obj->SetTitle(title.
Data());
55 FixTitle(htemp->GetXaxis());
56 FixTitle(htemp->GetYaxis());
57 FixTitle(htemp->GetZaxis());
71 pos = expr.
First(
'[');
78 if (
name.First(
'@') != 0)
83 pos = expr.
Index(
".@");
88 if ((pos !=
kNPOS) && (pos > 1)) {
91 while ((pos > 0) && (expr[pos] !=
'.')) pos--;
111 if (
const_cast<TBranch *
>(tbranch)->GetListOfBranches()->GetEntriesFast() > 0)
129 if (tbranch && (tbranch->GetNleaves() == 1))
158 auto tleaf = obj->get_object<
TLeaf>();
165 return DrawTree(tleaf->GetBranch()->GetTree(), expr.Data(),
name.Data());
174 if (
const_cast<TBranchElement *
>(tbranch)->GetListOfBranches()->GetEntriesFast() > 0)
185 pos = mothername.
First(
'[');
191 if (mothername(
len-1) !=
'.') {
196 TString doublename = mothername;
198 Int_t isthere = (expr.
Index(doublename) == 0);
203 doublename.
Append(mothername);
204 isthere = (expr.
Index(doublename) == 0);
236 return DrawTree(tbranch->GetTree(), expr.Data(),
name.Data());
246 bool can_draw = (!cl || (cl->GetCollectionProxy() && cl->GetCollectionProxy()->GetType() > 0));
278 return DrawTree(browsable->GetBranch()->GetTree(), expr.Data(),
name.Data());
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Provider of different browsing methods for supported classes.
A Branch for the case of an object.
A TTree is a list of TBranches.
virtual TString GetFullName() const
Return the 'full' name of the branch.
virtual TBranch * FindBranch(const char *name)
Find the immediate sub-branch with passed name.
TBranch * GetMother() const
Get our top-level parent branch in the tree.
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.
bool GetDrawExpr(const TBranch *tbranch, TString &expr, TString &name)
bool GetDrawExpr(const TVirtualBranchBrowsable *browsable, TString &expr, TString &name)
TH1 * DrawBranch(const TBranch *tbranch)
TH1 * DrawBranch(std::unique_ptr< RHolder > &obj)
void AdjustExpr(TString &expr, TString &name)
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)
bool GetDrawExpr(const TBranchElement *tbranch, TString &expr, TString &name)
bool GetDrawExpr(const TLeaf *tleaf, TString &expr, TString &name)
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
TBranch * GetBranch() const
virtual TString GetFullName() const
Return the full name (including the parent's branch names) of the leaf.
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
TString & Insert(Ssiz_t pos, const char *s)
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Prepend(const char *cs)
TString & Remove(Ssiz_t pos)
TString & Append(const char *cs)
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
A TTree represents a columnar dataset.
void Draw(Option_t *opt) override
Default Draw method for all objects.
TVirtualBranchBrowsable is a base class (not really abstract, but useless by itself) for helper objec...
const TBranch * GetBranch() const
return the parent branch (might be many levels up)
void GetScope(TString &scope) const
Returns the full name for TTree::Draw to draw *this.
TClass * GetClassType() const
return the type of this browsable object