ROOT  6.06/09
Reference Guide
TGL5D.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Timur Pocheptsov 2009
3 /*************************************************************************
4  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #ifndef ROOT_TGL5D
12 #define ROOT_TGL5D
13 
14 #include <memory>
15 #include <vector>
16 
17 #ifndef ROOT_TGLHistPainter
18 #include "TGLHistPainter.h"
19 #endif
20 #ifndef ROOT_TGLUtil
21 #include "TGLUtil.h"
22 #endif
23 #ifndef ROOT_TNamed
24 #include "TNamed.h"
25 #endif
26 #ifndef ROOT_TAxis
27 #include "TAxis.h"
28 #endif
29 
30 class TGL5DPainter;
31 class TTree;
32 
33 //TGL5D is a class to setup TGL5DPainter from TTree,
34 //hold data pointers, select required ranges,
35 //convert them into unit cube.
36 class TGL5DDataSet : public TNamed {
37  friend class TGL5DPainter;
38 private:
39  enum Edefaults{
40  kDefaultNB = 50//Default number of bins along X,Y,Z axes.
41  };
42 public:
43  TGL5DDataSet(TTree *inputData);
44 
45  //These are functions for TPad and
46  //TPad's standard machinery (picking, painting).
48  void ExecuteEvent(Int_t event, Int_t px, Int_t py);
49  char *GetObjectInfo(Int_t px, Int_t py) const;
50  void Paint(Option_t *option);
51 
52  //This is for editor.
54 
55  //Select points for iso-surface.
56  void SelectPoints(Double_t v4Level, Double_t range);
57  UInt_t SelectedSize()const;
58 
59  //Take a point from selected sub-range (V1 == X, V2 == Y, V3 == Z for 3D).
60  Double_t V1(UInt_t ind)const;
61  Double_t V2(UInt_t ind)const;
62  Double_t V3(UInt_t ind)const;
63 
64  //Very similar to TH3's axes.
65  TAxis *GetXAxis()const;
66  TAxis *GetYAxis()const;
67  TAxis *GetZAxis()const;
68 
69  //Data ranges for V1, V2, V3, V4.
70  const Rgl::Range_t &GetXRange()const;
71  const Rgl::Range_t &GetYRange()const;
72  const Rgl::Range_t &GetZRange()const;
73  const Rgl::Range_t &GetV4Range()const;
74 
75 private:
76  //These three functions for TKDEFGT,
77  //which will convert all point coordinates
78  //into unit cube before density estimation.
82 
83  Long64_t fNP;//Number of entries.
84  const Double_t *fV1;//V1.
85  const Double_t *fV2;//V2.
86  const Double_t *fV3;//V3.
87  const Double_t *fV4;//V4.
88  const Double_t *fV5;//V5.
89 
90  //These are fixed ranges of the data set,
91  //calculated during construction.
92  Rgl::Range_t fV1MinMax;//V1 range.
93  Double_t fV1Range;//max - min.
94  Rgl::Range_t fV2MinMax;//V2 range.
95  Double_t fV2Range;//max - min.
96  Rgl::Range_t fV3MinMax;//V3 range.
97  Double_t fV3Range;//max - min.
98  Rgl::Range_t fV4MinMax;//V4 range.
99  Rgl::Range_t fV5MinMax;//V5 range.
100 
101  //This are ranges and bin numbers
102  //for plot, inside fixed ranges.
103  mutable TAxis fXAxis;
104  mutable TAxis fYAxis;
105  mutable TAxis fZAxis;
106  //V4 can have a string type.
108  //Painter to visualize dataset.
109  std::auto_ptr<TGLHistPainter> fPainter;
110  //Indices of points, selected for some iso-level.
111  std::vector<UInt_t> fIndices;
112 
113  TGL5DDataSet(const TGL5DDataSet &rhs);
115 
116  ClassDef(TGL5DDataSet, 0)//Class to read data from TTree and create TGL5DPainter.
117 };
118 
119 #endif
TAxis * GetYAxis() const
Y axis for plot.
Definition: TGL5D.cxx:196
const Double_t * fV5
Definition: TGL5D.h:88
long long Long64_t
Definition: RtypesCore.h:69
const Double_t * v1
Definition: TArcBall.cxx:33
const char Option_t
Definition: RtypesCore.h:62
UInt_t SelectedSize() const
Size of selected sub-range.
Definition: TGL5D.cxx:156
std::pair< Double_t, Double_t > Range_t
Definition: TGLUtil.h:1197
TAxis fYAxis
Definition: TGL5D.h:104
const Rgl::Range_t & GetV4Range() const
V4 range.
Definition: TGL5D.cxx:236
const Rgl::Range_t & GetZRange() const
V3 range (Z).
Definition: TGL5D.cxx:228
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Action.
Definition: TGL5D.cxx:110
TGL5DPainter * GetRealPainter() const
Get access to painter (for GUI-editor).
Definition: TGL5D.cxx:135
Double_t V3(UInt_t ind) const
V3 from sub-range, converted to unit cube.
Definition: TGL5D.cxx:180
Double_t V1ToUnitCube(Double_t v1) const
V1 to unit cube.
Definition: TGL5D.cxx:244
TGL5DDataSet & operator=(const TGL5DDataSet &rhs)
const Rgl::Range_t & GetXRange() const
V1 range (X).
Definition: TGL5D.cxx:212
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
Bool_t fV4IsString
Definition: TGL5D.h:107
char * GetObjectInfo(Int_t px, Int_t py) const
Info for status bar.
Definition: TGL5D.cxx:118
Rgl::Range_t fV1MinMax
Definition: TGL5D.h:92
Double_t V2(UInt_t ind) const
V2 from sub-range, converted to unit cube.
Definition: TGL5D.cxx:172
Double_t fV3Range
Definition: TGL5D.h:97
Rgl::Range_t fV5MinMax
Definition: TGL5D.h:99
const Double_t * fV2
Definition: TGL5D.h:85
const Double_t * fV3
Definition: TGL5D.h:86
void SelectPoints(Double_t v4Level, Double_t range)
"Select" sub-range from source data
Definition: TGL5D.cxx:144
std::auto_ptr< TGLHistPainter > fPainter
Definition: TGL5D.h:109
Double_t V3ToUnitCube(Double_t v3) const
V3 to unit cube.
Definition: TGL5D.cxx:260
Class to manage histogram axis.
Definition: TAxis.h:36
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Check, if the object is under cursor.
Definition: TGL5D.cxx:102
TAxis * GetZAxis() const
Z axis for plot.
Definition: TGL5D.cxx:204
unsigned int UInt_t
Definition: RtypesCore.h:42
Rgl::Range_t fV3MinMax
Definition: TGL5D.h:96
const Double_t * fV1
Definition: TGL5D.h:84
Rgl::Range_t fV2MinMax
Definition: TGL5D.h:94
Rgl::Range_t fV4MinMax
Definition: TGL5D.h:98
TAxis * GetXAxis() const
X axis for plot.
Definition: TGL5D.cxx:188
double Double_t
Definition: RtypesCore.h:55
void Paint(Option_t *option)
Paint.
Definition: TGL5D.cxx:127
TGL5DPainter implements "gl5d" option for TTree::Draw.
Definition: TGL5DPainter.h:42
Long64_t fNP
Definition: TGL5D.h:83
Double_t fV2Range
Definition: TGL5D.h:95
TAxis fXAxis
Definition: TGL5D.h:103
Double_t V1(UInt_t ind) const
V1 from sub-range, converted to unit cube.
Definition: TGL5D.cxx:164
TAxis fZAxis
Definition: TGL5D.h:105
A TTree object has a header with a name and a title.
Definition: TTree.h:94
Double_t V2ToUnitCube(Double_t v2) const
V2 to unit cube.
Definition: TGL5D.cxx:252
const Rgl::Range_t & GetYRange() const
V2 range (Y).
Definition: TGL5D.cxx:220
std::vector< UInt_t > fIndices
Definition: TGL5D.h:111
TGL5DDataSet(TTree *inputData)
Constructor.
Definition: TGL5D.cxx:37
Double_t fV1Range
Definition: TGL5D.h:93
const Double_t * fV4
Definition: TGL5D.h:87