108 Error(
"AddRange",
"You must create a selection before adding ranges.");
130 if(!
gPad)
return 9999;
140 if (dist<=0.005)
return 0;
161 bool inarange =
false;
162 bool noOwnedRange =
true;
165 if(select->Contains(range)) {
166 noOwnedRange =
false;
167 if(range->
IsIn(
fVal[evtidx])) inarange =
true;
170 if (noOwnedRange)
return true;
171 else return inarange;
202 xx[0] = xx[1] =
pmove;
203 yy[0] =
y1; yy[1] =
y2;
205 xx[0] =
x1; xx[1] =
x2;
206 yy[0] = yy[1] =
pmove;
208 xx[0] = xx[2] =
x1 - 0.05;
209 xx[1] = xx[3] =
x1 + 0.05;
215 yy[0] = yy[2] =
y1 - 0.05;
216 yy[1] = yy[3] =
y1 + 0.05;
235 auto &parent = *
gPad;
241 if (parent.AbsPixeltoX(px) -
fX1 > 0)
246 if (parent.AbsPixeltoY(py) -
fY1 > 0)
257 parent.Interactive(
this, inter);
259 parent.GetCanvas()->Selected(&parent,
fParallel, 1);
268 if (inter && inter->zooming) {
287 }
else if (inter && !inter->zooming) {
288 TFrame *frame = parent.GetFrame();
292 pos = (inter->pmove - frame->
GetX1()) / axisSpace;
295 pos = (inter->pmove - frame->
GetY1()) / axisSpace;
300 else if (n < fParallel->GetVarList()->IndexOf(
this))
307 parent.Interactive();
395 static char info[128];
398 if (!
gPad)
return info;
431 quantiles[0]=0.; quantiles[1]=0.; quantiles[2] = 0.;
433 prob[0]=0.25; prob[1]=0.5; prob[2] = 0.75;
444 else val[selected] =
fVal[
n];
451 else val[selected] =
fVal[
n];
458 fQua1 = quantiles[0];
460 fQua3 = quantiles[2];
497 if(value < fMinCurrent || value >
fMaxCurrent)
return;
576 box->SetLineWidth(1);
578 box->SetLineStyle(1);
579 box->SetFillStyle(0);
587 if (boxSize >= 0.03) boxSize = 0.03;
631 if (min<frame->GetY1()) min = frame->
GetY1();
636 if (min<frame->GetX1()) min = frame->
GetX1();
644 else box->PaintBox(qua1,
fY1-boxSize,qua3,
fY1+boxSize);
695 for (i=1; i<=
fNbins; i++) {
710 for (i=1; i<=
fNbins; i++) {
743 for (i=1; i<=
fNbins; i++) {
758 for (i=1; i<=
fNbins; i++) {
783 if (
fX1-0.5*tlength<0.01) {
787 }
else if (
fX1+0.5*tlength > 0.99) {
805 if (
fX1-0.04-tlength<0.01) {
829 printf(
"at x1=%f, y1=%f, x2=%f, y2=%f.\n",
fX1,
fY1,
fX2,
fY2);
842 out <<
" para_var->SetBit(TParallelCoordVar::kLogScale," <<
TestBit(
kLogScale) <<
");\n";
843 out <<
" para_var->SetBit(TParallelCoordVar::kShowBox," <<
TestBit(
kShowBox) <<
");\n";
844 out <<
" para_var->SetBit(TParallelCoordVar::kShowBarHisto," <<
TestBit(
kShowBarHisto) <<
");\n";
845 out <<
" para_var->SetHistogramBinning(" <<
fNbins <<
");\n";
846 out <<
" para_var->SetHistogramLineWidth(" <<
fHistoLW <<
");\n";
847 out <<
" para_var->SetInitMin(" <<
fMinInit <<
");\n";
848 out <<
" para_var->SetInitMax(" <<
fMaxInit <<
");\n";
849 out <<
" para_var->SetHistogramHeight(" <<
fHistoHeight <<
");\n";
850 out <<
" para_var->GetMinMaxMean();\n";
851 out <<
" para_var->GetHistogram();\n";
855 out <<
" para_var->GetQuantiles();\n";
859 out <<
" //***************************************\n";
860 out <<
" // Create the " << i++ <<
"th range owned by the axis \"" <<
GetTitle() <<
"\".\n";
861 out <<
" para_sel = para->GetSelection(\"" << range->GetSelection()->GetTitle() <<
"\");\n";
863 TString::Format(
"para_var, %g, %g, para_sel", range->GetMin(), range->GetMax()));
864 out <<
" para_var->AddRange(para_newrange);\n";
865 out <<
" para_sel->Add(para_newrange);\n";
int Int_t
Signed integer 4 bytes (int)
double Double_t
Double 8 bytes.
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hmax
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 length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TStyle * gStyle
Fill Area Attributes class.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
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 void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
virtual Float_t GetTextSize() const
Return the text size.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
1-D histogram with a float per channel (see TH1 documentation)
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 Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual Double_t GetMinimum(Double_t minval=-FLT_MAX) const
Return minimum value larger than minval of bins in the range, unless the value has been overridden by...
To draw Mathematical Formula.
Double_t GetXsize()
Return size of the formula along X in pad coordinates when the text precision is smaller than 3.
virtual void PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
Main drawing function.
void Paint(Option_t *option="") override
Paint.
Use the TLine constructor to create a simple line.
virtual void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
void Paint(Option_t *option="") override
Paint this line with its current attributes.
void AddAt(TObject *obj, Int_t idx) override
Insert object at position idx in the list.
void Add(TObject *obj) override
TObject * Remove(TObject *obj) override
Remove object from the list.
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
void Paint(Option_t *option="") override
Paint this marker with its current attributes.
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
A TParallelCoordRange is a range used for parallel coordinates plots.
void Paint(Option_t *options) override
Paint a TParallelCoordRange.
bool IsIn(Double_t evtval)
Evaluate if the given value is within the range or not.
TParallelCoordSelect * GetSelection()
A TParallelCoordSelect is a specialised TList to hold TParallelCoordRanges used by TParallelCoord.
void HandleMouse(TVirtualPad &parent, Double_t x1, Double_t y1, Int_t px, Int_t py, Bool_t first=kFALSE)
void Paint(TVirtualPad &parent, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
void Paint(Option_t *option="") override
Paint the axis.
TH1F * fHistogram
! Histogram holding the variable distribution.
TH1F * GetHistogram()
Create or recreate the histogram.
char * GetObjectInfo(Int_t px, Int_t py) const override
Returns info about this axis.
void GetEntryXY(Long64_t n, Double_t &x, Double_t &y)
Get the position of the variable on the graph for the n'th entry.
Double_t GetValuefromXY(Double_t x, Double_t y)
Get the value corresponding to the position.
void PaintBoxPlot()
Paint the boxes in the case of a candle chart.
void PaintLabels()
Paint the axis labels and titles.
void ExecuteEvent(Int_t entry, Int_t px, Int_t py) override
Execute the corresponding entry.
bool GetVert() const
Tells if the axis is vertical or not.
void SetBoxPlot(bool box)
Set the axis to display a candle.
void PaintHistogram()
Paint the histogram on the axis.
Double_t fY1
y1 coordinate of the axis.
void SetCurrentMin(Double_t min)
Set the current minimum of the axis.
void SetY(Double_t y, bool gl)
Set the Y position of the axis in the case of a horizontal axis.
void SetLiveRangesUpdate(bool on)
If true, the pad is updated while the motion of a dragged range.
void SetX(Double_t x, bool gl)
Set the X position of the axis in the case of a vertical axis.
Double_t fX1
x1 coordinate of the axis.
~TParallelCoordVar() override
Destructor.
void SavePrimitive(std::ostream &out, Option_t *options) override
Save the TParallelCoordVar as a macro.
Double_t fMaxInit
Memory of the maximum when first initialized.
void SetCurrentMax(Double_t max)
Set the current maximum of the axis.
void SetLogScale(bool log)
Set the axis in log scale.
TList * fRanges
List of the TParallelRange owned by TParallelCoordVar.
void GetQuantiles()
Get the box plot values (quantiles).
Double_t fMinCurrent
Current used minimum.
void SetHistogramHeight(Double_t h=0)
Set the height of the bar histogram.
void DeleteVariable()
Delete variables.
TParallelCoordVar()
Default constructor.
Double_t fMinInit
Memory of the minimum when first initialized.
TParallelCoord * fParallel
Pointer to the TParallelCoord which owns the TParallelCoordVar.
Int_t fId
Id identifying the variable for the editor.
Int_t fNbins
Number of bins in fHistogram.
Long64_t fNentries
Number of stored entries values.
Int_t GetEntryWeight(Long64_t evtidx)
Get the entry weight: The weight of an entry for a given variable is the bin content of the histogram...
Double_t * fVal
![fNentries] Entries values for the variable.
Int_t fHistoLW
Line width used to draw the histogram line.
Double_t fY2
y2 coordinate of the axis.
void SetHistogramLineWidth(Int_t lw=2)
Double_t fX2
x2 coordinate of the axis.
void Init()
Initialise the TParallelVar variables.
void GetXYfromValue(Double_t value, Double_t &x, Double_t &y)
Get a position corresponding to the value on the axis.
void Print(Option_t *option="") const override
Print the axis main data.
void GetMinMaxMean()
Get mean, min and max of those variable.
bool Eval(Long64_t evtidx, TParallelCoordSelect *select)
Check if the entry is within the range(s) of "select".
void Draw(Option_t *option="") override
Draw the axis.
Double_t fQua1
First quantile (Q1).
void SetValues(Long64_t length, Double_t *val)
Set the variable values.
Double_t fQua3
Third quantile (Q3).
void SetHistogramBinning(Int_t n=100)
Set the histogram binning.
Double_t fMed
Median value (Q2).
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Computes the distance from the axis.
void SetCurrentLimits(Double_t min, Double_t max)
Set the limits within which one the entries must be painted.
Double_t fHistoHeight
Histogram Height.
Double_t fMaxCurrent
Current used maximum.
Parallel Coordinates class.
TParallelCoordSelect * GetCurrentSelection()
Return the selection currently being edited.
Double_t GetGlobalMin()
return the global minimum.
Long64_t GetCurrentFirst()
Double_t GetGlobalMax()
return the global maximum.
void SetGlobalMax(Double_t max)
Force all variables to adopt the same max.
void SetGlobalMin(Double_t min)
Force all variables to adopt the same min.
void RemoveVariable(TParallelCoordVar *var)
Delete a variable from the graph.
void CleanUpSelections(TParallelCoordRange *range)
Clean up the selections from the ranges which could have been deleted when a variable has been delete...
@ kGlobalScale
Every variable is on the same scale.
@ kCandleChart
To produce a candle chart.
virtual Int_t IndexOf(const TObject *obj) const
Return index of object in collection.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
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.
virtual void SetText(Double_t x, Double_t y, const char *text)
Helper class to store interactive parameters for individual objects Should be used via gPad->Interact...
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual void UpdateAsync()=0
virtual Double_t AbsPixeltoX(Double_t px)=0
virtual void PaintPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option="")=0
virtual Double_t AbsPixeltoY(Double_t py)=0
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
void Quantiles(Int_t n, Int_t nprob, Double_t *x, Double_t *quantiles, Double_t *prob, Bool_t isSorted=kTRUE, Int_t *index=nullptr, Int_t type=7)
Computes sample quantiles, corresponding to the given probabilities.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.