Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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).
39 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
40 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
41 char *GetObjectInfo(Int_t px, Int_t py) const override;
42 void Paint(Option_t *option) override;
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 ClassDefOverride(TGL5DDataSet, 0)//Class to read data from TTree and create TGL5DPainter.
109};
110
111#endif
int Int_t
Definition RtypesCore.h:45
unsigned int UInt_t
Definition RtypesCore.h:46
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:80
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
Class to manage histogram axis.
Definition TAxis.h:31
TAxis * GetZAxis() const
Z axis for plot.
Definition TGL5D.cxx:205
const Rgl::Range_t & GetZRange() const
V3 range (Z).
Definition TGL5D.cxx:229
TGL5DDataSet(const TGL5DDataSet &rhs)
void SelectPoints(Double_t v4Level, Double_t range)
"Select" sub-range from source data
Definition TGL5D.cxx:145
Double_t V3ToUnitCube(Double_t v3) const
V3 to unit cube.
Definition TGL5D.cxx:261
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 override
Info for status bar.
Definition TGL5D.cxx:119
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Check, if the object is under cursor.
Definition TGL5D.cxx:103
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:221
TGL5DPainter * GetRealPainter() const
Get access to painter (for GUI-editor).
Definition TGL5D.cxx:136
TAxis fYAxis
Definition TGL5D.h:96
TAxis * GetYAxis() const
Y axis for plot.
Definition TGL5D.cxx:197
Rgl::Range_t fV1MinMax
Definition TGL5D.h:84
Double_t V2ToUnitCube(Double_t v2) const
V2 to unit cube.
Definition TGL5D.cxx:253
TAxis * GetXAxis() const
X axis for plot.
Definition TGL5D.cxx:189
Double_t fV1Range
Definition TGL5D.h:85
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Action.
Definition TGL5D.cxx:111
Bool_t fV4IsString
Definition TGL5D.h:99
Double_t V1ToUnitCube(Double_t v1) const
V1 to unit cube.
Definition TGL5D.cxx:245
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:213
const Rgl::Range_t & GetV4Range() const
V4 range.
Definition TGL5D.cxx:237
TAxis fXAxis
Definition TGL5D.h:95
Double_t fV2Range
Definition TGL5D.h:87
TAxis fZAxis
Definition TGL5D.h:97
void Paint(Option_t *option) override
Paint.
Definition TGL5D.cxx:128
UInt_t SelectedSize() const
Size of selected sub-range.
Definition TGL5D.cxx:157
Rgl::Range_t fV3MinMax
Definition TGL5D.h:88
Double_t V1(UInt_t ind) const
V1 from sub-range, converted to unit cube.
Definition TGL5D.cxx:165
Double_t V2(UInt_t ind) const
V2 from sub-range, converted to unit cube.
Definition TGL5D.cxx:173
Double_t V3(UInt_t ind) const
V3 from sub-range, converted to unit cube.
Definition TGL5D.cxx:181
const Double_t * fV3
Definition TGL5D.h:78
TGL5DPainter implements "gl5d" option for TTree::Draw.
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:79
std::pair< Double_t, Double_t > Range_t
Definition TGLUtil.h:1202