Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TParallelCoordVar.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/treeviewer:$Id$
0002 // Author: Bastien Dalla Piazza  02/08/2007
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TParallelCoordVar
0013 #define ROOT_TParallelCoordVar
0014 
0015 #include "TNamed.h"
0016 #include "TAttLine.h"
0017 #include "TAttFill.h"
0018 
0019 class TParallelCoord;
0020 class TParallelCoordSelect;
0021 class TParallelCoordRange;
0022 class TH1F;
0023 
0024 class TParallelCoordVar : public TNamed, public TAttLine, public TAttFill {
0025 public:
0026    enum EStatusBits {
0027       kLogScale      = BIT(14),
0028       kShowBox       = BIT(15),
0029       kShowBarHisto  = BIT(16)
0030    };
0031 private:
0032    Int_t             fNbins;        ///< Number of bins in fHistogram.
0033    Int_t             fHistoLW;      ///< Line width used to draw the histogram line.
0034    Int_t             fId;           ///< Id identifying the variable for the editor.
0035    Long64_t          fNentries;     ///< Number of stored entries values.
0036    Double_t          fX1;           ///< x1 coordinate of the axis.
0037    Double_t          fX2;           ///< x2 coordinate of the axis.
0038    Double_t          fY1;           ///< y1 coordinate of the axis.
0039    Double_t          fY2;           ///< y2 coordinate of the axis.
0040    Double_t          fMinInit;      ///< Memory of the minimum when first initialized.
0041    Double_t          fMaxInit;      ///< Memory of the maximum when first initialized.
0042    Double_t          fMean;         ///< Average.
0043    Double_t          fMinCurrent;   ///< Current used minimum.
0044    Double_t          fMaxCurrent;   ///< Current used maximum.
0045    Double_t          fMed;          ///< Median value (Q2).
0046    Double_t          fQua1;         ///< First quantile (Q1).
0047    Double_t          fQua3;         ///< Third quantile (Q3).
0048    Double_t          fHistoHeight;  ///< Histogram Height.
0049    Double_t         *fVal;          ///<![fNentries] Entries values for the variable.
0050    TList            *fRanges;       ///< List of the TParallelRange owned by TParallelCoordVar.
0051    TParallelCoord   *fParallel;     ///< Pointer to the TParallelCoord which owns the TParallelCoordVar.
0052    TH1F             *fHistogram;    ///<! Histogram holding the variable distribution.
0053 
0054 public:
0055    TParallelCoordVar();
0056    TParallelCoordVar(Double_t *val, const char* title,Int_t id, TParallelCoord* gram);
0057    ~TParallelCoordVar() override;
0058 
0059    void           AddRange(TParallelCoordRange* range);
0060    void           AddRange() {AddRange(nullptr);} // *MENU*
0061    void           DeleteVariable(); // *MENU*
0062    Int_t  DistancetoPrimitive(Int_t px, Int_t py) override;
0063    void   Draw(Option_t *option="") override;
0064    bool           Eval(Long64_t evtidx, TParallelCoordSelect *select); // Check an entry is within its ranges owned by a given TParallelSelect.
0065    void   ExecuteEvent(Int_t entry, Int_t px, Int_t py) override;
0066    bool           GetBarHisto() {return TestBit(kShowBarHisto);}
0067    bool           GetBoxPlot() {return TestBit(kShowBox);}
0068    TH1F          *GetHistogram();
0069    Int_t          GetId() {return fId;}
0070    bool           GetLogScale() const {return TestBit (kLogScale);}
0071    Int_t          GetHistBinning() const {return fNbins;}
0072    Double_t       GetCurrentMin() const {return fMinCurrent;}
0073    Double_t       GetCurrentMax() const {return fMaxCurrent;}
0074    Double_t       GetCurrentAverage() const {return fMean;}
0075    void           GetEntryXY(Long64_t n, Double_t & x, Double_t & y);
0076    Int_t          GetEntryWeight(Long64_t evtidx);
0077    Double_t       GetHistHeight() {return fHistoHeight;}
0078    Int_t          GetHistLineWidth() {return fHistoLW;}
0079    void           GetMinMaxMean();
0080    void           GetQuantiles();
0081    Double_t       GetX() {return fX1;}
0082    Double_t       GetY() {return fY1;}
0083    Int_t          GetNbins() {return fNbins;}
0084    Long64_t       GetNentries() const {return fNentries;}
0085    char  *GetObjectInfo(Int_t px, Int_t py) const override;
0086    TParallelCoord* GetParallel() {return fParallel;}
0087    TList         *GetRanges() {return fRanges;}
0088    Double_t      *GetValues() {return fVal;}
0089    Double_t       GetValuefromXY(Double_t x,Double_t y);
0090    bool           GetVert() {return fX1 == fX2;} // Tells if the axis is vertical or not.
0091    void           GetXYfromValue(Double_t value, Double_t & x, Double_t & y);
0092    void           Init();
0093    void   Paint(Option_t* option="") override;
0094    void           PaintBoxPlot();
0095    void           PaintHistogram();
0096    void           PaintLabels();
0097    void   Print(Option_t* option="") const override; // *MENU*
0098    void           SavePrimitive(std::ostream & out, Option_t *options) override;
0099    void           SetBoxPlot(bool box); // *TOGGLE* *GETTER=GetBoxPlot
0100    void           SetBarHisto(bool h) {SetBit(kShowBarHisto,h);} // *TOGGLE* *GETTER=GetBarHisto
0101    void           SetHistogramLineWidth(Int_t lw=2) {fHistoLW = lw;} // *MENU*
0102    void           SetHistogramHeight(Double_t h=0); // *MENU*
0103    void           SetHistogramBinning(Int_t n=100); // *MENU*
0104    void           SetCurrentLimits(Double_t min, Double_t max); // *MENU*
0105    void           SetCurrentMin(Double_t min);
0106    void           SetCurrentMax(Double_t max);
0107    void           SetInitMin(Double_t min) {fMinInit = min;}
0108    void           SetInitMax(Double_t max) {fMaxInit = max;}
0109    void           SetLiveRangesUpdate(bool on);
0110    void           SetLogScale(bool log); // *TOGGLE* *GETTER=GetLogScale
0111    void           SetTitle(const char* /*title*/) override {} // To hide TNamed::SetTitle.
0112    void           SetValues(Long64_t length, Double_t* val);
0113    void           SetX(Double_t x, bool gl);    // Set a new x position in case of a vertical display.
0114    void           SetY(Double_t y, bool gl);    // Set a new y position in case of a horizontal display.
0115    void           Unzoom() {SetCurrentLimits(fMinInit,fMaxInit);} // *MENU* Reset fMin and fMax to their original value.
0116 
0117    ClassDefOverride(TParallelCoordVar,1); // A Variable of a parallel coordinates plot.
0118 };
0119 
0120 #endif