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