Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TParallelCoordVar.h
Go to the documentation of this file.
1// @(#)root/treeviewer:$Id$
2// Author: Bastien Dalla Piazza 02/08/2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TParallelCoordVar
13#define ROOT_TParallelCoordVar
14
15#include "TNamed.h"
16#include "TAttLine.h"
17#include "TAttFill.h"
18
19class TParallelCoord;
22class TH1F;
23
24class TParallelCoordVar : public TNamed, public TAttLine, public TAttFill {
25public:
29 kShowBarHisto = BIT(16)
30 };
31private:
32 Int_t fNbins; ///< Number of bins in fHistogram.
33 Int_t fHistoLW; ///< Line width used to draw the histogram line.
34 Int_t fId; ///< Id identifying the variable for the editor.
35 Long64_t fNentries; ///< Number of stored entries values.
36 Double_t fX1; ///< x1 coordinate of the axis.
37 Double_t fX2; ///< x2 coordinate of the axis.
38 Double_t fY1; ///< y1 coordinate of the axis.
39 Double_t fY2; ///< y2 coordinate of the axis.
40 Double_t fMinInit; ///< Memory of the minimum when first initialized.
41 Double_t fMaxInit; ///< Memory of the maximum when first initialized.
42 Double_t fMean; ///< Average.
43 Double_t fMinCurrent; ///< Current used minimum.
44 Double_t fMaxCurrent; ///< Current used maximum.
45 Double_t fMed; ///< Median value (Q2).
46 Double_t fQua1; ///< First quantile (Q1).
47 Double_t fQua3; ///< Third quantile (Q3).
48 Double_t fHistoHeight; ///< Histogram Height.
49 Double_t *fVal; ///<![fNentries] Entries values for the variable.
50 TList *fRanges; ///< List of the TParallelRange owned by TParallelCoordVar.
51 TParallelCoord *fParallel; ///< Pointer to the TParallelCoord which owns the TParallelCoordVar.
52 TH1F *fHistogram; ///<! Histogram holding the variable distribution.
53
54public:
56 TParallelCoordVar(Double_t *val, const char* title,Int_t id, TParallelCoord* gram);
57 ~TParallelCoordVar() override;
58
59 void AddRange(TParallelCoordRange* range);
60 void AddRange() {AddRange(nullptr);} // *MENU*
61 void DeleteVariable(); // *MENU*
62 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
63 void Draw(Option_t *option="") override;
64 bool Eval(Long64_t evtidx, TParallelCoordSelect *select); // Check an entry is within its ranges owned by a given TParallelSelect.
65 void ExecuteEvent(Int_t entry, Int_t px, Int_t py) override;
67 bool GetBoxPlot() {return TestBit(kShowBox);}
69 Int_t GetId() {return fId;}
70 bool GetLogScale() const {return TestBit (kLogScale);}
71 Int_t GetHistBinning() const {return fNbins;}
79 void GetMinMaxMean();
80 void GetQuantiles();
81 Double_t GetX() {return fX1;}
82 Double_t GetY() {return fY1;}
83 Int_t GetNbins() {return fNbins;}
84 Long64_t GetNentries() const {return fNentries;}
85 char *GetObjectInfo(Int_t px, Int_t py) const override;
87 TList *GetRanges() {return fRanges;}
88 Double_t *GetValues() {return fVal;}
90 bool GetVert() {return fX1 == fX2;} // Tells if the axis is vertical or not.
92 void Init();
93 void Paint(Option_t* option="") override;
94 void PaintBoxPlot();
95 void PaintHistogram();
96 void PaintLabels();
97 void Print(Option_t* option="") const override; // *MENU*
98 void SavePrimitive(std::ostream & out, Option_t *options) override;
99 void SetBoxPlot(bool box); // *TOGGLE* *GETTER=GetBoxPlot
100 void SetBarHisto(bool h) {SetBit(kShowBarHisto,h);} // *TOGGLE* *GETTER=GetBarHisto
101 void SetHistogramLineWidth(Int_t lw=2) {fHistoLW = lw;} // *MENU*
102 void SetHistogramHeight(Double_t h=0); // *MENU*
103 void SetHistogramBinning(Int_t n=100); // *MENU*
104 void SetCurrentLimits(Double_t min, Double_t max); // *MENU*
105 void SetCurrentMin(Double_t min);
106 void SetCurrentMax(Double_t max);
107 void SetInitMin(Double_t min) {fMinInit = min;}
108 void SetInitMax(Double_t max) {fMaxInit = max;}
109 void SetLiveRangesUpdate(bool on);
110 void SetLogScale(bool log); // *TOGGLE* *GETTER=GetLogScale
111 void SetTitle(const char* /*title*/) override {} // To hide TNamed::SetTitle.
112 void SetValues(Long64_t length, Double_t* val);
113 void SetX(Double_t x, bool gl); // Set a new x position in case of a vertical display.
114 void SetY(Double_t y, bool gl); // Set a new y position in case of a horizontal display.
115 void Unzoom() {SetCurrentLimits(fMinInit,fMaxInit);} // *MENU* Reset fMin and fMax to their original value.
116
117 ClassDefOverride(TParallelCoordVar,1); // A Variable of a parallel coordinates plot.
118};
119
120#endif
#define h(i)
Definition RSha256.hxx:106
int Int_t
Definition RtypesCore.h:45
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:69
const char Option_t
Definition RtypesCore.h:66
#define BIT(n)
Definition Rtypes.h:90
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t option
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 void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Fill Area Attributes class.
Definition TAttFill.h:19
Line Attributes class.
Definition TAttLine.h:18
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:623
A doubly linked list.
Definition TList.h:38
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:199
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:798
A TParallelCoordRange is a range used for parallel coordinates plots.
A TParallelCoordSelect is a specialised TList to hold TParallelCoordRanges used by TParallelCoord.
TParallelCoord axes.
void Paint(Option_t *option="") override
Paint the axis.
void SetInitMin(Double_t min)
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.
void SetTitle(const char *) override
Set the title of the TNamed.
Double_t fY1
y1 coordinate of the axis.
Double_t GetCurrentMax() const
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.
TParallelCoord * GetParallel()
void SetX(Double_t x, bool gl)
Set the X position of the axis in the case of a vertical axis.
Double_t GetCurrentMin() const
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.
Int_t GetHistBinning() const
Long64_t GetNentries() const
bool GetLogScale() const
Long64_t fNentries
Number of stored entries values.
Double_t GetCurrentAverage() const
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 fMean
Average.
Double_t fY2
y2 coordinate of the axis.
void SetInitMax(Double_t max)
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".
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.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition fillpatterns.C:1
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
th1 Draw()