BOSS 6.6.4.p03
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
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
72 Bool_t fDrawParticles2;
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 Int_t fMdcCon; //Mdc Construction flag
107 Int_t fTofCon; //Tof Construction flag
108 Int_t fEmcCon; //Emc Construction flag
109 Int_t fMucCon; //Muc Construction flag
110 Int_t fAllVis; //All node visible flag
111 Int_t fQuarterVis; //Quarter visible flag
112 Int_t fHalfVis; //Half visible flag
113 Int_t fNoEndVis; //NoEnd visible flag
114 BesView *fxyView; // XY View pointer;
115 BesView *fzrView; // ZR View pointer;
116 BesView *f3DView; // 3D View pointer;
117
118 public:
120 BesVisDisplay(const char *title);
121 virtual ~BesVisDisplay();
122
123 virtual void SetCanvas(TCanvas *c=0);
124
125 inline void SetDisplayMode(Int_t mode) { fDisplayMode = mode; }
126 inline Int_t GetDisplayMode() { return fDisplayMode; }
127 inline Bool_t IsVHeader() { if (fDisplayMode == 0 || fDisplayMode == 4) return false; else return true; }
128 virtual void SwitchDisplayMode(Int_t mode);
129 virtual void ResizePad();
130 virtual void SwitchPad();
131 TPad * GetPadXY() { return fPadXY; }
132 TPad * GetPadZR() { return fPadZR; }
133 TPad * GetPad3D() { return fPad3D; }
134 virtual void DrawHeader();
135 virtual void Reset();
136
137 virtual void InitGeometryFromGDML(const TString fPath);
138 virtual void InitGeometryFromROOT(TGeoVolume *bes);
139 BesGeometry* GetBesGeometry() { return fBesGeometry; }
140
141 virtual void SetMdcOn(Bool_t MdcOn); // *TOGGLE*
142 inline Bool_t GetMdcOn() { return fMdcOn; }
143 virtual void SetTofOn(Bool_t TofOn); // *TOGGLE*
144 inline Bool_t GetTofOn() { return fTofOn; }
145 virtual void SetEmcOn(Bool_t EmcOn); // *TOGGLE*
146 inline Bool_t GetEmcOn() { return fEmcOn; }
147
148 virtual Bool_t AllViews() {return fDrawAllViews;}
149 virtual void Clear(Option_t *option="");
150 //virtual void DisplayButtons();
151 virtual void DisplayTrigger(Int_t trig);
152 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
153 virtual void Draw(Option_t *option="");
154 void Draw2D(Option_t *option="");
155 void Draw3D(Option_t *option="");
156 void Draw2DXY(Option_t *option="");
157 void Draw2DZR(Option_t *option="");
158 virtual void DrawAllViews();
159 Bool_t DrawClusters() {return fDrawClusters;}
160 Bool_t DrawParticles() {return fDrawParticles;}
161
162 Bool_t DrawParticles2() {return fDrawParticles2;}
163
164 virtual void DrawTitle(Option_t *option="");
165 virtual void DrawView(Float_t theta, Float_t phi);
166 void DrawViewRange(Double_t x0, Double_t y0, Double_t z0, Double_t zoomSize);
167 virtual void DrawViewGL();
168 virtual void DrawViewX3D();
169 virtual void DrawViewRaytracer(Float_t theta, Float_t phi, Float_t psi);
170 virtual void DrawViewX3D(char option);
171 void DrawImageSequence(Int_t thetaStart, Int_t thetaStep);
172 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
173 virtual void GetEvent(Long64_t event); // *MENU*
174 TGeoVolume *GetVolBes() {return fBes;}
175 MdcROOTGeo *GetMdcROOTGeo() {return fMdcROOTGeo;}
176 TofROOTGeo *GetTofROOTGeo() {return fTofROOTGeo;}
177 EmcROOTGeo *GetEmcROOTGeo() {return fEmcROOTGeo;}
178 MucROOTGeo *GetMucROOTGeo() {return fMucROOTGeo;}
179 void Init();
180 //TNode *Nodin() {return fNodin;}
181 //TTUBE *Tubin() {return fTubin;}
182 TPad *Pad() {return fPad;}
183 virtual void Paint(Option_t *option="");
184 virtual void PaintFruit(TObject *obj, Float_t eta, Float_t phi, Float_t pt, Int_t type, Option_t *option="");
185 virtual void PaintParticles(Option_t *option="");
186
187 Float_t PTcut() {return fPTcut;}
188 Float_t PTcutEGMUNU() {return fPTcutEGMUNU;}
189 Float_t Rin() {return fRin;}
190 Float_t Rout() {return fRout;}
191 virtual void SetDrawClusters(Bool_t draw=kTRUE) {fDrawClusters=draw;} // *MENU*
192 virtual void SetDrawParticles(Bool_t draw=kTRUE) {fDrawParticles=draw;} // *MENU*
193
194 virtual void SetPTcut(Float_t ptcut=0.4); // *MENU*
195 virtual void SetPTcutEGMUNU(Float_t ptcut=5); // *MENU*
196 virtual void SetView(Float_t theta, Float_t phi);
197 virtual void ShowNextEvent(Int_t delta=1);
198 void SetMdcCon(Int_t mdcCon) {fMdcCon=mdcCon;}
199 void SetTofCon(Int_t tofCon) {fTofCon=tofCon;}
200 void SetEmcCon(Int_t emcCon) {fEmcCon=emcCon;}
201 void SetMucCon(Int_t mucCon) {fMucCon=mucCon;}
202 void SetAllVisible(Int_t vis) {fAllVis = vis;}
203 void SetQuarterVisible(Int_t vis) {fQuarterVis = vis;}
204 void SetHalfVisible(Int_t vis) {fHalfVis = vis;}
205 void SetNoEndVisible(Int_t vis) {fNoEndVis = vis;}
206 void SetMdcFiredCell();
207 void SetTofFiredCell();
208 void SetEmcFiredCell();
209 void SetMucFiredCell();
210 virtual void SizeFruit() const;
211 virtual void SizeParticles() const;
212
213 Float_t Zin() {return fZin;}
214 Float_t Zout() {return fZout;}
215
216 ClassDef(BesVisDisplay, 1) //Utility class to display ATLAS outline, tracks, clusters, jets,..
217};
218
220
221#endif
R__EXTERN BesVisDisplay * gDisplay
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 GetTofOn()
Float_t Rout()
Bool_t GetEmcOn()
Float_t Zin()
void SetDisplayMode(Int_t mode)
MucROOTGeo * GetMucROOTGeo()
virtual void SizeParticles() const
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 Clear(Option_t *option="")
Bool_t DrawParticles2()
TPad * GetPad3D()
TPad * GetPadXY()
void SetQuarterVisible(Int_t vis)
virtual void DrawHeader()
void SetMdcCon(Int_t mdcCon)
Float_t Rin()
Float_t Zout()
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 InitGeometryFromGDML(const TString fPath)
virtual void DrawTitle(Option_t *option="")
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)
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="")
void Draw2DXY(Option_t *option="")
Bool_t DrawParticles()
c1_1 Draw()