Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // @(#)root/gl:$Id$
0002 // Author: Timur Pocheptsov  2009
0003 /*************************************************************************
0004  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0005  * All rights reserved.                                                  *
0006  *                                                                       *
0007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0009  *************************************************************************/
0010 
0011 #ifndef ROOT_TGL5D
0012 #define ROOT_TGL5D
0013 
0014 #include "TGLHistPainter.h"
0015 #include "TGLUtil.h"
0016 #include "TNamed.h"
0017 #include "TAxis.h"
0018 
0019 #include <memory>
0020 #include <vector>
0021 
0022 class TGL5DPainter;
0023 class TTree;
0024 
0025 //TGL5D is a class to setup TGL5DPainter from TTree,
0026 //hold data pointers, select required ranges,
0027 //convert them into unit cube.
0028 class TGL5DDataSet : public TNamed {
0029    friend class TGL5DPainter;
0030 private:
0031    enum Edefaults{
0032       kDefaultNB = 50//Default number of bins along X,Y,Z axes.
0033    };
0034 public:
0035    TGL5DDataSet(TTree *inputData);
0036 
0037    //These are functions for TPad and
0038    //TPad's standard machinery (picking, painting).
0039    Int_t    DistancetoPrimitive(Int_t px, Int_t py) override;
0040    void     ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0041    char    *GetObjectInfo(Int_t px, Int_t py) const override;
0042    void     Paint(Option_t *option) override;
0043 
0044    //This is for editor.
0045    TGL5DPainter *GetRealPainter()const;
0046 
0047    //Select points for iso-surface.
0048    void     SelectPoints(Double_t v4Level, Double_t range);
0049    UInt_t   SelectedSize()const;
0050 
0051    //Take a point from selected sub-range (V1 == X, V2 == Y, V3 == Z for 3D).
0052    Double_t V1(UInt_t ind)const;
0053    Double_t V2(UInt_t ind)const;
0054    Double_t V3(UInt_t ind)const;
0055 
0056    //Very similar to TH3's axes.
0057    TAxis   *GetXAxis()const;
0058    TAxis   *GetYAxis()const;
0059    TAxis   *GetZAxis()const;
0060 
0061    //Data ranges for V1, V2, V3, V4.
0062    const Rgl::Range_t &GetXRange()const;
0063    const Rgl::Range_t &GetYRange()const;
0064    const Rgl::Range_t &GetZRange()const;
0065    const Rgl::Range_t &GetV4Range()const;
0066 
0067 private:
0068    //These three functions for TKDEFGT,
0069    //which will convert all point coordinates
0070    //into unit cube before density estimation.
0071    Double_t V1ToUnitCube(Double_t v1)const;
0072    Double_t V2ToUnitCube(Double_t v2)const;
0073    Double_t V3ToUnitCube(Double_t v3)const;
0074 
0075    Long64_t        fNP;//Number of entries.
0076    const Double_t *fV1;//V1.
0077    const Double_t *fV2;//V2.
0078    const Double_t *fV3;//V3.
0079    const Double_t *fV4;//V4.
0080    const Double_t *fV5;//V5.
0081 
0082    //These are fixed ranges of the data set,
0083    //calculated during construction.
0084    Rgl::Range_t    fV1MinMax;//V1 range.
0085    Double_t        fV1Range;//max - min.
0086    Rgl::Range_t    fV2MinMax;//V2 range.
0087    Double_t        fV2Range;//max - min.
0088    Rgl::Range_t    fV3MinMax;//V3 range.
0089    Double_t        fV3Range;//max - min.
0090    Rgl::Range_t    fV4MinMax;//V4 range.
0091    Rgl::Range_t    fV5MinMax;//V5 range.
0092 
0093    //This are ranges and bin numbers
0094    //for plot, inside fixed ranges.
0095    mutable TAxis   fXAxis;
0096    mutable TAxis   fYAxis;
0097    mutable TAxis   fZAxis;
0098    //V4 can have a string type.
0099    Bool_t          fV4IsString;
0100    //Painter to visualize dataset.
0101    std::unique_ptr<TGLHistPainter> fPainter;
0102    //Indices of points, selected for some iso-level.
0103    std::vector<UInt_t> fIndices;
0104 
0105    TGL5DDataSet(const TGL5DDataSet &rhs);
0106    TGL5DDataSet &operator = (const TGL5DDataSet &rhs);
0107 
0108    ClassDefOverride(TGL5DDataSet, 0)//Class to read data from TTree and create TGL5DPainter.
0109 };
0110 
0111 #endif