110 Error(
"AddRange",
"You must create a selection before adding ranges.");
132 if(!
gPad)
return 9999;
142 if (dist<=0.005)
return 0;
163 bool inarange =
false;
164 bool noOwnedRange =
true;
167 if(select->Contains(range)) {
168 noOwnedRange =
false;
169 if(range->
IsIn(
fVal[evtidx])) inarange =
true;
172 if (noOwnedRange)
return true;
173 else return inarange;
186 static Int_t pxold, pyold;
188 static Int_t pzoomold;
189 static bool first =
true;
191 Int_t px1,px2,py1,py2,
n=-1;
210 if(
gPad->AbsPixeltoX(px)-
fX1 > 0){
220 if(
gPad->AbsPixeltoY(py)-
fY1 > 0){
250 min = max; max = mem;
287 gVirtualX->DrawLine(pxold,py1,pxold,py2);
298 gVirtualX->DrawLine(px1,pyold,px2,pyold);
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];
489 if(value < fMinCurrent || value >
fMaxCurrent)
return;
566 line->SetLineWidth(1);
568 box->SetLineWidth(1);
570 box->SetLineStyle(1);
571 box->SetFillStyle(0);
579 if (boxSize >= 0.03) boxSize = 0.03;
613 line->PaintLine(
fX1-boxSize,min,
fX1+boxSize,min);
614 line->PaintLine(
fX2-boxSize,max,
fX2+boxSize,max);
616 line->PaintLine(min,
fY1-boxSize,min,
fY1+boxSize);
617 line->PaintLine(max,
fY2-boxSize,max,
fY2+boxSize);
621 line->SetLineStyle(7);
623 if (min<frame->GetY1()) min = frame->
GetY1();
628 if (min<frame->GetX1()) min = frame->
GetX1();
636 else box->PaintBox(qua1,
fY1-boxSize,qua3,
fY1+boxSize);
639 line->SetLineStyle(1);
641 else line->PaintLine(med,
fY1-boxSize,med,
fY1+boxSize);
687 for (i=1; i<=
fNbins; i++) {
692 b->PaintBox(
fX1,y1,x2,y2,
"l");
702 for (i=1; i<=
fNbins; i++) {
706 b->PaintBox(x1,
fY1,x2,y2,
"l");
735 for (i=1; i<=
fNbins; i++) {
736 theColor = (
Int_t)( ((
fHistogram->GetBinContent(i)-hmin)/(hmax-hmin))*(ncolors-1) );
750 for (i=1; i<=
fNbins; i++) {
751 theColor = (
Int_t)( ((
fHistogram->GetBinContent(i)-hmin)/(hmax-hmin))*(ncolors-1) );
775 if (
fX1-0.5*tlength<0.01) {
779 }
else if (
fX1+0.5*tlength > 0.99) {
797 if (
fX1-0.04-tlength<0.01) {
820 printf(
"**************variable #%d**************\n",
fParallel->GetVarList()->IndexOf(
this));
821 printf(
"at x1=%f, y1=%f, x2=%f, y2=%f.\n",
fX1,
fY1,
fX2,
fY2);
834 out <<
" para_var->SetBit(TParallelCoordVar::kLogScale," <<
TestBit(
kLogScale) <<
");\n";
835 out <<
" para_var->SetBit(TParallelCoordVar::kShowBox," <<
TestBit(
kShowBox) <<
");\n";
836 out <<
" para_var->SetBit(TParallelCoordVar::kShowBarHisto," <<
TestBit(
kShowBarHisto) <<
");\n";
837 out <<
" para_var->SetHistogramBinning(" <<
fNbins <<
");\n";
838 out <<
" para_var->SetHistogramLineWidth(" <<
fHistoLW <<
");\n";
839 out <<
" para_var->SetInitMin(" <<
fMinInit <<
");\n";
840 out <<
" para_var->SetInitMax(" <<
fMaxInit <<
");\n";
841 out <<
" para_var->SetHistogramHeight(" <<
fHistoHeight <<
");\n";
842 out <<
" para_var->GetMinMaxMean();\n";
843 out <<
" para_var->GetHistogram();\n";
847 out <<
" para_var->GetQuantiles();\n";
851 out <<
" //***************************************\n";
852 out <<
" // Create the " << i++ <<
"th range owned by the axis \"" <<
GetTitle() <<
"\".\n";
853 out <<
" para_sel = para->GetSelection(\"" << range->GetSelection()->GetTitle() <<
"\");\n";
855 TString::Format(
"para_var, %g, %g, para_sel", range->GetMin(), range->GetMax()));
856 out <<
" para_var->AddRange(para_newrange);\n";
857 out <<
" para_sel->Add(para_newrange);\n";
978 for (
Long64_t li = 0; li < length; ++li)
fVal[li] = val[li];
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned 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).
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
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)
virtual Color_t GetLineColor() const
Return the line color.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
virtual void SetLineColor(Color_t lcolor)
Set the line color.
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.
1-D histogram with a float per channel (see TH1 documentation)
virtual void PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
void Paint(Option_t *option="") override
This method must be overridden if a class wants to paint itself.
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 Add(TObject *obj) override
void Paint(Option_t *option="") override
Paint this marker with its current attributes.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
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 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.
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.
@ kGlobalScale
Every variable is on the same scale.
@ kCandleChart
To produce a candle chart.
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
virtual void SetText(Double_t x, Double_t y, const char *text)
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)
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.