BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEmcConstruction.hh
Go to the documentation of this file.
1//---------------------------------------------------------------------------//
2// BOOST --- BESIII Object_Oreiented Simulation Tool //
3//---------------------------------------------------------------------------//
4//Descpirtion: EMC detector
5//Author: Fu Chengdong
6//Created: Sep 4, 2003
7//Comment:
8//---------------------------------------------------------------------------//
9//
10
11#ifndef BesEmcConstruction_h
12#define BesEmcConstruction_h 1
13
14//#include "G4VUserDetectorConstruction.hh"
15#include "globals.hh"
16#include "BesSubdetector.hh"
17#include "BesEmcGeometry.hh"
18#include "BesEmcEndGeometry.hh"
19#include "G4VPVParameterisation.hh"
20
21//#include "CLHEP/config/CLHEP.h"
22#include "CLHEP/Vector/ThreeVector.h"
23#include "CLHEP/Vector/Rotation.h"
24#include "CLHEP/Geometry/Point3D.h"
25#include "CLHEP/Geometry/Plane3D.h"
26#ifndef ENABLE_BACKWARDS_COMPATIBILITY
28#endif
29#ifndef ENABLE_BACKWARDS_COMPATIBILITY
30 // backwards compatibility will be enabled ONLY in CLHEP 1.9
31 typedef HepGeom::Plane3D<double> HepPlane3D;
32#endif
33
34
35using namespace CLHEP;
36
37class G4Box;
38class G4Tubs;
39class G4Cons;
40class G4Polyhedra;
41class G4Trap;
42class G4UnionSolid;
43class G4LogicalVolume;
44class G4VPhysicalVolume;
45class G4Material;
46class G4UniformMagField;
48class BesEmcSD;
49class G4IrregBox;
50class G4SubtractionSolid;
51
53{
54public: // with description
56 // Static method which returns the singleton pointer of G4RunManager or
57 // its derived class.
58
59private:
60 static BesEmcConstruction* fBesEmcConstruction;
61
62public:
63
66
67public:
68
69 inline void SetVerboseLevel(G4int val){ verboseLevel=val;}
70
71 void SetCrystalMaterial (G4String);
72
73 void SetCasingMaterial (G4String);
74 void SetCasingThickness(G4ThreeVector);
75
76 void SetBSCRmin(G4double);
77 void SetBSCNbPhi(G4int);
78 void SetBSCNbTheta(G4int);
79 void SetStartIDTheta(G4int);
80 void SetBSCCrystalLength(G4double);
81 void SetBSCYFront0(G4double);
82 void SetBSCYFront(G4double);
83 void SetBSCPosition0(G4double);
84 void SetBSCPosition1(G4double);
85
86 void SetMagField(G4double);
87
88 void Construct(G4LogicalVolume*);
89
90 void UpdateGeometry();
91
92 void ThreeVectorTrans( G4ThreeVector fPnt[8], double x[8], double y[8], double z[8] );
93 void TransformToArb8( const G4ThreeVector fPnt[8], G4ThreeVector newfPnt[8],
94 G4ThreeVector &center, G4ThreeVector &rotAngle );
95 Hep3Vector RotAngleFromNewZ( Hep3Vector newZ );
96
97public:
98
99 void PrintEMCParameters();
100
101 G4int GetVerboseLevel() {return verboseLevel;};
102 G4double GetMagField() {return fmagField;};
103
104 G4int GetStartIDTheta() {return startID;};
105
106 G4Material* GetCrystalMaterial() {return fCrystalMaterial;};
107 G4Material* GetCasingMaterial() {return fCasingMaterial;};
108 //G4ThreeVector GetCasingThickness() {return G4ThreeVector(fTyvekThickness,fAlThickness,fMylarThickness);};
109
110 const G4VPhysicalVolume* GetEMC() {return physiEMC; }
111 const G4VPhysicalVolume* GetBSCPhi() {return physiBSCPhi;};
112 const G4VPhysicalVolume* GetBSCTheta() {return physiBSCTheta;};
113 const G4VPhysicalVolume* GetBSCCrystal(){return physiBSCCrystal;};
114 const G4VPVParameterisation* GetCrystalParam(){return crystalParam;};
115
116private:
117
118 G4int verboseLevel;
119 G4double fmagField;
120
121 G4Material* fCrystalMaterial;
122
123 G4int phiNbCrystals;
124 G4int thetaNbCrystals;
125 G4int startID;
126
127 G4Material* fCasingMaterial;
128
129 G4Material* defaultMaterial;
130
131 G4Tubs* solidBSC; //Barrel
132 G4Cons* solidESC; //Endcap
133 G4UnionSolid* solidEMC;
134 G4LogicalVolume* logicEMC;
135 G4VPhysicalVolume* physiEMC;
136
137 G4SubtractionSolid* solidBSCWorld; //virtual volume for barrel
138 G4LogicalVolume* logicBSCWorld;
139 G4VPhysicalVolume* physiBSCWorld;
140
141 G4Tubs* solidBSCPhiTub;
142 G4Cons* solidConsPhi;
143 G4SubtractionSolid* solidBSCPhi1;
144 G4SubtractionSolid* solidBSCPhi; //pointer to the solid Layer
145 G4LogicalVolume* logicBSCPhi; //pointer to the logical Layer
146 G4VPhysicalVolume* physiBSCPhi; //pointer to the physical Layer
147
148 G4Trap* solidBSCTheta; //pointer to the solid Absorber
149 G4LogicalVolume* logicBSCTheta; //pointer to the logical Absorber
150 G4VPhysicalVolume* physiBSCTheta; //pointer to the physical Absorber
151
152 G4Trap* solidBSCCrystal; //pointer to the solid Absorber
153 G4LogicalVolume* logicBSCCrystal; //pointer to the logical Absorber
154 G4VPhysicalVolume* physiBSCCrystal; //pointer to the physical Absorber
155
156 G4UniformMagField* magField; //pointer to the magnetic field
157
158 BesEmcDetectorMessenger* detectorMessenger; //pointer to the Messenger
159 BesEmcSD* besEMCSD; //pointer to the sensitive detector
160 BesEmcGeometry *besEMCGeometry;
161 BesEmcEndGeometry *emcEnd;
162 G4VPVParameterisation* crystalParam;
163
164//Endcap geometry
165private:
166
167 G4Cons* solidEnd; //pointer to the endcap
168 G4LogicalVolume* logicEnd;
169 G4VPhysicalVolume* physiEnd;
170
171 G4Cons* solidEndPhi;
172 G4LogicalVolume* logicEndPhi;
173 G4VPhysicalVolume* physiEndPhi;
174
175 G4IrregBox* solidEndCasing;
176 G4LogicalVolume* logicEndCasing;
177 G4VPhysicalVolume* physiEndCasing;
178
179 G4IrregBox* solidEndCrystal;
180 G4LogicalVolume* logicEndCrystal;
181 G4VPhysicalVolume* physiEndCrystal;
182
183//other substance on the rear face of crystal
184private:
185
186 G4Box* solidRear; //virtual volume
187 G4LogicalVolume* logicRear;
188 G4VPhysicalVolume* physiRear;
189
190 G4Box* solidCasingBox; //casing
191 G4Box* solidAirHole;
192 G4SubtractionSolid* solidRearCasing;
193 G4LogicalVolume* logicRearCasing;
194 G4VPhysicalVolume* physiRearCasing;
195
196 G4Box* solidOrgGlass; //organic glass
197 G4LogicalVolume* logicOrgGlass;
198 G4VPhysicalVolume* physiOrgGlass;
199
200 G4Box* solidPD; //photodiode
201 G4LogicalVolume* logicPD;
202 G4VPhysicalVolume* physiPD;
203
204 G4Box* solidAlBox; //Al plate
205 G4SubtractionSolid* solidAlPlate;
206 G4LogicalVolume* logicAlPlate;
207 G4VPhysicalVolume* physiAlPlate;
208
209 G4Box* solidPreAmpBox; //preamplifier box
210 G4LogicalVolume* logicPreAmpBox;
211 G4VPhysicalVolume* physiPreAmpBox;
212
213 G4Box* solidAirInPABox; //air in preamplifier box
214 G4LogicalVolume* logicAirInPABox;
215 G4VPhysicalVolume* physiAirInPABox;
216
217 G4Box* solidHangingPlate; //stainless steel for hanging the crysta
218 G4LogicalVolume* logicHangingPlate;
219 G4VPhysicalVolume* physiHangingPlate;
220
221 G4Cons* solidOCGirder; //opening-cut girder
222 G4LogicalVolume* logicOCGirder;
223 G4VPhysicalVolume* physiOCGirder;
224
225 G4Tubs* solidCable; //cable
226 G4LogicalVolume* logicCable;
227 G4VPhysicalVolume* physiCable;
228
229 G4Tubs* solidWaterPipe; //water pipe
230 G4LogicalVolume* logicWaterPipe;
231 G4VPhysicalVolume* physiWaterPipe;
232
233//barrel support frame
234private:
235 G4Tubs* solidSupportBar; //support bar
236 G4LogicalVolume* logicSupportBar;
237 G4VPhysicalVolume* physiSupportBar;
238
239 G4Tubs* solidSupportBar1;
240 G4LogicalVolume* logicSupportBar1;
241 G4VPhysicalVolume* physiSupportBar1;
242
243 G4Tubs* solidEndRing; //end ring
244 G4LogicalVolume* logicEndRing;
245 G4VPhysicalVolume* physiEndRing;
246
247 G4Tubs* solidGear;
248 G4LogicalVolume* logicGear;
249 G4VPhysicalVolume* physiGear;
250
251 G4Tubs* solidTaperRing1; //taper ring
252 G4LogicalVolume* logicTaperRing1;
253 G4VPhysicalVolume* physiTaperRing1;
254
255 G4Cons* solidTaperRing2;
256 G4LogicalVolume* logicTaperRing2;
257 G4VPhysicalVolume* physiTaperRing2;
258
259 G4Cons* solidTaperRing3;
260 G4LogicalVolume* logicTaperRing3;
261 G4VPhysicalVolume* physiTaperRing3;
262
263private:
264 G4Material* rearCasingMaterial;
265 G4Material* organicGlass;
266 G4Material* stainlessSteel;
267 G4Material* cable;
268 G4Material* waterPipe;
269
270public:
271 void ConstructSPFrame(G4LogicalVolume*, BesEmcGeometry*);
272 void ConstructEndGeometry(G4LogicalVolume*);
273 void GetLogicalVolume();
274 void SetVisAndSD();
275 G4int ComputeEndCopyNb(G4int);
276
277private:
278
279 void DefineMaterials();
280 void ComputeEMCParameters();
281 // G4VPhysicalVolume* Construct(G4LogicalVolume*);
282};
283
284//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
285
286#endif
HepGeom::Point3D< double > HepPoint3D
HepGeom::Plane3D< double > HepPlane3D
const G4VPhysicalVolume * GetEMC()
static BesEmcConstruction * GetBesEmcConstruction()
const G4VPhysicalVolume * GetBSCCrystal()
const G4VPVParameterisation * GetCrystalParam()
void ThreeVectorTrans(G4ThreeVector fPnt[8], double x[8], double y[8], double z[8])
void ConstructSPFrame(G4LogicalVolume *, BesEmcGeometry *)
void Construct(G4LogicalVolume *)
void TransformToArb8(const G4ThreeVector fPnt[8], G4ThreeVector newfPnt[8], G4ThreeVector &center, G4ThreeVector &rotAngle)
void ConstructEndGeometry(G4LogicalVolume *)
void SetBSCPosition1(G4double)
void SetCasingThickness(G4ThreeVector)
void SetBSCCrystalLength(G4double)
void SetCrystalMaterial(G4String)
void SetBSCPosition0(G4double)
Hep3Vector RotAngleFromNewZ(Hep3Vector newZ)
const G4VPhysicalVolume * GetBSCTheta()
void SetCasingMaterial(G4String)
G4Material * GetCasingMaterial()
void SetVerboseLevel(G4int val)
G4Material * GetCrystalMaterial()
const G4VPhysicalVolume * GetBSCPhi()
double y[1000]