Logo ROOT  
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 "TGLHistPainter.h"
15#include "TGLUtil.h"
16#include "TNamed.h"
17#include "TAxis.h"
18
19#include <memory>
20#include <vector>
21
22class TGL5DPainter;
23class TTree;
24
25//TGL5D is a class to setup TGL5DPainter from TTree,
26//hold data pointers, select required ranges,
27//convert them into unit cube.
28class TGL5DDataSet : public TNamed {
29 friend class TGL5DPainter;
30private:
32 kDefaultNB = 50//Default number of bins along X,Y,Z axes.
33 };
34public:
35 TGL5DDataSet(TTree *inputData);
36
37 //These are functions for TPad and
38 //TPad's standard machinery (picking, painting).
40 void ExecuteEvent(Int_t event, Int_t px, Int_t py);
41 char *GetObjectInfo(Int_t px, Int_t py) const;
42 void Paint(Option_t *option);
43
44 //This is for editor.
46
47 //Select points for iso-surface.
48 void SelectPoints(Double_t v4Level, Double_t range);
49 UInt_t SelectedSize()const;
50
51 //Take a point from selected sub-range (V1 == X, V2 == Y, V3 == Z for 3D).
52 Double_t V1(UInt_t ind)const;
53 Double_t V2(UInt_t ind)const;
54 Double_t V3(UInt_t ind)const;
55
56 //Very similar to TH3's axes.
57 TAxis *GetXAxis()const;
58 TAxis *GetYAxis()const;
59 TAxis *GetZAxis()const;
60
61 //Data ranges for V1, V2, V3, V4.
62 const Rgl::Range_t &GetXRange()const;
63 const Rgl::Range_t &GetYRange()const;
64 const Rgl::Range_t &GetZRange()const;
65 const Rgl::Range_t &GetV4Range()const;
66
67private:
68 //These three functions for TKDEFGT,
69 //which will convert all point coordinates
70 //into unit cube before density estimation.
74
75 Long64_t fNP;//Number of entries.
76 const Double_t *fV1;//V1.
77 const Double_t *fV2;//V2.
78 const Double_t *fV3;//V3.
79 const Double_t *fV4;//V4.
80 const Double_t *fV5;//V5.
81
82 //These are fixed ranges of the data set,
83 //calculated during construction.
85 Double_t fV1Range;//max - min.
87 Double_t fV2Range;//max - min.
89 Double_t fV3Range;//max - min.
92
93 //This are ranges and bin numbers
94 //for plot, inside fixed ranges.
95 mutable TAxis fXAxis;
96 mutable TAxis fYAxis;
97 mutable TAxis fZAxis;
98 //V4 can have a string type.
100 //Painter to visualize dataset.
101 std::unique_ptr<TGLHistPainter> fPainter;
102 //Indices of points, selected for some iso-level.
103 std::vector<UInt_t> fIndices;
104
107
108 ClassDef(TGL5DDataSet, 0)//Class to read data from TTree and create TGL5DPainter.
109};
110
111#endif
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
long long Long64_t
Definition: RtypesCore.h:69
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
Class to manage histogram axis.
Definition: TAxis.h:30
TAxis * GetZAxis() const
Z axis for plot.
Definition: TGL5D.cxx:204
const Rgl::Range_t & GetZRange() const
V3 range (Z).
Definition: TGL5D.cxx:228
TGL5DDataSet(const TGL5DDataSet &rhs)
void SelectPoints(Double_t v4Level, Double_t range)
"Select" sub-range from source data
Definition: TGL5D.cxx:144
Double_t V3ToUnitCube(Double_t v3) const
V3 to unit cube.
Definition: TGL5D.cxx:260
Rgl::Range_t fV4MinMax
Definition: TGL5D.h:90
const Double_t * fV4
Definition: TGL5D.h:79
Double_t fV3Range
Definition: TGL5D.h:89
std::vector< UInt_t > fIndices
Definition: TGL5D.h:103
Rgl::Range_t fV2MinMax
Definition: TGL5D.h:86
char * GetObjectInfo(Int_t px, Int_t py) const
Info for status bar.
Definition: TGL5D.cxx:118
const Double_t * fV1
Definition: TGL5D.h:76
const Double_t * fV2
Definition: TGL5D.h:77
const Rgl::Range_t & GetYRange() const
V2 range (Y).
Definition: TGL5D.cxx:220
TGL5DPainter * GetRealPainter() const
Get access to painter (for GUI-editor).
Definition: TGL5D.cxx:135
TAxis fYAxis
Definition: TGL5D.h:96
TAxis * GetYAxis() const
Y axis for plot.
Definition: TGL5D.cxx:196
Rgl::Range_t fV1MinMax
Definition: TGL5D.h:84
Double_t V2ToUnitCube(Double_t v2) const
V2 to unit cube.
Definition: TGL5D.cxx:252
TAxis * GetXAxis() const
X axis for plot.
Definition: TGL5D.cxx:188
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Check, if the object is under cursor.
Definition: TGL5D.cxx:102
Double_t fV1Range
Definition: TGL5D.h:85
TGL5DDataSet(TTree *inputData)
Constructor.
Definition: TGL5D.cxx:37
Bool_t fV4IsString
Definition: TGL5D.h:99
Double_t V1ToUnitCube(Double_t v1) const
V1 to unit cube.
Definition: TGL5D.cxx:244
const Double_t * fV5
Definition: TGL5D.h:80
Rgl::Range_t fV5MinMax
Definition: TGL5D.h:91
TGL5DDataSet & operator=(const TGL5DDataSet &rhs)
Long64_t fNP
Definition: TGL5D.h:75
std::unique_ptr< TGLHistPainter > fPainter
Definition: TGL5D.h:101
@ kDefaultNB
Definition: TGL5D.h:32
const Rgl::Range_t & GetXRange() const
V1 range (X).
Definition: TGL5D.cxx:212
const Rgl::Range_t & GetV4Range() const
V4 range.
Definition: TGL5D.cxx:236
TAxis fXAxis
Definition: TGL5D.h:95
Double_t fV2Range
Definition: TGL5D.h:87
TAxis fZAxis
Definition: TGL5D.h:97
UInt_t SelectedSize() const
Size of selected sub-range.
Definition: TGL5D.cxx:156
Rgl::Range_t fV3MinMax
Definition: TGL5D.h:88
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Action.
Definition: TGL5D.cxx:110
Double_t V1(UInt_t ind) const
V1 from sub-range, converted to unit cube.
Definition: TGL5D.cxx:164
Double_t V2(UInt_t ind) const
V2 from sub-range, converted to unit cube.
Definition: TGL5D.cxx:172
Double_t V3(UInt_t ind) const
V3 from sub-range, converted to unit cube.
Definition: TGL5D.cxx:180
void Paint(Option_t *option)
Paint.
Definition: TGL5D.cxx:127
const Double_t * fV3
Definition: TGL5D.h:78
TGL5DPainter implements "gl5d" option for TTree::Draw.
Definition: TGL5DPainter.h:32
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
A TTree represents a columnar dataset.
Definition: TTree.h:72
std::pair< Double_t, Double_t > Range_t
Definition: TGLUtil.h:1194