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