BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/BesView.h
Go to the documentation of this file.
1//
2// BesView.h
3//
4
5#ifndef BES_BESVIEW
6#define BES_BESVIEW
7
8#include "BesTView.h"
9#include <TPad.h>
10#include <TCanvas.h>
11#include <TPaveLabel.h>
12
13#include "BesStatus.h"
14#include "BesGeometry.h"
15
16#ifndef BES_EBESViewType
17#define BES_EBESViewType
18
19enum EBESViewType {
20 k3DView = BIT(0),
21 kXYView = BIT(1),
22 kZRView = BIT(2),
23 //Long Peixun's update: CGEM unfolded display for each layer
24 kCgemUFView0 = BIT(3),
25 kCgemUFView1 = BIT(4),
26 kCgemUFView2 = BIT(5)
27};
28#endif
29
30class BesView : public BesTView {
31
32 private:
33 Bool_t fFishEye; // variable needed for toggle in menu
34 EBESViewType fViewType; // View type
35 Float_t fPhiRangeMin; // Minimum of phi range for Z-R projection (in degrees)
36 Float_t fPhiRangeMax; // Maximum of phi range for Z-R projection (in degrees)
37 TPaveLabel *fLabel; // Label
38 Float_t fMarkerSize; // size for marker
39 BesStatus *fStatus3D; // 3D view status flags
40 BesStatus *fStatusXY; // XY view status flags
41 BesStatus *fStatusZR; // ZR view status flags
42
43 BesStatus *fStatusCurrent; // current view status flags
44 Double_t fZoomFactor; // zoom factor
45 Double_t fExtentDefault;
46 Float_t m_BesR;
47 Float_t m_BesZ;
48 Double_t ViewCenter[2]; //Long Peixun's update: Coordinate of the center of View
49
50 public:
52 virtual ~BesView();
53
54 virtual void SetViewType(EBESViewType ViewType, Bool_t resetview = kFALSE);
55 virtual void SetViewTypeBare(EBESViewType ViewType, Bool_t resetview = kFALSE);
56 virtual void DefaultRange();
57 virtual void ClearPad();
58 virtual void DrawLabel();
59 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
60
61 virtual Int_t GetRSign(Float_t Phi);
62 virtual void UpdateView(Bool_t resetview = kFALSE );
63 virtual void WCtoNDC(const Float_t *pw, Float_t *pn);
64 virtual void WCtoNDC(const Double_t *pw, Double_t *pn);
65 virtual void NDCtoWC(const Float_t* pn, Float_t* pw);
66 virtual void NDCtoWC(const Double_t* pn, Double_t* pw);
67 virtual char *GetObjectInfo(Int_t px, Int_t py) const;
68
69 void SetZoomRatio(Double_t ratio);
70 inline Double_t GetZoomRatio() { return fExtentDefault/GetExtent(); }
71 inline EBESViewType GetViewType() { return fViewType; }
72 inline Float_t GetMarkerSize() { return fMarkerSize;}
73
74 // menu
75 inline void View3D() { SetViewType(k3DView,1); } // *MENU*
76 inline void ViewXY() { SetViewType(kXYView,1); } // *MENU*
77 inline void ViewZR() { SetViewType(kZRView,1); } // *MENU*
78
79 void ZoomIn(); // *MENU*
80 void ZoomOut(); // *MENU*
81 void Center(); // *MENU*
82 void Move(Int_t px, Int_t py);
83 inline void Front3D() {
84 this->View3D();
85 this->Front(); } // *MENU*
86 void Side3D(); // *MENU*
87 inline void Top3D() {
88 this->View3D();
89 Int_t iret;
90 this->SetView(-90,90,270,iret);
91
92 // this->Top();
93 } // *MENU*
94 void SetPhiRange(Float_t PhiMin = 0, Float_t PhiMax = 180);
95 void Reset(); // *MENU*
96 void Refresh(); //Long Peixun's update: Refresh
97
98 inline void SetMarkerSize(Float_t size) { fMarkerSize = size; }
99
100 //Long Peixun's update: Add access functions for CGEM visibility
101 inline Bool_t GetVisCgemGlobal() { return fStatusCurrent->fCgemGlobal; }
102 inline Bool_t GetVisCgemLayers() { return fStatusCurrent->fCgemLayers; }
103 inline Bool_t GetVisCgemXStrips() { return fStatusCurrent->fCgemXStrips; }
104 inline Bool_t GetVisCgemVStrips() { return fStatusCurrent->fCgemVStrips; }
105
106 inline void SetVisCgemGlobal(Bool_t input) { fStatusCurrent->fCgemGlobal = input; }
107 inline void SetVisCgemLayers(Bool_t input) { fStatusCurrent->fCgemLayers = input; }
108 inline void SetVisCgemXStrips(Bool_t input) { fStatusCurrent->fCgemXStrips = input; }
109 inline void SetVisCgemVStrips(Bool_t input) { fStatusCurrent->fCgemVStrips = input; }
110
111 //access functions for Mdc visibility
112 inline Bool_t GetVisMdcGlobal() { return fStatusCurrent->fMdcGlobal; }
113 inline Bool_t GetVisMdcTubes() { return fStatusCurrent->fMdcTubes; }
114 inline Bool_t GetVisMdcWires() { return fStatusCurrent->fMdcWires; }
115
116 inline void SetVisMdcGlobal (Bool_t input) { fStatusCurrent->fMdcGlobal = input; }
117 inline void SetVisMdcTubes(Bool_t input) { fStatusCurrent->fMdcTubes = input; }
118 inline void SetVisMdcWires(Bool_t input) { fStatusCurrent->fMdcWires = input; }
119
120 //access functions for Tof visibility
121 inline Bool_t GetVisTofGlobal() { return fStatusCurrent->fTofGlobal; }
122 inline Bool_t GetVisTofEast() { return fStatusCurrent->fTofEast; }
123 inline Bool_t GetVisTofBarrel() { return fStatusCurrent->fTofBarrel; }
124 inline Bool_t GetVisTofWest() { return fStatusCurrent->fTofWest; }
125 inline Float_t GetVisZoom() { return fStatusCurrent->fZoom; }
126
127 inline void SetVisTofGlobal(Bool_t input) { fStatusCurrent->fTofGlobal = input; }
128 inline void SetVisTofEast(Bool_t input) { fStatusCurrent->fTofEast = input; }
129 inline void SetVisTofBarrel(Bool_t input) { fStatusCurrent->fTofBarrel = input; }
130 inline void SetVisTofWest(Bool_t input) { fStatusCurrent->fTofWest = input; }
131 inline void SetVisZoom(Float_t input) { fStatusCurrent->fZoom = input; }
132
133 //access functions for Emc visibility
134 inline Bool_t GetVisEmcGlobal() { return fStatusCurrent->fEmcGlobal; }
135 inline Bool_t GetVisEmcEast() { return fStatusCurrent->fEmcEast; }
136 inline Bool_t GetVisEmcBarrel() { return fStatusCurrent->fEmcBarrel; }
137 inline Bool_t GetVisEmcWest() { return fStatusCurrent->fEmcWest; }
138 inline Bool_t GetVisEmcSide() { return fStatusCurrent->fEmcSide; }
139
140 inline void SetVisEmcGlobal(Bool_t input) { fStatusCurrent->fEmcGlobal = input; }
141 inline void SetVisEmcEast(Bool_t input) { fStatusCurrent->fEmcEast = input; }
142 inline void SetVisEmcBarrel(Bool_t input) { fStatusCurrent->fEmcBarrel = input; }
143 inline void SetVisEmcWest(Bool_t input) { fStatusCurrent->fEmcWest = input; }
144 inline void SetVisEmcSide(Bool_t input) { fStatusCurrent->fEmcSide = input; }
145
146 //access functions for Muc visibility
147 inline Bool_t GetVisMucGlobal() { return fStatusCurrent->fMucGlobal; }
148 inline Bool_t GetVisMucEast() { return fStatusCurrent->fMucEast; }
149 inline Bool_t GetVisMucBarrel() { return fStatusCurrent->fMucBarrel; }
150 inline Bool_t GetVisMucWest() { return fStatusCurrent->fMucWest; }
151 inline Bool_t GetVisMucStrips() { return fStatusCurrent->fMucStrips; }
152
153 inline void SetVisMucGlobal(Bool_t input) { fStatusCurrent->fMucGlobal = input; }
154 inline void SetVisMucEast(Bool_t input) { fStatusCurrent->fMucEast = input; }
155 inline void SetVisMucBarrel(Bool_t input) { fStatusCurrent->fMucBarrel = input; }
156 inline void SetVisMucWest(Bool_t input) { fStatusCurrent->fMucWest = input; }
157 inline void SetVisMucStrips(Bool_t input) { fStatusCurrent->fMucStrips = input; }
158
159 //access functions for Full3D visibility
160 inline Bool_t GetVisFull3DCgem() { return fStatusCurrent->fFull3DCgem; }
161 inline Bool_t GetVisFull3DMdc() { return fStatusCurrent->fFull3DMdc; }
162 inline Bool_t GetVisFull3DTof() { return fStatusCurrent->fFull3DTof; }
163 inline Bool_t GetVisFull3DEmc() { return fStatusCurrent->fFull3DEmc; }
164 inline Bool_t GetVisFull3DMuc() { return fStatusCurrent->fFull3DMuc; }
165
166 inline void SetVisFull3DCgem(Bool_t input) { fStatusCurrent->fFull3DCgem = input; }
167 inline void SetVisFull3DMdc(Bool_t input) { fStatusCurrent->fFull3DMdc = input; }
168 inline void SetVisFull3DTof(Bool_t input) { fStatusCurrent->fFull3DTof = input; }
169 inline void SetVisFull3DEmc(Bool_t input) { fStatusCurrent->fFull3DEmc = input; }
170 inline void SetVisFull3DMuc(Bool_t input) { fStatusCurrent->fFull3DMuc = input; }
171
172 //access functions for other parts visibility
173 inline Bool_t GetVisBeamPipe() { return fStatusCurrent->fBeamPipe; }
174 inline Bool_t GetVisZRPlaneOnXY() { return fStatusCurrent->fZRPlaneOnXY; }
175 inline Bool_t GetVisAxis() { return fStatusCurrent->fAxis; }
176
177 inline void SetVisBeamPipe(Bool_t input) { fStatusCurrent->fBeamPipe = input; }
178 inline void SetVisZRPlaneOnXY(Bool_t input) { fStatusCurrent->fZRPlaneOnXY = input; }
179 inline void SetVisAxis(Bool_t input) { fStatusCurrent->fAxis = input; }
180
181 //Long Peixun's update: access functions for Cgem hits
182 inline Bool_t GetVisCgemHitsGlobal() { return fStatusCurrent->fCgemHitsGlobal; }
183 inline Bool_t GetVisCgemHitsXStrip() { return fStatusCurrent->fCgemHitsXStrip; }
184 inline Bool_t GetVisCgemHitsVStrip() { return fStatusCurrent->fCgemHitsVStrip; }
185 inline Bool_t GetVisCgemHitsClusters() { return fStatusCurrent->fCgemHitsClusters; }
186
187 inline void SetVisCgemHitsGlobal(Bool_t input) { fStatusCurrent->fCgemHitsGlobal = input; }
188 inline void SetVisCgemHitsXStrip(Bool_t input) { fStatusCurrent->fCgemHitsXStrip = input; }
189 inline void SetVisCgemHitsVStrip(Bool_t input) { fStatusCurrent->fCgemHitsVStrip = input; }
190 inline void SetVisCgemHitsClusters(Bool_t input) { fStatusCurrent->fCgemHitsClusters = input; }
191
192 // access functions for Mdc hits
193 inline Bool_t GetVisMdcHitsGlobal() { return fStatusCurrent->fMdcHitsGlobal; }
194 inline Bool_t GetVisMdcHits() { return fStatusCurrent->fMdcHits; }
195
196 inline void SetVisMdcHitsGlobal (Bool_t input) { fStatusCurrent->fMdcHitsGlobal = input; }
197 inline void SetVisMdcHits(Bool_t input) { fStatusCurrent->fMdcHits = input; }
198
199 // access functions for Tof hits
200 inline Bool_t GetVisTofHitsGlobal() { return fStatusCurrent->fTofHitsGlobal; }
201 inline Bool_t GetVisTofHitsEast() { return fStatusCurrent->fTofHitsEast; }
202 inline Bool_t GetVisTofHitsBarrel() { return fStatusCurrent->fTofHitsBarrel; }
203 inline Bool_t GetVisTofHitsWest() { return fStatusCurrent->fTofHitsWest; }
204
205 inline void SetVisTofHitsGlobal (Bool_t input) { fStatusCurrent->fTofHitsGlobal = input; }
206 inline void SetVisTofHitsEast(Bool_t input) { fStatusCurrent->fTofHitsEast = input; }
207 inline void SetVisTofHitsBarrel(Bool_t input) { fStatusCurrent->fTofHitsBarrel = input; }
208 inline void SetVisTofHitsWest(Bool_t input) { fStatusCurrent->fTofHitsWest = input; }
209
210 // access functions for Emc hits
211 inline Bool_t GetVisEmcHitsGlobal() { return fStatusCurrent->fEmcHitsGlobal; }
212 inline Bool_t GetVisEmcHitsEast() { return fStatusCurrent->fEmcHitsEast; }
213 inline Bool_t GetVisEmcHitsBarrel() { return fStatusCurrent->fEmcHitsBarrel; }
214 inline Bool_t GetVisEmcHitsWest() { return fStatusCurrent->fEmcHitsWest; }
215 inline Bool_t GetVisEmcHitsSide() { return fStatusCurrent->fEmcHitsSide; }
216
217 inline void SetVisEmcHitsGlobal (Bool_t input) { fStatusCurrent->fEmcHitsGlobal = input; }
218 inline void SetVisEmcHitsEast(Bool_t input) { fStatusCurrent->fEmcHitsEast = input; }
219 inline void SetVisEmcHitsBarrel(Bool_t input) { fStatusCurrent->fEmcHitsBarrel = input; }
220 inline void SetVisEmcHitsWest(Bool_t input) { fStatusCurrent->fEmcHitsWest = input; }
221 inline void SetVisEmcHitsSide(Bool_t input) { fStatusCurrent->fEmcHitsSide = input; }
222
223 // access functions for Muc hits
224 inline Bool_t GetVisMucHitsGlobal() { return fStatusCurrent->fMucHitsGlobal; }
225 inline Bool_t GetVisMucHitsEast() { return fStatusCurrent->fMucHitsEast; }
226 inline Bool_t GetVisMucHitsBarrel() { return fStatusCurrent->fMucHitsBarrel; }
227 inline Bool_t GetVisMucHitsWest() { return fStatusCurrent->fMucHitsWest; }
228
229 inline void SetVisMucHitsGlobal (Bool_t input) { fStatusCurrent->fMucHitsGlobal = input; }
230 inline void SetVisMucHitsEast(Bool_t input) { fStatusCurrent->fMucHitsEast = input; }
231 inline void SetVisMucHitsBarrel(Bool_t input) { fStatusCurrent->fMucHitsBarrel = input; }
232 inline void SetVisMucHitsWest(Bool_t input) { fStatusCurrent->fMucHitsWest = input; }
233
234 // access functions for tracks
235 inline Bool_t GetVisTracksGlobal() { return fStatusCurrent->fTracksGlobal; }
236 inline Bool_t GetVisTracksMdc() { return fStatusCurrent->fTracksMdc; }
237 inline Bool_t GetVisTracksTof() { return fStatusCurrent->fTracksTof; }
238 inline Bool_t GetVisTracksEmc() { return fStatusCurrent->fTracksEmc; }
239 inline Bool_t GetVisTracksMuc() { return fStatusCurrent->fTracksMuc; }
240 inline Bool_t GetVisTracksExt() { return fStatusCurrent->fTracksExt; }
241
242 inline void SetVisTracksGlobal(Bool_t input) { fStatusCurrent->fTracksGlobal = input; }
243 inline void SetVisTracksMdc(Bool_t input) { fStatusCurrent->fTracksMdc = input; }
244 inline void SetVisTracksTof(Bool_t input) { fStatusCurrent->fTracksTof = input; }
245 inline void SetVisTracksEmc(Bool_t input) { fStatusCurrent->fTracksEmc = input; }
246 inline void SetVisTracksMuc(Bool_t input) { fStatusCurrent->fTracksMuc = input; }
247 inline void SetVisTracksExt(Bool_t input) { fStatusCurrent->fTracksExt = input; }
248
249 // access functions for fish eye
250 inline Bool_t GetFishEyeStatus() { return fStatusCurrent->fFishEye; }
251 inline Bool_t GetFishEye() { return fFishEye; }
252 inline void SetFishEye(Bool_t input = 0) {
253 if ( fViewType & k3DView ) {
254 fFishEye = 0;
255 fStatusCurrent->fFishEye = 0;
256 } else {
257 fFishEye = input;
258 fStatusCurrent->fFishEye = input;
259 }
260 } // *TOGGLE*
261
262 inline void PrintCurrent() { fStatusCurrent->Print(); }
263
264 // clean up right mouse button menu
265 inline virtual void Centered() { BesTView::Centered(); }
266 inline virtual void Front() { BesTView::Top(); }
267 inline virtual void Side() { BesTView::Side(); }
268 inline virtual void Top() { BesTView::Front(); }
269 // inline virtual void ShowAxis() { BesTView::ShowAxis(); }
270 inline virtual void ZoomMove() { BesTView::ZoomMove(); }
271 inline virtual void AdjustScales(TVirtualPad* pad = 0) { BesTView::AdjustScales(pad); }
272 inline virtual void Delete(Option_t* option) { BesTView::Delete(option); }
273 inline virtual void DrawClass() { BesTView::DrawClass(); }
274 inline virtual TObject* DrawClone(Option_t* option) { return BesTView::DrawClone(option); }
275
276#ifndef CL__DEBUG
277 inline virtual void Dump() { BesTView::Dump(); }
278 inline virtual void Inspect() { BesTView::Inspect(); }
279#endif
280
281 inline virtual void SetDrawOption(Option_t* option) { BesTView::SetDrawOption(option); }
282 inline virtual void SetLineAttributes() { BesTView::SetLineAttributes(); }
283
284 inline virtual void SetZoomFactor(Double_t factor) { fZoomFactor = factor; };
285 inline virtual Double_t GetZoomFactor() { return fZoomFactor; }
286 inline BesStatus* GetStatusCurrent() { return fStatusCurrent; };
287 inline BesStatus* GetStatus3D() { return fStatus3D; };
288 inline BesStatus* GetStatusXY() { return fStatusXY; };
289 inline BesStatus* GetStatusZR() { return fStatusZR; };
290
291 ClassDef(BesView,0) // BesVis View
292};
293
294#endif
double Phi(RecMdcKalTrack *trk)
Bool_t fTracksEmc
visibility flag for Tof Tracks
Bool_t fMucHitsEast
visibility flag for global Muc Hits
Bool_t fTofHitsEast
visibility flag for global Tof Hits
Bool_t fMucBarrel
visivility flag for Muc east EC
Bool_t fFull3DCgem
visivility flag for Muc strips
Bool_t fTracksMdc
visibility flag for global Tracks
Bool_t fTofBarrel
visibility flag for Tof east EC
Bool_t fTracksExt
visibility flag for Muc Tracks
Bool_t fMucStrips
visivility flag for Muc west EC
Bool_t fAxis
visibility flag for ZRPlaneOnXY
Bool_t fEmcHitsGlobal
visibility flag for Tof Hits West
Bool_t fMucHitsWest
visibility flag for Muc Hits Barrel
Bool_t fZRPlaneOnXY
visibility flag for beam pipe
Bool_t fMucWest
visivility flag for Muc barrel
Bool_t fMucEast
visivility flag for global Muc
Bool_t fMdcWires
visibility flag for Mdc main tubes
Bool_t fFull3DMuc
visivility flag for full 3D Emc
Bool_t fEmcGlobal
visibility flag for Tof west EC
Bool_t fTofHitsWest
visibility flag for Tof Hits Barrel
Bool_t fFull3DEmc
visivility flag for full 3D Tof
Bool_t fTofHitsBarrel
visibility flag for Tof Hits East
Bool_t fEmcWest
visivility flag for Emc barrel
Bool_t fTofWest
visibility flag for Tof barrel
Bool_t fTofEast
visibility flag for global Tof
Bool_t fTofHitsGlobal
visibility flag for Mdc Hits
Bool_t fEmcHitsBarrel
visibility flag for Emc Hits East
Bool_t fEmcEast
visivility flag for global Emc
Bool_t fMdcHits
visibility flag for global Mdc Hits
Bool_t fMdcTubes
visibility flag for global Mdc
Bool_t fEmcHitsSide
visibility flag for Emc Hits West
Bool_t fEmcHitsWest
visibility flag for Emc Hits Barrel
Bool_t fEmcSide
visivility flag for Emc west EC
Bool_t fFull3DTof
visivility flag for full 3D Mdc
Bool_t fTracksMuc
visibility flag for Emc Tracks
Bool_t fTofGlobal
visibility flag for Mdc wires
Bool_t fBeamPipe
visivility flag for full 3D Muc
Bool_t fMucHitsBarrel
visibility flag for Muc Hits East
Bool_t fEmcHitsEast
visibility flag for global Emc Hits
Bool_t fTracksTof
visibility flag for Mdc Tracks
Bool_t fEmcBarrel
visivility flag for Emc east EC
Bool_t fMucHitsGlobal
visibility flag for Emc Hits Side
Bool_t fTracksGlobal
visibility flag for Muc Hits West
ClassDef(BesTView, 2)
virtual void AdjustScales(TVirtualPad *pad=0)
Definition: BesTView.cxx:1737
Double_t GetExtent() const
Definition: BesTView.cxx:1124
virtual void SetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)
Definition: BesTView.cxx:1526
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)
Definition: BesView.cxx:728
void ZoomIn()
Definition: BesView.cxx:523
virtual TObject * DrawClone(Option_t *option)
virtual ~BesView()
Definition: BesView.cxx:73
virtual Int_t GetRSign(Float_t Phi)
Definition: BesView.cxx:621
void Move(Int_t px, Int_t py)
Definition: BesView.cxx:428
virtual void UpdateView(Bool_t resetview=kFALSE)
Definition: BesView.cxx:657
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Definition: BesView.cxx:869
virtual void ClearPad()
Definition: BesView.cxx:354
void Center()
Definition: BesView.cxx:475
void SetPhiRange(Float_t PhiMin=0, Float_t PhiMax=180)
Definition: BesView.cxx:641
virtual void SetViewTypeBare(EBESViewType ViewType, Bool_t resetview=kFALSE)
Definition: BesView.cxx:252
void Side3D()
Definition: BesView.cxx:858
void ZoomOut()
Definition: BesView.cxx:575
virtual void SetViewType(EBESViewType ViewType, Bool_t resetview=kFALSE)
Definition: BesView.cxx:96
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Definition: BesView.cxx:366
virtual void NDCtoWC(const Float_t *pn, Float_t *pw)
Definition: BesView.cxx:794
void Refresh()
Definition: BesView.cxx:915
virtual void DefaultRange()
Definition: BesView.cxx:88
void SetZoomRatio(Double_t ratio)
Definition: BesView.cxx:494
void Reset()
Definition: BesView.cxx:894
virtual void DrawLabel()
Definition: BesView.cxx:677