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