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 = 20);
57 IJobOptionsSvc* jobSvc1;
58 Gaudi::svcLocator()->service(
"JobOptionsSvc", jobSvc1);
59 jobSvc1->setMyProperties(
"BesTofConstruction", &m_propMgr1);
61 cout<<
"BesTofConstruction Property:"<<endl
62 <<
" UserLimits= "<<m_userLimits
91 physicalBucket1Br1 = 0;
92 physicalBucket2Br1 = 0;
93 physicalBucket1Br2 = 0;
94 physicalBucket2Br2 = 0;
96 logicalScinEcWest = 0;
97 logicalScinEcEast = 0;
98 physicalScinEcWest = 0;
99 physicalScinEcEast = 0;
103 physicalAlEcWest = 0;
104 physicalAlEcEast = 0;
106 logicalPVFEcWest = 0;
107 logicalPVFEcEast = 0;
108 physicalPVFEcWest = 0;
109 physicalPVFEcEast = 0;
112 physicalBucketEc = 0;
135 G4cout<<
"BesTofConstruction::Construct(), logicalTof not found"<<G4endl;
139 physicalTof =
new G4PVPlacement(0,G4ThreeVector(0,0,0),
140 logicalTof,
"physicalTof",logicalBes,
false,0);
175 G4cout<<
"Tof Volume: "<<r1<<
" "<<r2<<
" "<<r3<<
" "<<r4<<
" "<<a1<<
" "<<a2<<
" "<<a3<<G4endl;
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) );
182 G4SubtractionSolid* solidTof =
new G4SubtractionSolid(
"solidTof",tub4,tub3,0, G4ThreeVector(0,0,0) );
183 logicalTof =
new G4LogicalVolume(solidTof, G4Material::GetMaterial(
"Air"),
"logicalTof");
184 physicalTof =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalTof,
"physicalTof",logicalBes,
false,0);
187 G4Tubs* tub5 =
new G4Tubs(
"tub5",r3,r4,a3,0,360);
188 logicalBrTof =
new G4LogicalVolume(tub5, G4Material::GetMaterial(
"Air"),
"logicalBrTof");
189 G4VPhysicalVolume* physicalBrTof =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalBrTof,
"physicalBrTof",logicalTof,
false,0);
193 G4Tubs* tub6 =
new G4Tubs(
"tub6",r1,r4,(a2-a3)/2,0,360);
194 G4Tubs* tub7 =
new G4Tubs(
"tub7",r1,r2,(a1-a2)/2,0,360);
195 G4UnionSolid* tub8 =
new G4UnionSolid(
"tub8",tub6,tub7,0,G4ThreeVector(0,0,(a3-a1)/2));
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);
199 G4UnionSolid* tub9 =
new G4UnionSolid(
"tub9",tub6,tub7,0,G4ThreeVector(0,0,(a1-a3)/2) );
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);
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);
223 G4cout<<
"BesTofConstruction::Construct(), logicalTof not found"<<G4endl;
226 physicalTof =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalTof,
"physicalTof",logicalBes,
false,0);
249 G4double r1=tofPara->
GetEcR1()-1;
257 G4cout<<
"Tof Volume: "<<r1<<
" "<<r2<<
" "<<r3<<
" "<<r4<<
" "<<a1<<
" "<<a2<<
" "<<a3<<G4endl;
259 G4Tubs* tub1 =
new G4Tubs(
"tub1",r1,r2,a1,0,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) );
263 G4SubtractionSolid* solidTof =
new G4SubtractionSolid(
"solidTof",tub4,tub3,0, G4ThreeVector(0,0,0) );
264 logicalTof =
new G4LogicalVolume(solidTof, G4Material::GetMaterial(
"Air"),
"logicalTof");
265 physicalTof =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalTof,
"physicalTof",logicalBes,
false,0);
267 G4Tubs* tub5 =
new G4Tubs(
"tub5",r3,r4,a3,0,360);
268 logicalBrTof =
new G4LogicalVolume(tub5, G4Material::GetMaterial(
"Air"),
"logicalBrTof");
269 G4VPhysicalVolume* physicalBrTof =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicalBrTof,
"physicalBrTof",logicalTof,
false,0);
272 G4Tubs* tub6 =
new G4Tubs(
"tub6",r1,r4,(a2-a3)/2,0,360);
273 G4Tubs* tub7 =
new G4Tubs(
"tub7",r1,r2,(a1-a2)/2,0,360);
274 G4UnionSolid* tub8 =
new G4UnionSolid(
"tub8",tub6,tub7,0,G4ThreeVector(0,0,(a3-a1)/2) );
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);
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);
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);
299 G4SDManager* SDman = G4SDManager::GetSDMpointer();
301 SDman->AddNewDetector(tofSD);
303 if (logicalScinBr1) logicalScinBr1->SetSensitiveDetector(tofSD);
304 if (logicalScinBr2) logicalScinBr2->SetSensitiveDetector(tofSD);
305 if (logicalScinEcWest) logicalScinEcWest->SetSensitiveDetector(tofSD);
306 if (logicalScinEcEast) logicalScinEcEast->SetSensitiveDetector(tofSD);
309 logical_gasLayer->SetSensitiveDetector(tofSD);
310 G4cout<<
"!!! Find logical_gasLayer !!!"<<G4endl;
313 logical_gasLayer->SetUserLimits (
new G4UserLimits(m_userLimits*mm));
318 G4VisAttributes* visBrTof =
new G4VisAttributes(G4Colour(1.,0.,0.));
319 G4VisAttributes* visEcTof =
new G4VisAttributes(G4Colour(0.,1.,0.));
322 logicalTof->SetVisAttributes(G4VisAttributes::Invisible);
324 logicalBrTof->SetVisAttributes(G4VisAttributes::Invisible);
326 if (logicalEcTofWest)
327 logicalEcTofWest->SetVisAttributes(G4VisAttributes::Invisible);
329 if (logicalEcTofEast)
330 logicalEcTofEast->SetVisAttributes(G4VisAttributes::Invisible);
335 logicalScinBr1->SetVisAttributes(G4VisAttributes::Invisible);
337 logicalScinBr2->SetVisAttributes(G4VisAttributes::Invisible);
340 logicalAlBr1->SetVisAttributes(G4VisAttributes::Invisible);
342 logicalAlBr2->SetVisAttributes(G4VisAttributes::Invisible);
345 logicalPVFBr1->SetVisAttributes(G4VisAttributes::Invisible);
347 logicalPVFBr2->SetVisAttributes(G4VisAttributes::Invisible);
349 G4VisAttributes* visAttBrBuck =
new G4VisAttributes(G4Colour(1.,1.,0.));
350 if (logicalBucketBr1)
351 logicalBucketBr1->SetVisAttributes(visAttBrBuck);
353 if (logicalBucketBr2)
354 logicalBucketBr2->SetVisAttributes(visAttBrBuck);
357 G4VisAttributes* visAttEcTof =
new G4VisAttributes(G4Colour(0.,1.,1.));
358 if (logicalScinEcWest)
359 logicalScinEcWest->SetVisAttributes(visAttEcTof);
361 if (logicalScinEcEast)
362 logicalScinEcEast->SetVisAttributes(visAttEcTof);
364 G4VisAttributes* visAttEcBuck =
new G4VisAttributes(G4Colour(1.,1.,0.));
366 logicalBucketEc->SetVisAttributes(visAttEcBuck);
370 logicalAlEcWest->SetVisAttributes(G4VisAttributes::Invisible);
372 logicalAlEcEast->SetVisAttributes(G4VisAttributes::Invisible);
373 if (logicalPVFEcWest)
374 logicalPVFEcWest->SetVisAttributes(G4VisAttributes::Invisible);
375 if (logicalPVFEcEast)
376 logicalPVFEcEast->SetVisAttributes(G4VisAttributes::Invisible);
385 G4double br1L=tofPara->
GetBr1L();
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));
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");
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);
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);
427 logicalPVFBr1 =
new G4LogicalVolume(solidPVFBr1,PVF,
"logicalPVFBr1");
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);
433 G4Tubs* solidBucketBr1=
new G4Tubs(
"solidBucketBr1",0,bucketDBr/2.,
434 bucketLBr/2., 0, 360.*deg);
435 logicalBucketBr1=
new G4LogicalVolume(solidBucketBr1,PMTmaterial,
"logicalBucketBr1");
439 G4RotationMatrix trapRot;
440 trapRot.rotateZ(0.5*angleBr-90.*deg);
447 G4ThreeVector pos(0,0,0);
449 for (
int i=0;i<nScinBr;i++)
451 ostringstream osnamePVFBr1;
452 osnamePVFBr1 <<
"physicalPVFBr1_"<<i;
453 ostringstream osnameBucket1Br1;
454 osnameBucket1Br1 <<
"physicalBucket1Br1_"<<i;
455 ostringstream osnameBucket2Br1;
456 osnameBucket2Br1 <<
"physicalBucket2Br1_"<<i;
459 x=scinPosR*
cos((i+0.5)*angleBr);
460 y=scinPosR*
sin((i+0.5)*angleBr);
468 G4RotationMatrix trapRotTemp;
469 trapRotTemp.rotateZ(c);
470 G4Transform3D transform(trapRotTemp,pos);
474 physicalPVFBr1 =
new G4PVPlacement(transform,logicalPVFBr1,osnamePVFBr1.str(), logicalBrTof,
false,i);
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);
482 trapRot.rotateZ(angleBr);
492 G4double br2L=tofPara->
GetBr2L();
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));
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");
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);
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);
534 logicalPVFBr2 =
new G4LogicalVolume(solidPVFBr2,PVF,
"logicalPVFBr2");
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);
540 G4Tubs* solidBucketBr2=
new G4Tubs(
"solidBucketBr2",0,bucketDBr/2.,
541 bucketLBr/2., 0, 360.*deg);
542 logicalBucketBr2=
new G4LogicalVolume(solidBucketBr2,PMTmaterial,
"logicalBucketBr2");
544 G4RotationMatrix trapRot;
545 trapRot.rotateZ(-90.*deg);
552 G4ThreeVector pos(0,0,0);
554 for (
int i=0;i<nScinBr;i++)
556 ostringstream osnamePVFBr2;
557 osnamePVFBr2 <<
"physicalPVFBr2_"<<i;
558 ostringstream osnameBucket1Br2;
559 osnameBucket1Br2 <<
"physicalBucket1Br2_"<<i;
560 ostringstream osnameBucket2Br2;
561 osnameBucket2Br2 <<
"physicalBucket2Br2_"<<i;
564 x=scinPosR*
cos(i*angleBr);
565 y=scinPosR*
sin(i*angleBr);
572 G4RotationMatrix trapRotTemp;
573 trapRotTemp.rotateZ(c);
574 G4Transform3D transform(trapRotTemp,pos);
576 physicalPVFBr2 =
new G4PVPlacement(transform,logicalPVFBr2,osnamePVFBr2.str(), logicalBrTof,
false,i);
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);
584 trapRot.rotateZ(angleBr);
596 G4double ecL = tofPara->
GetEcL();
603 G4double ecR1 = tofPara->
GetEcR1();
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;
628 G4double ecR = ecR1+ecTrapH/2+ecTrapH1/4;
631 G4Trap* solidScinEc=
new G4Trap(
"solidScinEc",pdz,ptheta, 270*deg,
632 pdy1,pdx1,pdx2,0*deg,pdy2,pdx3,pdx4,0*deg);
634 logicalScinEcWest=
new G4LogicalVolume(solidScinEc,BC404,
"logicalScinEcWest");
635 logicalScinEcEast=
new G4LogicalVolume(solidScinEc,BC404,
"logicalScinEcEast");
638 G4Tubs* solidBucketEc =
new G4Tubs(
"solidBucketEc", 0, bucketDEc/2.,
639 bucketLEc/2., 0, 360.*deg);
640 logicalBucketEc =
new G4LogicalVolume(solidBucketEc, PMTmaterial,
"logicalBucketEc");
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);
652 G4double thick = AlThickness+PVFThickness;
653 G4double pthetaPVF = atan(ecTrapH1/(2*(ecL+thick*2)));
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);
661 logicalAlEcWest =
new G4LogicalVolume(solidAlEc,G4Material::GetMaterial(
"Aluminium"),
"logicalAlEcWest");
662 logicalAlEcEast =
new G4LogicalVolume(solidAlEc,G4Material::GetMaterial(
"Aluminium"),
"logicalAlEcEast");
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);
668 logicalPVFEcWest =
new G4LogicalVolume(solidPVFEc,PVF,
"logicalPVFEcWest");
669 logicalPVFEcEast =
new G4LogicalVolume(solidPVFEc,PVF,
"logicalPVFEcEast");
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);
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);
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++)
691 ostringstream osnamePVFEc;
692 osnamePVFEc <<
"physicalPVFEcWest_"<<i;
693 ostringstream osnameBucketEc;
694 osnameBucketEc <<
"physicalBucketEcWest_"<<i;
696 posW.setX( ecR*
cos((0.5+i)*angleEc) );
697 posW.setY( ecR*
sin((0.5+i)*angleEc) );
704 G4RotationMatrix trapRotTemp;
705 trapRotTemp.rotateX(a);
706 trapRotTemp.rotateY(b);
707 trapRotTemp.rotateZ(c);
708 G4Transform3D transform(trapRotTemp,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) );
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);
724 trapRot.rotateZ(-angleEc);
725 trapRot.rotateX(180.*deg);
726 for (
int i=0;i<nScinEc;i++)
728 ostringstream osnamePVFEc;
729 osnamePVFEc <<
"physicalPVFEcEast_"<<i;
730 ostringstream osnameBucketEc;
731 osnameBucketEc <<
"physicalBucketEcEast_"<<i;
733 posE.setX( ecR*
cos((0.5+i)*angleEc) );
734 posE.setY( ecR*
sin((0.5+i)*angleEc) );
741 G4RotationMatrix trapRotTemp;
742 trapRotTemp.rotateX(a);
743 trapRotTemp.rotateY(b);
744 trapRotTemp.rotateZ(c);
745 G4Transform3D transform(trapRotTemp,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) );
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);
768 G4double
smallL = 0.01*mm;
769 G4RotationMatrix
rot_dummy(0*deg,0*deg,0*deg);
777 std::ostringstream name;
783 G4LogicalVolume* logical_container[4];
784 G4LogicalVolume* logical_gasContainer[4];
785 for(
int kk=0; kk<4; kk++)
788 name<<
"logical_container_m"<<kk;
789 logical_container[kk] = partProduce->
lg_container((
int)kk/2, name.str());
792 name<<
"logical_gasContainer_m"<<kk;
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");
812 for(
int kk=0; kk<4; kk++)
816 name<<
"physical_containerFrame_m"<<kk;
817 new G4PVPlacement(0, G4ThreeVector(0,0,0), logical_containerFrame, name.str(), logical_container[kk],
false, 0,
checkOverlap);
820 G4ThreeVector translation_upCover(0, (containerOut_y+upCover_y)/2+
smallL, (upCover_z-containerOut_z)/2-upCover_posz);
822 name<<
"physical_upCover_m"<<kk;
823 new G4PVPlacement(0, translation_upCover, logical_upCover, name.str(), logical_container[kk],
false, 0,
checkOverlap);
827 name<<
"physical_lowCover_m"<<kk;
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);
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);
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);
842 name<<
"physical_upFEE_m"<<kk;
843 new G4PVPlacement(0, translation_upFEE, logical_upFEE, name.str(), logical_container[kk],
false, 0,
checkOverlap);
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);
855 name<<
"physical_sideFEE_left_m"<<kk;
856 new G4PVPlacement(transform_sideFEE_left, logical_sideFEE, name.str(), logical_container[kk],
false, 0,
checkOverlap);
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);
864 name<<
"physical_sideFEE_right_m"<<kk;
865 new G4PVPlacement(transform_sideFEE_right, logical_sideFEE, name.str(), logical_container[kk],
false, 0,
checkOverlap);
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);
873 name<<
"physical_castingDie_1_m"<<kk;
874 new G4PVPlacement(transform_castingDie_1, logical_castingDie, name.str(), logical_container[kk],
false, 0,
checkOverlap);
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);
879 name<<
"physical_castingDie_2_m"<<kk;
880 new G4PVPlacement(transform_castingDie_2, logical_castingDie, name.str(), logical_container[kk],
false, 0,
checkOverlap);
883 G4ThreeVector translation_gasContainer(0, 0, (container_lowBorder-container_thickness)/2);
885 name<<
"physical_gasContainer_m"<<kk;
886 new G4PVPlacement(0, translation_gasContainer, logical_gasContainer[kk], name.str(), logical_container[kk],
false, 0,
checkOverlap);
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;
894 double z_chamber = (containerIn_z-pcbBoard_z)/2-
smallL;
895 for(
int kk=0; kk<4; kk++)
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;
902 transform_bareChamber = G4Transform3D(
rot_dummy, G4ThreeVector(0,y_chamber,z_chamber));
906 G4RotationMatrix rot_bareChamber;
907 rot_bareChamber.rotateZ(180*deg);
908 transform_bareChamber = G4Transform3D(rot_bareChamber, G4ThreeVector(0,y_chamber,z_chamber));
910 new G4PVPlacement(transform_bareChamber, logical_bareChamber,
"physical_bareChamber", logical_gasContainer[kk],
false, 0,
checkOverlap);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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++)
1019 y_glass = pcbBoard_y1/2.+mylar_y+glass0_y+glass1_y*(4.5-i)+gasLayer_y*(5-i);
1021 name<<
"physical_glass1_"<<i;
1022 new G4PVPlacement(0, G4ThreeVector(0, y_glass, z_glass), logical_glass1, name.str(), logical_bareChamber,
false, i,
checkOverlap);
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);
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++)
1035 y_gasLayer = pcbBoard_y1/2.+mylar_y+glass0_y+glass1_y*(5-i)+gasLayer_y*(5.5-i);
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);
1040 for(G4int i=6; i<12; i++)
1042 y_gasLayer = pcbBoard_y1/2.+mylar_y+glass0_y+glass1_y*(i-6)+gasLayer_y*(-5.5+i);
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);
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;
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");
1076 for(
int i=0; i<n_module; i++)
1078 G4double angle_module = startAngle_east+angle_east[i]+i*angle;
1079 G4double r_module = endcap_r+rOffset_east[i];
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]);
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);
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]);
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);
1100 name<<
"physical_mrpc_east_"<<i;
1103 new G4PVPlacement(transform_layerOut_east, logical_container[3], name.str(), logicalEcTofEast,
false, i,
checkOverlap);
1107 new G4PVPlacement(transform_layerIn_east, logical_container[0], name.str(), logicalEcTofEast,
false, i,
checkOverlap);
1112 for(
int i=0; i<n_module; i++)
1114 G4double angle_module = startAngle_west+angle_west[i]+i*angle;
1115 G4double r_module = endcap_r+rOffset_west[i];
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]);
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);
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]);
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);
1136 name<<
"physical_mrpc_west_"<<i;
1139 new G4PVPlacement(transform_layerOut_west, logical_container[2], name.str(), logicalEcTofWest,
false, i,
checkOverlap);
1143 new G4PVPlacement(transform_layerIn_west, logical_container[1], name.str(), logicalEcTofWest,
false, i,
checkOverlap);
1152 G4double a,z,density,fraction;
1153 G4int nel, natoms, ncomponents;
1154 G4String name, symbol;
1157 G4Element*
H=G4Element::GetElement(
"Hydrogen");
1159 H =
new G4Element(name=
"Hydrogen",symbol=
"H" , z= 1., a=1.01*g/mole);
1161 G4Element*
C=G4Element::GetElement(
"Carbon");
1163 C =
new G4Element(name=
"Carbon" ,symbol=
"C" , z= 6., a=12.01*g/mole);
1165 G4Element* F=G4Element::GetElement(
"Fluorin");
1167 F =
new G4Element(name=
"Fluorin", symbol=
"F", z=9., a=18.01*g/mole);
1169 G4Element* O=G4Element::GetElement(
"Oxygen");
1171 O =
new G4Element(name=
"Oxygen",symbol=
"O",z= 8., a= 16.00*g/mole);
1173 G4Element* N=G4Element::GetElement(
"Nitrogen");
1175 N =
new G4Element(name=
"Nitrogen",symbol=
"N",z= 7., a= 14.01*g/mole);
1177 G4Element* S=G4Element::GetElement(
"Sulfur");
1179 S =
new G4Element(name=
"Sulfur",symbol=
"S",z= 16., a= 32.06*g/mole);
1182 BC404 =
new G4Material(
"BC404",density=1.032*g/cm3,nel=2);
1183 BC404->AddElement(
C,10);
1184 BC404->AddElement(
H,11);
1186 BC408 =
new G4Material(
"BC408",density=1.032*g/cm3,nel=2);
1187 BC408->AddElement(
C,1000);
1188 BC408->AddElement(
H,1104);
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);
1196 G4Material* Cu = G4Material::GetMaterial(
"Copper");
1197 G4Material* Al = G4Material::GetMaterial(
"Aluminium");
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);
1210 G4cout<<PMTmaterial;
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);
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;
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;
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;
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;
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;
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;
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;
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;
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);
1276 if(0.0 == MRPCGas->GetIonisation()->GetMeanEnergyPerIonPair())
1279 MRPCGas->GetIonisation()->SetMeanEnergyPerIonPair(m_ionE*eV);
1281 G4cout<<MRPCGas<<G4endl;
1286 double cosb = sqrt( r.xx()*r.xx() + r.yx()*r.yx() );
1288 if (cosb > 16*FLT_EPSILON)
1290 a = atan2( r.zy(), r.zz() );
1291 b = atan2( -r.zx(), cosb );
1292 c = atan2( r.yx(), r.xx() );
1296 a = atan2( -r.yz(), r.yy() );
1297 b = atan2( -r.zx(), cosb );
1307 G4RotationMatrix temp;
1308 temp.rotateZ((c/deg)*deg);
1316void BesTofConstruction::IniParam_mrpc()
1321 containerOut_xdown = tofPara->
Get(
"containerOut_xdown");
1322 containerOut_xup = tofPara->
Get(
"containerOut_xup");
1323 containerOut_y = tofPara->
Get(
"containerOut_y");
1324 containerOut_z = tofPara->
Get(
"containerOut_z");
1325 container_thickness = tofPara->
Get(
"container_thickness");
1326 container_lowBorder = tofPara->
Get(
"container_lowBorder");
1328 containerIn_xdown = tofPara->
Get(
"containerIn_xdown");
1329 containerIn_xup = tofPara->
Get(
"containerIn_xup");
1330 containerIn_y = tofPara->
Get(
"containerIn_y");
1331 containerIn_z = tofPara->
Get(
"containerIn_z");
1333 upCover_xdown = tofPara->
Get(
"upCover_xdown");
1334 upCover_xup = tofPara->
Get(
"upCover_xup");
1335 upCover_y = tofPara->
Get(
"upCover_y");
1336 upCover_z = tofPara->
Get(
"upCover_z");
1337 upCover_posz = tofPara->
Get(
"upCover_posz");
1339 lowCover1_xdown = tofPara->
Get(
"lowCover1_xdown");
1340 lowCover1_xup = tofPara->
Get(
"lowCover1_xup");
1341 lowCover1_y = tofPara->
Get(
"lowCover1_y");
1342 lowCover1_z = tofPara->
Get(
"lowCover1_z");
1343 lowCover1_addx = tofPara->
Get(
"lowCover1_addx");
1344 lowCover1_addz = tofPara->
Get(
"lowCover1_addz");
1345 lowCover1_posz = tofPara->
Get(
"lowCover1_posz");
1347 lowCover2_xdown = tofPara->
Get(
"lowCover2_xdown");
1348 lowCover2_xup = tofPara->
Get(
"lowCover2_xup");
1349 lowCover2_y = tofPara->
Get(
"lowCover2_y");
1350 lowCover2_z = tofPara->
Get(
"lowCover2_z");
1351 lowCover2_posz = tofPara->
Get(
"lowCover2_posz");
1353 upFEE_xdown = tofPara->
Get(
"upFEE_xdown");
1354 upFEE_xup = tofPara->
Get(
"upFEE_xup");
1355 upFEE_y = tofPara->
Get(
"upFEE_y");
1356 upFEE_z = tofPara->
Get(
"upFEE_z");
1357 FEE_thickness = tofPara->
Get(
"FEE_thickness");
1358 upFEE_posz = tofPara->
Get(
"upFEE_posz");
1360 upFEE_pcb_xdown = tofPara->
Get(
"upFEE_pcb_xdown");
1361 upFEE_pcb_xup = tofPara->
Get(
"upFEE_pcb_xup");
1362 upFEE_pcb_y = tofPara->
Get(
"upFEE_pcb_y");
1363 upFEE_pcb_z = tofPara->
Get(
"upFEE_pcb_z");
1365 sideFEE_x = tofPara->
Get(
"sideFEE_x");
1366 sideFEE_y = tofPara->
Get(
"sideFEE_y");
1367 sideFEE_z = tofPara->
Get(
"sideFEE_z");
1368 sideFEE_posl = tofPara->
Get(
"sideFEE_posl");
1370 sideFEE_pcb_x = tofPara->
Get(
"sideFEE_pcb_x");
1371 sideFEE_pcb_y = tofPara->
Get(
"sideFEE_pcb_y");
1372 sideFEE_pcb_z = tofPara->
Get(
"sideFEE_pcb_z");
1374 castingDie_x = tofPara->
Get(
"castingDie_x");
1375 castingDie_y = tofPara->
Get(
"castingDie_y");
1376 castingDie_z = tofPara->
Get(
"castingDie_z");
1377 castingDie_addr = tofPara->
Get(
"castingDie_addr");
1378 castingDie_subtractx = tofPara->
Get(
"castingDie_subtractx");
1379 castingDie_subtract_posz = tofPara->
Get(
"castingDie_subtract_posz");
1380 castingDie_posz1 = tofPara->
Get(
"castingDie_posz1");
1381 castingDie_posz2 = tofPara->
Get(
"castingDie_posz2");
1383 chamber_in_posy = tofPara->
Get(
"chamber_in_posy");
1384 chamber_out_posy = tofPara->
Get(
"chamber_out_posy");
1386 bracket_x = tofPara->
Get(
"bracket_x");
1387 bracket_y = tofPara->
Get(
"bracket_y");
1388 bracket_z = tofPara->
Get(
"bracket_z");
1389 bracket_r = tofPara->
Get(
"bracket_r");
1390 bracket_posx = tofPara->
Get(
"bracket_posx");
1392 upStopBlock_x = tofPara->
Get(
"upStopBlock_x");
1393 upStopBlock_y = tofPara->
Get(
"upStopBlock_y");
1394 upStopBlock_z = tofPara->
Get(
"upStopBlock_z");
1395 upStopBlock_subtractr = tofPara->
Get(
"upStopBlock_subtractr");
1396 upStopBlock_subtractposz = tofPara->
Get(
"upStopBlock_subtractposz");
1398 sideStopBlock_x = tofPara->
Get(
"sideStopBlock_x");
1399 sideStopBlock_y = tofPara->
Get(
"sideStopBlock_y");
1400 sideStopBlock_z = tofPara->
Get(
"sideStopBlock_z");
1401 sideStopBlock_thickness = tofPara->
Get(
"sideStopBlock_thickness");
1402 sideStopBlock_posz0 = tofPara->
Get(
"sideStopBlock_posz0");
1403 sideStopBlock_posz1 = tofPara->
Get(
"sideStopBlock_posz1");
1406 honeyComb_xdown = tofPara->
Get(
"honeyComb_xdown");
1407 honeyComb_xup = tofPara->
Get(
"honeyComb_xup");
1408 honeyComb_y = tofPara->
Get(
"honeyComb_y");
1409 honeyComb_z = tofPara->
Get(
"honeyComb_z");
1410 honeyComb_surface_y = tofPara->
Get(
"honeyComb_surface_y");
1411 honeyComb_posz = tofPara->
Get(
"honeyComb_posz");
1413 tape_mrpc_xdown = tofPara->
Get(
"tape_mrpc_xdown");
1414 tape_mrpc_xup = tofPara->
Get(
"tape_mrpc_xup");
1415 tape_mrpc_y = tofPara->
Get(
"tape_mrpc_y");
1416 tape_mrpc_z = tofPara->
Get(
"tape_mrpc_z");
1417 tape_mrpc_posz = tofPara->
Get(
"tape_mrpc_posz");
1419 pcbBoard_xdown = tofPara->
Get(
"pcbBoard_xdown");
1420 pcbBoard_xup = tofPara->
Get(
"pcbBoard_xup");
1421 pcbBoard_y0 = tofPara->
Get(
"pcbBoard_y0");
1422 pcbBoard_y1 = tofPara->
Get(
"pcbBoard_y1");
1423 pcbBoard_z = tofPara->
Get(
"pcbBoard_z");
1425 strip_x[0] = tofPara->
Get(
"strip_x[0]");
1426 strip_x[1] = tofPara->
Get(
"strip_x[1]");
1427 strip_x[2] = tofPara->
Get(
"strip_x[2]");
1428 strip_x[3] = tofPara->
Get(
"strip_x[3]");
1429 strip_x[4] = tofPara->
Get(
"strip_x[4]");
1430 strip_x[5] = tofPara->
Get(
"strip_x[5]");
1431 strip_x[6] = tofPara->
Get(
"strip_x[6]");
1432 strip_x[7] = tofPara->
Get(
"strip_x[7]");
1433 strip_x[8] = tofPara->
Get(
"strip_x[8]");
1434 strip_x[9] = tofPara->
Get(
"strip_x[9]");
1435 strip_x[10] = tofPara->
Get(
"strip_x[10]");
1436 strip_x[11] = tofPara->
Get(
"strip_x[11]");
1437 strip_y = tofPara->
Get(
"strip_y");
1438 strip_z = tofPara->
Get(
"strip_z");
1439 strip_gap = tofPara->
Get(
"strip_gap");
1440 strip_posz = tofPara->
Get(
"strip_posz");
1442 mylar_xdown = tofPara->
Get(
"mylar_xdown");
1443 mylar_xup = tofPara->
Get(
"mylar_xup");
1444 mylar_y = tofPara->
Get(
"mylar_y");
1445 mylar_z = tofPara->
Get(
"mylar_z");
1446 mylar_posz = tofPara->
Get(
"mylar_posz");
1448 glass0_xdown = tofPara->
Get(
"glass0_xdown");
1449 glass0_xup = tofPara->
Get(
"glass0_xup");
1450 glass0_y = tofPara->
Get(
"glass0_y");
1451 glass0_z = tofPara->
Get(
"glass0_z");
1452 glass0_posz = tofPara->
Get(
"glass0_posz");
1454 glass1_xdown = tofPara->
Get(
"glass1_xdown");
1455 glass1_xup = tofPara->
Get(
"glass1_xup");
1456 glass1_y = tofPara->
Get(
"glass1_y");
1457 glass1_z = tofPara->
Get(
"glass1_z");
1458 glass1_posz = tofPara->
Get(
"glass1_posz");
1460 gasLayer_xdown = tofPara->
Get(
"gasLayer_xdown");
1461 gasLayer_xup = tofPara->
Get(
"gasLayer_xup");
1462 gasLayer_y = tofPara->
Get(
"gasLayer_y");
1463 gasLayer_z = tofPara->
Get(
"gasLayer_z");
1464 gasLayer_posz = tofPara->
Get(
"gasLayer_posz");
1466 endcap_r = tofPara->
Get(
"endcap_r");
1467 endcap_length = tofPara->
Get(
"endcap_length");
1468 layer_posz = tofPara->
Get(
"layer_posz");
1469 startAngle_east = tofPara->
Get(
"startAngle_east");
1470 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;.