BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EventDisplay/BesVisLib/include/BesVisLib/MucROOTGeo.h
Go to the documentation of this file.
1//$id$
2/*
3 * 2004/9/20 Zhengyun You Peking University
4 * Muc Geometry General for EventDisplay
5 *
6 * 2004/12/11 Zhengyun You Peking University
7 * named from MucGeo to MucROOTGeo
8 * inherit from class SubDetectorROOTGeo
9 */
10
11#ifndef Muc_ROOT_GEO_H
12#define Muc_ROOT_GEO_H
13
14#include <TGeoNode.h>
15#include <TGeoPhysicalNode.h>
16#include <TGeoVolume.h>
17
18#include "BesPolygon2D.h"
19#include "Muc2DStrip.h"
20#include "SubDetectorROOTGeo.h"
21
22/**
23 * Class MucGeo contains all of the objects necessary to describe the
24 * muc geometry.
25 *
26 * @author Zhengyun You \URL{mailto:youzy@hep.pku.cn}
27 *
28 */
29
30class MucROOTGeo : public SubDetectorROOTGeo {
31public:
32 /// Constructor.
34
35 /// Destructor.
37
38 /// Initialize ROOTGeo from GDML.
39 void InitFromGDML( const char* gdmlFile, const char* setupName );
40
41 /// Initialize ROOTGeo from TGeoVolume logicalMuc.
42 void InitFromROOT( TGeoVolume* vol );
43
44 /// Initialize 2D Geometry
45 void Init2DGeometry();
46
47 /// Set the pointers to theirs nodes;
48 void SetNode();
49
50 /// Set default visual attributes;
52
53 // Long Peixun's update: Set detector 3D color
55
56 /// Set all visible;
58
59 /// Set quater visible;
61
62 /// Set half visible;
63 void SetHalfVisible();
64
65 /// Set noend visible;
66 void SetNoEndVisible();
67
68 /// Set the pointers to the physical nodes;
70
71 /// Set Detecor (what is detector depends on you)
72 void SetDetector();
73
74 /// Set all physicalNodes corresponding to digiCol;
75 void SetHits();
76
77 /// Set Muc detector visibility;
78 void SetVisMucDetector();
79
80 /// Set Muc hits visibility;
81 void SetVisMucHits();
82
83 /// Get number of part;
84 int GetPartNb();
85
86 /// Get number of segment on part;
87 int GetSegNb( int part );
88
89 /// Get number of gap on part;
90 int GetGapNb( int part );
91
92 /// Get number of strip on gap;
93 int GetStripNb( int part, int seg, int gap );
94
95 /// Get number of absorber on part;
96 int GetAbsorberNb( int part );
97
98 /// Set Muc volume, while initializing from ROOT;
99 void SetVolumeMuc( TGeoVolume* vol ) { m_Muc = vol; }
100
101 /// Get Muc volume;
102 TGeoVolume* GetVolumeMuc() { return m_Muc; }
103
104 /// Get absorber volume;
105 TGeoVolume* GetVolumeAbsorber( int part, int seg, int absorber );
106
107 /// Get absorber small block;
108 TGeoVolume* GetVolumeAbsorberSmallBlock( int gap, int sb );
109
110 /// Get absorber panel volume;
111 TGeoVolume* GetVolumeAbsorberPanel( int part, int seg, int absorber, int panel );
112
113 /// Get gap volume;
114 TGeoVolume* GetVolumeGap( int part, int seg, int gap );
115
116 /// Get box volume;
117 TGeoVolume* GetVolumeBox( int part, int seg, int gap );
118
119 /// Get box surface volume;
120 TGeoVolume* GetVolumeBoxSurface( int part, int seg, int gap, int up );
121
122 /// Get strip plane volume;
123 TGeoVolume* GetVolumeStripPlane( int part, int seg, int gap );
124
125 /// Get strip volume;
126 TGeoVolume* GetVolumeStrip( int part, int seg, int gap, int strip );
127
128 /// Get rpc gas chamber volume;
129 TGeoVolume* GetVolumeGasChamber( int part, int seg, int gap, int panel, int gasChamber );
130
131 /// Get rpc gas border volume;
132 TGeoVolume* GetVolumeGasBorder( int part, int seg, int gap, int panel, int gasChamber );
133
134 /// Get rpc bakelite volume;
135 TGeoVolume* GetVolumeBakelite( int part, int seg, int gap, int RpcUpDown, int panel,
136 int bakelite );
137
138 /// Get absorber node;
139 TGeoNode* GetAbsorber( int part, int seg, int absorber );
140
141 /// Get absorber panel node;
142 TGeoNode* GetAbsorberPanel( int part, int seg, int absorber, int panel );
143
144 /// Get gap node;
145 TGeoNode* GetGap( int part, int seg, int gap );
146
147 /// Get strip plane node;
148 TGeoNode* GetStripPlane( int part, int seg, int gap );
149
150 /// Get strip node;
151 TGeoNode* GetStrip( int part, int seg, int gap, int strip );
152
153 /// Get rpc gas chamber node;
154 // TGeoNode *GetGasChamber( int part, int seg, int gap, int gasChamber );
155
156 /// Get rpc bakelite node;
157 // TGeoNode *GetBakelite( int part, int seg, int gap, int bakelite );
158
159 /// Get absorber physical node;
160 TGeoPhysicalNode* GetPhysicalAbsorber( int part, int seg, int gap, int panel );
161
162 /// Get gap physical node;
163 TGeoPhysicalNode* GetPhysicalGap( int part, int seg, int gap );
164
165 /// Get strip physical node;
166 TGeoPhysicalNode* GetPhysicalStrip( int part, int seg, int gap, int strip );
167
168 /// Get Muc2DStrip;
169 Muc2DStrip* Get2DStrip( int part, int seg, int gap, int strip );
170
171 /// Get part no of a physcial node
172 Int_t GetPart( TGeoPhysicalNode* phyNode );
173
174 /// Is a segment visible in ZR view
175 Bool_t IsZRVisible( int part, int seg );
176
177 /// Get input value 0~360
178 Double_t Range360( Double_t input );
179
180 /// Draw function
181 void Draw( Option_t* option );
182
183 /// Draw 2D hits
184 void DrawHits( Option_t* option );
185
186private:
187 static const int m_kPart = 3;
188 static const int m_kSegMax = 8;
189 static const int m_kAbsorberMax = 9;
190 static const int m_kGapMax = 9;
191 static const int m_kPanelMax = 4;
192 static const int m_kStripMax = 112;
193 static const int m_kBakelite = 2;
194 static const int m_kGasChamber = 1;
195 static const int m_kSmallBlockMax = 2;
196 static const int m_kUpDown = 2;
197
198 static const int m_kSeg[m_kPart];
199 static const int m_kAbsorber[m_kPart];
200 static const int m_kGap[m_kPart];
201 static const int m_kPanel[m_kPart];
202 static const int m_kBakelitePanel[m_kPart][m_kUpDown];
203
204 int m_StripNum[m_kPart][m_kSegMax][m_kGapMax];
205
206 int m_MucColor;
207 int m_absorberColor;
208 int m_gapColor;
209 int m_gasChamberColor;
210 int m_bakeliteColor;
211 int m_stripColor;
212
213 static const Int_t m_kStripZMuliple =
214 12; // as dz is very thin, multiply so that it can be seen.
215
216 TGeoVolume* m_Muc;
217 TGeoNode* m_NodeAbsorber[m_kPart][m_kSegMax][m_kAbsorberMax];
218 TGeoNode* m_NodeAbsorberPanel[m_kPart][m_kSegMax][m_kAbsorberMax][m_kPanelMax];
219 TGeoNode* m_NodeGap[m_kPart][m_kSegMax][m_kGapMax];
220 TGeoNode* m_NodeStripPlane[m_kPart][m_kSegMax][m_kGapMax];
221 TGeoNode* m_NodeStrip[m_kPart][m_kSegMax][m_kGapMax][m_kStripMax];
222
223 TGeoPhysicalNode* m_PhysicalAbsorber[m_kPart][m_kSegMax][m_kAbsorberMax][m_kPanelMax];
224 TGeoPhysicalNode* m_PhysicalGap[m_kPart][m_kSegMax][m_kGapMax];
225 TGeoPhysicalNode* m_PhysicalStrip[m_kPart][m_kSegMax][m_kGapMax][m_kStripMax];
226
227 const TObjArray* m_MucDigiCol;
228
229 // 2D
230 BesPolygon2D* m_MucXY[m_kPart][m_kSegMax];
231 BesPolygon2D* m_MucZR[m_kPart][m_kSegMax];
232 BesPolygon2D* m_MucXYGap[m_kPart][m_kSegMax][m_kGapMax];
233 BesPolygon2D* m_MucZRGap[m_kPart][m_kSegMax][m_kGapMax];
234
235 Muc2DStrip* m_Muc2DStrip[m_kPart][m_kSegMax][m_kGapMax][m_kStripMax];
236};
237
238#endif /* Muc_ROOT_GEO_H */
legend Draw()
TGeoVolume * GetVolumeMuc()
Get Muc volume;.
void SetQuarterVisible()
Set quater visible;.
TGeoVolume * GetVolumeStripPlane(int part, int seg, int gap)
Get strip plane volume;.
void SetPhysicalNode()
Set the pointers to the physical nodes;.
int GetGapNb(int part)
Get number of gap on part;.
void SetDetector()
Set Detecor (what is detector depends on you).
void SetVolumeDefaultVis()
Set default visual attributes;.
TGeoVolume * GetVolumeGasChamber(int part, int seg, int gap, int panel, int gasChamber)
Get rpc gas chamber volume;.
void SetHalfVisible()
Set half visible;.
int GetAbsorberNb(int part)
Get number of absorber on part;.
MucROOTGeo()
Constructor.
TGeoPhysicalNode * GetPhysicalStrip(int part, int seg, int gap, int strip)
Get strip physical node;.
TGeoVolume * GetVolumeBox(int part, int seg, int gap)
Get box volume;.
TGeoVolume * GetVolumeBakelite(int part, int seg, int gap, int panel, int bakelite)
Get rpc bakelite volume;.
TGeoVolume * GetVolumeGasBorder(int part, int seg, int gap, int panel, int gasChamber)
Get rpc gas border volume;.
Double_t Range360(Double_t input)
Get input value 0~360.
void SetNode()
Set the pointers to theirs nodes;.
void SetVolumeMuc(TGeoVolume *vol)
Set Muc volume, while initializing from ROOT;.
TGeoVolume * GetVolumeAbsorberPanel(int part, int seg, int absorber, int panel)
Get absorber panel volume;.
TGeoNode * GetAbsorber(int part, int seg, int absorber)
Get absorber node;.
Bool_t IsZRVisible(int part, int seg)
Is a segment visible in ZR view.
void SetVisMucDetector()
Set Muc detector visibility;.
void SetAllVisible()
Set all visible;.
Int_t GetPart(TGeoPhysicalNode *phyNode)
Get part no of a physcial node.
int GetSegNb(int part)
Get number of segment on part;.
TGeoVolume * GetVolumeGap(int part, int seg, int gap)
Get gap volume;.
int GetPartNb()
Get number of part;.
void SetHits()
Set all physicalNodes corresponding to digiCol;.
~MucROOTGeo()
Destructor.
void SetNoEndVisible()
Set noend visible;.
TGeoVolume * GetVolumeBoxSurface(int part, int seg, int gap, int up)
Get box surface volume;.
TGeoNode * GetGap(int part, int seg, int gap)
Get gap node;.
TGeoNode * GetStripPlane(int part, int seg, int gap)
Get strip plane node;.
TGeoVolume * GetVolumeStrip(int part, int seg, int gap, int strip)
Get strip volume;.
void SetVisMucHits()
Set Muc hits visibility;.
TGeoVolume * GetVolumeAbsorber(int part, int seg, int absorber)
Get absorber volume;.
TGeoPhysicalNode * GetPhysicalGap(int part, int seg, int gap)
Get gap physical node;.
TGeoNode * GetStrip(int part, int seg, int gap, int strip)
Get strip node;.
TGeoPhysicalNode * GetPhysicalAbsorber(int part, int seg, int gap, int panel)
Get rpc gas chamber node;.
void Init2DGeometry()
Initialize 2D Geometry.
void DrawHits(Option_t *option)
Draw 2D hits.
int GetStripNb(int part, int seg, int gap)
Get number of strip on gap;.
Muc2DStrip * Get2DStrip(int part, int seg, int gap, int strip)
Get Muc2DStrip;.
TGeoVolume * GetVolumeAbsorberSmallBlock(int gap, int sb)
Get absorber small block;.
TGeoNode * GetAbsorberPanel(int part, int seg, int absorber, int panel)
Get absorber panel node;.
void InitFromGDML(const char *gdmlFile, const char *setupName)
Initialize ROOTGeo from GDML.
void InitFromROOT(TGeoVolume *vol)
Initialize ROOTGeo from TGeoVolume logicalMuc.