BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
BesTofConstruction Class Reference

#include <BesTofConstruction.hh>

+ Inheritance diagram for BesTofConstruction:

Public Member Functions

 BesTofConstruction ()
 
virtual ~BesTofConstruction ()
 
void Construct (G4LogicalVolume *logicalBes)
 
void ConstructBr1Tof ()
 
void ConstructBr2Tof ()
 
void ConstructEcTof ()
 
void ConstructEcTof_mrpc ()
 
void DefineMaterial ()
 
void getXYZ (const G4RotationMatrix r, double &a, double &b, double &c) const
 
- Public Member Functions inherited from BesSubdetector
 BesSubdetector ()
 
virtual ~BesSubdetector ()
 
virtual void Construct (G4LogicalVolume *bes)=0
 
G4LogicalVolume * FindLogicalVolume (const G4String &vn)
 

Additional Inherited Members

- Protected Attributes inherited from BesSubdetector
SAXProcessor m_sxp
 
ProcessingConfigurator m_config
 

Detailed Description

Definition at line 21 of file BesTofConstruction.hh.

Constructor & Destructor Documentation

◆ BesTofConstruction()

BesTofConstruction::BesTofConstruction ( )

Definition at line 52 of file BesTofConstruction.cc.

53{
54 PropertyMgr m_propMgr1;
55 m_propMgr1.declareProperty("UserLimits", m_userLimits = 0.03);
56 m_propMgr1.declareProperty("IonE", m_ionE = 20);
57 IJobOptionsSvc* jobSvc1;
58 Gaudi::svcLocator()->service("JobOptionsSvc", jobSvc1);
59 jobSvc1->setMyProperties("BesTofConstruction", &m_propMgr1);
60
61 cout<<"BesTofConstruction Property:"<<endl
62 <<" UserLimits= "<<m_userLimits
63 <<" IonE= "<<m_ionE
64 <<endl;
65
66 logicalTof = 0;
67 physicalTof = 0;
68
69 logicalBrTof = 0;
70 logicalEcTofWest=0;
71 logicalEcTofEast=0;
72
73 logicalScinBr1 = 0;
74 logicalScinBr2 = 0;
75 physicalScinBr1 = 0;
76 physicalScinBr2 = 0;
77
78 logicalAlBr1 = 0;
79 logicalAlBr2 = 0;
80 physicalAlBr1 = 0;
81 physicalAlBr2 = 0;
82
83 logicalPVFBr1 = 0;
84 logicalPVFBr2 = 0;
85 physicalPVFBr1 = 0;
86 physicalPVFBr2 = 0;
87
88 logicalBucketBr1= 0;
89 logicalBucketBr2= 0;
90
91 physicalBucket1Br1 = 0;
92 physicalBucket2Br1 = 0;
93 physicalBucket1Br2 = 0;
94 physicalBucket2Br2 = 0;
95
96 logicalScinEcWest = 0;
97 logicalScinEcEast = 0;
98 physicalScinEcWest = 0;
99 physicalScinEcEast = 0;
100
101 logicalAlEcWest = 0;
102 logicalAlEcEast = 0;
103 physicalAlEcWest = 0;
104 physicalAlEcEast = 0;
105
106 logicalPVFEcWest = 0;
107 logicalPVFEcEast = 0;
108 physicalPVFEcWest = 0;
109 physicalPVFEcEast = 0;
110
111 logicalBucketEc = 0;
112 physicalBucketEc = 0;
113
114 BC404 = 0;
115 BC408 = 0;
116 PVF = 0;
117 PMTmaterial = 0;
118
119 //MRPC
120 logical_gasLayer=0;
121}

◆ ~BesTofConstruction()

BesTofConstruction::~BesTofConstruction ( )
virtual

Definition at line 123 of file BesTofConstruction.cc.

124{}

Member Function Documentation

◆ Construct()

void BesTofConstruction::Construct ( G4LogicalVolume *  logicalBes)
virtual

Implements BesSubdetector.

Definition at line 126 of file BesTofConstruction.cc.

127{
128 DefineMaterial(); //This function just defines my material, used for the TOF
129
130 if ( ReadBoostRoot::GetTof() == 2 )
131 {
132 TofG4Geo* aTofG4Geo = new TofG4Geo();
133 logicalTof = aTofG4Geo->GetTopVolume();
134 if (!logicalTof)
135 G4cout<<"BesTofConstruction::Construct(), logicalTof not found"<<G4endl;
136 else
137 {
138 //produce the logical Tof
139 physicalTof = new G4PVPlacement(0,G4ThreeVector(0,0,0),
140 logicalTof,"physicalTof",logicalBes,false,0); // Class representing a single volume positioned within and relative to a mother volume.
141
142 //for visual attributes
143 logicalScinBr1 = FindLogicalVolume("logicalScinBr1");
144 logicalScinBr2 = FindLogicalVolume("logicalScinBr2");
145
146 logicalAlBr1 = FindLogicalVolume("logicalAlBr1");
147 logicalAlBr2 = FindLogicalVolume("logicalAlBr2");
148 logicalPVFBr1 = FindLogicalVolume("logicalPVFBr1");
149 logicalPVFBr2 = FindLogicalVolume("logicalPVFBr2");
150 logicalBucketBr1 = FindLogicalVolume("logicalBucketBr1");
151 logicalBucketBr2 = FindLogicalVolume("logicalBucketBr2");
152
153 logicalScinEcWest = FindLogicalVolume("logicalScinEcWest");
154 logicalScinEcEast = FindLogicalVolume("logicalScinEcEast");
155 logicalBucketEc = FindLogicalVolume("logicalBucketEc");
156 }
157 //m_sxp.Finalize();
158 delete aTofG4Geo;
159 } //close (ReadBoostRoot::GetTof() == 2)
160
161 else if(ReadBoostRoot::GetTof() == 3 ) //start TOF with MRPC Endcaps
162 {
163 //This part intialize a function where the Parameter of the TOF are saved!
165
166 //Get the coordinates of the TOF
167 G4double r1=380; //Newly changed from 399 for MRPC to avoid overlap
168 G4double r2=tofPara->GetBucketPosR()+0.5*tofPara->GetBucketDEc()+1; //=474
169 G4double r3=810;
170 G4double r4=925;
171 G4double a1=1382+tofPara->GetBucketLEc()+1; //1463
172 G4double a2=1381; // Changed from 1382 to avoid overlapping with EMC
173 //to make the center of tub6 is tofPara.GetzPosEastEc()=1356
174 G4double a3=1330;
175 G4cout<<"Tof Volume: "<<r1<<" "<<r2<<" "<<r3<<" "<<r4<<" "<<a1<<" "<<a2<<" "<<a3<<G4endl;
176
177 //Tof: produce a cylinder with inner radius r1 and outer radius r2, z height: 2a1, starting angle 0 untill 360
178 G4Tubs* tub1 = new G4Tubs("tub1",r1,r2,a1,0,360);
179 G4Tubs* tub2 = new G4Tubs("tub2",r2-4,r4,a2,0,360);
180 G4Tubs* tub3 = new G4Tubs("tub3",0,r3,a3,0,360);
181 G4UnionSolid* tub4 = new G4UnionSolid("tub4",tub1,tub2,0,G4ThreeVector(0,0,0) ); //Vereinigt tub 1 und 2 in tub4
182 G4SubtractionSolid* solidTof = new G4SubtractionSolid("solidTof",tub4,tub3,0, G4ThreeVector(0,0,0) ); //Subtracts tub4 - tub3
183 logicalTof = new G4LogicalVolume(solidTof, G4Material::GetMaterial("Air"),"logicalTof"); //book logical Tof VOlume
184 physicalTof = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalTof,"physicalTof",logicalBes,false,0);
185
186 //Logical + Physical volumes for the barrel
187 G4Tubs* tub5 = new G4Tubs("tub5",r3,r4,a3,0,360);
188 logicalBrTof = new G4LogicalVolume(tub5, G4Material::GetMaterial("Air"),"logicalBrTof"); //book logical Barrel TOF
189 G4VPhysicalVolume* physicalBrTof = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalBrTof,"physicalBrTof",logicalTof,false,0);
190
191
192 //Logical + Physical volumes for the endcaps
193 G4Tubs* tub6 = new G4Tubs("tub6",r1,r4,(a2-a3)/2,0,360); //ring: dz/2=2.55cm, xy=52.6 cm
194 G4Tubs* tub7 = new G4Tubs("tub7",r1,r2,(a1-a2)/2,0,360); //ring: dz/2=0.1cm, xy=7.5 cm
195 G4UnionSolid* tub8 = new G4UnionSolid("tub8",tub6,tub7,0,G4ThreeVector(0,0,(a3-a1)/2)); //Unify both tubes,translate z-axes -6.15 cm to the originally one
196 logicalEcTofWest = new G4LogicalVolume(tub8, G4Material::GetMaterial("Air"),"logicalEcTofWest");
197 G4VPhysicalVolume* physicalEcTofWest = new G4PVPlacement(0,G4ThreeVector(0,0,tofPara->GetzPosWestEc()),logicalEcTofWest,"physicalEcTofWest",logicalTof,false,0);
198
199 G4UnionSolid* tub9 = new G4UnionSolid("tub9",tub6,tub7,0,G4ThreeVector(0,0,(a1-a3)/2) ); //Unify both tubes,translate z-axes +6.15 cm to the originally one
200 logicalEcTofEast = new G4LogicalVolume(tub9, G4Material::GetMaterial("Air"),"logicalEcTofEast");
201 G4VPhysicalVolume* physicalEcTofEast = new G4PVPlacement(0,G4ThreeVector(0,0,tofPara->GetzPosEastEc()),logicalEcTofEast,"physicalEcTofEast",logicalTof,false,0);
202
203
204 //Functions which construct the different parts of the TOF -->See below
205 //Construct Tape
206 //put these lines before ConstructBr1Tof();
207 //so in BesTofSD.cc, no need to change the tofid caculation method
208 G4Tubs* tubTape = new G4Tubs("tubTape",866, 866.3, 1150, 0, 360);
209 G4LogicalVolume* logicalTape = new G4LogicalVolume(tubTape,G4Material::GetMaterial("tape"),"logicalTape");
210 G4VPhysicalVolume* physicalTape = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalTape,"physicalTape",logicalBrTof,false,0);
211 logicalTape->SetVisAttributes(G4VisAttributes::Invisible);
212
216 }
217
218 else if (ReadBoostRoot::GetTof() == 4 ) //start TOF with MRPC Endcaps GDML Construction
219 {
220 MRPCG4Geo* aTofG4Geo = new MRPCG4Geo();
221 logicalTof = aTofG4Geo->GetTopVolume();
222 if (!logicalTof)
223 G4cout<<"BesTofConstruction::Construct(), logicalTof not found"<<G4endl;
224 else
225 {
226 physicalTof = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalTof,"physicalTof",logicalBes,false,0);
227
228 logicalScinBr1 = FindLogicalVolume("logicalScinBr1");
229 logicalScinBr2 = FindLogicalVolume("logicalScinBr2");
230
231 logicalAlBr1 = FindLogicalVolume("logicalAlBr1");
232 logicalAlBr2 = FindLogicalVolume("logicalAlBr2");
233 logicalPVFBr1 = FindLogicalVolume("logicalPVFBr1");
234 logicalPVFBr2 = FindLogicalVolume("logicalPVFBr2");
235 logicalBucketBr1 = FindLogicalVolume("logicalBucketBr1");
236 logicalBucketBr2 = FindLogicalVolume("logicalBucketBr2");
237
238 logical_gasLayer=FindLogicalVolume("logical_gasLayer");
239 }
240 delete aTofG4Geo;
241 } //close else if(==4)
242
243 else
244 {
245 //-----------------logicalTof added here
247
248 //Get the coordinates of the TOF
249 G4double r1=tofPara->GetEcR1()-1; //=399
250 G4double r2=tofPara->GetBucketPosR()+0.5*tofPara->GetBucketDEc()+1; //=474
251 G4double r3=810;;
252 G4double r4=925;
253 G4double a1=1382+tofPara->GetBucketLEc()+1; //1463
254 G4double a2=1381; // Changed from 1382 to avoid overlapping with EMC
255 //to make the center of tub6 is tofPara.GetzPosEastEc()=1356
256 G4double a3=1330;
257 G4cout<<"Tof Volume: "<<r1<<" "<<r2<<" "<<r3<<" "<<r4<<" "<<a1<<" "<<a2<<" "<<a3<<G4endl;
258
259 G4Tubs* tub1 = new G4Tubs("tub1",r1,r2,a1,0,360); //Just produce a cylinder with inner radius r1 and outer radius r2, z height: 2a1, starting angle 0 untill 360
260 G4Tubs* tub2 = new G4Tubs("tub2",r2-4,r4,a2,0,360);
261 G4Tubs* tub3 = new G4Tubs("tub3",0,r3,a3,0,360);
262 G4UnionSolid* tub4 = new G4UnionSolid("tub4",tub1,tub2,0,G4ThreeVector(0,0,0) ); //Vereinigt tub 1 und 2 in tub4
263 G4SubtractionSolid* solidTof = new G4SubtractionSolid("solidTof",tub4,tub3,0, G4ThreeVector(0,0,0) ); //Subtracts tub4 - tub3
264 logicalTof = new G4LogicalVolume(solidTof, G4Material::GetMaterial("Air"),"logicalTof"); //book logical Tof VOlume
265 physicalTof = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalTof,"physicalTof",logicalBes,false,0);
266
267 G4Tubs* tub5 = new G4Tubs("tub5",r3,r4,a3,0,360);
268 logicalBrTof = new G4LogicalVolume(tub5, G4Material::GetMaterial("Air"),"logicalBrTof"); //book logical Barrel TOF
269 G4VPhysicalVolume* physicalBrTof = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalBrTof,"physicalBrTof",logicalTof,false,0);
270
271 //Logical + Physical volumes for the endcaps
272 G4Tubs* tub6 = new G4Tubs("tub6",r1,r4,(a2-a3)/2,0,360);//r1=39.9cm, r4=92.5cm, zlength=2.55 cm
273 G4Tubs* tub7 = new G4Tubs("tub7",r1,r2,(a1-a2)/2,0,360);//r1=39.9cm, r2=47.4cm, zlength=4.05 cm
274 G4UnionSolid* tub8 = new G4UnionSolid("tub8",tub6,tub7,0,G4ThreeVector(0,0,(a3-a1)/2) );// -6.65cm
275 logicalEcTofWest = new G4LogicalVolume(tub8, G4Material::GetMaterial("Air"),"logicalEcTofWest");
276 G4VPhysicalVolume* physicalEcTofWest = new G4PVPlacement(0,G4ThreeVector(0,0,tofPara->GetzPosWestEc()),logicalEcTofWest,"physicalEcTofWest",logicalTof,false,0);
277
278 G4UnionSolid* tub9 = new G4UnionSolid("tub9",tub6,tub7,0,G4ThreeVector(0,0,(a1-a3)/2) );
279 logicalEcTofEast = new G4LogicalVolume(tub9, G4Material::GetMaterial("Air"),"logicalEcTofEast");
280 G4VPhysicalVolume* physicalEcTofEast = new G4PVPlacement(0,G4ThreeVector(0,0,tofPara->GetzPosEastEc()),logicalEcTofEast,"physicalEcTofEast",logicalTof,false,0);
281
282
283 //Construct Tape
284 //put these lines before ConstructBr1Tof();
285 //so in BesTofSD.cc, no need to change the tofid caculation method
286 G4Tubs* tubTape = new G4Tubs("tubTape",866, 866.3, 1150, 0, 360);
287 G4LogicalVolume* logicalTape = new G4LogicalVolume(tubTape,G4Material::GetMaterial("tape"),"logicalTape");
288 G4VPhysicalVolume* physicalTape = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalTape,"physicalTape",logicalBrTof,false,0);
289 logicalTape->SetVisAttributes(G4VisAttributes::Invisible);
290
291 //Functions which construct the different parts of the TOF -->See below
295 }
296
297
298 //sensitive detector
299 G4SDManager* SDman = G4SDManager::GetSDMpointer();
300 BesTofSD* tofSD = new BesTofSD("BesTofSD");
301 SDman->AddNewDetector(tofSD);
302
303 if (logicalScinBr1) logicalScinBr1->SetSensitiveDetector(tofSD);
304 if (logicalScinBr2) logicalScinBr2->SetSensitiveDetector(tofSD);
305 if (logicalScinEcWest) logicalScinEcWest->SetSensitiveDetector(tofSD);
306 if (logicalScinEcEast) logicalScinEcEast->SetSensitiveDetector(tofSD);
307 if(logical_gasLayer)
308 {
309 logical_gasLayer->SetSensitiveDetector(tofSD);
310 G4cout<<"!!! Find logical_gasLayer !!!"<<G4endl;
311
312 //For limits smaller than 0.02 one has to use the PAI-Model for ionisation!
313 logical_gasLayer->SetUserLimits (new G4UserLimits(m_userLimits*mm));
314 //logical_gasLayer->SetUserLimits (new G4UserLimits(0.03*mm));
315 }
316
317
318 G4VisAttributes* visBrTof = new G4VisAttributes(G4Colour(1.,0.,0.));
319 G4VisAttributes* visEcTof = new G4VisAttributes(G4Colour(0.,1.,0.));
320
321 if (logicalTof)
322 logicalTof->SetVisAttributes(G4VisAttributes::Invisible);
323 if (logicalBrTof)
324 logicalBrTof->SetVisAttributes(G4VisAttributes::Invisible);
325 //logicalBrTof->SetVisAttributes(visBrTof);
326 if (logicalEcTofWest)
327 logicalEcTofWest->SetVisAttributes(G4VisAttributes::Invisible);
328 //logicalEcTofWest->SetVisAttributes(visEcTof);
329 if (logicalEcTofEast)
330 logicalEcTofEast->SetVisAttributes(G4VisAttributes::Invisible);
331 //logicalEcTofEast->SetVisAttributes(visEcTof);
332
333
334 if (logicalScinBr1)
335 logicalScinBr1->SetVisAttributes(G4VisAttributes::Invisible);
336 if (logicalScinBr2)
337 logicalScinBr2->SetVisAttributes(G4VisAttributes::Invisible);
338
339 if (logicalAlBr1)
340 logicalAlBr1->SetVisAttributes(G4VisAttributes::Invisible);
341 if (logicalAlBr2)
342 logicalAlBr2->SetVisAttributes(G4VisAttributes::Invisible);
343
344 if (logicalPVFBr1)
345 logicalPVFBr1->SetVisAttributes(G4VisAttributes::Invisible);
346 if (logicalPVFBr2)
347 logicalPVFBr2->SetVisAttributes(G4VisAttributes::Invisible);
348
349 G4VisAttributes* visAttBrBuck = new G4VisAttributes(G4Colour(1.,1.,0.));
350 if (logicalBucketBr1)
351 logicalBucketBr1->SetVisAttributes(visAttBrBuck);
352 //logicalBucketBr1->SetVisAttributes(G4VisAttributes::Invisible);
353 if (logicalBucketBr2)
354 logicalBucketBr2->SetVisAttributes(visAttBrBuck);
355 //logicalBucketBr2->SetVisAttributes(G4VisAttributes::Invisible);
356
357 G4VisAttributes* visAttEcTof = new G4VisAttributes(G4Colour(0.,1.,1.));
358 if (logicalScinEcWest)
359 logicalScinEcWest->SetVisAttributes(visAttEcTof);
360 //logicalScinEc->SetVisAttributes(G4VisAttributes::Invisible);
361 if (logicalScinEcEast)
362 logicalScinEcEast->SetVisAttributes(visAttEcTof);
363
364 G4VisAttributes* visAttEcBuck = new G4VisAttributes(G4Colour(1.,1.,0.));
365 if (logicalBucketEc)
366 logicalBucketEc->SetVisAttributes(visAttEcBuck);
367 //logicalBucketEc->SetVisAttributes(G4VisAttributes::Invisible);
368
369 if (logicalAlEcWest)
370 logicalAlEcWest->SetVisAttributes(G4VisAttributes::Invisible);
371 if (logicalAlEcEast)
372 logicalAlEcEast->SetVisAttributes(G4VisAttributes::Invisible);
373 if (logicalPVFEcWest)
374 logicalPVFEcWest->SetVisAttributes(G4VisAttributes::Invisible);
375 if (logicalPVFEcEast)
376 logicalPVFEcEast->SetVisAttributes(G4VisAttributes::Invisible);
377}
G4LogicalVolume * FindLogicalVolume(const G4String &vn)
static BesTofGeoParameter * GetInstance()
static G4int GetTof()
G4LogicalVolume * GetTopVolume()
Get the top(world) volume;.

Referenced by BesDetectorConstruction::Construct().

◆ ConstructBr1Tof()

void BesTofConstruction::ConstructBr1Tof ( )

Definition at line 379 of file BesTofConstruction.cc.

380{
382
383 //Get barrel tof layer1 geometry data
384 G4int nScinBr=tofPara->GetnScinBr(); //number of barrel scintillators
385 G4double br1L=tofPara->GetBr1L();
386 G4double br1TrapW1=tofPara->GetBr1TrapW1();
387 G4double br1TrapW2=tofPara->GetBr1TrapW2();
388 G4double br1TrapH=tofPara->GetBr1TrapH();
389 G4double br1R1=tofPara->GetBr1R1();
390 G4double AlThickness=tofPara->GetAlThickness();
391 G4double PVFThickness=tofPara->GetPVFThickness();
392 //barrel PMT bucket geometry data
393 G4double bucketDBr=tofPara->GetBucketDBr(); //diameter of barrel PMT bucket
394 G4double bucketLBr=tofPara->GetBucketLBr(); //length of barrel PMT bucket
395
396 //computer from the original data
397 G4double angleBr=360./nScinBr*deg;
398 G4double scinTrapdx1,scinTrapdx2,scinTrapdx3,scinTrapdx4;
399 scinTrapdx1=scinTrapdx3=br1TrapW1/2.;
400 scinTrapdx2=scinTrapdx4=br1TrapW2/2.;
401 G4double scinTrapdy1,scinTrapdy2;
402 scinTrapdy1=scinTrapdy2=0.5*br1TrapH;
403 G4double scinTrapdz=br1L/2.;
404 G4double scinPosR=br1R1+scinTrapdy1;
405 G4double theta = atan((br1TrapW2/2.-br1TrapW1/2.)/br1TrapH);
406 G4double delta13 = AlThickness*(1/cos(theta)-tan(theta));
407 G4double delta24 = AlThickness*(1/cos(theta)+tan(theta));
408 G4double delta13P = (PVFThickness+AlThickness)*(1/cos(theta)-tan(theta));
409 G4double delta24P = (PVFThickness+AlThickness)*(1/cos(theta)+tan(theta));
410
411 //construct barrel tof scintillator
412 G4Trap* solidScinBr1=new G4Trap("solidScinBr1",scinTrapdz,0*deg,0*deg,
413 scinTrapdy1,scinTrapdx1,scinTrapdx2,0*deg,
414 scinTrapdy2,scinTrapdx3,scinTrapdx4,0*deg);
415 logicalScinBr1 = new G4LogicalVolume(solidScinBr1,BC408,"logicalScinBr1");
416
417 //construct barrel Al film and PVF film
418 G4Trap* solidAlBr1 = new G4Trap("solidAlBr1", scinTrapdz+0.001,0*deg,0*deg,
419 scinTrapdy1+AlThickness, scinTrapdx1+delta13, scinTrapdx2+delta24 ,0*deg,
420 scinTrapdy2+AlThickness, scinTrapdx3+delta13, scinTrapdx4+delta24 ,0*deg);
421
422 logicalAlBr1 = new G4LogicalVolume(solidAlBr1,G4Material::GetMaterial("Aluminium"),"logicalAlBr1");
423 G4Trap* solidPVFBr1 = new G4Trap("solidPVFBr1",scinTrapdz+0.002,0*deg,0*deg,
424 scinTrapdy1+AlThickness+PVFThickness,scinTrapdx1+delta13P, scinTrapdx2+delta24P,0*deg,
425 scinTrapdy2+AlThickness+PVFThickness,scinTrapdx3+delta13P, scinTrapdx4+delta24P,0*deg);
426
427 logicalPVFBr1 = new G4LogicalVolume(solidPVFBr1,PVF,"logicalPVFBr1");
428 //put daughter in mother logical volume
429 physicalAlBr1 = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalAlBr1, "physicalAlBr1",logicalPVFBr1, false,0);
430 physicalScinBr1 = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalScinBr1, "physicalScinBr1",logicalAlBr1, false, 0);
431
432 //construct barrel PMT bucket (bucket=Behaelter)
433 G4Tubs* solidBucketBr1= new G4Tubs("solidBucketBr1",0,bucketDBr/2.,
434 bucketLBr/2., 0, 360.*deg);
435 logicalBucketBr1=new G4LogicalVolume(solidBucketBr1,PMTmaterial,"logicalBucketBr1");
436
437
438 //Rotate the crystalls:
439 G4RotationMatrix trapRot;
440 trapRot.rotateZ(0.5*angleBr-90.*deg);
441 // /| y
442 //------- / | |
443 //\ / | | rotate->(0.5*angleBr-90.*deg): |
444 // \ / ->>>> | | -----x
445 // --- \ |
446 // \|
447 G4ThreeVector pos(0,0,0);
448 G4double x,y;
449 for (int i=0;i<nScinBr;i++)
450 {
451 ostringstream osnamePVFBr1;
452 osnamePVFBr1 << "physicalPVFBr1_"<<i;
453 ostringstream osnameBucket1Br1;
454 osnameBucket1Br1 << "physicalBucket1Br1_"<<i;
455 ostringstream osnameBucket2Br1;
456 osnameBucket2Br1 << "physicalBucket2Br1_"<<i;
457
458 //scintillator and casing
459 x=scinPosR*cos((i+0.5)*angleBr); //+0.5: start from phi=0
460 y=scinPosR*sin((i+0.5)*angleBr);
461 pos.setX(x);
462 pos.setY(y);
463 pos.setZ(0);
464
465 //to make code consistent with gdml
466 double a, b, c;
467 getXYZ(trapRot, a, b ,c); //Function is defined below
468 G4RotationMatrix trapRotTemp;
469 trapRotTemp.rotateZ(c);
470 G4Transform3D transform(trapRotTemp,pos);
471
472 //G4PVPlacement: Class representing a single volume positioned within and relative to a mother volume.
473 //G4Transform3D transform(trapRot,pos);
474 physicalPVFBr1 = new G4PVPlacement(transform,logicalPVFBr1,osnamePVFBr1.str(), logicalBrTof,false,i);
475 //bucket --> Two PMT, one on each side
476 pos.setZ(-(bucketLBr+br1L)/2.-0.01);
477 physicalBucket1Br1 = new G4PVPlacement(0,pos,logicalBucketBr1,osnameBucket1Br1.str(),logicalBrTof,false,0);
478 pos.setZ((bucketLBr+br1L)/2.+0.01);
479 physicalBucket2Br1 = new G4PVPlacement(0,pos,logicalBucketBr1,osnameBucket2Br1.str(),logicalBrTof,false,0);
480
481 //rotate for next scintillator
482 trapRot.rotateZ(angleBr);
483 }
484}
double tan(const BesAngle a)
Definition: BesAngle.h:216
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
void getXYZ(const G4RotationMatrix r, double &a, double &b, double &c) const
double y[1000]
double x[1000]
const double b
Definition: slope.cxx:9

Referenced by Construct().

◆ ConstructBr2Tof()

void BesTofConstruction::ConstructBr2Tof ( )

Definition at line 486 of file BesTofConstruction.cc.

487{
489
490 //barrel tof layer2 geometry data
491 G4int nScinBr=tofPara->GetnScinBr(); //number of barrel scintillators
492 G4double br2L=tofPara->GetBr2L();
493 G4double br2TrapW1=tofPara->GetBr2TrapW1();
494 G4double br2TrapW2=tofPara->GetBr2TrapW2();
495 G4double br2TrapH=tofPara->GetBr2TrapH();
496 G4double br2R1=tofPara->GetBr2R1();
497 G4double AlThickness=tofPara->GetAlThickness();
498 G4double PVFThickness=tofPara->GetPVFThickness();
499 //barrel PMT bucket geometry data
500 G4double bucketDBr=tofPara->GetBucketDBr(); //diameter of barrel PMT bucket
501 G4double bucketLBr=tofPara->GetBucketLBr(); //length of barrel PMT bucket
502
503 //computer from the original data
504 G4double angleBr=360./nScinBr*deg;
505 G4double scinTrapdx1,scinTrapdx2,scinTrapdx3,scinTrapdx4;
506 scinTrapdx1=scinTrapdx3=br2TrapW1/2.;
507 scinTrapdx2=scinTrapdx4=br2TrapW2/2.;
508 G4double scinTrapdy1,scinTrapdy2;
509 scinTrapdy1=scinTrapdy2=0.5*br2TrapH;
510 G4double scinTrapdz=br2L/2.;
511 G4double scinPosR=br2R1+scinTrapdy1;
512 G4double theta = atan((br2TrapW2/2.-br2TrapW1/2.)/br2TrapH);
513 G4double delta13 = AlThickness*(1/cos(theta)-tan(theta));
514 G4double delta24 = AlThickness*(1/cos(theta)+tan(theta));
515 G4double delta13P = (PVFThickness+AlThickness)*(1/cos(theta)-tan(theta));
516 G4double delta24P = (PVFThickness+AlThickness)*(1/cos(theta)+tan(theta));
517
518 //construct barrel tof scintillator
519 G4Trap* solidScinBr2=new G4Trap("solidScinBr2",scinTrapdz,0*deg,0*deg,
520 scinTrapdy1,scinTrapdx1,scinTrapdx2,0*deg,
521 scinTrapdy2,scinTrapdx3,scinTrapdx4,0*deg);
522 logicalScinBr2 = new G4LogicalVolume(solidScinBr2,BC408,"logicalScinBr2");
523
524 //construct barrel Al film and PVF film
525 G4Trap* solidAlBr2 = new G4Trap("solidAlBr2", scinTrapdz+0.001,0*deg,0*deg,
526 scinTrapdy1+AlThickness, scinTrapdx1+delta13, scinTrapdx2+delta24 ,0*deg,
527 scinTrapdy2+AlThickness, scinTrapdx3+delta13, scinTrapdx4+delta24 ,0*deg);
528
529 logicalAlBr2 = new G4LogicalVolume(solidAlBr2,G4Material::GetMaterial("Aluminium"),"logicalAlBr2");
530 G4Trap* solidPVFBr2 = new G4Trap("solidPVFBr2",scinTrapdz+0.002,0*deg,0*deg,
531 scinTrapdy1+AlThickness+PVFThickness,scinTrapdx1+delta13P, scinTrapdx2+delta24P,0*deg,
532 scinTrapdy2+AlThickness+PVFThickness,scinTrapdx3+delta13P, scinTrapdx4+delta24P,0*deg);
533
534 logicalPVFBr2 = new G4LogicalVolume(solidPVFBr2,PVF,"logicalPVFBr2");
535 //put daughter in mother logical volume
536 physicalAlBr2 = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalAlBr2, "physicalAlBr2",logicalPVFBr2, false,0);
537 physicalScinBr2 = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalScinBr2, "physicalScinBr2",logicalAlBr2, false, 0);
538
539 //construct barrel PMT bucket
540 G4Tubs* solidBucketBr2= new G4Tubs("solidBucketBr2",0,bucketDBr/2.,
541 bucketLBr/2., 0, 360.*deg);
542 logicalBucketBr2=new G4LogicalVolume(solidBucketBr2,PMTmaterial,"logicalBucketBr2");
543
544 G4RotationMatrix trapRot;
545 trapRot.rotateZ(-90.*deg);
546 // /| y
547 //------- / | |
548 //\ / | | rotate->(-90.*deg): |
549 // \ / ->>>> | | -----x
550 // --- \ |
551 // \|
552 G4ThreeVector pos(0,0,0);
553 G4double x,y;
554 for (int i=0;i<nScinBr;i++)
555 {
556 ostringstream osnamePVFBr2;
557 osnamePVFBr2 << "physicalPVFBr2_"<<i;
558 ostringstream osnameBucket1Br2;
559 osnameBucket1Br2 << "physicalBucket1Br2_"<<i;
560 ostringstream osnameBucket2Br2;
561 osnameBucket2Br2 << "physicalBucket2Br2_"<<i;
562
563 //scintillator and casing
564 x=scinPosR*cos(i*angleBr); //+0.5: start from phi=0
565 y=scinPosR*sin(i*angleBr);
566 pos.setX(x);
567 pos.setY(y);
568 pos.setZ(0);
569 //to make code consistent with gdml
570 double a, b, c;
571 getXYZ(trapRot, a, b ,c);
572 G4RotationMatrix trapRotTemp;
573 trapRotTemp.rotateZ(c);
574 G4Transform3D transform(trapRotTemp,pos);
575 //G4Transform3D transform(trapRot,pos);
576 physicalPVFBr2 = new G4PVPlacement(transform,logicalPVFBr2,osnamePVFBr2.str(), logicalBrTof,false,i);
577 //bucket
578 pos.setZ(-(bucketLBr+br2L)/2.-0.01);
579 physicalBucket1Br2 = new G4PVPlacement(0,pos,logicalBucketBr2,osnameBucket1Br2.str(),logicalBrTof,false,0);
580 pos.setZ((bucketLBr+br2L)/2.+0.01);
581 physicalBucket2Br2 = new G4PVPlacement(0,pos,logicalBucketBr2,osnameBucket2Br2.str(),logicalBrTof,false,0);
582
583 //rotate for next scintillator
584 trapRot.rotateZ(angleBr);
585 }
586
587}

Referenced by Construct().

◆ ConstructEcTof()

void BesTofConstruction::ConstructEcTof ( )

Definition at line 589 of file BesTofConstruction.cc.

590{
592
593 //Get all interesting parameters for the TOF construction
594 //endcap geometry data
595 G4int nScinEc = tofPara->GetnScinEc(); //number of endcap scintillators
596 G4double ecL = tofPara->GetEcL();
597 G4double ecTrapW1 = tofPara->GetEcTrapW1();
598 G4double ecTrapW2 = tofPara->GetEcTrapW2();
599 G4double ecTrapH = tofPara->GetEcTrapH();
600 G4double ecTrapH1 = tofPara->GetEcTrapH1();
601 G4double zPosEastEc = tofPara->GetzPosEastEc(); //z position of east endcap
602 G4double zPosWestEc = tofPara->GetzPosWestEc(); //z position of west endcap
603 G4double ecR1 = tofPara->GetEcR1();
604 //G4double ecR2 = tofPara.GetEcR2();
605
606 //endcap PMT bucket geometry data
607 G4double bucketDEc = tofPara->GetBucketDEc(); //diameter of endcap PMT bucket
608 G4double bucketLEc = tofPara->GetBucketLEc(); //length of endcap PMT bucket
609 G4double bucketPosR = tofPara->GetBucketPosR(); //R of bucket center
610
611 G4double AlThickness=tofPara->GetAlThickness();
612 G4double PVFThickness=tofPara->GetPVFThickness();
613
614 G4double angleEc=360./nScinEc*deg;
615 G4double ecTrapW3 = ecTrapW1 + (ecTrapW2-ecTrapW1)*ecTrapH1/ecTrapH;
616 G4double ecTrapH2 = ecTrapH-ecTrapH1;
617 G4double pdz = ecL/2;
618 G4double ptheta = atan(ecTrapH1/(2*ecL));
619 G4double pdy1 = ecTrapH2/2;
620 G4double pdx1 = ecTrapW3/2;
621 G4double pdx2 = ecTrapW2/2;
622 G4double pdy2 = ecTrapH/2;
623 G4double pdx3 = ecTrapW1/2;
624 G4double pdx4 = ecTrapW2/2;
625
626 //because of removing a heighth of H1,
627 //plus initial center position ecR=ecR1+ecTrapH/2 with ecTrapH1/4
628 G4double ecR = ecR1+ecTrapH/2+ecTrapH1/4;
629
630 //construct endcap scintillator
631 G4Trap* solidScinEc=new G4Trap("solidScinEc",pdz,ptheta, 270*deg,
632 pdy1,pdx1,pdx2,0*deg,pdy2,pdx3,pdx4,0*deg);
633
634 logicalScinEcWest=new G4LogicalVolume(solidScinEc,BC404,"logicalScinEcWest");
635 logicalScinEcEast=new G4LogicalVolume(solidScinEc,BC404,"logicalScinEcEast");
636
637 //construct endcap PMT bucket
638 G4Tubs* solidBucketEc = new G4Tubs("solidBucketEc", 0, bucketDEc/2.,
639 bucketLEc/2., 0, 360.*deg);
640 logicalBucketEc = new G4LogicalVolume(solidBucketEc, PMTmaterial, "logicalBucketEc");
641
642 //construct Al and PVF film
643 G4double pthetaAl = atan(ecTrapH1/(2*(ecL+AlThickness*2)));
644 G4double theta1 = atan((ecTrapW2/2.-ecTrapW3/2.)/ecTrapH2);
645 G4double theta2 = atan((ecTrapW2/2.-ecTrapW1/2.)/ecTrapH);
646
647 G4double delta1 = AlThickness*(1/cos(theta1)-tan(theta1));
648 G4double delta2 = AlThickness*(1/cos(theta1)+tan(theta1));
649 G4double delta3 = AlThickness*(1/cos(theta2)-tan(theta2));
650 G4double delta4 = AlThickness*(1/cos(theta2)+tan(theta2));
651
652 G4double thick = AlThickness+PVFThickness;
653 G4double pthetaPVF = atan(ecTrapH1/(2*(ecL+thick*2)));
654 G4double delta1P = thick*(1/cos(theta1)-tan(theta1));
655 G4double delta2P = thick*(1/cos(theta1)+tan(theta1));
656 G4double delta3P = thick*(1/cos(theta2)-tan(theta2));
657 G4double delta4P = thick*(1/cos(theta2)+tan(theta2));
658
659 G4Trap* solidAlEc= new G4Trap("solidAlEc",pdz+AlThickness,pthetaAl,270*deg,pdy1+AlThickness,pdx1+delta1,pdx2+delta2,0*deg,pdy2+AlThickness,pdx3+delta3,pdx4+delta4,0*deg);
660
661 logicalAlEcWest = new G4LogicalVolume(solidAlEc,G4Material::GetMaterial("Aluminium"),"logicalAlEcWest");
662 logicalAlEcEast = new G4LogicalVolume(solidAlEc,G4Material::GetMaterial("Aluminium"),"logicalAlEcEast");
663
664 G4Trap* solidPVFEc = new G4Trap("solidPVFEc",pdz+thick,pthetaPVF,270*deg,
665 pdy1+thick,pdx1+delta1P,pdx2+delta2P,0*deg,
666 pdy2+thick,pdx3+delta3P,pdx4+delta4P,0*deg);
667
668 logicalPVFEcWest = new G4LogicalVolume(solidPVFEc,PVF,"logicalPVFEcWest");
669 logicalPVFEcEast = new G4LogicalVolume(solidPVFEc,PVF,"logicalPVFEcEast");
670
671 //put scintilator in Al, then put Al in PVF
672 physicalAlEcWest = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalAlEcWest, "physicalAlEcWest",logicalPVFEcWest, false,0);
673 physicalScinEcWest = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalScinEcWest, "physicalScinEcWest",logicalAlEcWest, false, 0);
674
675
676 //put scintilator in Al, then put Al in PVF
677 physicalAlEcEast = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalAlEcEast, "physicalAlEcEast",logicalPVFEcEast, false,0);
678 physicalScinEcEast = new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalScinEcEast, "physicalScinEcEast",logicalAlEcEast, false, 0);
679
680 //zPosWestEc<0, zPosEastEc>0, direction of axis z: west--->east
681 //construct west endcap first
682 //when no rotation, the first tub is start from phi=90
683 //after rotation, the first tub is start from 0, rotate angle = 0.5*angleEc
684 G4ThreeVector posW(0,0,0);
685 G4ThreeVector posE(0,0,0);
686 G4RotationMatrix trapRot;
687 trapRot.rotateY(180.*deg);
688 trapRot.rotateZ(0.5*angleEc-90*deg);
689 for (int i=0;i<nScinEc;i++)
690 {
691 ostringstream osnamePVFEc;
692 osnamePVFEc << "physicalPVFEcWest_"<<i;
693 ostringstream osnameBucketEc;
694 osnameBucketEc << "physicalBucketEcWest_"<<i;
695
696 posW.setX( ecR*cos((0.5+i)*angleEc) );
697 posW.setY( ecR*sin((0.5+i)*angleEc) );
698 //posW.setZ( zPosWestEc );
699 posW.setZ(0);
700
701 //to make code consistent with gdml
702 double a, b, c;
703 getXYZ(trapRot, a, b ,c);
704 G4RotationMatrix trapRotTemp;
705 trapRotTemp.rotateX(a);
706 trapRotTemp.rotateY(b);
707 trapRotTemp.rotateZ(c);
708 G4Transform3D transform(trapRotTemp,posW);
709 //G4Transform3D transform(trapRot,posW);
710 physicalPVFEcWest = new G4PVPlacement(transform,logicalPVFEcWest,osnamePVFEc.str(), logicalEcTofWest,false,i);
711 posW.setX( bucketPosR*cos((0.5+i)*angleEc) );
712 posW.setY( bucketPosR*sin((0.5+i)*angleEc) );
713 //posW.setZ( zPosWestEc-ecL/2-thick-bucketLEc/2-0.01 );
714 posW.setZ(-ecL/2-thick-bucketLEc/2-0.01 );
715 physicalBucketEc = new G4PVPlacement(0,posW,logicalBucketEc,osnameBucketEc.str(),logicalEcTofWest,false,0);
716 trapRot.rotateZ(angleEc); //pay attention: not i*angleEc
717 }
718 //to make east scintillator start from phi=0
719 // _ _
720 // _ - _ -
721 // - - - - ====> - - - - ====> - - - -
722 // ~ - _
723 //
724 trapRot.rotateZ(-angleEc);
725 trapRot.rotateX(180.*deg); //make east bucket point to the center
726 for (int i=0;i<nScinEc;i++)
727 {
728 ostringstream osnamePVFEc;
729 osnamePVFEc << "physicalPVFEcEast_"<<i;
730 ostringstream osnameBucketEc;
731 osnameBucketEc << "physicalBucketEcEast_"<<i;
732
733 posE.setX( ecR*cos((0.5+i)*angleEc) );
734 posE.setY( ecR*sin((0.5+i)*angleEc) );
735 //posE.setZ( zPosEastEc );
736 posE.setZ(0);
737
738 //to make code consistent with gdml
739 double a, b, c;
740 getXYZ(trapRot, a, b ,c);
741 G4RotationMatrix trapRotTemp;
742 trapRotTemp.rotateX(a);
743 trapRotTemp.rotateY(b);
744 trapRotTemp.rotateZ(c);
745 G4Transform3D transform(trapRotTemp,posE);
746 //G4Transform3D transform(trapRot,posE);
747 physicalPVFEcEast = new G4PVPlacement(transform,logicalPVFEcEast,osnamePVFEc.str(), logicalEcTofEast,false,i);
748 posE.setX( bucketPosR*cos((0.5+i)*angleEc) );
749 posE.setY( bucketPosR*sin((0.5+i)*angleEc) );
750 //posE.setZ( zPosEastEc+ecL/2+thick+bucketLEc/2+0.01 );
751 posE.setZ(ecL/2+thick+bucketLEc/2+0.01 );
752 physicalBucketEc = new G4PVPlacement(0,posE,logicalBucketEc,osnameBucketEc.str(),logicalEcTofEast,false,0);
753 trapRot.rotateZ(angleEc); //pay attention: not i*angleEc
754 }
755}
@ theta2
Definition: TrkKalDeriv.h:24
@ theta1
Definition: TrkKalDeriv.h:24

Referenced by Construct().

◆ ConstructEcTof_mrpc()

void BesTofConstruction::ConstructEcTof_mrpc ( )

Definition at line 759 of file BesTofConstruction.cc.

760{
761 //I construct my detector in the Geant4 coordinate system. It will be rotated into the BES coordinatesystem later!
762 // |z ___________
763 // | /y \ /
764 // | / \ /
765 // |/______x \_____/
766
767
768 G4double smallL = 0.01*mm;
769 G4RotationMatrix rot_dummy(0*deg,0*deg,0*deg);
770 IniParam_mrpc();
771 PartProduce* partProduce = new PartProduce();
772 partProduce->IniParam();
773 bool checkOverlap = false;
774
775 //Get the parts and place them in the container
776 //container
777 std::ostringstream name;
778 //Create 4 containers and gasContainers
779 //0: top module, closer to IP, longer bottom cover;
780 //1: same to [0], with gas sensitive detector overturned;
781 //2: bottom module, next to EMC, shorter bottom cover;
782 //3: same to [2], with gas sensitive detector overturned
783 G4LogicalVolume* logical_container[4];
784 G4LogicalVolume* logical_gasContainer[4];
785 for(int kk=0; kk<4; kk++)
786 {
787 name.str("");
788 name<<"logical_container_m"<<kk;
789 logical_container[kk] = partProduce->lg_container((int)kk/2, name.str());
790
791 name.str("");
792 name<<"logical_gasContainer_m"<<kk;
793 logical_gasContainer[kk] = partProduce->lg_gasContainer(name.str());
794 }
795
796
797 //The parts that compose the container
798 G4LogicalVolume* logical_containerFrame = partProduce->lg_containerFrame("logical_containerFrame");
799 G4LogicalVolume* logical_upCover = partProduce->lg_upCover("logical_upCover");
800 G4LogicalVolume* logical_lowCover1 = partProduce->lg_lowCover1("logical_lowCover1");
801 G4LogicalVolume* logical_lowCover2 = partProduce->lg_lowCover2("logical_lowCover2");
802 G4LogicalVolume* logical_upFEE = partProduce->lg_upFEE("logical_upFEE");
803 G4LogicalVolume* logical_sideFEE = partProduce->lg_sideFEE("logical_sideFEE");
804 G4LogicalVolume* logical_castingDie = partProduce->lg_castingDie("logical_castingDie");
805 G4LogicalVolume* logical_bareChamber = partProduce->lg_bareChamber("logical_bareChamber");
806 G4LogicalVolume* logical_bracket = partProduce->lg_bracket("logical_bracket");
807 G4LogicalVolume* logical_sideStopBlock = partProduce->lg_sideStopBlock("logical_sideStopBlock");
808 G4LogicalVolume* logical_upStopBlock = partProduce->lg_upStopBlock("logical_upStopBlock");
809
810
811 //Place the parts in the container
812 for(int kk=0; kk<4; kk++)
813 {
814 //container frame
815 name.str("");
816 name<<"physical_containerFrame_m"<<kk;
817 new G4PVPlacement(0, G4ThreeVector(0,0,0), logical_containerFrame, name.str(), logical_container[kk], false, 0, checkOverlap);
818
819 //top cover
820 G4ThreeVector translation_upCover(0, (containerOut_y+upCover_y)/2+smallL, (upCover_z-containerOut_z)/2-upCover_posz);
821 name.str("");
822 name<<"physical_upCover_m"<<kk;
823 new G4PVPlacement(0, translation_upCover, logical_upCover, name.str(), logical_container[kk], false, 0, checkOverlap);
824
825 //bottom cover
826 name.str("");
827 name<<"physical_lowCover_m"<<kk;
828 if(kk<2)
829 {
830 G4ThreeVector translation_lowCover(0, -1*(containerOut_y+upCover_y)/2, (lowCover1_z-containerOut_z)/2-lowCover1_posz);
831 new G4PVPlacement(0, translation_lowCover, logical_lowCover1, name.str(), logical_container[kk], false, 0, checkOverlap);
832 }
833 else
834 {
835 G4ThreeVector translation_lowCover(0, -1*(containerOut_y+upCover_y)/2, (lowCover2_z-containerOut_z)/2-lowCover2_posz);
836 new G4PVPlacement(0, translation_lowCover, logical_lowCover2, name.str(), logical_container[kk], false, 0, checkOverlap);
837 }
838
839 //FEE on the top cover
840 G4ThreeVector translation_upFEE(0, containerOut_y/2+upCover_y+upFEE_y/2+smallL, upCover_z-upFEE_posz-upFEE_z/2-upCover_posz-containerOut_z/2);
841 name.str("");
842 name<<"physical_upFEE_m"<<kk;
843 new G4PVPlacement(0, translation_upFEE, logical_upFEE, name.str(), logical_container[kk], false, 0, checkOverlap);
844
845 //FEE at the side
846 double angle_containerFrameSide = atan((containerOut_xup-containerOut_xdown)/2/containerOut_z) *rad;
847 double l_containerFrameSide = containerOut_z/cos(angle_containerFrameSide);
848 double x_sideFEE = (l_containerFrameSide/2-sideFEE_posl)*sin(angle_containerFrameSide)+(containerOut_xup+containerOut_xdown)/4+sideFEE_x/2*cos(angle_containerFrameSide);
849 double z_sideFEE = (l_containerFrameSide/2-sideFEE_posl)*cos(angle_containerFrameSide)-sideFEE_x/2*sin(angle_containerFrameSide);
850 G4ThreeVector translation_sideFEE_left(-x_sideFEE, 0, z_sideFEE);
851 G4RotationMatrix rot_sideFEE_left;
852 rot_sideFEE_left.rotateY(-angle_containerFrameSide);
853 G4Transform3D transform_sideFEE_left(rot_sideFEE_left, translation_sideFEE_left);
854 name.str("");
855 name<<"physical_sideFEE_left_m"<<kk;
856 new G4PVPlacement(transform_sideFEE_left, logical_sideFEE, name.str(), logical_container[kk], false, 0, checkOverlap);
857
858 G4ThreeVector translation_sideFEE_right(x_sideFEE, 0, z_sideFEE);
859 G4RotationMatrix rot_sideFEE_right;
860 rot_sideFEE_right.rotateZ(180*deg);
861 rot_sideFEE_right.rotateY(angle_containerFrameSide);
862 G4Transform3D transform_sideFEE_right(rot_sideFEE_right, translation_sideFEE_right);
863 name.str("");
864 name<<"physical_sideFEE_right_m"<<kk;
865 new G4PVPlacement(transform_sideFEE_right, logical_sideFEE, name.str(), logical_container[kk], false, 0, checkOverlap);
866
867 //casting die
868 G4RotationMatrix rot_castingDie;
869 rot_castingDie.rotateX(-90*deg);
870 G4ThreeVector translation_castingDie_1(0, containerOut_y/2+upCover_y+castingDie_z/2+smallL, -containerOut_z/2+upCover_posz+castingDie_posz1);
871 G4Transform3D transform_castingDie_1(rot_castingDie, translation_castingDie_1);
872 name.str("");
873 name<<"physical_castingDie_1_m"<<kk;
874 new G4PVPlacement(transform_castingDie_1, logical_castingDie, name.str(), logical_container[kk], false, 0, checkOverlap);
875
876 G4ThreeVector translation_castingDie_2(0, containerOut_y/2+upCover_y+castingDie_z/2+smallL, -containerOut_z/2+upCover_posz+castingDie_posz2);
877 G4Transform3D transform_castingDie_2(rot_castingDie, translation_castingDie_2);
878 name.str("");
879 name<<"physical_castingDie_2_m"<<kk;
880 new G4PVPlacement(transform_castingDie_2, logical_castingDie, name.str(), logical_container[kk], false, 0, checkOverlap);
881
882 //gas container
883 G4ThreeVector translation_gasContainer(0, 0, (container_lowBorder-container_thickness)/2);
884 name.str("");
885 name<<"physical_gasContainer_m"<<kk;
886 new G4PVPlacement(0, translation_gasContainer, logical_gasContainer[kk], name.str(), logical_container[kk], false, 0, checkOverlap);
887 }
888
889
890 //Fill in the inside of the container
891 //1mm from the bottom cover in design. Considering the modules's position are not real, change this number to make the bare chamber in the right place
892 double l_chamber = honeyComb_y*2+tape_mrpc_y*2+pcbBoard_y0*2+pcbBoard_y1+mylar_y*4+glass0_y*4+glass1_y*10+gasLayer_y*12;
893 double y_chamber;
894 double z_chamber = (containerIn_z-pcbBoard_z)/2-smallL;
895 for(int kk=0; kk<4; kk++)
896 {
897 if(kk<2) y_chamber = -(containerIn_y-l_chamber)/2+chamber_in_posy;
898 else y_chamber = -(containerIn_y-l_chamber)/2+chamber_out_posy;
899 G4Transform3D transform_bareChamber;
900 if(kk==0 || kk==2)
901 {
902 transform_bareChamber = G4Transform3D(rot_dummy, G4ThreeVector(0,y_chamber,z_chamber));
903 }
904 else
905 {
906 G4RotationMatrix rot_bareChamber;
907 rot_bareChamber.rotateZ(180*deg);
908 transform_bareChamber = G4Transform3D(rot_bareChamber, G4ThreeVector(0,y_chamber,z_chamber));
909 }
910 new G4PVPlacement(transform_bareChamber, logical_bareChamber, "physical_bareChamber", logical_gasContainer[kk], false, 0, checkOverlap);
911
912 //lower bracket
913 G4double z_bracket = -(containerIn_z-bracket_z)/2+smallL;
914 new G4PVPlacement(0, G4ThreeVector(-bracket_posx, 0, z_bracket), logical_bracket, "physical_bracket_0", logical_gasContainer[kk], false, 0, checkOverlap);
915 new G4PVPlacement(0, G4ThreeVector(bracket_posx, 0, z_bracket), logical_bracket, "physical_bracket_1", logical_gasContainer[kk], false, 0, checkOverlap);
916
917 //side stop block
918 G4Transform3D transform_sideStopBlock;
919 G4double angle_gasContainerSide = (atan((containerIn_xup-containerIn_xdown)/2/(containerIn_z))) *rad;
920 G4double x_sideStopBlock = (containerIn_xup+containerIn_xdown)/4+sideStopBlock_posz0*tan(angle_gasContainerSide)-sideStopBlock_x/2*cos(angle_gasContainerSide);
921 G4double z_sideStopBlock = sideStopBlock_posz0+sideStopBlock_x/2*sin(angle_gasContainerSide);
922
923 G4RotationMatrix rot_sideStopBlock;
924 rot_sideStopBlock.rotateY(angle_gasContainerSide);
925 rot_sideStopBlock.rotateZ(180*deg);
926 transform_sideStopBlock = G4Transform3D(rot_sideStopBlock, G4ThreeVector(-x_sideStopBlock, 0, z_sideStopBlock));
927 new G4PVPlacement(transform_sideStopBlock, logical_sideStopBlock, "physical_sideStopBlock_0", logical_gasContainer[kk], false, 0, checkOverlap);
928
929 rot_sideStopBlock = G4RotationMatrix(0,0,0);
930 rot_sideStopBlock.rotateY(angle_gasContainerSide);
931 transform_sideStopBlock = G4Transform3D(rot_sideStopBlock, G4ThreeVector(x_sideStopBlock, 0, z_sideStopBlock));
932 new G4PVPlacement(transform_sideStopBlock, logical_sideStopBlock, "physical_sideStopBlock_1", logical_gasContainer[kk], false, 0, checkOverlap);
933
934 x_sideStopBlock = (containerIn_xup+containerIn_xdown)/4+sideStopBlock_posz1*tan(angle_gasContainerSide)-sideStopBlock_x/2*cos(angle_gasContainerSide);
935 z_sideStopBlock = sideStopBlock_posz1+sideStopBlock_x/2*sin(angle_gasContainerSide);
936 rot_sideStopBlock = G4RotationMatrix(0,0,0);
937 rot_sideStopBlock.rotateY(angle_gasContainerSide);
938 rot_sideStopBlock.rotateZ(180*deg);
939 transform_sideStopBlock = G4Transform3D(rot_sideStopBlock, G4ThreeVector(-x_sideStopBlock, 0, z_sideStopBlock));
940 new G4PVPlacement(transform_sideStopBlock, logical_sideStopBlock, "physical_sideStopBlock_2", logical_gasContainer[kk], false, 0, checkOverlap);
941
942 rot_sideStopBlock = G4RotationMatrix(0,0,0);
943 rot_sideStopBlock.rotateY(angle_gasContainerSide);
944 transform_sideStopBlock = G4Transform3D(rot_sideStopBlock, G4ThreeVector(x_sideStopBlock, 0, z_sideStopBlock));
945 new G4PVPlacement(transform_sideStopBlock, logical_sideStopBlock, "physical_sideStopBlock_3", logical_gasContainer[kk], false, 0, checkOverlap);
946 }
947
948 //stop block
949 //upper stop block
950 G4double x_upStopBlock = containerIn_xup/4;
951 G4double y_upStopBlock = pcbBoard_y1/2.+mylar_y+glass0_y+glass1_y*2.5+gasLayer_y*3;
952 G4double z_upStopBlock = (pcbBoard_z-upStopBlock_z)/2-smallL;
953 new G4PVPlacement(0, G4ThreeVector(-x_upStopBlock, -y_upStopBlock, z_upStopBlock ), logical_upStopBlock, "physical_upStopBlock_0", logical_bareChamber, false,0, checkOverlap);
954 new G4PVPlacement(0, G4ThreeVector(-x_upStopBlock, y_upStopBlock, z_upStopBlock ), logical_upStopBlock, "physical_upStopBlock_1", logical_bareChamber, false,0, checkOverlap);
955 new G4PVPlacement(0, G4ThreeVector(x_upStopBlock, -y_upStopBlock, z_upStopBlock ), logical_upStopBlock, "physical_upStopBlock_2", logical_bareChamber, false,0, checkOverlap);
956 new G4PVPlacement(0, G4ThreeVector(x_upStopBlock, y_upStopBlock, z_upStopBlock ), logical_upStopBlock, "physical_upStopBlock_3", logical_bareChamber, false,0, checkOverlap);
957
958
959 //honeyComb
960 G4LogicalVolume* logical_honeyComb = partProduce->lg_honeyComb("logical_honeyComb");
961 G4double y_honeyComb = (honeyComb_y+pcbBoard_y1)/2+tape_mrpc_y+pcbBoard_y0+mylar_y*2+glass0_y*2+glass1_y*5+gasLayer_y*6;
962 G4double z_honeyComb = (pcbBoard_z-honeyComb_z)/2-honeyComb_posz;
963 new G4PVPlacement(0,G4ThreeVector(0,y_honeyComb,z_honeyComb), logical_honeyComb,"physical_honeyComb_0",logical_bareChamber,false,0, checkOverlap);
964 new G4PVPlacement(0,G4ThreeVector(0,-1*y_honeyComb,z_honeyComb), logical_honeyComb,"physical_honeyComb_1",logical_bareChamber,false,1, checkOverlap);
965
966 //tape_mrpc
967 G4LogicalVolume* logical_tape_mrpc = partProduce->lg_tape_mrpc("logical_tape_mrpc");
968 G4double y_tape_mrpc = (tape_mrpc_y+pcbBoard_y1)/2+pcbBoard_y0+mylar_y*2+glass0_y*2+glass1_y*5+gasLayer_y*6;
969 G4double z_tape_mrpc = (pcbBoard_z-tape_mrpc_z)/2-tape_mrpc_posz;
970 new G4PVPlacement(0,G4ThreeVector(0,y_tape_mrpc,z_tape_mrpc), logical_tape_mrpc,"physical_tape_mrpc_0",logical_bareChamber,false,0, checkOverlap);
971 new G4PVPlacement(0,G4ThreeVector(0,-1*y_tape_mrpc,z_tape_mrpc), logical_tape_mrpc,"physical_tape_mrpc_1",logical_bareChamber,false,1, checkOverlap);
972
973 //pcbBoard
974 G4LogicalVolume* logical_pcbBoard0 = partProduce->lg_pcbBoard(0, "logical_pcbBoard0");
975 G4double y_pcbBoard = (pcbBoard_y0+pcbBoard_y1)/2+mylar_y*2+glass0_y*2+glass1_y*5+gasLayer_y*6;
976 new G4PVPlacement(0,G4ThreeVector(0,y_pcbBoard,0),logical_pcbBoard0,"physical_pcbBoard0_0",logical_bareChamber,false,0, checkOverlap);
977 //Notice!!! I rotate 180 deg in order to make the strips near the PCB surface,
978 //but keep in mind that this will make the readout strips not mirror symmetry, but Z axial symmetry
979 G4RotationMatrix* rot_pcbBoard = new G4RotationMatrix();
980 rot_pcbBoard->rotateZ(180*degree);
981 new G4PVPlacement(rot_pcbBoard,G4ThreeVector(0,-1*y_pcbBoard,0),logical_pcbBoard0,"physical_pcbBoard0_1",logical_bareChamber,false,1, checkOverlap);
982
983 G4LogicalVolume* logical_pcbBoard1 = partProduce->lg_pcbBoard(1, "logical_pcbBoard1");
984 new G4PVPlacement(0,G4ThreeVector(0,0,0),logical_pcbBoard1,"physical_pcbBoard1",logical_bareChamber,false,0, checkOverlap);
985
986 //readout strip
987 G4AssemblyVolume* logical_strip = partProduce->lg_strip("logical_strip");
988 G4double z_strip = (pcbBoard_z-12*strip_z-11*strip_gap)/2-strip_posz;
989 G4Transform3D transform_strip(rot_dummy, G4ThreeVector(0, pcbBoard_y0/2.-strip_y/2-smallL, z_strip));
990 logical_strip->MakeImprint(logical_pcbBoard0, transform_strip);
991 transform_strip = G4Transform3D(rot_dummy, G4ThreeVector(0,0,z_strip));
992 logical_strip->MakeImprint(logical_pcbBoard1, transform_strip);
993
994 //mylar
995 G4LogicalVolume* logical_mylar = partProduce->lg_mylar("logical_mylar");
996 G4double y_mylar = (mylar_y+pcbBoard_y1)/2+mylar_y+glass0_y*2+glass1_y*5+gasLayer_y*6;
997 G4double z_mylar = (pcbBoard_z-mylar_z)/2-mylar_posz;
998 new G4PVPlacement(0,G4ThreeVector(0,y_mylar,z_mylar),logical_mylar,"physical_mylar_0",logical_bareChamber,false,0, checkOverlap);
999 new G4PVPlacement(0,G4ThreeVector(0,-y_mylar,z_mylar),logical_mylar,"physical_mylar_3",logical_bareChamber,false,3, checkOverlap);
1000
1001 y_mylar = (mylar_y+pcbBoard_y1)/2;
1002 new G4PVPlacement(0,G4ThreeVector(0,y_mylar,z_mylar),logical_mylar,"physical_mylar_1",logical_bareChamber,false,1, checkOverlap);
1003 new G4PVPlacement(0,G4ThreeVector(0,-y_mylar,z_mylar),logical_mylar,"physical_mylar_2",logical_bareChamber,false,2, checkOverlap);
1004
1005 //glass
1006 G4LogicalVolume* logical_glass0 = partProduce->lg_glass(0, "logical_glass0");
1007 G4double y_glass = (glass0_y+pcbBoard_y1)/2.+mylar_y+glass0_y+glass1_y*5+gasLayer_y*6;
1008 G4double z_glass = (pcbBoard_z-glass0_z)/2.-glass0_posz;
1009 new G4PVPlacement(0, G4ThreeVector(0, y_glass, z_glass), logical_glass0, "physical_glass0_0", logical_bareChamber, false, 0, checkOverlap);
1010 new G4PVPlacement(0, G4ThreeVector(0, -y_glass, z_glass), logical_glass0, "physical_glass0_3", logical_bareChamber, false, 3, checkOverlap);
1011 y_glass = pcbBoard_y1/2.+mylar_y+glass0_y/2.;
1012 new G4PVPlacement(0, G4ThreeVector(0, y_glass, z_glass), logical_glass0, "physical_glass0_1", logical_bareChamber, false, 1, checkOverlap);
1013 new G4PVPlacement(0, G4ThreeVector(0, -y_glass, z_glass), logical_glass0, "physical_glass0_2", logical_bareChamber, false, 2, checkOverlap);
1014
1015 G4LogicalVolume* logical_glass1 = partProduce->lg_glass(1, "logical_glass1");
1016 z_glass = (pcbBoard_z-glass1_z)/2.-glass1_posz;
1017 for(G4int i=0; i<5; i++)
1018 {
1019 y_glass = pcbBoard_y1/2.+mylar_y+glass0_y+glass1_y*(4.5-i)+gasLayer_y*(5-i);
1020 name.str("");
1021 name<<"physical_glass1_"<<i;
1022 new G4PVPlacement(0, G4ThreeVector(0, y_glass, z_glass), logical_glass1, name.str(), logical_bareChamber, false, i, checkOverlap);
1023 name.str("");
1024 name<<"physical_glass1_"<<9-i;
1025 new G4PVPlacement(0, G4ThreeVector(0, -y_glass, z_glass), logical_glass1, name.str(), logical_bareChamber, false, 9-i, checkOverlap);
1026 }
1027
1028 //gas
1029 logical_gasLayer = partProduce->lg_gasLayer("logical_gasLayer");
1030 G4double y_gasLayer;
1031 G4double z_gasLayer = (pcbBoard_z-gasLayer_z)/2.-gasLayer_posz;
1032 G4VPhysicalVolume* physical_gasLayer[12];
1033 for(G4int i=0; i<6; i++) //y->larger, gasNp->larger
1034 {
1035 y_gasLayer = pcbBoard_y1/2.+mylar_y+glass0_y+glass1_y*(5-i)+gasLayer_y*(5.5-i);
1036 name.str("");
1037 name<<"physical_gasLayer_"<<11-i;
1038 physical_gasLayer[i] = new G4PVPlacement(0, G4ThreeVector(0, -y_gasLayer, z_gasLayer), logical_gasLayer, name.str(), logical_bareChamber, false, 11-i, checkOverlap);
1039 }
1040 for(G4int i=6; i<12; i++)
1041 {
1042 y_gasLayer = pcbBoard_y1/2.+mylar_y+glass0_y+glass1_y*(i-6)+gasLayer_y*(-5.5+i);
1043 name.str("");
1044 name<<"physical_gasLayer_"<<11-i;
1045 physical_gasLayer[i] = new G4PVPlacement(0, G4ThreeVector(0, y_gasLayer, z_gasLayer), logical_gasLayer, name.str(), logical_bareChamber, false, 11-i, checkOverlap);
1046 }
1047
1048
1049 //arrange the 72 modules in the endcap, it's assumed to form two semicircles with a gap of about 2mm
1050
1051 // Z: East; y: Up; x: North
1052 // /y |z y y|/|
1053 // |z/ ___________ rotateX | / rotateZ /| |
1054 // |/_____x \ / ___|_/_ ||_|____x
1055 // \ / ->>>> / |/__\___x ->>>> | |
1056 // small end \_____/ bigger end /_________\ \ |
1057 // \|
1058
1059 const G4int n_module = 36;
1060 G4double angle = 360.0*deg/n_module;
1061 G4double z_layerIn = endcap_length/2-containerOut_y/2-lowCover1_y-layer_posz;
1062 G4double z_layerOut = endcap_length/2-containerOut_y/2-lowCover2_y-layer_posz;
1063 //Adjusting parameters
1064 //rOffset_east: along R direction
1065 //angle_east: along phi direction
1066 //angleOffset_east: along self asymmetric axis
1067 rOffset_east = tofPara->GetVec("rOffset_east");
1068 angle_east = tofPara->GetVec("angle_east");
1069 angleOffset_east = tofPara->GetVec("angleOffset_east");
1070 rOffset_west = tofPara->GetVec("rOffset_west");
1071 angle_west = tofPara->GetVec("angle_west");
1072 angleOffset_west = tofPara->GetVec("angleOffset_west");
1073
1074
1075 //arrange east endcap
1076 for(int i=0; i<n_module; i++)
1077 {
1078 G4double angle_module = startAngle_east+angle_east[i]+i*angle;
1079 G4double r_module = endcap_r+rOffset_east[i];
1080
1081 G4RotationMatrix rot_layerIn_east;
1082 rot_layerIn_east.rotateX(90.*deg);
1083 rot_layerIn_east.rotateZ(90.*deg);
1084 rot_layerIn_east.rotateZ(angle_module+angleOffset_east[i]);
1085
1086 G4ThreeVector translation_layerIn_east = G4ThreeVector(r_module*cos(angle_module), r_module*sin(angle_module), -z_layerIn);
1087 G4Transform3D transform_layerIn_east = G4Transform3D(rot_layerIn_east, translation_layerIn_east);
1088
1089
1090 G4RotationMatrix rot_layerOut_east;
1091 rot_layerOut_east.rotateZ(180.*deg);
1092 rot_layerOut_east.rotateX(90.*deg);
1093 rot_layerOut_east.rotateZ(90.*deg);
1094 rot_layerOut_east.rotateZ(angle_module+angleOffset_east[i]);
1095
1096 G4ThreeVector translation_layerOut_east = G4ThreeVector(r_module*cos(angle_module), r_module*sin(angle_module), z_layerOut);
1097 G4Transform3D transform_layerOut_east = G4Transform3D(rot_layerOut_east, translation_layerOut_east);
1098
1099 name.str("");
1100 name<<"physical_mrpc_east_"<<i;
1101 if(i%2==0)
1102 {
1103 new G4PVPlacement(transform_layerOut_east, logical_container[3], name.str(), logicalEcTofEast, false, i, checkOverlap);
1104 }
1105 else
1106 {
1107 new G4PVPlacement(transform_layerIn_east, logical_container[0], name.str(), logicalEcTofEast, false, i, checkOverlap);
1108 }
1109 }
1110
1111 //arrange west endcap
1112 for(int i=0; i<n_module; i++)
1113 {
1114 G4double angle_module = startAngle_west+angle_west[i]+i*angle;
1115 G4double r_module = endcap_r+rOffset_west[i];
1116
1117 G4RotationMatrix rot_layerIn_west;
1118 rot_layerIn_west.rotateZ(180.*deg);
1119 rot_layerIn_west.rotateX(90.*deg);
1120 rot_layerIn_west.rotateZ(90.*deg);
1121 rot_layerIn_west.rotateZ(angle_module+angleOffset_west[i]);
1122
1123 G4ThreeVector translation_layerIn_west = G4ThreeVector(r_module*cos(angle_module), r_module*sin(angle_module), z_layerIn);
1124 G4Transform3D transform_layerIn_west = G4Transform3D(rot_layerIn_west, translation_layerIn_west);
1125
1126
1127 G4RotationMatrix rot_layerOut_west;
1128 rot_layerOut_west.rotateX(90.*deg);
1129 rot_layerOut_west.rotateZ(90.*deg);
1130 rot_layerOut_west.rotateZ(angle_module+angleOffset_west[i]);
1131
1132 G4ThreeVector translation_layerOut_west = G4ThreeVector(r_module*cos(angle_module), r_module*sin(angle_module), -z_layerOut);
1133 G4Transform3D transform_layerOut_west = G4Transform3D(rot_layerOut_west, translation_layerOut_west);
1134
1135 name.str("");
1136 name<<"physical_mrpc_west_"<<i;
1137 if(i%2==0)
1138 {
1139 new G4PVPlacement(transform_layerOut_west, logical_container[2], name.str(), logicalEcTofWest, false, i, checkOverlap);
1140 }
1141 else
1142 {
1143 new G4PVPlacement(transform_layerIn_west, logical_container[1], name.str(), logicalEcTofWest, false, i, checkOverlap);
1144 }
1145 }
1146}
G4double smallL
Definition: PartProduce.cc:19
G4RotationMatrix rot_dummy(0 *deg, 0 *deg, 0 *deg)
bool checkOverlap
Definition: PartProduce.cc:21
VEC GetVec(std::string key)
G4LogicalVolume * lg_sideFEE(string name="")
Definition: PartProduce.cc:390
void IniParam()
Definition: PartProduce.cc:34
G4LogicalVolume * lg_mylar(string name="")
Definition: PartProduce.cc:732
G4LogicalVolume * lg_lowCover1(string name="")
Definition: PartProduce.cc:270
G4LogicalVolume * lg_glass(G4int flag, string name="")
Definition: PartProduce.cc:747
G4LogicalVolume * lg_container(int flag, string name="")
Definition: PartProduce.cc:485
G4LogicalVolume * lg_gasContainer(string name="")
Definition: PartProduce.cc:589
G4LogicalVolume * lg_sideStopBlock(string name="")
Definition: PartProduce.cc:848
G4AssemblyVolume * lg_strip(string name="")
Definition: PartProduce.cc:700
G4LogicalVolume * lg_honeyComb(string name="")
Definition: PartProduce.cc:627
G4LogicalVolume * lg_containerFrame(string name="")
Definition: PartProduce.cc:204
G4LogicalVolume * lg_lowCover2(string name="")
Definition: PartProduce.cc:285
G4LogicalVolume * lg_pcbBoard(G4int flag, string name="")
Definition: PartProduce.cc:680
G4LogicalVolume * lg_bracket(string name="")
Definition: PartProduce.cc:796
G4LogicalVolume * lg_bareChamber(string name="")
Definition: PartProduce.cc:605
G4LogicalVolume * lg_upStopBlock(string name="")
Definition: PartProduce.cc:820
G4LogicalVolume * lg_tape_mrpc(string name="")
Definition: PartProduce.cc:664
G4LogicalVolume * lg_gasLayer(string name="")
Definition: PartProduce.cc:781
G4LogicalVolume * lg_castingDie(string name="")
Definition: PartProduce.cc:460
G4LogicalVolume * lg_upFEE(string name="")
Definition: PartProduce.cc:321
G4LogicalVolume * lg_upCover(string name="")
Definition: PartProduce.cc:255
const float rad
Definition: vector3.h:134

Referenced by Construct().

◆ DefineMaterial()

void BesTofConstruction::DefineMaterial ( )

Definition at line 1150 of file BesTofConstruction.cc.

1151{
1152 G4double a,z,density,fraction;
1153 G4int nel, natoms, ncomponents;
1154 G4String name, symbol;
1155
1156
1157 G4Element* H=G4Element::GetElement("Hydrogen");
1158 if (!H)
1159 H = new G4Element(name="Hydrogen",symbol="H" , z= 1., a=1.01*g/mole);
1160
1161 G4Element* C=G4Element::GetElement("Carbon");
1162 if (!C)
1163 C = new G4Element(name="Carbon" ,symbol="C" , z= 6., a=12.01*g/mole);
1164
1165 G4Element* F=G4Element::GetElement("Fluorin");
1166 if (!F)
1167 F = new G4Element(name="Fluorin", symbol="F", z=9., a=18.01*g/mole);
1168
1169 G4Element* O=G4Element::GetElement("Oxygen");
1170 if (!O)
1171 O = new G4Element(name="Oxygen",symbol="O",z= 8., a= 16.00*g/mole);
1172
1173 G4Element* N=G4Element::GetElement("Nitrogen");
1174 if (!N)
1175 N = new G4Element(name="Nitrogen",symbol="N",z= 7., a= 14.01*g/mole);
1176
1177 G4Element* S=G4Element::GetElement("Sulfur");
1178 if(!S)
1179 S = new G4Element(name="Sulfur",symbol="S",z= 16., a= 32.06*g/mole);
1180
1181
1182 BC404 = new G4Material("BC404",density=1.032*g/cm3,nel=2);
1183 BC404->AddElement(C,10);
1184 BC404->AddElement(H,11);
1185
1186 BC408 = new G4Material("BC408",density=1.032*g/cm3,nel=2);
1187 BC408->AddElement(C,1000);
1188 BC408->AddElement(H,1104);
1189
1190 PVF = new G4Material("PVF",density=1.45*g/cm3,nel=3);
1191 PVF->AddElement(C,2);
1192 PVF->AddElement(H,3);
1193 PVF->AddElement(F,1);
1194
1195 //PMT mixed material
1196 G4Material* Cu = G4Material::GetMaterial("Copper");
1197 G4Material* Al = G4Material::GetMaterial("Aluminium");
1198
1199 //vacuum
1200 //G4Material* Vacuum = new G4Material("Galactic", z=1., a=1.01*g/mole,
1201 //density= universe_mean_density, kStateGas, 3.e-18*pascal, 2.73*kelvin);
1202
1203 density = 1.4618815*g/cm3;
1204 PMTmaterial = new G4Material(name="PMTmaterial", density, 4);
1205 PMTmaterial->AddMaterial(Al, 0.4495);
1206 PMTmaterial->AddMaterial(Cu,0.35);
1207 PMTmaterial->AddMaterial(G4Material::GetMaterial("SiO2"),0.2);
1208 PMTmaterial->AddMaterial(G4Material::GetMaterial("Air"),0.0005);
1209 //PMTmaterial->AddMaterial(Vacuum,0.1);
1210 G4cout<<PMTmaterial;
1211
1212 density = 1.002*g/cm3;
1213 G4Material* tape = new G4Material(name="tape",density,nel=2);
1214 tape->AddElement(C,2);
1215 tape->AddElement(H,5);
1216
1217
1218 //MRPC material
1219 //The stop block in the gas container
1220 G4Material* Nylon = new G4Material("Nylon", density=1.15*g/cm3, ncomponents=4);
1221 Nylon->AddElement(C, natoms=2);
1222 Nylon->AddElement(H, natoms=3);
1223 Nylon->AddElement(O, natoms=1);
1224 Nylon->AddElement(N, natoms=1);
1225 G4cout<<Nylon<<G4endl;
1226
1227 //The core of honeyComb is thought to be cellulose
1228 G4Material* honeycombCore = new G4Material("honeycombCore", density=0.024*g/cm3, ncomponents=3);
1229 honeycombCore->AddElement(C,natoms=6);
1230 honeycombCore->AddElement(H,natoms=10);
1231 honeycombCore->AddElement(O,natoms=5);
1232 G4cout<<honeycombCore<<G4endl;
1233
1234 //The honeyComb surface and the PCB board are thought to be composed of SiO2(60%) and epoxy resins(40%)
1235 G4Material* epoxy = new G4Material("epoxy", density=1.2*g/cm3, ncomponents=3);
1236 epoxy->AddElement(C,natoms=11);
1237 epoxy->AddElement(H,natoms=12);
1238 epoxy->AddElement(O,natoms=3);
1239 G4cout<<epoxy<<G4endl;
1240
1241 G4Material* insulationBoard = new G4Material("insulationBoard", density=1.85*g/cm3, 2);
1242 insulationBoard->AddMaterial(G4Material::GetMaterial("SiO2"), 0.6);
1243 insulationBoard->AddMaterial(epoxy, 0.4);
1244 G4cout<<insulationBoard<<G4endl;
1245
1246 //Mylar and tape are thought to be PET
1247 G4Material* PET = new G4Material("PET", density= 1.39*g/cm3, ncomponents=3);
1248 PET->AddElement(C,natoms=10);
1249 PET->AddElement(H,natoms=8);
1250 PET->AddElement(O,natoms=4);
1251 G4cout<<PET<<G4endl;
1252
1253 //MRPC gas: 90% r134a, 5% isobutan, 5% SF6
1254 G4Material* FreonR134A = new G4Material("FreonR134A", density =4.241*mg/cm3,ncomponents=3);
1255 FreonR134A->AddElement(C,natoms=2);
1256 FreonR134A->AddElement(H,natoms=2);
1257 FreonR134A->AddElement(F,natoms=4);
1258 G4cout<<FreonR134A<<G4endl;
1259
1260 G4Material* SF6 = new G4Material("SF6", density =6.14*mg/cm3,ncomponents=2);
1261 SF6->AddElement(S,natoms=1);
1262 SF6->AddElement(F,natoms=6);
1263 G4cout<<SF6<<G4endl;
1264
1265 G4Material* Isobutan = new G4Material("Isobutan", density =2.487*mg/cm3,ncomponents=2);
1266 Isobutan->AddElement(C, natoms=4);
1267 Isobutan->AddElement(H, natoms=10);
1268 G4cout<<Isobutan<<G4endl;
1269
1270 G4Material* MRPCGas = new G4Material(name="MRPCGas", density=4.17*mg/cm3,ncomponents=3);
1271 MRPCGas->AddMaterial(FreonR134A, fraction= 89.69*perCent);
1272 MRPCGas->AddMaterial(SF6, fraction=7.34*perCent);
1273 MRPCGas->AddMaterial(Isobutan, fraction=2.97*perCent);
1274
1275 //This setting is to produce ion pairs, default is 0
1276 if(0.0 == MRPCGas->GetIonisation()->GetMeanEnergyPerIonPair())
1277 {
1278 //MRPCGas->GetIonisation()->SetMeanEnergyPerIonPair(20*eV);
1279 MRPCGas->GetIonisation()->SetMeanEnergyPerIonPair(m_ionE*eV);
1280 }
1281 G4cout<<MRPCGas<<G4endl;
1282}
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations C
Definition: RRes.h:29
IMPLICIT REAL *A H
Definition: myXsection.h:1

Referenced by Construct().

◆ getXYZ()

void BesTofConstruction::getXYZ ( const G4RotationMatrix  r,
double &  a,
double &  b,
double &  c 
) const

Definition at line 1284 of file BesTofConstruction.cc.

1285{
1286 double cosb = sqrt( r.xx()*r.xx() + r.yx()*r.yx() );
1287
1288 if (cosb > 16*FLT_EPSILON)
1289 {
1290 a = atan2( r.zy(), r.zz() );
1291 b = atan2( -r.zx(), cosb );
1292 c = atan2( r.yx(), r.xx() );
1293 }
1294 else
1295 {
1296 a = atan2( -r.yz(), r.yy() );
1297 b = atan2( -r.zx(), cosb );
1298 c = 0.;
1299 }
1300 //std::cout.precision(20);
1301 //std::cout<<"in getXYZ :( "<<r.xx()<<" "<<r.xy()<<" "<<r.xz()<<std::endl;
1302 //std::cout<<" "<<r.yx()<<" "<<r.yy()<<" "<<r.yz()<<std::endl;
1303 //std::cout<<" "<<r.zx()<<" "<<r.zy()<<" "<<r.zz()<<std::endl;
1304 //std::cout<<"details: cosb="<<cosb<<" a="<<a<<" b="<<b<<" c="<<c<<" min="<<16*FLT_EPSILON<<std::endl;
1305
1306
1307 G4RotationMatrix temp;
1308 temp.rotateZ((c/deg)*deg);
1309 //std::cout.precision(20);
1310 //std::cout<<"in detail temp2:( "<<temp.xx()<<" "<<temp.xy()<<" "<<temp.xz()<<std::endl;
1311 //std::cout<<" "<<temp.yx()<<" "<<temp.yy()<<" "<<temp.yz()<<std::endl;
1312 //std::cout<<" "<<temp.zx()<<" "<<temp.zy()<<" "<<temp.zz()<<std::endl;
1313}

Referenced by ConstructBr1Tof(), ConstructBr2Tof(), and ConstructEcTof().


The documentation for this class was generated from the following files: