BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EventDisplay/BesVisLib/include/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#include <TArc.h>
13#include <TCanvas.h>
14#include <TGeoVolume.h>
15#include <TImage.h>
16#include <TPaveText.h>
17#include <TQObject.h>
18#include <TString.h>
19#include <TView.h>
20#include <TWbox.h>
21
22#include "Bes2DView.h"
23#include "BesGeometry.h"
24#include "BesHeader.h"
25#include "BesView.h"
26#include "EmcROOTGeo.h"
27#include "MdcROOTGeo.h"
28#include "MucROOTGeo.h"
29#include "TofROOTGeo.h"
30#include <vector>
31
32using std::vector;
33
34class TPolyLine3D;
35
36class BesVisDisplay : public TQObject {
37
38private:
39 Int_t fDisplayMode; // Flag for display mode, 0: 2D XY+ZR, 1: 2D XY, 2: 2D ZR, 3: 3D, 4:
40 // 2D+3D
41 // Long Peixun's setting: 5 for CGEM Unfolded display, 6 for CGEM
42 // 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
120public:
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 if ( fDisplayMode == 0 || fDisplayMode == 4 ) return false;
131 else return true;
132 }
133 virtual void SwitchDisplayMode( Int_t mode );
134 virtual void ResizePad();
135 virtual void SwitchPad();
136 TPad* GetPadXY() { return fPadXY; }
137 TPad* GetPadZR() { return fPadZR; }
138 TPad* GetPad3D() { return fPad3D; }
139 virtual void DrawHeader();
140 virtual void Reset();
141 virtual void Refresh(); // Long Peixun's update: Refresh views
142
143 // Long Peixun's update: Add parameters for MRPC and CGEM
144 virtual void InitGeometryFromGDML( const TString fPath, bool mrpc = false,
145 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,
197 Option_t* option = "" );
198 virtual void PaintParticles( Option_t* option = "" );
199
200 Float_t PTcut() { return fPTcut; }
201 Float_t PTcutEGMUNU() { return fPTcutEGMUNU; }
202 Float_t Rin() { return fRin; }
203 Float_t Rout() { return fRout; }
204 virtual void SetDrawClusters( Bool_t draw = kTRUE ) { fDrawClusters = draw; } // *MENU*
205 virtual void SetDrawParticles( Bool_t draw = kTRUE ) { fDrawParticles = draw; } // *MENU*
206
207 virtual void SetPTcut( Float_t ptcut = 0.4 ); // *MENU*
208 virtual void SetPTcutEGMUNU( Float_t ptcut = 5 ); // *MENU*
209 virtual void SetView( Float_t theta, Float_t phi );
210 virtual void ShowNextEvent( Int_t delta = 1 );
211 void SetMdcCon( Int_t mdcCon ) { fMdcCon = mdcCon; }
212 void SetTofCon( Int_t tofCon ) { fTofCon = tofCon; }
213 void SetEmcCon( Int_t emcCon ) { fEmcCon = emcCon; }
214 void SetMucCon( Int_t mucCon ) { fMucCon = mucCon; }
215 void SetAllVisible( Int_t vis ) { fAllVis = vis; }
216 void SetQuarterVisible( Int_t vis ) { fQuarterVis = vis; }
217 void SetHalfVisible( Int_t vis ) { fHalfVis = vis; }
218 void SetNoEndVisible( Int_t vis ) { fNoEndVis = vis; }
219 void SetMdcFiredCell();
220 void SetTofFiredCell();
221 void SetEmcFiredCell();
222 void SetMucFiredCell();
223 virtual void SizeFruit() const;
224 virtual void SizeParticles() const;
225
226 Float_t Zin() { return fZin; }
227 Float_t Zout() { return fZout; }
228
229 ClassDef( BesVisDisplay,
230 1 ) // Utility class to display ATLAS outline, tracks, clusters, jets,..
231};
232
234
235#endif
legend Draw()
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="")