115 const char *varexp0 = obj ? obj->
GetTitle() :
"";
117 const char *selection = obj ? obj->
GetTitle() :
"";
121 char *hdefault = (
char *)
"htemp";
130 bool profile =
false;
131 bool optSame =
false;
132 bool optEnlist =
false;
133 bool optEnlistArray =
false;
134 bool optpara =
false;
135 bool optcandle =
false;
143 if (opt.
Contains(
"entrylistarray")) {
144 optEnlistArray =
true;
162 TCut realSelection(selection);
166 if (evlist && inElist) {
181 realSelection *= inElist->
GetTitle();
194 bool canExtend =
true;
195 if (optSame) canExtend =
false;
197 Int_t nbinsx = 0, nbinsy = 0, nbinsz = 0;
201 char *hname =
nullptr;
204 if (varexp0 && strlen(varexp0)) {
205 for (
UInt_t k = strlen(varexp0) - 1; k > 0; k--) {
206 if (varexp0[k] ==
'>' && varexp0[k-1] ==
'>') {
207 i = (
int)(&(varexp0[k-1]) - varexp0);
208 hnamealloc = &(varexp0[k+1]);
209 hname = (
char *) hnamealloc.
Data();
217 bool hnameplus =
false;
218 while (*hname ==
' ') hname++;
222 while (*hname ==
' ') hname++;
224 j = strlen(hname) - 1;
226 if (hname[j] !=
' ')
break;
232 varexp = std::string(varexp0, i);
234 Int_t mustdelete = 0;
251 const Int_t maxvalues = 9;
253 pstart = strchr(hname,
'(');
254 pend = strchr(hname,
')');
255 if (pstart !=
nullptr) {
260 if (pstart == strrchr(hname,
'(') && pend == strrchr(hname,
')')) {
265 cdummy = strchr(&cdummy[1],
',');
266 while (cdummy !=
nullptr) {
267 cdummy = strchr(&cdummy[1],
',');
271 if (ncomma + 1 > maxvalues) {
272 Error(
"DrawSelect",
"ncomma+1>maxvalues, ncomma=%d, maxvalues=%d", ncomma, maxvalues);
273 ncomma = maxvalues - 1;
281 for (j = 0; j < i; j++) {
283 && !((j > 0 && varexp[j-1] ==
':') || varexp[j+1] ==
':')
286 }
else if (varexp[j] ==
'?') {
292 Error(
"DrawSelect",
"ncols > 3, ncols=%d", ncols);
297 if (ncols * 3 < ncomma) {
298 Error(
"DrawSelect",
"ncols*3 < ncomma ncols=%d, ncomma=%d", ncols, ncomma);
303 for (j = 0; j < ncomma; j++) {
305 if (sscanf(cdummy,
" %lf ", &
value) == 1) {
306 cdummy = strchr(&cdummy[1],
',');
313 }
else if (ncols < 3) {
330 if (ncols < 3)
gEnv->
SetValue(
"Hist.Binning.2D.y", nbinsy);
353 Error(
"DrawSelect",
"j>8");
359 Error(
"Begin",
"Two open or close brackets found, hname=%s", hname);
366 j = strlen(hname) - 1;
368 if (hname[j] !=
' ')
break;
377 abrt.
Form(
"An object of type '%s' has the same name as the requested histo (%s)", oldObject->
IsA()->
GetName(), hname);
383 "TTree::Draw was asked to fill the histogram '%s', but it was not found in the current directory."
384 "Did you forget to call histogram->SetDirectory(gDirectory) or similar?",
391 Warning(
"Begin",
"Deleting old histogram, since (possibly new) limits and binnings have been given");
401 enlist = oldObject ?
dynamic_cast<TEntryList*
>(oldObject) :
nullptr;
403 if (!enlist && oldObject) {
404 abrt.
Form(
"An object of type '%s' has the same name as the requested event list (%s)",
413 "TTree::Draw was asked to append to TEntryList '%s', but it was not found in the current "
415 "Did you forget to call entryList->SetDirectory(gDirectory) or similar? Creating a new list now.",
418 if (optEnlistArray) {
427 if (enlist == inElist) {
430 if (optEnlistArray) {
449 evlist = oldObject ?
dynamic_cast<TEventList*
>(oldObject) :
nullptr;
451 if (!evlist && oldObject) {
452 abrt.
Form(
"An object of type '%s' has the same name as the requested event list (%s)",
461 "TTree::Draw was asked to append to TEventList '%s', but it was not found in the current "
463 "Did you forget to call eventList->SetDirectory(gDirectory) or similar? Creating a new list now.",
474 Abort(
"Input and output lists are the same!");
500 abrt.
Form(
"Variable compilation failed: {%s,%s}", varexp.c_str(), realSelection.
GetTitle());
505 Abort(
"Too many variables. Use the option \"para\", \"gl5d\" or \"candle\" to display more than 4 variables.");
508 if (
fDimension < 2 && (optpara || optcandle)) {
509 Abort(
"The options \"para\" and \"candle\" require at least 2 variables.");
514 Int_t nsel = strlen(selection);
516 htitle.
Form(
"%s {%s}", varexp.c_str(), selection);
522 Int_t mustdelete = 0;
533 if (!profile || olddim !=
fDimension) mustdelete = 1;
540 Warning(
"Begin",
"Deleting old histogram with different dimensions");
549 gROOT->MakeDefCanvas();
551 Abort(
"Creation of default canvas failed");
562 if (
gPad && optSame) {
565 TH1 *oldhtemp =
nullptr;
566 while ((op =
np()) && !oldhtemp) {
615 }
else if (
fDimension == 2 && !(optpara || optcandle)) {
647 if (profile || opt.
Contains(
"prof")) {
729 if (
l == 0 || optSame) graph =
true;
733 if (opt.
Contains(
"box")) graph =
false;
771 Error(
"Begin",
"You cannot use option same when no 3D view exists");
876 h3 =
new TH3F(hname, htitle.
Data(),
fNbins[2],
fVmin[2],
fVmax[2],
fNbins[1],
fVmin[1],
fVmax[1],
fNbins[0],
fVmin[0],
fVmax[0]);
878 h3 =
new TH3D(hname, htitle.
Data(),
fNbins[2],
fVmin[2],
fVmax[2],
fNbins[1],
fVmin[1],
fVmax[1],
fNbins[0],
fVmin[0],
fVmax[0]);
909 if (optSame) noscat -= 4;
926 }
else if (optcandle || optpara || opt5d) {
1006 if (strlen(selection)) {
1017 nch = strlen(varexp);
1036 std::vector<TString> varnames;
1044 for (i = 0; i < ncols; ++i) {
1128 for (
Int_t i = 0; i < oldsize; ++i)
1149 bool ternary =
false;
1152 if (varexp[i] ==
':'
1153 && !((i > 0 && varexp[i-1] ==
':') || varexp[i+1] ==
':')
1158 names.push_back(varexp(prev, i - prev));
1162 if (varexp[i] ==
'?') {
1166 names.push_back(varexp(prev, varexp.
Length() - prev));
1167 return names.size();
1270 for (
Int_t i = 1; i < ndata; i++) {
1273 if (subList && !subList->
Contains(i))
1278 if (ww == 0)
continue;
1319 for (
Int_t i = 0; i < ndata; i++) {
1328 if (ww == 0)
continue;
1343 if (nextbit >= nbits)
break;
1354 "Not implemented for %s",
1355 cl ? cl->
GetName() :
"unknown class");
1379 delete []
fW;
fW =
nullptr;
1406 enlist->
Enter(enumb);
1417 for (i = 0; i <
fNfill; i++) {
1456 for (i = 0; i <
fNfill; i++) {
1478 for (col = 0; col < ncolors; col++) {
1490 for (i = 0; i <
fNfill; i++) {
1492 if (col < 0) col = 0;
1493 if (col > ncolors - 1) col = ncolors - 1;
1498 for (col = 0; col < ncolors; col++) {
1525 for (col = 0; col < ncolors; col++) {
1530 pms->
AddAt(pm3d, col);
1536 for (i = 0; i <
fNfill; i++) {
1538 if (col > ncolors-1) col = ncolors-1;
1539 if (col < 0) col = 0;
1550 gROOT->ProcessLine(
TString::Format(
"TParallelCoord::BuildParallelCoord((TSelectorDraw*)0x%zx,0x%zx)",
1551 (
size_t)
this, (
size_t)candle));
1580 for (i = 0; i <
fValSize && i < 4; i++) {
1581 vminOld[i] =
fVmin[i];
1582 vmaxOld[i] =
fVmax[i];
1586 fVmax[i] = - DBL_MAX;
1592 for (i = 0; i <
fNfill; i++) {
1603 for (i = 0; i <
fNfill; i++) {
1616 for (i = 0; i <
fNfill; i++) {
1629 for (i = 0; i <
fNfill; i++) {
1704 bool process2 =
false;
1706 if (vminOld[2] == DBL_MAX)
1708 for (i = 0; i <
fValSize && i < 4; i++) {
1709 fVmin[i] = vminOld[i];
1710 fVmax[i] = vmaxOld[i];
1712 for (i = 0; i <
fNfill; i++) {
1735 for (i = 0; i <
fNfill; i++) {
1744 for (i = 0; i <
fNfill; i++) {
1778 gPad->Range(-1, -1, 1, 1);
1785 for (i = 0; i <
fNfill; i++) {
1797 for (i = 0; i <
fNfill; i++) {
1812 for (i = 0; i <
fValSize && i < 4; i++) {
1813 fVmin[i] = vminOld[i];
1814 fVmax[i] = vmaxOld[i];
1816 for (i = 0; i <
fNfill; i++) {
1829 for (i = 0; i <
fNfill; i++) {
1854 if (
fNfill && fNfill < fTree->GetEstimate())
int Int_t
Signed integer 4 bytes (int)
long long Long64_t
Portable signed long integer 8 bytes.
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 np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
const Int_t kCustomHistogram
R__EXTERN TStyle * gStyle
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
virtual Float_t GetTitleOffset() const
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual Size_t GetMarkerSize() const
Return the marker size.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Class to manage histogram axis.
virtual Int_t FindFixBin(Double_t x) const
Find bin number corresponding to abscissa x
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Int_t GetFirst() const
Return first bin on the axis i.e.
UInt_t FirstSetBit(UInt_t startBit=0) const
Return position of first non null bit (starting from position 0 and up)
TClass instances represent classes, structs and namespaces in the ROOT type system.
void SetName(const char *name)
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
static void InitializeColors()
Initialize colors used by the TCanvas based graphics (via TColor objects).
A specialized string object used for TTree selections.
A list of entries and subentries in a TTree or TChain.
virtual TEntryListArray * GetSubListForEntry(Long64_t entry, TTree *tree=nullptr)
Return the list holding the subentries for the given entry or 0.
virtual bool Enter(Long64_t entry, TTree *tree, Long64_t subentry)
Add entry #entry (, #subentry) to the list.
A List of entry numbers in a TTree or TChain.
virtual bool Enter(Long64_t entry, TTree *tree=nullptr)
Add entry #entry to the list.
virtual Int_t Contains(Long64_t entry, TTree *tree=nullptr)
virtual void SetDirectory(TDirectory *dir)
Add reference to directory dir. dir can be 0.
virtual void Reset()
Reset this list.
virtual bool GetReapplyCut() const
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
Set the value of a resource or create a new resource.
<div class="legacybox"><h2>Legacy Code</h2> TEventList is a legacy interface: there will be no bug fi...
virtual void Reset(Option_t *option="")
Reset number of entries in event list.
virtual Int_t GetIndex(Long64_t entry) const
Return index in the list of element with value entry array is supposed to be sorted prior to this cal...
virtual void SetDirectory(TDirectory *dir)
Remove reference to this EventList from current directory and add reference to new directory dir.
virtual void Enter(Long64_t entry)
Enter element entry into the list.
A TGraph is an object made of two arrays X and Y with npoints each.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
void Draw(Option_t *chopt="") override
Draw this graph with its current attributes.
virtual TH1F * GetHistogram() const
Returns a pointer to the histogram used to draw the axis Takes into account the two following cases.
virtual void SetEditable(Bool_t editable=kTRUE)
if editable=kFALSE, the graph cannot be modified with the mouse by default a TGraph is editable
1-D histogram with a double per channel (see TH1 documentation)
1-D histogram with a float per channel (see TH1 documentation)
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 ...
virtual Int_t GetDimension() const
@ kNoStats
Don't draw stats box.
virtual Bool_t CanExtendAllAxes() const
Returns true if all axes are extendable.
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
TObject * FindObject(const char *name) const override
Search object named name in the list of functions.
virtual void SetMaximum(Double_t maximum=-1111)
void Draw(Option_t *option="") override
Draw this histogram with options.
virtual void SetMinimum(Double_t minimum=-1111)
virtual UInt_t SetCanExtend(UInt_t extendBitMask)
Make the histogram axes extendable / not extendable according to the bit mask returns the previous bi...
TList * GetListOfFunctions() const
virtual TH1 * DrawCopy(Option_t *option="", const char *name_postfix="_copy") const
Copy this histogram and Draw in the current pad.
virtual void FillN(Int_t ntimes, const Double_t *x, const Double_t *w, Int_t stride=1)
Fill this histogram with an array x and weights w.
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
virtual void SetEntries(Double_t n)
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
2-D histogram with a double per channel (see TH1 documentation)
2-D histogram with a float per channel (see TH1 documentation)
Service class for 2-D histogram classes.
Int_t Fill(Double_t) override
Invalid Fill method.
3-D histogram with a double per channel (see TH1 documentation)
3-D histogram with a float per channel (see TH1 documentation)
The 3-D histogram classes derived from the 1-D histogram classes.
Int_t Fill(Double_t) override
Invalid Fill method.
static THLimitsFinder * GetLimitsFinder()
Return pointer to the current finder.
virtual Int_t FindGoodLimitsXY(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Int_t newbinsx=0, Int_t newbinsy=0)
Compute the best axis limits for the X and Y axis if the corresponding newbins variable is set to 0,...
virtual Int_t FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax)
Compute the best axis limits for the X axis.
virtual Int_t FindGoodLimitsXYZ(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax, Int_t newbinsx=0, Int_t newbinsy=0, Int_t newbinsz=0)
Compute the best axis limits and bins for the X, Y and Z axis if the corresponding newbins variable i...
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
void AddAt(TObject *obj, Int_t idx) override
Add object at position ids.
TObject * At(Int_t idx) const override
TObject * UncheckedAt(Int_t i) const
TObject * Remove(TObject *obj) override
Remove object from array.
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Delete(Option_t *option="")
Delete this object.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const char * GetTitle() const
Returns title of object.
virtual TClass * IsA() const
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
@ kCanDelete
if object in a list can be deleted
void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
virtual Int_t GetLastPoint() const
void Draw(Option_t *option="") override
Draws 3-D polymarker with its current attributes.
Profile2D histograms are used to display the mean value of Z and its error for each cell in X,...
Int_t Fill(const Double_t *v)
void FillN(Int_t, const Double_t *, const Double_t *, Int_t) override
Fill this histogram with an array x and weights w.
void ProcessFill(Long64_t entry) override
Called in the entry loop for all entries accepted by Select.
TEntryListArray * fTreeElistArray
! Pointer to Tree Event list array
virtual void SetEstimate(Long64_t n)
Set number of entries to estimate variable limits.
virtual void InitArrays(Int_t newsize)
Initialization of the primitive type arrays if the new size is bigger than the available space.
void Terminate() override
Called at the end of a loop on a TTree.
Int_t fAction
! Action type
Int_t GetMultiplicity() const
TTreeFormulaManager * fManager
Pointer to the formula manager.
TTreeFormula * GetVar(Int_t i) const
Return the TTreeFormula corresponding to the i-th component of the request formula (where the compone...
bool * fVarMultiple
![fDimension] True if fVar[i] has a variable index
~TSelectorDraw() override
Selector destructor.
TSelectorDraw()
Default selector constructor.
Double_t * fW
![fSelectedRows]Local buffer for weights
virtual UInt_t SplitNames(const TString &varexp, std::vector< TString > &names)
Build Index array for names in varexp.
Long64_t fCurrentSubEntry
Current subentry when fSelectMultiple is true. Used to fill TEntryListArray.
TTreeFormula * fSelect
Pointer to selection formula.
Long64_t fSelectedRows
Number of selected entries.
Int_t fForceRead
Force Read flag.
virtual void ClearFormula()
Delete internal buffers.
virtual void TakeAction()
Execute action for object obj fNfill times.
Long64_t fOldEstimate
Value of Tree fEstimate when selector is called.
Double_t fWeight
Tree weight (see TTree::SetWeight)
Int_t fNfill
! Total number of histogram fills
TH1 * fOldHistogram
! Pointer to previously used histogram
virtual bool CompileVariables(const char *varexp="", const char *selection="")
Compile input variables and selection expression.
Double_t * fVmax
![fDimension] Maxima of varexp columns
Int_t fMultiplicity
Indicator of the variability of the size of entries.
TTreeFormula ** fVar
![fDimension] Array of pointers to variables formula
virtual void ProcessFillMultiple(Long64_t entry)
Called in the entry loop for all entries accepted by Select.
bool fSelectMultiple
True if selection has a variable index.
TTree * fTree
Pointer to current Tree.
Int_t fDimension
Dimension of the current expression.
TObject * fTreeElist
Pointer to Tree Event list.
virtual Double_t * GetVal(Int_t i) const
Return the last values corresponding to the i-th component of the formula being processed (where the ...
Int_t * fNbins
![fDimension] Number of bins per dimension
Double_t ** fVal
![fSelectedRows][fDimension] Local buffer for the variables
Long64_t fDraw
! Last entry loop number when object was drawn
virtual void TakeEstimate()
Estimate limits for 1-D, 2-D or 3-D objects.
bool Notify() override
This function is called at the first entry of a new tree in a chain.
bool fCleanElist
True if original Tree elist must be saved.
bool fObjEval
True if fVar1 returns an object (or pointer to).
void Begin(TTree *tree) override
Called every time a loop on the tree(s) starts.
virtual void ProcessFillObject(Long64_t entry)
Called in the entry loop for all entries accepted by Select.
Double_t * fVmin
![fDimension] Minima of varexp columns
virtual void SetStatus(Long64_t status)
TList * fInput
List of objects available during processing.
TString fOption
Option given to TTree::Process.
virtual void Abort(const char *why, EAbort what=kAbortProcess)
Abort processing.
const char * GetOption() const override
TObject * fObject
! Current object if processing object (vs. TTree)
virtual void ResetAbort()
void ToLower()
Change string to lower-case.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Int_t GetColorPalette(Int_t i) const
Return color number i in current palette.
Int_t GetNumberOfColors() const
Return number of colors in the color palette.
A TTree represents a columnar dataset.
virtual Long64_t GetEstimate() const
virtual Double_t GetWeight() const
virtual TEntryList * GetEntryList()
Returns the entry list assigned to this tree.
virtual void SetEstimate(Long64_t nentries=1000000)
Set number of entries to estimate variable limits.
virtual Long64_t GetReadEntry() const
virtual TTree * GetTree() const
virtual void SetEntryList(TEntryList *list, Option_t *opt="")
Set an EntryList.
TEventList * GetEventList() const
virtual Int_t GetUpdate() const
virtual Long64_t GetChainOffset() const
virtual Double_t * GetRmax()=0
virtual Double_t * GetRmin()=0
static TView * CreateView(Int_t system=1, const Double_t *rmin=nullptr, const Double_t *rmax=nullptr)
Create a concrete default 3-d view via the plug-in manager.