CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
BesVisDisplay.h
Go to the documentation of this file.
1#ifndef BesVisDisplay_H
2#define BesVisDisplay_H
3
4//////////////////////////////////////////////////////////////////////////
5// //
6// BesVisDisplay //
7// //
8// Utility class to display ATLAS outline, tracks, clusters, jets,.. //
9// //
10//////////////////////////////////////////////////////////////////////////
11
12
13#include <TQObject.h>
14#include <TCanvas.h>
15#include <TArc.h>
16#include <TWbox.h>
17#include <TString.h>
18#include <TGeoVolume.h>
19#include <TView.h>
20#include <TImage.h>
21#include <TPaveText.h>
22
23#include "MdcROOTGeo.h"
24#include "TofROOTGeo.h"
25#include "EmcROOTGeo.h"
26#include "MucROOTGeo.h"
27#include "BesView.h"
28#include "Bes2DView.h"
29#include "BesGeometry.h"
30#include "BesHeader.h"
31#include <vector>
32
33using std::vector;
34
35class TPolyLine3D;
36
37class BesVisDisplay : public TQObject {
38
39private:
40
41 Int_t fDisplayMode; // Flag for display mode, 0: 2D XY+ZR, 1: 2D XY, 2: 2D ZR, 3: 3D, 4: 2D+3D
42 //Long Peixun's setting: 5 for CGEM Unfolded display, 6 for CGEM Unfolded all view
43 TPad *fPadHeader;
44 TPad *fPadXY;
45 TPad *fPadZR;
46 TPad *fPad3D;
47
48 //Long Peixun's update: Add pads for CGEM Unfolded display
49 TPad *fPadCgemUF[3];
50
51 BesHeader *fBesHeader;
52 TImage *fHeaderImage;
53 TImage *fHeaderHImage;
54 TImage *fHeaderVImage;
55 //TImage *fMdcPaletteImage;
56
57 Double_t fLatticeWidth; // Lattice Width
58 Double_t fTextSizeTitle; // Text Size: Title
59 Double_t fTextSizeTime; // Text Size: Time
60 Double_t fTextSizeData; // Text Size: Data
61 Double_t fTextSizeFlt; // Text Size: FLT
62 Double_t fCoordx; // x coordinate of text
63 Double_t fCoordy; // y coordinate of text
64 Double_t fDistanceOfRows;// Distance between rows
65
66 Bool_t fMdcOn;
67 Bool_t fTofOn;
68 Bool_t fEmcOn;
69
70 BesGeometry *fBesGeometry;
71
72 Bool_t fDrawAllViews; //Flag True if AllViews selected
73 Bool_t fDrawParticles; //Flag True if particles to be drawn
74 Bool_t fDrawParticles2;
75 Bool_t fVisHeader; //Long Peixun's update: visibility flag
76
77 Bool_t fDrawClusters; //Flag True if clusters to be drawn
78 Float_t fPTcut; //PT cut to display objects
79 Float_t fPTcutEGMUNU; //PT cut for Electrons, Gammas, MUons, Neutrinos
80 Float_t fRin; //Inner ATLAS radius
81 Float_t fRout; //Outer ATLAS radius
82 Float_t fZin; //Inner ATLAS length along Z
83 Float_t fZout; //Outer ATLAS length along Z
84 Float_t fTheta; //Viewing angle theta
85 Float_t fPhi; //Viewing angle phi
86 Float_t fBesR; //BesR
87 Float_t fBesZ; //BesZ
88 TCanvas *fCanvas; //Pointer to the display canvas
89 TPad *fTrigPad; //Pointer to the trigger pad
90 TPad *fButtons; //Pointer to the buttons pad
91 TPad *fPad; //Pointer to the event display main pad
92 TArc *fEM1; //Pointer to arc showing ON/OFF trigger EM1
93 TArc *fPH1; //Pointer to arc showing ON/OFF trigger PH1
94 TArc *fEM2; //Pointer to arc showing ON/OFF trigger EM2
95 TArc *fMU1; //Pointer to arc showing ON/OFF trigger MU1
96 TArc *fMU2; //Pointer to arc showing ON/OFF trigger MU2
97 TArc *fEMU; //Pointer to arc showing ON/OFF trigger EMU
98 TArc *fJT1; //Pointer to arc showing ON/OFF trigger JT1
99 TArc *fJT3; //Pointer to arc showing ON/OFF trigger JT3
100 TArc *fJT4; //Pointer to arc showing ON/OFF trigger JT4
101 TArc *fALL; //Pointer to arc showing ON/OFF trigger ALL
102 TGeoVolume *fBes; //Bes world volume
103 Int_t fRayPicCount; //Counter of picture
104
105 CgemROOTGeo *fCgemROOTGeo; //Long Peixun's update: Add CgemROOTGeo pointer
106 MdcROOTGeo *fMdcROOTGeo; //MdcROOTGeo
107 TofROOTGeo *fTofROOTGeo; //TofROOTGeo
108 EmcROOTGeo *fEmcROOTGeo; //EmcROOTGeo
109 MucROOTGeo *fMucROOTGeo; //MucROOTGeo
110
111 Int_t fMdcCon; //Mdc Construction flag
112 Int_t fTofCon; //Tof Construction flag
113 Int_t fEmcCon; //Emc Construction flag
114 Int_t fMucCon; //Muc Construction flag
115 Int_t fAllVis; //All node visible flag
116 Int_t fQuarterVis; //Quarter visible flag
117 Int_t fHalfVis; //Half visible flag
118 Int_t fNoEndVis; //NoEnd visible flag
119
120 BesView *fxyView; // XY View pointer;
121 BesView *fzrView; // ZR View pointer;
122 BesView *f3DView; // 3D View pointer;
123 //Long Peixun's update: CGEM Unfolded view pointers for each layer
124 BesView *fCgemUFView[3];
125 Int_t fCgemUFViewLayer; //which layer will be displayed in Cgem UF view
126
127 public:
129 BesVisDisplay(const char *title);
130 virtual ~BesVisDisplay();
131
132 virtual void SetCanvas(TCanvas *c=0);
133 inline void SetDisplayMode(Int_t mode) { fDisplayMode = mode; }
134 inline Int_t GetDisplayMode() { return fDisplayMode; }
135 inline Bool_t IsVHeader()
136 {
137 //Long Peixun's update: CGEM UF all view have horizontal header
138 if (fDisplayMode == 0 || fDisplayMode == 4 || fDisplayMode == 6) return false;
139 else return true;
140 }
141 virtual void SwitchDisplayMode(Int_t mode);
142 virtual void ResizePad();
143 virtual void SwitchPad();
144 TPad * GetPadXY() { return fPadXY; }
145 TPad * GetPadZR() { return fPadZR; }
146 TPad * GetPad3D() { return fPad3D; }
147 TPad * GetPadCgemUF(int layer) { return fPadCgemUF[layer]; } //Long Peixun's update: CGEM Unfolded pads
148
149 virtual void DrawHeader();
150 virtual void Reset();
151 virtual void Refresh(); //Long Peixun's update: Refresh views
152
153 //Long Peixun's update: Add parameters for MRPC and CGEM
154 virtual void InitGeometryFromGDML(const TString fPath, bool mrpc = false, bool cgem = false);
155 virtual void InitGeometryFromROOT(TGeoVolume *bes);
156 BesGeometry* GetBesGeometry() { return fBesGeometry; }
157
158 virtual void SetMdcOn(Bool_t MdcOn); // *TOGGLE*
159 inline Bool_t GetMdcOn() { return fMdcOn; }
160 virtual void SetTofOn(Bool_t TofOn); // *TOGGLE*
161 inline Bool_t GetTofOn() { return fTofOn; }
162 virtual void SetEmcOn(Bool_t EmcOn); // *TOGGLE*
163 inline Bool_t GetEmcOn() { return fEmcOn; }
164
165 //Long Peixun's update: Get and Set Header visibility flag
166 virtual void SetVisHeader(Bool_t val);
167 inline Bool_t GetVisHeader() const { return fVisHeader; }
168
169 virtual Bool_t AllViews() {return fDrawAllViews;}
170 virtual void Clear(Option_t *option="");
171 //virtual void DisplayButtons();
172 virtual void DisplayTrigger(Int_t trig);
173 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
174 virtual void Draw(Option_t *option="");
175 void Draw2D(Option_t *option="");
176 void Draw3D(Option_t *option="");
177 void Draw2DXY(Option_t *option="");
178 void Draw2DZR(Option_t *option="");
179 void DrawCgemUF(Option_t *option = ""); //Long Peixun's update: for CGEM UF view
180 void DrawCgemUFLayer(int layer, Option_t *option = ""); //Long Peixun's update: for each layer of CGEM
181 virtual void DrawAllViews();
182 Bool_t DrawClusters() {return fDrawClusters;}
183 Bool_t DrawParticles() {return fDrawParticles;}
184
185 Bool_t DrawParticles2() {return fDrawParticles2;}
186
187 virtual void DrawTitle(Option_t *option="");
188 virtual void DrawView(Float_t theta, Float_t phi);
189 void DrawViewRange(Double_t x0, Double_t y0, Double_t z0, Double_t zoomSize);
190 virtual void DrawViewGL();
191 virtual void DrawViewX3D();
192 virtual void DrawViewRaytracer(Float_t theta, Float_t phi, Float_t psi);
193 virtual void DrawViewX3D(char option);
194 void DrawImageSequence(Int_t thetaStart, Int_t thetaStep);
195 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
196 virtual void GetEvent(Long64_t event); // *MENU*
197 TGeoVolume *GetVolBes() {return fBes;}
198 CgemROOTGeo *GetCgemROOTGeo() {return fCgemROOTGeo;} //Long Peixun's updata: for CGEM
199 MdcROOTGeo *GetMdcROOTGeo() {return fMdcROOTGeo;}
200 TofROOTGeo *GetTofROOTGeo() {return fTofROOTGeo;}
201 EmcROOTGeo *GetEmcROOTGeo() {return fEmcROOTGeo;}
202 MucROOTGeo *GetMucROOTGeo() {return fMucROOTGeo;}
203 void Init();
204 //TNode *Nodin() {return fNodin;}
205 //TTUBE *Tubin() {return fTubin;}
206 TPad *Pad() {return fPad;}
207 virtual void Paint(Option_t *option="");
208 virtual void PaintFruit(TObject *obj, Float_t eta, Float_t phi, Float_t pt, Int_t type, Option_t *option="");
209 virtual void PaintParticles(Option_t *option="");
210
211 Float_t PTcut() {return fPTcut;}
212 Float_t PTcutEGMUNU() {return fPTcutEGMUNU;}
213 Float_t Rin() {return fRin;}
214 Float_t Rout() {return fRout;}
215 virtual void SetDrawClusters(Bool_t draw=kTRUE) {fDrawClusters=draw;} // *MENU*
216 virtual void SetDrawParticles(Bool_t draw=kTRUE) {fDrawParticles=draw;} // *MENU*
217
218 virtual void SetPTcut(Float_t ptcut=0.4); // *MENU*
219 virtual void SetPTcutEGMUNU(Float_t ptcut=5); // *MENU*
220 virtual void SetView(Float_t theta, Float_t phi);
221 virtual void ShowNextEvent(Int_t delta=1);
222 void SetMdcCon(Int_t mdcCon) {fMdcCon=mdcCon;}
223 void SetTofCon(Int_t tofCon) {fTofCon=tofCon;}
224 void SetEmcCon(Int_t emcCon) {fEmcCon=emcCon;}
225 void SetMucCon(Int_t mucCon) {fMucCon=mucCon;}
226 void SetAllVisible(Int_t vis) {fAllVis = vis;}
227 void SetQuarterVisible(Int_t vis) {fQuarterVis = vis;}
228 void SetHalfVisible(Int_t vis) {fHalfVis = vis;}
229 void SetNoEndVisible(Int_t vis) {fNoEndVis = vis;}
230 void SetMdcFiredCell();
231 void SetTofFiredCell();
232 void SetEmcFiredCell();
233 void SetMucFiredCell();
234 virtual void SizeFruit() const;
235 virtual void SizeParticles() const;
236
237 //Long Peixun's update: Set which layer will be displayed in Cgem UF view
238 void SetCurrentCgemLayer(int layer)
239 {
240 if (layer < 0 || layer > 2) return;
241 fCgemUFViewLayer = layer;
242 }
243
244 Float_t Zin() {return fZin;}
245 Float_t Zout() {return fZout;}
246
247 ClassDef(BesVisDisplay, 1) //Utility class to display ATLAS outline, tracks, clusters, jets,..
248};
249
251
252#endif
R__EXTERN BesVisDisplay * gDisplay
float Float_t
virtual void SizeFruit() const
virtual void DrawViewRaytracer(Float_t theta, Float_t phi, Float_t psi)
void Draw3D(Option_t *option="")
virtual void SetMdcOn(Bool_t MdcOn)
virtual void PaintParticles(Option_t *option="")
Int_t GetDisplayMode()
void SetMucCon(Int_t mucCon)
virtual void Reset()
virtual void SetTofOn(Bool_t TofOn)
void SetNoEndVisible(Int_t vis)
virtual void SetPTcut(Float_t ptcut=0.4)
virtual void SetDrawParticles(Bool_t draw=kTRUE)
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual void SwitchPad()
Float_t PTcutEGMUNU()
MdcROOTGeo * GetMdcROOTGeo()
BesGeometry * GetBesGeometry()
void Draw2DZR(Option_t *option="")
Bool_t GetVisHeader() const
Bool_t GetTofOn()
void DrawCgemUFLayer(int layer, Option_t *option="")
Bool_t GetEmcOn()
void SetDisplayMode(Int_t mode)
MucROOTGeo * GetMucROOTGeo()
virtual void SizeParticles() const
void SetCurrentCgemLayer(int layer)
virtual void DrawViewGL()
virtual void DrawView(Float_t theta, Float_t phi)
virtual void SetDrawClusters(Bool_t draw=kTRUE)
Bool_t GetMdcOn()
void DrawImageSequence(Int_t thetaStart, Int_t thetaStep)
void SetEmcCon(Int_t emcCon)
virtual ~BesVisDisplay()
virtual void ResizePad()
virtual void SetPTcutEGMUNU(Float_t ptcut=5)
TPad * GetPadZR()
void SetTofCon(Int_t tofCon)
virtual void InitGeometryFromGDML(const TString fPath, bool mrpc=false, bool cgem=false)
virtual void Clear(Option_t *option="")
Bool_t DrawParticles2()
TPad * GetPad3D()
TPad * GetPadXY()
void SetQuarterVisible(Int_t vis)
virtual void DrawHeader()
void SetMdcCon(Int_t mdcCon)
TPad * GetPadCgemUF(int layer)
void SetAllVisible(Int_t vis)
virtual void InitGeometryFromROOT(TGeoVolume *bes)
virtual void Paint(Option_t *option="")
TofROOTGeo * GetTofROOTGeo()
virtual void ShowNextEvent(Int_t delta=1)
EmcROOTGeo * GetEmcROOTGeo()
Bool_t DrawClusters()
virtual void DrawViewX3D()
virtual void DrawTitle(Option_t *option="")
virtual void Refresh()
virtual void SetVisHeader(Bool_t val)
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual void SwitchDisplayMode(Int_t mode)
virtual void SetCanvas(TCanvas *c=0)
virtual Bool_t AllViews()
virtual void SetView(Float_t theta, Float_t phi)
virtual void DrawAllViews()
Bool_t IsVHeader()
void SetHalfVisible(Int_t vis)
void DrawViewRange(Double_t x0, Double_t y0, Double_t z0, Double_t zoomSize)
void DrawCgemUF(Option_t *option="")
virtual void SetEmcOn(Bool_t EmcOn)
Float_t PTcut()
virtual void GetEvent(Long64_t event)
void Draw2D(Option_t *option="")
virtual void DisplayTrigger(Int_t trig)
TGeoVolume * GetVolBes()
virtual void PaintFruit(TObject *obj, Float_t eta, Float_t phi, Float_t pt, Int_t type, Option_t *option="")
CgemROOTGeo * GetCgemROOTGeo()
void Draw2DXY(Option_t *option="")
Bool_t DrawParticles()
c1_1 Draw()