File indexing completed on 2025-01-18 10:12:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TParallelCoord
0013 #define ROOT_TParallelCoord
0014
0015 #include "TAttLine.h"
0016 #include "TNamed.h"
0017
0018 class TTree;
0019 class TPaveText;
0020 class TEntryList;
0021 class TParallelCoordSelect;
0022 class TParallelCoordVar;
0023 class TParallelCoordRange;
0024 class TList;
0025 class TGaxis;
0026 class TSelectorDraw;
0027
0028 class TParallelCoord : public TNamed {
0029 public:
0030 enum EStatusBits {
0031 kVertDisplay = BIT(14),
0032 kCurveDisplay = BIT(15),
0033 kPaintEntries = BIT(16),
0034 kLiveUpdate = BIT(17),
0035 kGlobalScale = BIT(19),
0036 kCandleChart = BIT(20),
0037 kGlobalLogScale = BIT(21)
0038 };
0039
0040 private:
0041 UInt_t fNvar;
0042 Long64_t fCurrentFirst;
0043 Long64_t fCurrentN;
0044 Long64_t fNentries;
0045 Int_t fDotsSpacing;
0046 Color_t fLineColor;
0047 Width_t fLineWidth;
0048 Int_t fWeightCut;
0049 TEntryList *fCurrentEntries;
0050 TEntryList *fInitEntries;
0051 TTree *fTree;
0052 TString fTreeName;
0053 TString fTreeFileName;
0054 TList *fVarList;
0055 TList *fSelectList;
0056 TParallelCoordSelect* fCurrentSelection;
0057 TGaxis *fCandleAxis;
0058
0059 void Init();
0060 void PaintEntries(TParallelCoordSelect* sel=nullptr);
0061 void SetAxesPosition();
0062
0063 public:
0064 TParallelCoord();
0065 TParallelCoord(Long64_t nentries);
0066 TParallelCoord(TTree* tree, Long64_t nentries);
0067 ~TParallelCoord() override;
0068
0069 void AddVariable(Double_t* val, const char* title="");
0070 void AddVariable(const char* varexp);
0071 void AddSelection(const char* title);
0072 void ApplySelectionToTree();
0073 static void BuildParallelCoord(TSelectorDraw* selector, bool candle);
0074 void CleanUpSelections(TParallelCoordRange* range);
0075 void RemoveVariable(TParallelCoordVar* var);
0076 bool RemoveVariable(const char* var);
0077 void DeleteSelection(TParallelCoordSelect* sel);
0078 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0079 void Draw(Option_t* options="") override;
0080 void ExecuteEvent(Int_t entry, Int_t px, Int_t py) override;
0081 bool GetCandleChart() {return TestBit(kCandleChart);}
0082 Long64_t GetCurrentFirst() {return fCurrentFirst;}
0083 Long64_t GetCurrentN() {return fCurrentN;}
0084 TParallelCoordSelect* GetCurrentSelection();
0085 bool GetCurveDisplay() const {return TestBit(kCurveDisplay);}
0086 Int_t GetDotsSpacing() const {return fDotsSpacing;}
0087 TEntryList *GetEntryList(bool sel=true);
0088 Double_t GetGlobalMin();
0089 Double_t GetGlobalMax();
0090 bool GetGlobalScale() {return TestBit(kGlobalScale);}
0091 bool GetGlobalLogScale() {return TestBit(kGlobalLogScale);}
0092 Color_t GetLineColor() {return fLineColor;}
0093 Width_t GetLineWidth() {return fLineWidth;}
0094 Int_t GetNbins();
0095 UInt_t GetNvar() {return fNvar;}
0096 Long64_t GetNentries() {return fNentries;}
0097 TList *GetSelectList() {return fSelectList;}
0098 TParallelCoordSelect* GetSelection(const char* title);
0099 TTree *GetTree();
0100 Double_t *GetVariable(const char* var);
0101 Double_t *GetVariable(Int_t i);
0102 TList *GetVarList() {return fVarList;}
0103 bool GetVertDisplay() const {return TestBit(kVertDisplay);}
0104 Int_t GetWeightCut() const {return fWeightCut;};
0105 void Paint(Option_t* options="") override;
0106 void ResetTree();
0107 void SaveEntryLists(const char* filename="", bool overwrite=false);
0108 void SavePrimitive(std::ostream & out,Option_t *options) override;
0109 void SaveTree(const char* filename="", bool overwrite=false);
0110 void SetAxisHistogramBinning(Int_t n=100);
0111 void SetAxisHistogramHeight(Double_t h=0.5);
0112 void SetAxisHistogramLineWidth(Int_t lw=2);
0113 void SetCandleChart(bool can);
0114 virtual void SetCurveDisplay(bool curve=true) {SetBit(kCurveDisplay,curve);}
0115 void SetCurrentEntries(TEntryList* entries) {fCurrentEntries = entries;}
0116 void SetCurrentFirst(Long64_t);
0117 void SetCurrentN(Long64_t);
0118 TParallelCoordSelect* SetCurrentSelection(const char* title);
0119 void SetCurrentSelection(TParallelCoordSelect* sel);
0120 void SetDotsSpacing(Int_t s=0);
0121 static void SetEntryList(TParallelCoord* para, TEntryList* enlist);
0122 void SetGlobalScale(bool gl);
0123 void SetGlobalLogScale(bool);
0124 void SetGlobalMin(Double_t min);
0125 void SetGlobalMax(Double_t max);
0126 void SetInitEntries(TEntryList* entries) {fInitEntries = entries;}
0127 void SetLineColor(Color_t col) {fLineColor = col;}
0128 void SetLineWidth(Width_t wid) {fLineWidth = wid;}
0129 void SetLiveRangesUpdate(bool);
0130 void SetNentries(Long64_t n) {fNentries = n;}
0131 void SetTree(TTree* tree) {fTree = tree;}
0132 void SetVertDisplay(bool vert=true);
0133 void SetWeightCut(Int_t w=0) {fWeightCut = w;}
0134 void UnzoomAll();
0135
0136 ClassDefOverride(TParallelCoord,1);
0137 };
0138
0139 #endif