Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TSpider.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  20/07/07
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_TSpider
0013 #define ROOT_TSpider
0014 
0015 //////////////////////////////////////////////////////////////////////////
0016 //                                                                      //
0017 // TSpider                                                              //
0018 //                                                                      //
0019 // TSpider is a manager used to paint a spider view                     //
0020 // of the events of a TNtuple.                                          //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TObject.h"
0025 #include "TAttFill.h"
0026 #include "TAttLine.h"
0027 
0028 class TTree;
0029 class TGraphPolargram;
0030 class TPolyLine;
0031 class TTreeFormula;
0032 class TTreeFormulaManager;
0033 class TList;
0034 class TSelectorDraw;
0035 class TString;
0036 class TLatex;
0037 class TCanvas;
0038 class TArc;
0039 
0040 class TSpider : public TObject, public TAttFill, public TAttLine {
0041 private:
0042    UInt_t                  fNx;             ///< Number of horizontal spider plots.
0043    UInt_t                  fNy;             ///< Number of vertical spider plots.
0044    UInt_t                  fNcols;          ///< Number of variables.
0045    Int_t                   fArraySize;      ///< Actual size of the arrays.
0046    Long64_t                fEntry;          ///< Present entry number in fTree.
0047    Long64_t                fNentries;       ///< Number of entries.
0048    Long64_t                fFirstEntry;     ///< First entry.
0049    Long64_t*               fCurrentEntries; ///<![fNx*fNy] current selected entries;
0050    Double_t*               fAve;            ///<[fNcols] Average value of each variable.
0051    Double_t*               fMax;            ///<[fNcols]  Maximum value of the variables.
0052    Double_t*               fMin;            ///<[fNcols]  Minimum value of the variables.
0053    TList*                  fSuperposed;     ///< Superposed spider plots.
0054    TTree*                  fTree;           ///< Pointer to the TTree to represent.
0055    TPolyLine*              fAveragePoly;    ///< Polygon representing the average variables value.
0056    TArc**                  fAverageSlices;  ///<! Average slices.
0057    TCanvas*                fCanvas;         ///<! Pointer to the mother pad.
0058    TList*                  fFormulas;       ///< List of all formulas to represent.
0059    TList*                  fInput;          ///< Used for fSelector.
0060    TTreeFormulaManager*    fManager;        ///< Coordinator for the formulas.
0061    TGraphPolargram*        fPolargram;      ///< Polar graph.
0062    TList*                  fPolyList;       ///< Polygons representing the variables.
0063    TTreeFormula*           fSelect;         ///< Selection condition
0064    TSelectorDraw*          fSelector;       ///<! Selector.
0065    bool                    fAngularLabels;  ///< True if the labels are oriented according to their axis.
0066    bool                    fDisplayAverage; ///< Display or not the average.
0067    bool                    fForceDim;       ///< Force dimension.
0068    bool                    fSegmentDisplay; ///< True if displaying a segment plot.
0069    bool                    fShowRange;      ///< Show range of variables or not.
0070 
0071    Int_t          FindTextAlign(Double_t theta);
0072    Double_t       FindTextAngle(Double_t theta);
0073    void           InitVariables(Long64_t firstentry, Long64_t nentries);
0074    void           DrawPoly(Option_t* options);
0075    void           DrawPolyAverage(Option_t* options);
0076    void           DrawSlices(Option_t* options);
0077    void           DrawSlicesAverage(Option_t* options);
0078    void           SyncFormulas();
0079    void           InitArrays(Int_t newsize);
0080    void           SetCurrentEntries();
0081    void           UpdateView();
0082 
0083 public:
0084    TSpider();
0085    TSpider(TTree* tree, const char *varexp, const char *selection, Option_t *option="",
0086                   Long64_t nentries=0, Long64_t firstentry=0);
0087    ~TSpider() override;
0088    void           AddSuperposed(TSpider* sp);
0089    void           AddVariable(const char* varexp); // *MENU*
0090    void           DeleteVariable(const char* varexp); // *MENU*
0091    void   Draw(Option_t *options="") override;
0092    Int_t  DistancetoPrimitive(Int_t px, Int_t py) override;
0093    void   ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0094    Style_t        GetAverageLineStyle() const;
0095    Color_t        GetAverageLineColor() const;
0096    Width_t        GetAverageLineWidth() const;
0097    Color_t        GetAverageFillColor() const;
0098    Style_t        GetAverageFillStyle() const;
0099    bool           GetDisplayAverage() const {return fDisplayAverage;}
0100    Long64_t       GetCurrentEntry() const {return fEntry;}
0101    Long64_t       GetEntriesToProcess(Long64_t firstentry, Long64_t nentries) const;
0102    Int_t          GetNx() const {return fNx;}
0103    Int_t          GetNy() const {return fNy;}
0104    bool           GetSegmentDisplay() const {return fSegmentDisplay;}
0105    void           GotoEntry(Long64_t e); // *MENU*
0106    void           GotoNext(); // *MENU*
0107    void           GotoPrevious(); // *MENU*
0108    void           GotoFollowing(); // *MENU*
0109    void           GotoPreceding(); // *MENU*
0110    void   Paint(Option_t *options) override;
0111    void           SetAverageLineStyle(Style_t sty);
0112    void           SetAverageLineColor(Color_t col);
0113    void           SetAverageLineWidth(Width_t wid);
0114    void           SetAverageFillColor(Color_t col);
0115    void           SetAverageFillStyle(Style_t sty);
0116    void           SetLineStyle(Style_t sty) override;
0117    void           SetLineColor(Color_t col) override;
0118    void           SetLineWidth(Width_t wid) override;
0119    void           SetFillColor(Color_t col) override;
0120    void           SetFillStyle(Style_t sty) override;
0121    void           SetDisplayAverage(bool disp); // *TOGGLE*
0122    void           SetVariablesExpression(const char* varexp);
0123    void           SetNdivRadial(Int_t div); // *MENU*
0124    void           SetNx(UInt_t nx); // *MENU*
0125    void           SetNy(UInt_t ny); // *MENU*
0126    void           SetSelectionExpression(const char* selexp);
0127    void           SetSegmentDisplay(bool seg); // *TOGGLE*
0128    void           SetShowRange(bool showrange) {fShowRange = showrange;}
0129    void           SuperposeTo(TSpider* sp) {sp->AddSuperposed(this);}
0130 
0131    ClassDefOverride(TSpider,0)  //Helper class to draw spider
0132 };
0133 
0134 #endif