62 long long millisec =
gSystem->Now();
95 std::string expr2 = expr +
">>htemp_tree_draw";
98 std::unique_ptr<TTreeDrawMonitoring> monitoring;
101 monitoring = std::make_unique<TTreeDrawMonitoring>(50, ttree,
fHandle2);
105 ttree->
Draw(expr2.c_str(),
"",
"goff");
112 auto htemp =
dynamic_cast<TH1*
>(
gDirectory->FindObject(
"htemp_tree_draw"));
118 htemp->SetName(hname.c_str());
120 auto FixTitle = [](
TNamed *obj) {
121 TString title = obj->GetTitle();
122 title.ReplaceAll(
"\\/",
"/");
123 title.ReplaceAll(
"#",
"\\#");
124 obj->SetTitle(title.Data());
128 FixTitle(htemp->GetXaxis());
129 FixTitle(htemp->GetYaxis());
130 FixTitle(htemp->GetZaxis());
132 htemp->BufferEmpty();
151 if (
name.First(
'@') != 0)
164 while ((
pos > 0) && (expr[
pos] !=
'.'))
pos--;
184 if (
const_cast<TBranch *
>(tbranch)->GetListOfBranches()->GetEntriesFast() > 0)
202 if (tbranch && (tbranch->GetNleaves() == 1))
233 auto tleaf = obj->get_object<
TLeaf>();
240 return DrawTree(tleaf->GetBranch()->GetTree(), expr.Data(),
name.Data());
249 if (
const_cast<TBranchElement *
>(tbranch)->GetListOfBranches()->GetEntriesFast() > 0)
266 if (mothername(len-1) !=
'.') {
271 TString doublename = mothername;
273 Int_t isthere = (expr.
Index(doublename) == 0);
278 doublename.
Append(mothername);
279 isthere = (expr.
Index(doublename) == 0);
313 return DrawTree(tbranch->GetTree(), expr.Data(),
name.Data());
323 bool can_draw = (!cl || (cl->GetCollectionProxy() && cl->GetCollectionProxy()->GetType() > 0));
355 return DrawTree(browsable->GetBranch()->GetTree(), expr.Data(),
name.Data());
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
static unsigned int total
externTVirtualMonitoringWriter * gMonitoringWriter
Provider of different browsing methods for supported classes.
static bool ReportProgress(void *handle, float progress)
Report running progress Returns true if handling function was invoked Method can be used to detect if...
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.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
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.
void * fHandle2
! used only for reporting progress
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
TTreeDrawMonitoring & operator=(const TTreeDrawMonitoring &)=delete
Bool_t SendFileReadProgress(TFile *) override
TTreeDrawMonitoring(const TTreeDrawMonitoring &)=delete
Bool_t SendFileWriteProgress(TFile *) override
Bool_t SendInfoStatus(const char *) override
TTreeDrawMonitoring(Int_t period, TTree *tree, void *handle2)
Bool_t SendProcessingStatus(const char *, Bool_t=kFALSE) override
Bool_t SendParameters(TList *, const char *=nullptr) override
Bool_t SendFileOpenProgress(TFile *, TList *, const char *, Bool_t=kFALSE) override
Bool_t SendProcessingProgress(Double_t nevent, Double_t, Bool_t=kFALSE) override
Bool_t SendFileCloseEvent(TFile *) override
void SetLogLevel(const char *="WARNING") override
long long fLastProgressSendTm
Bool_t SendInfoTime() override
Bool_t SendInfoDescription(const char *) override
void Verbose(Bool_t) override
Bool_t SendInfoUser(const char *=nullptr) override
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
TVirtualMonitoringWriter(const TVirtualMonitoringWriter &)=delete