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