13#include "GaudiKernel/MsgStream.h"
14#include "GaudiKernel/Bootstrap.h"
15#include "GaudiKernel/PropertyMgr.h"
16#include "GaudiKernel/IJobOptionsSvc.h"
17#include "GaudiKernel/ISvcLocator.h"
18#include "GaudiKernel/IDataProviderSvc.h"
20#include "BesTofConstruction.hh"
21#include "BesTofGeoParameter.hh"
22#include "PartProduce.hh"
24#include "G4Geo/TofG4Geo.h"
25#include "G4Geo/MRPCG4Geo.h"
26#include "ReadBoostRoot.hh"
28#include "G4Material.hh"
34#include "G4UnionSolid.hh"
35#include "G4SubtractionSolid.hh"
36#include "G4IntersectionSolid.hh"
38#include "G4LogicalVolume.hh"
39#include "G4Transform3D.hh"
40#include "G4PVPlacement.hh"
41#include "G4AssemblyVolume.hh"
42#include "G4SDManager.hh"
43#include "G4UnitsTable.hh"
46#include "G4VisAttributes.hh"
47#include "G4UnionSolid.hh"
48#include "G4UserLimits.hh"
54 PropertyMgr m_propMgr1;
55 m_propMgr1.declareProperty(
"UserLimits", m_userLimits = 0.03);
56 m_propMgr1.declareProperty(
"IonE", m_ionE = 100);
57 IJobOptionsSvc* jobSvc1;
58 Gaudi::svcLocator()->service(
"JobOptionsSvc", jobSvc1);
59 jobSvc1->setMyProperties(
"BesTofConstruction", &m_propMgr1);
86 physicalBucket1Br1 = 0;
87 physicalBucket2Br1 = 0;
88 physicalBucket1Br2 = 0;
89 physicalBucket2Br2 = 0;
91 logicalScinEcWest = 0;
92 logicalScinEcEast = 0;
93 physicalScinEcWest = 0;
94 physicalScinEcEast = 0;
101 logicalPVFEcWest = 0;
102 logicalPVFEcEast = 0;
103 physicalPVFEcWest = 0;
104 physicalPVFEcEast = 0;
107 physicalBucketEc = 0;
130 G4cout<<
"BesTofConstruction::Construct(), logicalTof not found"<<G4endl;
134 physicalTof =
new G4PVPlacement(0,G4ThreeVector(0,0,0),
135 logicalTof,
"physicalTof",logicalBes,
false,0);
170 G4cout<<
"Tof Volume: "<<r1<<
" "<<r2<<
" "<<r3<<
" "<<r4<<
" "<<a1<<
" "<<a2<<
" "<<a3<<G4endl;
173 G4Tubs* tub1 =
new G4Tubs(
"tub1",r1,r2,a1,0,360);
174 G4Tubs* tub2 =
new G4Tubs(
"tub2",r2-4,r4,a2,0,360);
175 G4Tubs* tub3 =
new G4Tubs(
"tub3",0,r3,a3,0,360);
176 G4UnionSolid* tub4 =
new G4UnionSolid(
"tub4",tub1,tub2,0,G4ThreeVector(0,0,0) );
177 G4SubtractionSolid* solidTof =
new G4SubtractionSolid(
"solidTof",tub4,tub3,0, G4ThreeVector(0,0,0) );
178 logicalTof =
new G4LogicalVolume(solidTof, G4Material::GetMaterial(
"Air"),
"logicalTof");
179 physicalTof =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalTof,
"physicalTof",logicalBes,
false,0);
182 G4Tubs* tub5 =
new G4Tubs(
"tub5",r3,r4,a3,0,360);
183 logicalBrTof =
new G4LogicalVolume(tub5, G4Material::GetMaterial(
"Air"),
"logicalBrTof");
184 G4VPhysicalVolume* physicalBrTof =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalBrTof,
"physicalBrTof",logicalTof,
false,0);
188 G4Tubs* tub6 =
new G4Tubs(
"tub6",r1,r4,(a2-a3)/2,0,360);
189 G4Tubs* tub7 =
new G4Tubs(
"tub7",r1,r2,(a1-a2)/2,0,360);
190 G4UnionSolid* tub8 =
new G4UnionSolid(
"tub8",tub6,tub7,0,G4ThreeVector(0,0,(a3-a1)/2));
191 logicalEcTofWest =
new G4LogicalVolume(tub8, G4Material::GetMaterial(
"Air"),
"logicalEcTofWest");
192 G4VPhysicalVolume* physicalEcTofWest =
new G4PVPlacement(0,G4ThreeVector(0,0,tofPara->
GetzPosWestEc()),logicalEcTofWest,
"physicalEcTofWest",logicalTof,
false,0);
194 G4UnionSolid* tub9 =
new G4UnionSolid(
"tub9",tub6,tub7,0,G4ThreeVector(0,0,(a1-a3)/2) );
195 logicalEcTofEast =
new G4LogicalVolume(tub9, G4Material::GetMaterial(
"Air"),
"logicalEcTofEast");
196 G4VPhysicalVolume* physicalEcTofEast =
new G4PVPlacement(0,G4ThreeVector(0,0,tofPara->
GetzPosEastEc()),logicalEcTofEast,
"physicalEcTofEast",logicalTof,
false,0);
203 G4Tubs* tubTape =
new G4Tubs(
"tubTape",866, 866.3, 1150, 0, 360);
204 G4LogicalVolume* logicalTape =
new G4LogicalVolume(tubTape,G4Material::GetMaterial(
"tape"),
"logicalTape");
205 G4VPhysicalVolume* physicalTape =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalTape,
"physicalTape",logicalBrTof,
false,0);
206 logicalTape->SetVisAttributes(G4VisAttributes::Invisible);
218 G4cout<<
"BesTofConstruction::Construct(), logicalTof not found"<<G4endl;
221 physicalTof =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalTof,
"physicalTof",logicalBes,
false,0);
244 G4double r1=tofPara->
GetEcR1()-1;
252 G4cout<<
"Tof Volume: "<<r1<<
" "<<r2<<
" "<<r3<<
" "<<r4<<
" "<<a1<<
" "<<a2<<
" "<<a3<<G4endl;
254 G4Tubs* tub1 =
new G4Tubs(
"tub1",r1,r2,a1,0,360);
255 G4Tubs* tub2 =
new G4Tubs(
"tub2",r2-4,r4,a2,0,360);
256 G4Tubs* tub3 =
new G4Tubs(
"tub3",0,r3,a3,0,360);
257 G4UnionSolid* tub4 =
new G4UnionSolid(
"tub4",tub1,tub2,0,G4ThreeVector(0,0,0) );
258 G4SubtractionSolid* solidTof =
new G4SubtractionSolid(
"solidTof",tub4,tub3,0, G4ThreeVector(0,0,0) );
259 logicalTof =
new G4LogicalVolume(solidTof, G4Material::GetMaterial(
"Air"),
"logicalTof");
260 physicalTof =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalTof,
"physicalTof",logicalBes,
false,0);
262 G4Tubs* tub5 =
new G4Tubs(
"tub5",r3,r4,a3,0,360);
263 logicalBrTof =
new G4LogicalVolume(tub5, G4Material::GetMaterial(
"Air"),
"logicalBrTof");
264 G4VPhysicalVolume* physicalBrTof =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalBrTof,
"physicalBrTof",logicalTof,
false,0);
267 G4Tubs* tub6 =
new G4Tubs(
"tub6",r1,r4,(a2-a3)/2,0,360);
268 G4Tubs* tub7 =
new G4Tubs(
"tub7",r1,r2,(a1-a2)/2,0,360);
269 G4UnionSolid* tub8 =
new G4UnionSolid(
"tub8",tub6,tub7,0,G4ThreeVector(0,0,(a3-a1)/2) );
270 logicalEcTofWest =
new G4LogicalVolume(tub8, G4Material::GetMaterial(
"Air"),
"logicalEcTofWest");
271 G4VPhysicalVolume* physicalEcTofWest =
new G4PVPlacement(0,G4ThreeVector(0,0,tofPara->
GetzPosWestEc()),logicalEcTofWest,
"physicalEcTofWest",logicalTof,
false,0);
273 G4UnionSolid* tub9 =
new G4UnionSolid(
"tub9",tub6,tub7,0,G4ThreeVector(0,0,(a1-a3)/2) );
274 logicalEcTofEast =
new G4LogicalVolume(tub9, G4Material::GetMaterial(
"Air"),
"logicalEcTofEast");
275 G4VPhysicalVolume* physicalEcTofEast =
new G4PVPlacement(0,G4ThreeVector(0,0,tofPara->
GetzPosEastEc()),logicalEcTofEast,
"physicalEcTofEast",logicalTof,
false,0);
281 G4Tubs* tubTape =
new G4Tubs(
"tubTape",866, 866.3, 1150, 0, 360);
282 G4LogicalVolume* logicalTape =
new G4LogicalVolume(tubTape,G4Material::GetMaterial(
"tape"),
"logicalTape");
283 G4VPhysicalVolume* physicalTape =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalTape,
"physicalTape",logicalBrTof,
false,0);
284 logicalTape->SetVisAttributes(G4VisAttributes::Invisible);
294 G4SDManager* SDman = G4SDManager::GetSDMpointer();
296 SDman->AddNewDetector(tofSD);
298 if (logicalScinBr1) logicalScinBr1->SetSensitiveDetector(tofSD);
299 if (logicalScinBr2) logicalScinBr2->SetSensitiveDetector(tofSD);
300 if (logicalScinEcWest) logicalScinEcWest->SetSensitiveDetector(tofSD);
301 if (logicalScinEcEast) logicalScinEcEast->SetSensitiveDetector(tofSD);
304 logical_gasLayer->SetSensitiveDetector(tofSD);
305 G4cout<<
"!!! Find logical_gasLayer !!!"<<G4endl;
308 logical_gasLayer->SetUserLimits (
new G4UserLimits(m_userLimits*mm));
313 G4VisAttributes* visBrTof =
new G4VisAttributes(G4Colour(1.,0.,0.));
314 G4VisAttributes* visEcTof =
new G4VisAttributes(G4Colour(0.,1.,0.));
317 logicalTof->SetVisAttributes(G4VisAttributes::Invisible);
319 logicalBrTof->SetVisAttributes(G4VisAttributes::Invisible);
321 if (logicalEcTofWest)
322 logicalEcTofWest->SetVisAttributes(G4VisAttributes::Invisible);
324 if (logicalEcTofEast)
325 logicalEcTofEast->SetVisAttributes(G4VisAttributes::Invisible);
330 logicalScinBr1->SetVisAttributes(G4VisAttributes::Invisible);
332 logicalScinBr2->SetVisAttributes(G4VisAttributes::Invisible);
335 logicalAlBr1->SetVisAttributes(G4VisAttributes::Invisible);
337 logicalAlBr2->SetVisAttributes(G4VisAttributes::Invisible);
340 logicalPVFBr1->SetVisAttributes(G4VisAttributes::Invisible);
342 logicalPVFBr2->SetVisAttributes(G4VisAttributes::Invisible);
344 G4VisAttributes* visAttBrBuck =
new G4VisAttributes(G4Colour(1.,1.,0.));
345 if (logicalBucketBr1)
346 logicalBucketBr1->SetVisAttributes(visAttBrBuck);
348 if (logicalBucketBr2)
349 logicalBucketBr2->SetVisAttributes(visAttBrBuck);
352 G4VisAttributes* visAttEcTof =
new G4VisAttributes(G4Colour(0.,1.,1.));
353 if (logicalScinEcWest)
354 logicalScinEcWest->SetVisAttributes(visAttEcTof);
356 if (logicalScinEcEast)
357 logicalScinEcEast->SetVisAttributes(visAttEcTof);
359 G4VisAttributes* visAttEcBuck =
new G4VisAttributes(G4Colour(1.,1.,0.));
361 logicalBucketEc->SetVisAttributes(visAttEcBuck);
365 logicalAlEcWest->SetVisAttributes(G4VisAttributes::Invisible);
367 logicalAlEcEast->SetVisAttributes(G4VisAttributes::Invisible);
368 if (logicalPVFEcWest)
369 logicalPVFEcWest->SetVisAttributes(G4VisAttributes::Invisible);
370 if (logicalPVFEcEast)
371 logicalPVFEcEast->SetVisAttributes(G4VisAttributes::Invisible);
380 G4double br1L=tofPara->
GetBr1L();
392 G4double angleBr=360./nScinBr*deg;
393 G4double scinTrapdx1,scinTrapdx2,scinTrapdx3,scinTrapdx4;
394 scinTrapdx1=scinTrapdx3=br1TrapW1/2.;
395 scinTrapdx2=scinTrapdx4=br1TrapW2/2.;
396 G4double scinTrapdy1,scinTrapdy2;
397 scinTrapdy1=scinTrapdy2=0.5*br1TrapH;
398 G4double scinTrapdz=br1L/2.;
399 G4double scinPosR=br1R1+scinTrapdy1;
400 G4double theta = atan((br1TrapW2/2.-br1TrapW1/2.)/br1TrapH);
401 G4double delta13 = AlThickness*(1/
cos(theta)-
tan(theta));
402 G4double delta24 = AlThickness*(1/
cos(theta)+
tan(theta));
403 G4double delta13P = (PVFThickness+AlThickness)*(1/
cos(theta)-
tan(theta));
404 G4double delta24P = (PVFThickness+AlThickness)*(1/
cos(theta)+
tan(theta));
407 G4Trap* solidScinBr1=
new G4Trap(
"solidScinBr1",scinTrapdz,0*deg,0*deg,
408 scinTrapdy1,scinTrapdx1,scinTrapdx2,0*deg,
409 scinTrapdy2,scinTrapdx3,scinTrapdx4,0*deg);
410 logicalScinBr1 =
new G4LogicalVolume(solidScinBr1,BC408,
"logicalScinBr1");
413 G4Trap* solidAlBr1 =
new G4Trap(
"solidAlBr1", scinTrapdz+0.001,0*deg,0*deg,
414 scinTrapdy1+AlThickness, scinTrapdx1+delta13, scinTrapdx2+delta24 ,0*deg,
415 scinTrapdy2+AlThickness, scinTrapdx3+delta13, scinTrapdx4+delta24 ,0*deg);
417 logicalAlBr1 =
new G4LogicalVolume(solidAlBr1,G4Material::GetMaterial(
"Aluminium"),
"logicalAlBr1");
418 G4Trap* solidPVFBr1 =
new G4Trap(
"solidPVFBr1",scinTrapdz+0.002,0*deg,0*deg,
419 scinTrapdy1+AlThickness+PVFThickness,scinTrapdx1+delta13P, scinTrapdx2+delta24P,0*deg,
420 scinTrapdy2+AlThickness+PVFThickness,scinTrapdx3+delta13P, scinTrapdx4+delta24P,0*deg);
422 logicalPVFBr1 =
new G4LogicalVolume(solidPVFBr1,PVF,
"logicalPVFBr1");
424 physicalAlBr1 =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalAlBr1,
"physicalAlBr1",logicalPVFBr1,
false,0);
425 physicalScinBr1 =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalScinBr1,
"physicalScinBr1",logicalAlBr1,
false, 0);
428 G4Tubs* solidBucketBr1=
new G4Tubs(
"solidBucketBr1",0,bucketDBr/2.,
429 bucketLBr/2., 0, 360.*deg);
430 logicalBucketBr1=
new G4LogicalVolume(solidBucketBr1,PMTmaterial,
"logicalBucketBr1");
434 G4RotationMatrix trapRot;
435 trapRot.rotateZ(0.5*angleBr-90.*deg);
442 G4ThreeVector pos(0,0,0);
444 for (
int i=0;i<nScinBr;i++)
446 ostringstream osnamePVFBr1;
447 osnamePVFBr1 <<
"physicalPVFBr1_"<<i;
448 ostringstream osnameBucket1Br1;
449 osnameBucket1Br1 <<
"physicalBucket1Br1_"<<i;
450 ostringstream osnameBucket2Br1;
451 osnameBucket2Br1 <<
"physicalBucket2Br1_"<<i;
454 x=scinPosR*
cos((i+0.5)*angleBr);
455 y=scinPosR*
sin((i+0.5)*angleBr);
463 G4RotationMatrix trapRotTemp;
464 trapRotTemp.rotateZ(c);
465 G4Transform3D transform(trapRotTemp,pos);
469 physicalPVFBr1 =
new G4PVPlacement(transform,logicalPVFBr1,osnamePVFBr1.str(), logicalBrTof,
false,i);
471 pos.setZ(-(bucketLBr+br1L)/2.-0.01);
472 physicalBucket1Br1 =
new G4PVPlacement(0,pos,logicalBucketBr1,osnameBucket1Br1.str(),logicalBrTof,
false,0);
473 pos.setZ((bucketLBr+br1L)/2.+0.01);
474 physicalBucket2Br1 =
new G4PVPlacement(0,pos,logicalBucketBr1,osnameBucket2Br1.str(),logicalBrTof,
false,0);
477 trapRot.rotateZ(angleBr);
487 G4double br2L=tofPara->
GetBr2L();
499 G4double angleBr=360./nScinBr*deg;
500 G4double scinTrapdx1,scinTrapdx2,scinTrapdx3,scinTrapdx4;
501 scinTrapdx1=scinTrapdx3=br2TrapW1/2.;
502 scinTrapdx2=scinTrapdx4=br2TrapW2/2.;
503 G4double scinTrapdy1,scinTrapdy2;
504 scinTrapdy1=scinTrapdy2=0.5*br2TrapH;
505 G4double scinTrapdz=br2L/2.;
506 G4double scinPosR=br2R1+scinTrapdy1;
507 G4double theta = atan((br2TrapW2/2.-br2TrapW1/2.)/br2TrapH);
508 G4double delta13 = AlThickness*(1/
cos(theta)-
tan(theta));
509 G4double delta24 = AlThickness*(1/
cos(theta)+
tan(theta));
510 G4double delta13P = (PVFThickness+AlThickness)*(1/
cos(theta)-
tan(theta));
511 G4double delta24P = (PVFThickness+AlThickness)*(1/
cos(theta)+
tan(theta));
514 G4Trap* solidScinBr2=
new G4Trap(
"solidScinBr2",scinTrapdz,0*deg,0*deg,
515 scinTrapdy1,scinTrapdx1,scinTrapdx2,0*deg,
516 scinTrapdy2,scinTrapdx3,scinTrapdx4,0*deg);
517 logicalScinBr2 =
new G4LogicalVolume(solidScinBr2,BC408,
"logicalScinBr2");
520 G4Trap* solidAlBr2 =
new G4Trap(
"solidAlBr2", scinTrapdz+0.001,0*deg,0*deg,
521 scinTrapdy1+AlThickness, scinTrapdx1+delta13, scinTrapdx2+delta24 ,0*deg,
522 scinTrapdy2+AlThickness, scinTrapdx3+delta13, scinTrapdx4+delta24 ,0*deg);
524 logicalAlBr2 =
new G4LogicalVolume(solidAlBr2,G4Material::GetMaterial(
"Aluminium"),
"logicalAlBr2");
525 G4Trap* solidPVFBr2 =
new G4Trap(
"solidPVFBr2",scinTrapdz+0.002,0*deg,0*deg,
526 scinTrapdy1+AlThickness+PVFThickness,scinTrapdx1+delta13P, scinTrapdx2+delta24P,0*deg,
527 scinTrapdy2+AlThickness+PVFThickness,scinTrapdx3+delta13P, scinTrapdx4+delta24P,0*deg);
529 logicalPVFBr2 =
new G4LogicalVolume(solidPVFBr2,PVF,
"logicalPVFBr2");
531 physicalAlBr2 =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalAlBr2,
"physicalAlBr2",logicalPVFBr2,
false,0);
532 physicalScinBr2 =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalScinBr2,
"physicalScinBr2",logicalAlBr2,
false, 0);
535 G4Tubs* solidBucketBr2=
new G4Tubs(
"solidBucketBr2",0,bucketDBr/2.,
536 bucketLBr/2., 0, 360.*deg);
537 logicalBucketBr2=
new G4LogicalVolume(solidBucketBr2,PMTmaterial,
"logicalBucketBr2");
539 G4RotationMatrix trapRot;
540 trapRot.rotateZ(-90.*deg);
547 G4ThreeVector pos(0,0,0);
549 for (
int i=0;i<nScinBr;i++)
551 ostringstream osnamePVFBr2;
552 osnamePVFBr2 <<
"physicalPVFBr2_"<<i;
553 ostringstream osnameBucket1Br2;
554 osnameBucket1Br2 <<
"physicalBucket1Br2_"<<i;
555 ostringstream osnameBucket2Br2;
556 osnameBucket2Br2 <<
"physicalBucket2Br2_"<<i;
559 x=scinPosR*
cos(i*angleBr);
560 y=scinPosR*
sin(i*angleBr);
567 G4RotationMatrix trapRotTemp;
568 trapRotTemp.rotateZ(c);
569 G4Transform3D transform(trapRotTemp,pos);
571 physicalPVFBr2 =
new G4PVPlacement(transform,logicalPVFBr2,osnamePVFBr2.str(), logicalBrTof,
false,i);
573 pos.setZ(-(bucketLBr+br2L)/2.-0.01);
574 physicalBucket1Br2 =
new G4PVPlacement(0,pos,logicalBucketBr2,osnameBucket1Br2.str(),logicalBrTof,
false,0);
575 pos.setZ((bucketLBr+br2L)/2.+0.01);
576 physicalBucket2Br2 =
new G4PVPlacement(0,pos,logicalBucketBr2,osnameBucket2Br2.str(),logicalBrTof,
false,0);
579 trapRot.rotateZ(angleBr);
591 G4double ecL = tofPara->
GetEcL();
598 G4double ecR1 = tofPara->
GetEcR1();
609 G4double angleEc=360./nScinEc*deg;
610 G4double ecTrapW3 = ecTrapW1 + (ecTrapW2-ecTrapW1)*ecTrapH1/ecTrapH;
611 G4double ecTrapH2 = ecTrapH-ecTrapH1;
612 G4double pdz = ecL/2;
613 G4double ptheta = atan(ecTrapH1/(2*ecL));
614 G4double pdy1 = ecTrapH2/2;
615 G4double pdx1 = ecTrapW3/2;
616 G4double pdx2 = ecTrapW2/2;
617 G4double pdy2 = ecTrapH/2;
618 G4double pdx3 = ecTrapW1/2;
619 G4double pdx4 = ecTrapW2/2;
623 G4double ecR = ecR1+ecTrapH/2+ecTrapH1/4;
626 G4Trap* solidScinEc=
new G4Trap(
"solidScinEc",pdz,ptheta, 270*deg,
627 pdy1,pdx1,pdx2,0*deg,pdy2,pdx3,pdx4,0*deg);
629 logicalScinEcWest=
new G4LogicalVolume(solidScinEc,BC404,
"logicalScinEcWest");
630 logicalScinEcEast=
new G4LogicalVolume(solidScinEc,BC404,
"logicalScinEcEast");
633 G4Tubs* solidBucketEc =
new G4Tubs(
"solidBucketEc", 0, bucketDEc/2.,
634 bucketLEc/2., 0, 360.*deg);
635 logicalBucketEc =
new G4LogicalVolume(solidBucketEc, PMTmaterial,
"logicalBucketEc");
638 G4double pthetaAl = atan(ecTrapH1/(2*(ecL+AlThickness*2)));
639 G4double
theta1 = atan((ecTrapW2/2.-ecTrapW3/2.)/ecTrapH2);
640 G4double
theta2 = atan((ecTrapW2/2.-ecTrapW1/2.)/ecTrapH);
647 G4double thick = AlThickness+PVFThickness;
648 G4double pthetaPVF = atan(ecTrapH1/(2*(ecL+thick*2)));
654 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);
656 logicalAlEcWest =
new G4LogicalVolume(solidAlEc,G4Material::GetMaterial(
"Aluminium"),
"logicalAlEcWest");
657 logicalAlEcEast =
new G4LogicalVolume(solidAlEc,G4Material::GetMaterial(
"Aluminium"),
"logicalAlEcEast");
659 G4Trap* solidPVFEc =
new G4Trap(
"solidPVFEc",pdz+thick,pthetaPVF,270*deg,
660 pdy1+thick,pdx1+delta1P,pdx2+delta2P,0*deg,
661 pdy2+thick,pdx3+delta3P,pdx4+delta4P,0*deg);
663 logicalPVFEcWest =
new G4LogicalVolume(solidPVFEc,PVF,
"logicalPVFEcWest");
664 logicalPVFEcEast =
new G4LogicalVolume(solidPVFEc,PVF,
"logicalPVFEcEast");
667 physicalAlEcWest =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalAlEcWest,
"physicalAlEcWest",logicalPVFEcWest,
false,0);
668 physicalScinEcWest =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalScinEcWest,
"physicalScinEcWest",logicalAlEcWest,
false, 0);
672 physicalAlEcEast =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalAlEcEast,
"physicalAlEcEast",logicalPVFEcEast,
false,0);
673 physicalScinEcEast =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalScinEcEast,
"physicalScinEcEast",logicalAlEcEast,
false, 0);
679 G4ThreeVector posW(0,0,0);
680 G4ThreeVector posE(0,0,0);
681 G4RotationMatrix trapRot;
682 trapRot.rotateY(180.*deg);
683 trapRot.rotateZ(0.5*angleEc-90*deg);
684 for (
int i=0;i<nScinEc;i++)
686 ostringstream osnamePVFEc;
687 osnamePVFEc <<
"physicalPVFEcWest_"<<i;
688 ostringstream osnameBucketEc;
689 osnameBucketEc <<
"physicalBucketEcWest_"<<i;
691 posW.setX( ecR*
cos((0.5+i)*angleEc) );
692 posW.setY( ecR*
sin((0.5+i)*angleEc) );
699 G4RotationMatrix trapRotTemp;
700 trapRotTemp.rotateX(a);
701 trapRotTemp.rotateY(b);
702 trapRotTemp.rotateZ(c);
703 G4Transform3D transform(trapRotTemp,posW);
705 physicalPVFEcWest =
new G4PVPlacement(transform,logicalPVFEcWest,osnamePVFEc.str(), logicalEcTofWest,
false,i);
706 posW.setX( bucketPosR*
cos((0.5+i)*angleEc) );
707 posW.setY( bucketPosR*
sin((0.5+i)*angleEc) );
709 posW.setZ(-ecL/2-thick-bucketLEc/2-0.01 );
710 physicalBucketEc =
new G4PVPlacement(0,posW,logicalBucketEc,osnameBucketEc.str(),logicalEcTofWest,
false,0);
711 trapRot.rotateZ(angleEc);
719 trapRot.rotateZ(-angleEc);
720 trapRot.rotateX(180.*deg);
721 for (
int i=0;i<nScinEc;i++)
723 ostringstream osnamePVFEc;
724 osnamePVFEc <<
"physicalPVFEcEast_"<<i;
725 ostringstream osnameBucketEc;
726 osnameBucketEc <<
"physicalBucketEcEast_"<<i;
728 posE.setX( ecR*
cos((0.5+i)*angleEc) );
729 posE.setY( ecR*
sin((0.5+i)*angleEc) );
736 G4RotationMatrix trapRotTemp;
737 trapRotTemp.rotateX(a);
738 trapRotTemp.rotateY(b);
739 trapRotTemp.rotateZ(c);
740 G4Transform3D transform(trapRotTemp,posE);
742 physicalPVFEcEast =
new G4PVPlacement(transform,logicalPVFEcEast,osnamePVFEc.str(), logicalEcTofEast,
false,i);
743 posE.setX( bucketPosR*
cos((0.5+i)*angleEc) );
744 posE.setY( bucketPosR*
sin((0.5+i)*angleEc) );
746 posE.setZ(ecL/2+thick+bucketLEc/2+0.01 );
747 physicalBucketEc =
new G4PVPlacement(0,posE,logicalBucketEc,osnameBucketEc.str(),logicalEcTofEast,
false,0);
748 trapRot.rotateZ(angleEc);
763 G4double
smallL = 0.01*mm;
764 G4RotationMatrix
rot_dummy(0*deg,0*deg,0*deg);
772 std::ostringstream name;
778 G4LogicalVolume* logical_container[4];
779 G4LogicalVolume* logical_gasContainer[4];
780 for(
int kk=0; kk<4; kk++)
783 name<<
"logical_container_m"<<kk;
784 logical_container[kk] = partProduce->
lg_container((
int)kk/2, name.str());
787 name<<
"logical_gasContainer_m"<<kk;
793 G4LogicalVolume* logical_containerFrame = partProduce->
lg_containerFrame(
"logical_containerFrame");
794 G4LogicalVolume* logical_upCover = partProduce->
lg_upCover(
"logical_upCover");
795 G4LogicalVolume* logical_lowCover1 = partProduce->
lg_lowCover1(
"logical_lowCover1");
796 G4LogicalVolume* logical_lowCover2 = partProduce->
lg_lowCover2(
"logical_lowCover2");
797 G4LogicalVolume* logical_upFEE = partProduce->
lg_upFEE(
"logical_upFEE");
798 G4LogicalVolume* logical_sideFEE = partProduce->
lg_sideFEE(
"logical_sideFEE");
799 G4LogicalVolume* logical_castingDie = partProduce->
lg_castingDie(
"logical_castingDie");
800 G4LogicalVolume* logical_bareChamber = partProduce->
lg_bareChamber(
"logical_bareChamber");
801 G4LogicalVolume* logical_bracket = partProduce->
lg_bracket(
"logical_bracket");
802 G4LogicalVolume* logical_sideStopBlock = partProduce->
lg_sideStopBlock(
"logical_sideStopBlock");
803 G4LogicalVolume* logical_upStopBlock = partProduce->
lg_upStopBlock(
"logical_upStopBlock");
807 for(
int kk=0; kk<4; kk++)
811 name<<
"physical_containerFrame_m"<<kk;
812 new G4PVPlacement(0, G4ThreeVector(0,0,0), logical_containerFrame, name.str(), logical_container[kk],
false, 0,
checkOverlap);
815 G4ThreeVector translation_upCover(0, (containerOut_y+upCover_y)/2+
smallL, (upCover_z-containerOut_z)/2-upCover_posz);
817 name<<
"physical_upCover_m"<<kk;
818 new G4PVPlacement(0, translation_upCover, logical_upCover, name.str(), logical_container[kk],
false, 0,
checkOverlap);
822 name<<
"physical_lowCover_m"<<kk;
825 G4ThreeVector translation_lowCover(0, -1*(containerOut_y+upCover_y)/2, (lowCover1_z-containerOut_z)/2-lowCover1_posz);
826 new G4PVPlacement(0, translation_lowCover, logical_lowCover1, name.str(), logical_container[kk],
false, 0,
checkOverlap);
830 G4ThreeVector translation_lowCover(0, -1*(containerOut_y+upCover_y)/2, (lowCover2_z-containerOut_z)/2-lowCover2_posz);
831 new G4PVPlacement(0, translation_lowCover, logical_lowCover2, name.str(), logical_container[kk],
false, 0,
checkOverlap);
835 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);
837 name<<
"physical_upFEE_m"<<kk;
838 new G4PVPlacement(0, translation_upFEE, logical_upFEE, name.str(), logical_container[kk],
false, 0,
checkOverlap);
841 double angle_containerFrameSide = atan((containerOut_xup-containerOut_xdown)/2/containerOut_z) *
rad;
842 double l_containerFrameSide = containerOut_z/
cos(angle_containerFrameSide);
843 double x_sideFEE = (l_containerFrameSide/2-sideFEE_posl)*
sin(angle_containerFrameSide)+(containerOut_xup+containerOut_xdown)/4+sideFEE_x/2*
cos(angle_containerFrameSide);
844 double z_sideFEE = (l_containerFrameSide/2-sideFEE_posl)*
cos(angle_containerFrameSide)-sideFEE_x/2*
sin(angle_containerFrameSide);
845 G4ThreeVector translation_sideFEE_left(-x_sideFEE, 0, z_sideFEE);
846 G4RotationMatrix rot_sideFEE_left;
847 rot_sideFEE_left.rotateY(-angle_containerFrameSide);
848 G4Transform3D transform_sideFEE_left(rot_sideFEE_left, translation_sideFEE_left);
850 name<<
"physical_sideFEE_left_m"<<kk;
851 new G4PVPlacement(transform_sideFEE_left, logical_sideFEE, name.str(), logical_container[kk],
false, 0,
checkOverlap);
853 G4ThreeVector translation_sideFEE_right(x_sideFEE, 0, z_sideFEE);
854 G4RotationMatrix rot_sideFEE_right;
855 rot_sideFEE_right.rotateZ(180*deg);
856 rot_sideFEE_right.rotateY(angle_containerFrameSide);
857 G4Transform3D transform_sideFEE_right(rot_sideFEE_right, translation_sideFEE_right);
859 name<<
"physical_sideFEE_right_m"<<kk;
860 new G4PVPlacement(transform_sideFEE_right, logical_sideFEE, name.str(), logical_container[kk],
false, 0,
checkOverlap);
863 G4RotationMatrix rot_castingDie;
864 rot_castingDie.rotateX(-90*deg);
865 G4ThreeVector translation_castingDie_1(0, containerOut_y/2+upCover_y+castingDie_z/2+
smallL, -containerOut_z/2+upCover_posz+castingDie_posz1);
866 G4Transform3D transform_castingDie_1(rot_castingDie, translation_castingDie_1);
868 name<<
"physical_castingDie_1_m"<<kk;
869 new G4PVPlacement(transform_castingDie_1, logical_castingDie, name.str(), logical_container[kk],
false, 0,
checkOverlap);
871 G4ThreeVector translation_castingDie_2(0, containerOut_y/2+upCover_y+castingDie_z/2+
smallL, -containerOut_z/2+upCover_posz+castingDie_posz2);
872 G4Transform3D transform_castingDie_2(rot_castingDie, translation_castingDie_2);
874 name<<
"physical_castingDie_2_m"<<kk;
875 new G4PVPlacement(transform_castingDie_2, logical_castingDie, name.str(), logical_container[kk],
false, 0,
checkOverlap);
878 G4ThreeVector translation_gasContainer(0, 0, (container_lowBorder-container_thickness)/2);
880 name<<
"physical_gasContainer_m"<<kk;
881 new G4PVPlacement(0, translation_gasContainer, logical_gasContainer[kk], name.str(), logical_container[kk],
false, 0,
checkOverlap);
887 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;
889 double z_chamber = (containerIn_z-pcbBoard_z)/2-
smallL;
890 for(
int kk=0; kk<4; kk++)
892 if(kk<2) y_chamber = -(containerIn_y-l_chamber)/2+chamber_in_posy;
893 else y_chamber = -(containerIn_y-l_chamber)/2+chamber_out_posy;
894 G4Transform3D transform_bareChamber;
897 transform_bareChamber = G4Transform3D(
rot_dummy, G4ThreeVector(0,y_chamber,z_chamber));
901 G4RotationMatrix rot_bareChamber;
902 rot_bareChamber.rotateZ(180*deg);
903 transform_bareChamber = G4Transform3D(rot_bareChamber, G4ThreeVector(0,y_chamber,z_chamber));
905 new G4PVPlacement(transform_bareChamber, logical_bareChamber,
"physical_bareChamber", logical_gasContainer[kk],
false, 0,
checkOverlap);
908 G4double z_bracket = -(containerIn_z-bracket_z)/2+
smallL;
909 new G4PVPlacement(0, G4ThreeVector(-bracket_posx, 0, z_bracket), logical_bracket,
"physical_bracket_0", logical_gasContainer[kk],
false, 0,
checkOverlap);
910 new G4PVPlacement(0, G4ThreeVector(bracket_posx, 0, z_bracket), logical_bracket,
"physical_bracket_1", logical_gasContainer[kk],
false, 0,
checkOverlap);
913 G4Transform3D transform_sideStopBlock;
914 G4double angle_gasContainerSide = (atan((containerIn_xup-containerIn_xdown)/2/(containerIn_z))) *
rad;
915 G4double x_sideStopBlock = (containerIn_xup+containerIn_xdown)/4+sideStopBlock_posz0*
tan(angle_gasContainerSide)-sideStopBlock_x/2*
cos(angle_gasContainerSide);
916 G4double z_sideStopBlock = sideStopBlock_posz0+sideStopBlock_x/2*
sin(angle_gasContainerSide);
918 G4RotationMatrix rot_sideStopBlock;
919 rot_sideStopBlock.rotateY(angle_gasContainerSide);
920 rot_sideStopBlock.rotateZ(180*deg);
921 transform_sideStopBlock = G4Transform3D(rot_sideStopBlock, G4ThreeVector(-x_sideStopBlock, 0, z_sideStopBlock));
922 new G4PVPlacement(transform_sideStopBlock, logical_sideStopBlock,
"physical_sideStopBlock_0", logical_gasContainer[kk],
false, 0,
checkOverlap);
924 rot_sideStopBlock = G4RotationMatrix(0,0,0);
925 rot_sideStopBlock.rotateY(angle_gasContainerSide);
926 transform_sideStopBlock = G4Transform3D(rot_sideStopBlock, G4ThreeVector(x_sideStopBlock, 0, z_sideStopBlock));
927 new G4PVPlacement(transform_sideStopBlock, logical_sideStopBlock,
"physical_sideStopBlock_1", logical_gasContainer[kk],
false, 0,
checkOverlap);
929 x_sideStopBlock = (containerIn_xup+containerIn_xdown)/4+sideStopBlock_posz1*
tan(angle_gasContainerSide)-sideStopBlock_x/2*
cos(angle_gasContainerSide);
930 z_sideStopBlock = sideStopBlock_posz1+sideStopBlock_x/2*
sin(angle_gasContainerSide);
931 rot_sideStopBlock = G4RotationMatrix(0,0,0);
932 rot_sideStopBlock.rotateY(angle_gasContainerSide);
933 rot_sideStopBlock.rotateZ(180*deg);
934 transform_sideStopBlock = G4Transform3D(rot_sideStopBlock, G4ThreeVector(-x_sideStopBlock, 0, z_sideStopBlock));
935 new G4PVPlacement(transform_sideStopBlock, logical_sideStopBlock,
"physical_sideStopBlock_2", logical_gasContainer[kk],
false, 0,
checkOverlap);
937 rot_sideStopBlock = G4RotationMatrix(0,0,0);
938 rot_sideStopBlock.rotateY(angle_gasContainerSide);
939 transform_sideStopBlock = G4Transform3D(rot_sideStopBlock, G4ThreeVector(x_sideStopBlock, 0, z_sideStopBlock));
940 new G4PVPlacement(transform_sideStopBlock, logical_sideStopBlock,
"physical_sideStopBlock_3", logical_gasContainer[kk],
false, 0,
checkOverlap);
945 G4double x_upStopBlock = containerIn_xup/4;
946 G4double y_upStopBlock = pcbBoard_y1/2.+mylar_y+glass0_y+glass1_y*2.5+gasLayer_y*3;
947 G4double z_upStopBlock = (pcbBoard_z-upStopBlock_z)/2-
smallL;
948 new G4PVPlacement(0, G4ThreeVector(-x_upStopBlock, -y_upStopBlock, z_upStopBlock ), logical_upStopBlock,
"physical_upStopBlock_0", logical_bareChamber,
false,0,
checkOverlap);
949 new G4PVPlacement(0, G4ThreeVector(-x_upStopBlock, y_upStopBlock, z_upStopBlock ), logical_upStopBlock,
"physical_upStopBlock_1", logical_bareChamber,
false,0,
checkOverlap);
950 new G4PVPlacement(0, G4ThreeVector(x_upStopBlock, -y_upStopBlock, z_upStopBlock ), logical_upStopBlock,
"physical_upStopBlock_2", logical_bareChamber,
false,0,
checkOverlap);
951 new G4PVPlacement(0, G4ThreeVector(x_upStopBlock, y_upStopBlock, z_upStopBlock ), logical_upStopBlock,
"physical_upStopBlock_3", logical_bareChamber,
false,0,
checkOverlap);
955 G4LogicalVolume* logical_honeyComb = partProduce->
lg_honeyComb(
"logical_honeyComb");
956 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;
957 G4double z_honeyComb = (pcbBoard_z-honeyComb_z)/2-honeyComb_posz;
958 new G4PVPlacement(0,G4ThreeVector(0,y_honeyComb,z_honeyComb), logical_honeyComb,
"physical_honeyComb_0",logical_bareChamber,
false,0,
checkOverlap);
959 new G4PVPlacement(0,G4ThreeVector(0,-1*y_honeyComb,z_honeyComb), logical_honeyComb,
"physical_honeyComb_1",logical_bareChamber,
false,1,
checkOverlap);
962 G4LogicalVolume* logical_tape_mrpc = partProduce->
lg_tape_mrpc(
"logical_tape_mrpc");
963 G4double y_tape_mrpc = (tape_mrpc_y+pcbBoard_y1)/2+pcbBoard_y0+mylar_y*2+glass0_y*2+glass1_y*5+gasLayer_y*6;
964 G4double z_tape_mrpc = (pcbBoard_z-tape_mrpc_z)/2-tape_mrpc_posz;
965 new G4PVPlacement(0,G4ThreeVector(0,y_tape_mrpc,z_tape_mrpc), logical_tape_mrpc,
"physical_tape_mrpc_0",logical_bareChamber,
false,0,
checkOverlap);
966 new G4PVPlacement(0,G4ThreeVector(0,-1*y_tape_mrpc,z_tape_mrpc), logical_tape_mrpc,
"physical_tape_mrpc_1",logical_bareChamber,
false,1,
checkOverlap);
969 G4LogicalVolume* logical_pcbBoard0 = partProduce->
lg_pcbBoard(0,
"logical_pcbBoard0");
970 G4double y_pcbBoard = (pcbBoard_y0+pcbBoard_y1)/2+mylar_y*2+glass0_y*2+glass1_y*5+gasLayer_y*6;
971 new G4PVPlacement(0,G4ThreeVector(0,y_pcbBoard,0),logical_pcbBoard0,
"physical_pcbBoard0_0",logical_bareChamber,
false,0,
checkOverlap);
974 G4RotationMatrix* rot_pcbBoard =
new G4RotationMatrix();
975 rot_pcbBoard->rotateZ(180*degree);
976 new G4PVPlacement(rot_pcbBoard,G4ThreeVector(0,-1*y_pcbBoard,0),logical_pcbBoard0,
"physical_pcbBoard0_1",logical_bareChamber,
false,1,
checkOverlap);
978 G4LogicalVolume* logical_pcbBoard1 = partProduce->
lg_pcbBoard(1,
"logical_pcbBoard1");
979 new G4PVPlacement(0,G4ThreeVector(0,0,0),logical_pcbBoard1,
"physical_pcbBoard1",logical_bareChamber,
false,0,
checkOverlap);
982 G4AssemblyVolume* logical_strip = partProduce->
lg_strip(
"logical_strip");
983 G4double z_strip = (pcbBoard_z-12*strip_z-11*strip_gap)/2-strip_posz;
984 G4Transform3D transform_strip(
rot_dummy, G4ThreeVector(0, pcbBoard_y0/2.-strip_y/2-
smallL, z_strip));
985 logical_strip->MakeImprint(logical_pcbBoard0, transform_strip);
986 transform_strip = G4Transform3D(
rot_dummy, G4ThreeVector(0,0,z_strip));
987 logical_strip->MakeImprint(logical_pcbBoard1, transform_strip);
990 G4LogicalVolume* logical_mylar = partProduce->
lg_mylar(
"logical_mylar");
991 G4double y_mylar = (mylar_y+pcbBoard_y1)/2+mylar_y+glass0_y*2+glass1_y*5+gasLayer_y*6;
992 G4double z_mylar = (pcbBoard_z-mylar_z)/2-mylar_posz;
993 new G4PVPlacement(0,G4ThreeVector(0,y_mylar,z_mylar),logical_mylar,
"physical_mylar_0",logical_bareChamber,
false,0,
checkOverlap);
994 new G4PVPlacement(0,G4ThreeVector(0,-y_mylar,z_mylar),logical_mylar,
"physical_mylar_3",logical_bareChamber,
false,3,
checkOverlap);
996 y_mylar = (mylar_y+pcbBoard_y1)/2;
997 new G4PVPlacement(0,G4ThreeVector(0,y_mylar,z_mylar),logical_mylar,
"physical_mylar_1",logical_bareChamber,
false,1,
checkOverlap);
998 new G4PVPlacement(0,G4ThreeVector(0,-y_mylar,z_mylar),logical_mylar,
"physical_mylar_2",logical_bareChamber,
false,2,
checkOverlap);
1001 G4LogicalVolume* logical_glass0 = partProduce->
lg_glass(0,
"logical_glass0");
1002 G4double y_glass = (glass0_y+pcbBoard_y1)/2.+mylar_y+glass0_y+glass1_y*5+gasLayer_y*6;
1003 G4double z_glass = (pcbBoard_z-glass0_z)/2.-glass0_posz;
1004 new G4PVPlacement(0, G4ThreeVector(0, y_glass, z_glass), logical_glass0,
"physical_glass0_0", logical_bareChamber,
false, 0,
checkOverlap);
1005 new G4PVPlacement(0, G4ThreeVector(0, -y_glass, z_glass), logical_glass0,
"physical_glass0_3", logical_bareChamber,
false, 3,
checkOverlap);
1006 y_glass = pcbBoard_y1/2.+mylar_y+glass0_y/2.;
1007 new G4PVPlacement(0, G4ThreeVector(0, y_glass, z_glass), logical_glass0,
"physical_glass0_1", logical_bareChamber,
false, 1,
checkOverlap);
1008 new G4PVPlacement(0, G4ThreeVector(0, -y_glass, z_glass), logical_glass0,
"physical_glass0_2", logical_bareChamber,
false, 2,
checkOverlap);
1010 G4LogicalVolume* logical_glass1 = partProduce->
lg_glass(1,
"logical_glass1");
1011 z_glass = (pcbBoard_z-glass1_z)/2.-glass1_posz;
1012 for(G4int i=0; i<5; i++)
1014 y_glass = pcbBoard_y1/2.+mylar_y+glass0_y+glass1_y*(4.5-i)+gasLayer_y*(5-i);
1016 name<<
"physical_glass1_"<<i;
1017 new G4PVPlacement(0, G4ThreeVector(0, y_glass, z_glass), logical_glass1, name.str(), logical_bareChamber,
false, i,
checkOverlap);
1019 name<<
"physical_glass1_"<<9-i;
1020 new G4PVPlacement(0, G4ThreeVector(0, -y_glass, z_glass), logical_glass1, name.str(), logical_bareChamber,
false, 9-i,
checkOverlap);
1024 logical_gasLayer = partProduce->
lg_gasLayer(
"logical_gasLayer");
1025 G4double y_gasLayer;
1026 G4double z_gasLayer = (pcbBoard_z-gasLayer_z)/2.-gasLayer_posz;
1027 G4VPhysicalVolume* physical_gasLayer[12];
1028 for(G4int i=0; i<6; i++)
1030 y_gasLayer = pcbBoard_y1/2.+mylar_y+glass0_y+glass1_y*(5-i)+gasLayer_y*(5.5-i);
1032 name<<
"physical_gasLayer_"<<11-i;
1033 physical_gasLayer[i] =
new G4PVPlacement(0, G4ThreeVector(0, -y_gasLayer, z_gasLayer), logical_gasLayer, name.str(), logical_bareChamber,
false, 11-i,
checkOverlap);
1035 for(G4int i=6; i<12; i++)
1037 y_gasLayer = pcbBoard_y1/2.+mylar_y+glass0_y+glass1_y*(i-6)+gasLayer_y*(-5.5+i);
1039 name<<
"physical_gasLayer_"<<11-i;
1040 physical_gasLayer[i] =
new G4PVPlacement(0, G4ThreeVector(0, y_gasLayer, z_gasLayer), logical_gasLayer, name.str(), logical_bareChamber,
false, 11-i,
checkOverlap);
1054 const G4int n_module = 36;
1055 G4double angle = 360.0*deg/n_module;
1056 G4double z_layerIn = endcap_length/2-containerOut_y/2-lowCover1_y-layer_posz;
1057 G4double z_layerOut = endcap_length/2-containerOut_y/2-lowCover2_y-layer_posz;
1062 rOffset_east = tofPara->
GetVec(
"rOffset_east");
1063 angle_east = tofPara->
GetVec(
"angle_east");
1064 angleOffset_east = tofPara->
GetVec(
"angleOffset_east");
1065 rOffset_west = tofPara->
GetVec(
"rOffset_west");
1066 angle_west = tofPara->
GetVec(
"angle_west");
1067 angleOffset_west = tofPara->
GetVec(
"angleOffset_west");
1071 for(
int i=0; i<n_module; i++)
1073 G4double angle_module = startAngle_east+angle_east[i]+i*angle;
1074 G4double r_module = endcap_r+rOffset_east[i];
1076 G4RotationMatrix rot_layerIn_east;
1077 rot_layerIn_east.rotateX(90.*deg);
1078 rot_layerIn_east.rotateZ(90.*deg);
1079 rot_layerIn_east.rotateZ(angle_module+angleOffset_east[i]);
1081 G4ThreeVector translation_layerIn_east = G4ThreeVector(r_module*
cos(angle_module), r_module*
sin(angle_module), -z_layerIn);
1082 G4Transform3D transform_layerIn_east = G4Transform3D(rot_layerIn_east, translation_layerIn_east);
1085 G4RotationMatrix rot_layerOut_east;
1086 rot_layerOut_east.rotateZ(180.*deg);
1087 rot_layerOut_east.rotateX(90.*deg);
1088 rot_layerOut_east.rotateZ(90.*deg);
1089 rot_layerOut_east.rotateZ(angle_module+angleOffset_east[i]);
1091 G4ThreeVector translation_layerOut_east = G4ThreeVector(r_module*
cos(angle_module), r_module*
sin(angle_module), z_layerOut);
1092 G4Transform3D transform_layerOut_east = G4Transform3D(rot_layerOut_east, translation_layerOut_east);
1095 name<<
"physical_mrpc_east_"<<i;
1098 new G4PVPlacement(transform_layerOut_east, logical_container[3], name.str(), logicalEcTofEast,
false, i,
checkOverlap);
1102 new G4PVPlacement(transform_layerIn_east, logical_container[0], name.str(), logicalEcTofEast,
false, i,
checkOverlap);
1107 for(
int i=0; i<n_module; i++)
1109 G4double angle_module = startAngle_west+angle_west[i]+i*angle;
1110 G4double r_module = endcap_r+rOffset_west[i];
1112 G4RotationMatrix rot_layerIn_west;
1113 rot_layerIn_west.rotateZ(180.*deg);
1114 rot_layerIn_west.rotateX(90.*deg);
1115 rot_layerIn_west.rotateZ(90.*deg);
1116 rot_layerIn_west.rotateZ(angle_module+angleOffset_west[i]);
1118 G4ThreeVector translation_layerIn_west = G4ThreeVector(r_module*
cos(angle_module), r_module*
sin(angle_module), z_layerIn);
1119 G4Transform3D transform_layerIn_west = G4Transform3D(rot_layerIn_west, translation_layerIn_west);
1122 G4RotationMatrix rot_layerOut_west;
1123 rot_layerOut_west.rotateX(90.*deg);
1124 rot_layerOut_west.rotateZ(90.*deg);
1125 rot_layerOut_west.rotateZ(angle_module+angleOffset_west[i]);
1127 G4ThreeVector translation_layerOut_west = G4ThreeVector(r_module*
cos(angle_module), r_module*
sin(angle_module), -z_layerOut);
1128 G4Transform3D transform_layerOut_west = G4Transform3D(rot_layerOut_west, translation_layerOut_west);
1131 name<<
"physical_mrpc_west_"<<i;
1134 new G4PVPlacement(transform_layerOut_west, logical_container[2], name.str(), logicalEcTofWest,
false, i,
checkOverlap);
1138 new G4PVPlacement(transform_layerIn_west, logical_container[1], name.str(), logicalEcTofWest,
false, i,
checkOverlap);
1147 G4double a,z,density,fraction;
1148 G4int nel, natoms, ncomponents;
1149 G4String name, symbol;
1152 G4Element*
H=G4Element::GetElement(
"Hydrogen");
1154 H =
new G4Element(name=
"Hydrogen",symbol=
"H" , z= 1., a=1.01*g/mole);
1156 G4Element*
C=G4Element::GetElement(
"Carbon");
1158 C =
new G4Element(name=
"Carbon" ,symbol=
"C" , z= 6., a=12.01*g/mole);
1160 G4Element* F=G4Element::GetElement(
"Fluorin");
1162 F =
new G4Element(name=
"Fluorin", symbol=
"F", z=9., a=18.01*g/mole);
1164 G4Element* O=G4Element::GetElement(
"Oxygen");
1166 O =
new G4Element(name=
"Oxygen",symbol=
"O",z= 8., a= 16.00*g/mole);
1168 G4Element* N=G4Element::GetElement(
"Nitrogen");
1170 N =
new G4Element(name=
"Nitrogen",symbol=
"N",z= 7., a= 14.01*g/mole);
1172 G4Element* S=G4Element::GetElement(
"Sulfur");
1174 S =
new G4Element(name=
"Sulfur",symbol=
"S",z= 16., a= 32.06*g/mole);
1177 BC404 =
new G4Material(
"BC404",density=1.032*g/cm3,nel=2);
1178 BC404->AddElement(
C,10);
1179 BC404->AddElement(
H,11);
1181 BC408 =
new G4Material(
"BC408",density=1.032*g/cm3,nel=2);
1182 BC408->AddElement(
C,1000);
1183 BC408->AddElement(
H,1104);
1185 PVF =
new G4Material(
"PVF",density=1.45*g/cm3,nel=3);
1186 PVF->AddElement(
C,2);
1187 PVF->AddElement(
H,3);
1188 PVF->AddElement(F,1);
1191 G4Material* Cu = G4Material::GetMaterial(
"Copper");
1192 G4Material* Al = G4Material::GetMaterial(
"Aluminium");
1198 density = 1.4618815*g/cm3;
1199 PMTmaterial =
new G4Material(name=
"PMTmaterial", density, 4);
1200 PMTmaterial->AddMaterial(Al, 0.4495);
1201 PMTmaterial->AddMaterial(Cu,0.35);
1202 PMTmaterial->AddMaterial(G4Material::GetMaterial(
"SiO2"),0.2);
1203 PMTmaterial->AddMaterial(G4Material::GetMaterial(
"Air"),0.0005);
1205 G4cout<<PMTmaterial;
1207 density = 1.002*g/cm3;
1208 G4Material* tape =
new G4Material(name=
"tape",density,nel=2);
1209 tape->AddElement(
C,2);
1210 tape->AddElement(
H,5);
1215 G4Material* Nylon =
new G4Material(
"Nylon", density=1.15*g/cm3, ncomponents=4);
1216 Nylon->AddElement(
C, natoms=2);
1217 Nylon->AddElement(
H, natoms=3);
1218 Nylon->AddElement(O, natoms=1);
1219 Nylon->AddElement(N, natoms=1);
1220 G4cout<<Nylon<<G4endl;
1223 G4Material* honeycombCore =
new G4Material(
"honeycombCore", density=0.024*g/cm3, ncomponents=3);
1224 honeycombCore->AddElement(
C,natoms=6);
1225 honeycombCore->AddElement(
H,natoms=10);
1226 honeycombCore->AddElement(O,natoms=5);
1227 G4cout<<honeycombCore<<G4endl;
1230 G4Material* epoxy =
new G4Material(
"epoxy", density=1.2*g/cm3, ncomponents=3);
1231 epoxy->AddElement(
C,natoms=11);
1232 epoxy->AddElement(
H,natoms=12);
1233 epoxy->AddElement(O,natoms=3);
1234 G4cout<<epoxy<<G4endl;
1236 G4Material* insulationBoard =
new G4Material(
"insulationBoard", density=1.85*g/cm3, 2);
1237 insulationBoard->AddMaterial(G4Material::GetMaterial(
"SiO2"), 0.6);
1238 insulationBoard->AddMaterial(epoxy, 0.4);
1239 G4cout<<insulationBoard<<G4endl;
1242 G4Material* PET =
new G4Material(
"PET", density= 1.39*g/cm3, ncomponents=3);
1243 PET->AddElement(
C,natoms=10);
1244 PET->AddElement(
H,natoms=8);
1245 PET->AddElement(O,natoms=4);
1246 G4cout<<PET<<G4endl;
1249 G4Material* FreonR134A =
new G4Material(
"FreonR134A", density =4.241*mg/cm3,ncomponents=3);
1250 FreonR134A->AddElement(
C,natoms=2);
1251 FreonR134A->AddElement(
H,natoms=2);
1252 FreonR134A->AddElement(F,natoms=4);
1253 G4cout<<FreonR134A<<G4endl;
1255 G4Material* SF6 =
new G4Material(
"SF6", density =6.14*mg/cm3,ncomponents=2);
1256 SF6->AddElement(S,natoms=1);
1257 SF6->AddElement(F,natoms=6);
1258 G4cout<<SF6<<G4endl;
1260 G4Material* Isobutan =
new G4Material(
"Isobutan", density =2.487*mg/cm3,ncomponents=2);
1261 Isobutan->AddElement(
C, natoms=4);
1262 Isobutan->AddElement(
H, natoms=10);
1263 G4cout<<Isobutan<<G4endl;
1265 G4Material* MRPCGas =
new G4Material(name=
"MRPCGas", density=4.17*mg/cm3,ncomponents=3);
1266 MRPCGas->AddMaterial(FreonR134A, fraction= 89.69*perCent);
1267 MRPCGas->AddMaterial(SF6, fraction=7.34*perCent);
1268 MRPCGas->AddMaterial(Isobutan, fraction=2.97*perCent);
1271 if(0.0 == MRPCGas->GetIonisation()->GetMeanEnergyPerIonPair())
1274 MRPCGas->GetIonisation()->SetMeanEnergyPerIonPair(m_ionE*eV);
1276 G4cout<<MRPCGas<<G4endl;
1281 double cosb = sqrt( r.xx()*r.xx() + r.yx()*r.yx() );
1283 if (cosb > 16*FLT_EPSILON)
1285 a = atan2( r.zy(), r.zz() );
1286 b = atan2( -r.zx(), cosb );
1287 c = atan2( r.yx(), r.xx() );
1291 a = atan2( -r.yz(), r.yy() );
1292 b = atan2( -r.zx(), cosb );
1302 G4RotationMatrix temp;
1303 temp.rotateZ((c/deg)*deg);
1311void BesTofConstruction::IniParam_mrpc()
1316 containerOut_xdown = tofPara->
Get(
"containerOut_xdown");
1317 containerOut_xup = tofPara->
Get(
"containerOut_xup");
1318 containerOut_y = tofPara->
Get(
"containerOut_y");
1319 containerOut_z = tofPara->
Get(
"containerOut_z");
1320 container_thickness = tofPara->
Get(
"container_thickness");
1321 container_lowBorder = tofPara->
Get(
"container_lowBorder");
1323 containerIn_xdown = tofPara->
Get(
"containerIn_xdown");
1324 containerIn_xup = tofPara->
Get(
"containerIn_xup");
1325 containerIn_y = tofPara->
Get(
"containerIn_y");
1326 containerIn_z = tofPara->
Get(
"containerIn_z");
1328 upCover_xdown = tofPara->
Get(
"upCover_xdown");
1329 upCover_xup = tofPara->
Get(
"upCover_xup");
1330 upCover_y = tofPara->
Get(
"upCover_y");
1331 upCover_z = tofPara->
Get(
"upCover_z");
1332 upCover_posz = tofPara->
Get(
"upCover_posz");
1334 lowCover1_xdown = tofPara->
Get(
"lowCover1_xdown");
1335 lowCover1_xup = tofPara->
Get(
"lowCover1_xup");
1336 lowCover1_y = tofPara->
Get(
"lowCover1_y");
1337 lowCover1_z = tofPara->
Get(
"lowCover1_z");
1338 lowCover1_addx = tofPara->
Get(
"lowCover1_addx");
1339 lowCover1_addz = tofPara->
Get(
"lowCover1_addz");
1340 lowCover1_posz = tofPara->
Get(
"lowCover1_posz");
1342 lowCover2_xdown = tofPara->
Get(
"lowCover2_xdown");
1343 lowCover2_xup = tofPara->
Get(
"lowCover2_xup");
1344 lowCover2_y = tofPara->
Get(
"lowCover2_y");
1345 lowCover2_z = tofPara->
Get(
"lowCover2_z");
1346 lowCover2_posz = tofPara->
Get(
"lowCover2_posz");
1348 upFEE_xdown = tofPara->
Get(
"upFEE_xdown");
1349 upFEE_xup = tofPara->
Get(
"upFEE_xup");
1350 upFEE_y = tofPara->
Get(
"upFEE_y");
1351 upFEE_z = tofPara->
Get(
"upFEE_z");
1352 FEE_thickness = tofPara->
Get(
"FEE_thickness");
1353 upFEE_posz = tofPara->
Get(
"upFEE_posz");
1355 upFEE_pcb_xdown = tofPara->
Get(
"upFEE_pcb_xdown");
1356 upFEE_pcb_xup = tofPara->
Get(
"upFEE_pcb_xup");
1357 upFEE_pcb_y = tofPara->
Get(
"upFEE_pcb_y");
1358 upFEE_pcb_z = tofPara->
Get(
"upFEE_pcb_z");
1360 sideFEE_x = tofPara->
Get(
"sideFEE_x");
1361 sideFEE_y = tofPara->
Get(
"sideFEE_y");
1362 sideFEE_z = tofPara->
Get(
"sideFEE_z");
1363 sideFEE_posl = tofPara->
Get(
"sideFEE_posl");
1365 sideFEE_pcb_x = tofPara->
Get(
"sideFEE_pcb_x");
1366 sideFEE_pcb_y = tofPara->
Get(
"sideFEE_pcb_y");
1367 sideFEE_pcb_z = tofPara->
Get(
"sideFEE_pcb_z");
1369 castingDie_x = tofPara->
Get(
"castingDie_x");
1370 castingDie_y = tofPara->
Get(
"castingDie_y");
1371 castingDie_z = tofPara->
Get(
"castingDie_z");
1372 castingDie_addr = tofPara->
Get(
"castingDie_addr");
1373 castingDie_subtractx = tofPara->
Get(
"castingDie_subtractx");
1374 castingDie_subtract_posz = tofPara->
Get(
"castingDie_subtract_posz");
1375 castingDie_posz1 = tofPara->
Get(
"castingDie_posz1");
1376 castingDie_posz2 = tofPara->
Get(
"castingDie_posz2");
1378 chamber_in_posy = tofPara->
Get(
"chamber_in_posy");
1379 chamber_out_posy = tofPara->
Get(
"chamber_out_posy");
1381 bracket_x = tofPara->
Get(
"bracket_x");
1382 bracket_y = tofPara->
Get(
"bracket_y");
1383 bracket_z = tofPara->
Get(
"bracket_z");
1384 bracket_r = tofPara->
Get(
"bracket_r");
1385 bracket_posx = tofPara->
Get(
"bracket_posx");
1387 upStopBlock_x = tofPara->
Get(
"upStopBlock_x");
1388 upStopBlock_y = tofPara->
Get(
"upStopBlock_y");
1389 upStopBlock_z = tofPara->
Get(
"upStopBlock_z");
1390 upStopBlock_subtractr = tofPara->
Get(
"upStopBlock_subtractr");
1391 upStopBlock_subtractposz = tofPara->
Get(
"upStopBlock_subtractposz");
1393 sideStopBlock_x = tofPara->
Get(
"sideStopBlock_x");
1394 sideStopBlock_y = tofPara->
Get(
"sideStopBlock_y");
1395 sideStopBlock_z = tofPara->
Get(
"sideStopBlock_z");
1396 sideStopBlock_thickness = tofPara->
Get(
"sideStopBlock_thickness");
1397 sideStopBlock_posz0 = tofPara->
Get(
"sideStopBlock_posz0");
1398 sideStopBlock_posz1 = tofPara->
Get(
"sideStopBlock_posz1");
1401 honeyComb_xdown = tofPara->
Get(
"honeyComb_xdown");
1402 honeyComb_xup = tofPara->
Get(
"honeyComb_xup");
1403 honeyComb_y = tofPara->
Get(
"honeyComb_y");
1404 honeyComb_z = tofPara->
Get(
"honeyComb_z");
1405 honeyComb_surface_y = tofPara->
Get(
"honeyComb_surface_y");
1406 honeyComb_posz = tofPara->
Get(
"honeyComb_posz");
1408 tape_mrpc_xdown = tofPara->
Get(
"tape_mrpc_xdown");
1409 tape_mrpc_xup = tofPara->
Get(
"tape_mrpc_xup");
1410 tape_mrpc_y = tofPara->
Get(
"tape_mrpc_y");
1411 tape_mrpc_z = tofPara->
Get(
"tape_mrpc_z");
1412 tape_mrpc_posz = tofPara->
Get(
"tape_mrpc_posz");
1414 pcbBoard_xdown = tofPara->
Get(
"pcbBoard_xdown");
1415 pcbBoard_xup = tofPara->
Get(
"pcbBoard_xup");
1416 pcbBoard_y0 = tofPara->
Get(
"pcbBoard_y0");
1417 pcbBoard_y1 = tofPara->
Get(
"pcbBoard_y1");
1418 pcbBoard_z = tofPara->
Get(
"pcbBoard_z");
1420 strip_x[0] = tofPara->
Get(
"strip_x[0]");
1421 strip_x[1] = tofPara->
Get(
"strip_x[1]");
1422 strip_x[2] = tofPara->
Get(
"strip_x[2]");
1423 strip_x[3] = tofPara->
Get(
"strip_x[3]");
1424 strip_x[4] = tofPara->
Get(
"strip_x[4]");
1425 strip_x[5] = tofPara->
Get(
"strip_x[5]");
1426 strip_x[6] = tofPara->
Get(
"strip_x[6]");
1427 strip_x[7] = tofPara->
Get(
"strip_x[7]");
1428 strip_x[8] = tofPara->
Get(
"strip_x[8]");
1429 strip_x[9] = tofPara->
Get(
"strip_x[9]");
1430 strip_x[10] = tofPara->
Get(
"strip_x[10]");
1431 strip_x[11] = tofPara->
Get(
"strip_x[11]");
1432 strip_y = tofPara->
Get(
"strip_y");
1433 strip_z = tofPara->
Get(
"strip_z");
1434 strip_gap = tofPara->
Get(
"strip_gap");
1435 strip_posz = tofPara->
Get(
"strip_posz");
1437 mylar_xdown = tofPara->
Get(
"mylar_xdown");
1438 mylar_xup = tofPara->
Get(
"mylar_xup");
1439 mylar_y = tofPara->
Get(
"mylar_y");
1440 mylar_z = tofPara->
Get(
"mylar_z");
1441 mylar_posz = tofPara->
Get(
"mylar_posz");
1443 glass0_xdown = tofPara->
Get(
"glass0_xdown");
1444 glass0_xup = tofPara->
Get(
"glass0_xup");
1445 glass0_y = tofPara->
Get(
"glass0_y");
1446 glass0_z = tofPara->
Get(
"glass0_z");
1447 glass0_posz = tofPara->
Get(
"glass0_posz");
1449 glass1_xdown = tofPara->
Get(
"glass1_xdown");
1450 glass1_xup = tofPara->
Get(
"glass1_xup");
1451 glass1_y = tofPara->
Get(
"glass1_y");
1452 glass1_z = tofPara->
Get(
"glass1_z");
1453 glass1_posz = tofPara->
Get(
"glass1_posz");
1455 gasLayer_xdown = tofPara->
Get(
"gasLayer_xdown");
1456 gasLayer_xup = tofPara->
Get(
"gasLayer_xup");
1457 gasLayer_y = tofPara->
Get(
"gasLayer_y");
1458 gasLayer_z = tofPara->
Get(
"gasLayer_z");
1459 gasLayer_posz = tofPara->
Get(
"gasLayer_posz");
1461 endcap_r = tofPara->
Get(
"endcap_r");
1462 endcap_length = tofPara->
Get(
"endcap_length");
1463 layer_posz = tofPara->
Get(
"layer_posz");
1464 startAngle_east = tofPara->
Get(
"startAngle_east");
1465 startAngle_west = tofPara->
Get(
"startAngle_west");
double tan(const BesAngle a)
double sin(const BesAngle a)
double cos(const BesAngle a)
G4RotationMatrix rot_dummy(0 *deg, 0 *deg, 0 *deg)
***************************************************************************************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
G4LogicalVolume * FindLogicalVolume(const G4String &vn)
void ConstructEcTof_mrpc()
void getXYZ(const G4RotationMatrix r, double &a, double &b, double &c) const
void Construct(G4LogicalVolume *logicalBes)
virtual ~BesTofConstruction()
G4double GetPVFThickness()
double Get(std::string key)
static BesTofGeoParameter * GetInstance()
VEC GetVec(std::string key)
G4double GetAlThickness()
G4LogicalVolume * lg_sideFEE(string name="")
G4LogicalVolume * lg_mylar(string name="")
G4LogicalVolume * lg_lowCover1(string name="")
G4LogicalVolume * lg_glass(G4int flag, string name="")
G4LogicalVolume * lg_container(int flag, string name="")
G4LogicalVolume * lg_gasContainer(string name="")
G4LogicalVolume * lg_sideStopBlock(string name="")
G4AssemblyVolume * lg_strip(string name="")
G4LogicalVolume * lg_honeyComb(string name="")
G4LogicalVolume * lg_containerFrame(string name="")
G4LogicalVolume * lg_lowCover2(string name="")
G4LogicalVolume * lg_pcbBoard(G4int flag, string name="")
G4LogicalVolume * lg_bracket(string name="")
G4LogicalVolume * lg_bareChamber(string name="")
G4LogicalVolume * lg_upStopBlock(string name="")
G4LogicalVolume * lg_tape_mrpc(string name="")
G4LogicalVolume * lg_gasLayer(string name="")
G4LogicalVolume * lg_castingDie(string name="")
G4LogicalVolume * lg_upFEE(string name="")
G4LogicalVolume * lg_upCover(string name="")
G4LogicalVolume * GetTopVolume()
Get the top(world) volume;.