BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EventDisplay/BesVisLib/include/BesVisLib/TofROOTGeo.h
Go to the documentation of this file.
1//$id$
2/*
3 * 2004/11/29 Zhengyun You Peking University
4 * Tof Geometry General for EventDisplay
5 *
6 * 2004/12/9 Zhengyun You Peking University
7 * named from TofGeo to TofROOTGeo
8 * inherit from class SubDetectorROOTGeo
9 */
10
11#ifndef Tof_ROOT_GEO_H
12#define Tof_ROOT_GEO_H
13
14#include <TGeoNode.h>
15#include <TGeoPhysicalNode.h>
16#include <TGeoVolume.h>
17
18#include "SubDetectorROOTGeo.h"
19#include "Tof2DScin.h"
20
21/**
22 * Class TofGeo contains all of the objects necessary to describe the
23 * tof geometry.
24 *
25 * @author Zhengyun You \URL{mailto:youzy@hep.pku.cn}
26 *
27 */
28
29class TofROOTGeo : public SubDetectorROOTGeo {
30public:
31 /// Constructor.
33
34 /// Destructor.
36
37 // Long Peixun's update: return wether Tof contains Mrpc
38 bool GetMrpc() const { return fTofMrpc; }
39
40 /// Initialize ROOTGeo from GDML.
41 void InitFromGDML( const char* gdmlFile, const char* setupName );
42
43 /// Initialize ROOTGeo from TGeoVolume logicalTof.
44 void InitFromROOT( TGeoVolume* vol );
45
46 /// Initialize 2D Geometry
47 void Init2DGeometry();
48
49 /// Set the pointers to theirs nodes;
50 void SetNode();
51
52 /// Set default visual attributes;
54 // Long Peixun's update: Set default 3D color
56
57 /// Set all visible;
59 void SetTMatch( Bool_t input );
60 void SetQMatch( Bool_t input );
61
62 /// Set quater visible;
64
65 /// Set half visible;
66 void SetHalfVisible();
67
68 /// Set noend visible;
69 void SetNoEndVisible();
70
71 /// Set the pointers to the physical nodes;
73
74 /// Draw Detecor (what is detector depends on you)
75 void SetDetector();
76
77 /// Set all physicalNodes corresponding to digiCol;
78 void SetHits();
79
80 /// Set Tof detector visibility;
81 void SetVisTofDetector();
82
83 /// Set Tof hits visibility;
84 void SetVisTofHits();
85
86 /// Get number of part;
87 int GetPartNb();
88
89 /// Get number of scintillators on each part;
90 int GetScinNb( int part );
91
92 // Get number of layer on part;
93 int GetLayerNb( int part );
94
95 // Huang ShuHui's update: for Tof with MRPC
96 // Get number of Module/Container on each end-cap;
97 int GetModuleNb( int part );
98 // Get number of Strip on each module;
99 int GetStripNb( int module );
100 // Get bareChamber copy number;
101 int GetChamberNodeNb( int module );
102 // Get gasContainer copy number;
103 int GetContainerNodeNb( int module );
104 // Get pcbBoard1 copy number;
105 int GetBoard1NodeNb( int module );
106
107 /// Set Tof volume, while initializing from ROOT;
108 void SetVolumeTof( TGeoVolume* vol ) { m_Tof = vol; }
109
110 /// Get Tof volume;
111 TGeoVolume* GetVolumeTof() { return m_Tof; }
112
113 /// Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;
114 // TGeoVolumeAssembly *GetVolumeAssembly( int part );
115
116 /// Get part volume;
117 TGeoVolume* GetVolumePart( int part );
118
119 /// Get PVF volume;
120 TGeoVolume* GetVolumePVF( int part, int layer );
121
122 /// Get Al volume;
123 TGeoVolume* GetVolumeAl( int part, int layer );
124
125 /// Get scintillator volume;
126 TGeoVolume* GetVolumeScin( int part, int layer );
127
128 /// Get bucket volume;
129 TGeoVolume* GetVolumeBucket( int part, int layer );
130
131 /// Get PVF node;
132 TGeoNode* GetPVF( int part, int layer, int scin );
133
134 /// Get Al node;
135 TGeoNode* GetAl( int part, int layer );
136
137 /// Get scintillator node;
138 TGeoNode* GetScin( int part, int layer );
139
140 // Huang Shuhui's update: for Tof with MRPC
141 /// Get module node;
142 TGeoNode* GetModule( int part, int module );
143 /// Get strip node;
144 TGeoNode* GetStrip( int part, int module, int strip );
145 /// Get gasContainer node;
146 TGeoNode* GetgasContainer( int part, int module );
147 /// Get bareChamber node;
148 TGeoNode* GetbareChamber( int part, int module );
149 /// Get pcbBoard1 node;
150 TGeoNode* GetpcbBoard1( int part, int module );
151
152 /// Get bucket node, 0 for west bucket, 1 for the east one;
153 // TGeoNode *GetBucket( int part, int layer, int scin, int bucket );
154
155 /// Get scintillator physical node;
156 TGeoPhysicalNode* GetPhysicalScin( int part, int layer, int scin );
157
158 /// Get Tof2DScin;
159 Tof2DScin* Get2DScin( Int_t part, Int_t layer, Int_t scin );
160
161 /// Get part no of a scintillator physcial node
162 Int_t GetPart( TGeoPhysicalNode* phyNode );
163
164 /// Draw function
165 void Draw( Option_t* option );
166
167 /// Draw 2D hits
168 void DrawHits( Option_t* option );
169
170private:
171 static const int m_kPart = 3;
172 static const int m_kLayerBr = 2;
173 static const int m_kLayerEc = 1;
174 static const int m_kScinBr = 88;
175 static const int m_kScinEc = 48;
176 static const int m_kBucketEc = 1;
177 static const int m_kBucketBr = 2;
178
179 static const int m_kModuleEc = 36; // Huang Shuhui's update: For Mrpc
180 static const int m_kStripEc = 12; // Huang Shuhui's update: For Mrpc
181 static const int m_kChamberNodeNb =
182 6; // Huang Shuhui's update: For Mrpc Geometry Initialization
183 static const int m_kContainerNodeNb =
184 0; // Huang Shuhui's update: For Mrpc Geometry Initialization
185 static const int m_kBoard1NodeNb =
186 30; // Huang Shuhui's update: For Mrpc Geometry Initialization
187
188 static const int TOF_TIME_FACTOR = 1000000;
189 static const int TOF_CHARGE_FACTOR = 1000000;
190
191 Bool_t k_TMatch;
192 Bool_t k_QMatch;
193
194 int m_TofColor;
195 int m_BucketColor;
196 int m_ScinColor;
197
198 TGeoVolume* m_Tof;
199 TGeoNode* m_NodePVF[m_kPart][m_kLayerBr][m_kScinBr];
200 TGeoNode* m_NodeAl[m_kPart][m_kLayerBr];
201 TGeoNode* m_NodeScin[m_kPart][m_kLayerBr];
202 TGeoPhysicalNode* m_PhysicalScin[m_kPart][m_kModuleEc][m_kScinBr]; // Huang Shuhui's update:
203 // m_kLayerBr ->
204 // m_kModuleEc
205
206 // Huang Shuhui's update: For Mrpc
207 TGeoNode* m_NodeModule[m_kPart][m_kModuleEc];
208 TGeoNode* m_NodegasContainer[m_kPart][m_kModuleEc];
209 TGeoNode* m_NodebareChamber[m_kPart][m_kModuleEc];
210 TGeoNode* m_NodepcbBoard1[m_kPart][m_kModuleEc];
211 TGeoNode* m_NodeStrip[m_kPart][m_kModuleEc][m_kStripEc];
212 // Long Peixun's update: Merge m_PhysicalMrpc into m_PhysicalScin
213 // TGeoPhysicalNode *m_PhysicalMrpc[m_kPart][m_kModuleEc][m_kStripEc];
214
215 const TObjArray* m_TofDigiCol;
216
217 // Huang Shuhui's update: Geometry flag for Tof_mrpc
218 // Long Peixun's update: Change fTofMrpc to be a private variable
219 Bool_t fTofMrpc;
220
221 // 2D
222 Tof2DScin* m_Tof2DScin[m_kPart][m_kModuleEc][m_kScinBr]; // Huang Shuhui's update: m_kLayerBr
223 // -> m_kModuleEc
224};
225
226#endif /* Tof_ROOT_GEO_H */
legend Draw()
TGeoNode * GetAl(int part, int layer)
Get Al node;.
void SetQuarterVisible()
Set quater visible;.
TGeoNode * GetpcbBoard1(int part, int module)
Get pcbBoard1 node;.
TGeoVolume * GetVolumeScin(int part)
Get scintillator volume;.
void SetVolumeTof(TGeoVolume *vol)
Set Tof volume, while initializing from ROOT;.
void InitFromROOT(TGeoVolume *vol)
Initialize ROOTGeo from TGeoVolume logicalTof.
TGeoVolume * GetVolumeAl(int part, int layer)
Get Al volume;.
TGeoNode * GetModule(int part, int module)
Get module node;.
TGeoNode * GetgasContainer(int part, int module)
Get gasContainer node;.
int GetPartNb()
Get number of part;.
void InitFromGDML(const char *gdmlFile, const char *setupName)
Initialize ROOTGeo from GDML.
TGeoVolume * GetVolumeTof()
Get Tof volume;.
TGeoVolume * GetVolumeBucket(int part)
Get bucket volume;.
void SetHalfVisible()
Set half visible;.
TGeoNode * GetbareChamber(int part, int module)
Get bareChamber node;.
void SetNoEndVisible()
Set noend visible;.
void SetHits()
Set all physicalNodes corresponding to digiCol;.
TofROOTGeo()
Constructor.
TGeoVolume * GetVolumePart(int part)
Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;.
void SetDetector()
Draw Detecor (what is detector depends on you).
void DrawHits(Option_t *option)
Draw 2D hits.
Tof2DScin * Get2DScin(Int_t part, Int_t layer, Int_t scin)
Get Tof2DScin;.
~TofROOTGeo()
Destructor.
TGeoNode * GetStrip(int part, int module, int strip)
Get strip node;.
void SetVisTofDetector()
Set Tof detector visibility;.
int GetScinNb(int part)
Get number of scintillators on each part;.
void SetPhysicalNode()
Set the pointers to the physical nodes;.
TGeoNode * GetPVF(int part, int layer, int scin)
Get PVF node;.
void Init2DGeometry()
Initialize 2D Geometry.
TGeoVolume * GetVolumePVF(int part, int layer)
Get PVF volume;.
void SetVisTofHits()
Set Tof hits visibility;.
TGeoPhysicalNode * GetPhysicalScin(int part, int scin)
Get scintillator physical node;.
Int_t GetPart(TGeoPhysicalNode *phyNode)
Get part no of a scintillator physcial node.
TGeoNode * GetScin(int part, int layer)
Get scintillator node;.
void SetNode()
Set the pointers to theirs nodes;.
void SetVolumeDefaultVis()
Set default visual attributes;.
void SetAllVisible()
Set all visible;.