30 #include "G4Material.hh"
33 #include "G4Polyhedra.hh"
34 #include "G4Sphere.hh"
35 #include "G4GenericTrap.hh"
36 #include "G4Polycone.hh"
38 #include "G4LogicalVolume.hh"
39 #include "G4AssemblyVolume.hh"
41 #include "G4PVPlacement.hh"
42 #include "G4PVParameterised.hh"
43 #include "G4UserLimits.hh"
44 #include "G4VisAttributes.hh"
45 #include "G4Colour.hh"
47 #include "G4SubtractionSolid.hh"
48 #include "G4UnionSolid.hh"
49 #include "G4IntersectionSolid.hh"
51 #include "G4PhysicalVolumeStore.hh"
52 #include "G4LogicalVolumeStore.hh"
53 #include "G4SDManager.hh"
54 #include "G4UnitsTable.hh"
80 G4bool do_caps =
true;
82 if ( opt.contains(
"bare" ) )
87 G4VPhysicalVolume *theDetector = 0x0;
89 const G4double world_x = 50.*CLHEP::cm;
90 const G4double world_y = 50.*CLHEP::cm;
91 const G4double world_z = 100.*CLHEP::cm;
94 G4Box *detWorld=
new G4Box(detname,world_x,world_y,world_z);
95 G4LogicalVolume *detlogicWorld=
new G4LogicalVolume(detWorld, SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"AIR"), detname, 0, 0, 0);
99 G4VisAttributes *detlogicWorldVisAtt=
new G4VisAttributes(G4Colour(0.0,1.0,1.0));
100 detlogicWorld->SetVisAttributes(detlogicWorldVisAtt);
103 theDetector =
new G4PVPlacement(0,
117 const G4double CrystalLength = 90.0*CLHEP::mm;
118 const G4double CrystalHoleDepth = 15.0*CLHEP::mm;
120 const G4double CrystalOuterRadius = 30.0*CLHEP::mm;
121 const G4double CrystalInnerRadius = 5.0*CLHEP::mm;
123 const G4double CrystalEdgeOffset1 = 24.5*CLHEP::mm;
124 const G4double CrystalEdgeOffset2 = 29*CLHEP::mm;
126 const G4double CrystalEdgeDepth = 30.0*CLHEP::mm;
127 const G4double CrystalEdgeAngle = 22.5*CLHEP::deg;
129 const G4double CapsuleWidth1 = 1.5*CLHEP::mm;
130 const G4double CapsuleWidth2 = 2.0*CLHEP::mm;
131 const G4double CapsuleLength = 147.*CLHEP::mm;
132 const G4double CapsuleEdgeDepth = 43.25*CLHEP::mm;
133 const G4double CrystalToCapsuleTOP = 7.*CLHEP::mm;
134 const G4double CrystalToCapsuleLATERAL = 8.*CLHEP::mm;
136 const G4double BGOLength = 132.893*CLHEP::mm;
137 const G4double BGOWidth = 25.0*CLHEP::mm;
139 const G4double CsILength = 38.8*CLHEP::mm;
141 const G4double Tolerance = 0.1*CLHEP::mm;
142 const G4double Space = 1.0*CLHEP::mm;
143 const G4double AlcapstoBGO = 52.907*CLHEP::mm;
149 G4VPhysicalVolume *CrystalA_phys = 0x0;
150 G4VPhysicalVolume *CrystalB_phys = 0x0;
151 G4VPhysicalVolume *CrystalC_phys = 0x0;
152 G4VPhysicalVolume *CrystalD_phys = 0x0;
153 G4VPhysicalVolume *Capsule_phys = 0x0;
154 G4VPhysicalVolume *Capsule_OUT_phys = 0x0;
155 G4VPhysicalVolume *Capsule_IN_phys = 0x0;
156 G4VPhysicalVolume *CFPlate_phys= 0x0;
157 G4VPhysicalVolume *CF_int_phys = 0x0;
158 G4VPhysicalVolume *CF_OUT_phys= 0x0;
159 G4VPhysicalVolume *physiIntEnvColdFinger =0x0;
160 G4VPhysicalVolume *Dewar_phys=0x0;
161 G4VPhysicalVolume *IntDewar_phys=0x0;
162 G4VPhysicalVolume *physiCloverCan= 0x0;
163 G4VPhysicalVolume *BGO_phys = 0x0;
164 G4VPhysicalVolume *CsIBack_phys = 0x0;
169 G4double zPlaneGe[4] = { 0.0*CLHEP::mm,
171 CrystalHoleDepth + 3.0*CLHEP::mm,
173 G4double rInnerGe[4] = { 0.0*CLHEP::mm,
177 G4double rOuterGe[4] = { CrystalOuterRadius,
184 sprintf(sName,
"Crystal");
186 G4Polycone *detCrystal=
new G4Polycone(G4String(sName),
199 sprintf(sName,
"LongEdge1");
200 Edge[0] = (CrystalOuterRadius-CrystalEdgeOffset1);
201 Edge[1] = 1.001*CLHEP::mm*CrystalOuterRadius;
202 Edge[2] = 1.001*CLHEP::mm*CrystalLength/2.0;
203 G4Box *cutEdge1 =
new G4Box(G4String(sName),Edge[0],Edge[1],Edge[2]);
205 sprintf(sName,
"LongEdge2");
206 Edge[0] = (CrystalOuterRadius-CrystalEdgeOffset2);
207 Edge[1] = 1.001*CLHEP::mm*CrystalOuterRadius;
208 Edge[2] = 1.001*CLHEP::mm*CrystalLength/2.0;
209 G4Box *cutEdge2 =
new G4Box(G4String(sName),Edge[0],Edge[1],Edge[2]);
211 sprintf(sName,
"Bevel");
212 Edge[0] = 1.001*CLHEP::mm*CrystalOuterRadius;
213 Edge[1] = sin(CrystalEdgeAngle)*(CrystalEdgeDepth);
214 Edge[2] = 1.001*CLHEP::mm*CrystalLength/2.0;
215 G4Box *cutBevel =
new G4Box(G4String(sName),Edge[0],Edge[1],Edge[2]);
226 sprintf(sName,
"coax_cut1_edge");
227 G4SubtractionSolid *coax_cut1
228 =
new G4SubtractionSolid (G4String(sName), detCrystal, cutEdge1, &rm, G4ThreeVector(-CrystalOuterRadius,0.0,CrystalLength/2.0));
230 sprintf(sName,
"coax_cut2_edge");
231 G4SubtractionSolid *coax_cut2
232 =
new G4SubtractionSolid (G4String(sName), coax_cut1, cutEdge2, &rm, G4ThreeVector(CrystalOuterRadius,0.0,CrystalLength/2.0));
234 sprintf(sName,
"coax_cut3_edge");
235 rm.rotateZ(90.0*CLHEP::deg);
236 G4SubtractionSolid *coax_cut3
237 =
new G4SubtractionSolid (G4String(sName), coax_cut2, cutEdge2, &rm, G4ThreeVector(0.0,CrystalOuterRadius,CrystalLength/2.0));
239 sprintf(sName,
"coax_cut4_edge");
240 G4SubtractionSolid *coax_cut4
241 =
new G4SubtractionSolid (G4String(sName), coax_cut3, cutEdge1, &rm, G4ThreeVector(0.0,-CrystalOuterRadius,CrystalLength/2.0));
242 rm.rotateZ(-90.0*CLHEP::deg);
244 sprintf(sName,
"coax_cut5_edge");
245 rm.rotateX(CrystalEdgeAngle);
246 G4SubtractionSolid *coax_cut5
247 =
new G4SubtractionSolid (G4String(sName), coax_cut4, cutBevel, &rm, G4ThreeVector(0.,CrystalEdgeOffset2,0.));
251 rm.rotateX(-CrystalEdgeAngle);
252 sprintf(sName,
"coax_cut6_edge");
253 rm.rotateZ(90.0*CLHEP::deg);
254 rm.rotateX(CrystalEdgeAngle);
255 G4SubtractionSolid *coax_cut6
256 =
new G4SubtractionSolid (G4String(sName), coax_cut5, cutBevel, &rm, G4ThreeVector(CrystalEdgeOffset2,0.,0.));
258 rm.rotateX(-CrystalEdgeAngle);
259 rm.rotateZ(-90.0*CLHEP::deg);
264 G4RotationMatrix* Crystal_90deg =
new G4RotationMatrix();
265 Crystal_90deg -> rotateZ(90*CLHEP::deg);
267 sprintf(sName,
"ShapedCrystalA");
268 G4LogicalVolume *pCrystalA =
new G4LogicalVolume( coax_cut6, SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"SToGS_Ge"), G4String(sName), 0, 0, 0 );
271 CrystalA_phys =
new G4PVPlacement(Crystal_90deg,
272 G4ThreeVector(CrystalEdgeOffset1+Tolerance,-CrystalEdgeOffset1-Tolerance,CrystalToCapsuleTOP),
278 G4VisAttributes *CrystalA_VisAtt=
new G4VisAttributes(G4Colour(0.0,0.0,1.0));
279 pCrystalA ->SetVisAttributes(CrystalA_VisAtt);
283 G4RotationMatrix* Crystal_180deg =
new G4RotationMatrix();
284 Crystal_180deg -> rotateZ(180*CLHEP::deg);
286 sprintf(sName,
"ShapedCrystalB");
287 G4LogicalVolume *pCrystalB =
new G4LogicalVolume( coax_cut6, SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"SToGS_Ge"), G4String(sName), 0, 0, 0 );
290 CrystalB_phys =
new G4PVPlacement(Crystal_180deg,
291 G4ThreeVector(-CrystalEdgeOffset1-Tolerance,-CrystalEdgeOffset1-Tolerance,CrystalToCapsuleTOP),
297 G4VisAttributes *CrystalB_VisAtt=
new G4VisAttributes(G4Colour(0.0,1.0,0.0));
298 pCrystalB ->SetVisAttributes(CrystalB_VisAtt);
302 G4RotationMatrix* Crystal_270deg =
new G4RotationMatrix();
303 Crystal_270deg -> rotateZ(270*CLHEP::deg);
305 sprintf(sName,
"ShapedCrystalC");
306 G4LogicalVolume *pCrystalC =
new G4LogicalVolume( coax_cut6, SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"SToGS_Ge"), G4String(sName), 0, 0, 0 );
309 CrystalC_phys =
new G4PVPlacement(Crystal_270deg,
310 G4ThreeVector(-CrystalEdgeOffset1-Tolerance,CrystalEdgeOffset1+Tolerance,CrystalToCapsuleTOP),
316 G4VisAttributes *CrystalC_VisAtt=
new G4VisAttributes(G4Colour(1.0,0.0,0.0));
317 pCrystalC ->SetVisAttributes(CrystalC_VisAtt);
321 sprintf(sName,
"ShapedCrystalD");
322 G4LogicalVolume *pCrystalD =
new G4LogicalVolume( coax_cut6, SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"SToGS_Ge"), G4String(sName), 0, 0, 0 );
326 CrystalD_phys =
new G4PVPlacement(0,
327 G4ThreeVector(CrystalEdgeOffset1+Tolerance,CrystalEdgeOffset1+Tolerance,CrystalToCapsuleTOP),
333 G4VisAttributes *CrystalD_VisAtt=
new G4VisAttributes(G4Colour(1.0,1.0,0.0));
334 pCrystalD ->SetVisAttributes(CrystalD_VisAtt);
344 const G4double widthface = 44.085*CLHEP::mm;
346 G4double zSlice[7] = { 0.0*CLHEP::mm,
347 CapsuleWidth1-0.001*CLHEP::mm,
350 CapsuleLength-CapsuleWidth2-0.001*CLHEP::mm,
351 CapsuleLength-CapsuleWidth2,
354 G4double InnRad[7] = { 0.00*CLHEP::mm,
363 G4double OutRad[7] = { widthface,
364 widthface+CapsuleWidth1,
365 widthface+CapsuleWidth1,
372 G4RotationMatrix* Cap_45deg =
new G4RotationMatrix();
373 Cap_45deg -> rotateZ(45*CLHEP::deg);
375 G4Tubs *hole=
new G4Tubs(G4String(
"ShapeHole"),
387 G4Polyhedra *caps =
new G4Polyhedra(G4String(
"ShapeCapsule"),
396 G4SubtractionSolid *hole_cut_Al_caps=
new G4SubtractionSolid (G4String(
"cut_Alcaps"), caps, hole, &rm,G4ThreeVector(0.,0.,CapsuleLength*CLHEP::mm));
398 sprintf(sName,
"Capsule");
399 G4LogicalVolume * pCapsule =
new G4LogicalVolume( hole_cut_Al_caps, SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"SToGS_Al"), G4String(sName), 0, 0, 0 );
402 Capsule_phys =
new G4PVPlacement(Cap_45deg,
411 G4VisAttributes *Capsule_VisAtt=
new G4VisAttributes(G4Colour(0.5,0.5,0.5,0.75));
412 pCapsule ->SetVisAttributes(Capsule_VisAtt);
423 G4double x_CFPlate = 100.80*CLHEP::mm;
424 G4double y_CFPlate = 100.80*CLHEP::mm;
425 G4double z_CFPlate = 2.*CLHEP::mm;
427 G4Box* CFPlate =
new G4Box(
"CFPlate",x_CFPlate/2,y_CFPlate/2,z_CFPlate/2);
429 G4LogicalVolume* logicCFPlate =
new G4LogicalVolume(CFPlate,SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"SToGS_Cu"),
"CFPlate");
431 CFPlate_phys=
new G4PVPlacement(0,
432 G4ThreeVector(0,0,CapsuleLength-48.999*CLHEP::mm),
439 G4VisAttributes *CFPlate_VisAtt=
new G4VisAttributes(G4Colour(0.45,0.25,0.0));
440 logicCFPlate->SetVisAttributes(CFPlate_VisAtt);
447 G4double InnRadiusCF_Int = 0.*CLHEP::mm;
448 G4double OutRadiusCF_Int = 15*CLHEP::mm;
449 G4double HalfLengtCF_Int = 24.0*CLHEP::mm;
450 G4double startPhiCF_Int = 0.*CLHEP::deg;
451 G4double spanningAngleCF_Int = 360.*CLHEP::deg;
453 G4Tubs* CF_int =
new G4Tubs(G4String(
"ColdFinger"),
458 spanningAngleCF_Int);
460 sprintf(sName,
"CFinger_int");
461 G4LogicalVolume * pCF_int =
new G4LogicalVolume(CF_int, SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"SToGS_Cu"), G4String(sName), 0, 0, 0 );
463 CF_int_phys =
new G4PVPlacement(0,
464 G4ThreeVector(0,0,CapsuleLength-23.999*CLHEP::mm),
472 G4VisAttributes *CF_int_VisAtt=
new G4VisAttributes(G4Colour(0.45,0.25,0.0));
473 pCF_int ->SetVisAttributes(CF_int_VisAtt);
480 G4double CF_OUT_HalfLength = 72.5*CLHEP::mm;
481 G4double PhiStart = 0.*CLHEP::deg;
482 G4double PhiTot = 360.*CLHEP::deg;
483 G4int nbZplanesColdFinger = 6;
485 G4double zPlaneColdFinger[6] = { 0*CLHEP::mm,
492 G4double rInnerColdFinger[6] = { 0.0*CLHEP::mm,
499 G4double rOuterColdFinger[6] = { 22.25*CLHEP::mm,
509 G4Polycone* solidColdFinger =
new G4Polycone(
"ShapeColdFinger",PhiStart,PhiTot,nbZplanesColdFinger,
510 zPlaneColdFinger,rInnerColdFinger,rOuterColdFinger);
512 G4LogicalVolume *logicColdFinger =
new G4LogicalVolume(solidColdFinger,SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"SToGS_Al"),
"CFinger_out");
514 CF_OUT_phys =
new G4PVPlacement(0,
515 G4ThreeVector(0,0,CapsuleLength+0.001*CLHEP::mm),
523 G4VisAttributes *CF_OUT_VisAtt=
new G4VisAttributes(G4Colour(0.8,0.8,0.8));
524 logicColdFinger->SetVisAttributes(CF_OUT_VisAtt);
528 G4double minRadiusIntEnvColdFinger = 0.*CLHEP::mm;
529 G4double maxRadiusIntEnvColdFinger = 20.25*CLHEP::mm;
530 G4double HalfLengthIntEnvColdFinger = 72.4*CLHEP::mm;
531 G4double startPhiIntEnvColdFinger = 0.*CLHEP::deg;
532 G4double deltaPhiIntEnvColdFinger = 360.*CLHEP::deg;
534 G4Tubs* solidIntEnvColdFinger =
new G4Tubs(
"ShapeIntEnvColdFinger",minRadiusIntEnvColdFinger,maxRadiusIntEnvColdFinger,
535 HalfLengthIntEnvColdFinger,startPhiIntEnvColdFinger,deltaPhiIntEnvColdFinger);
537 G4LogicalVolume* logicIntEnvColdFinger =
538 new G4LogicalVolume(solidIntEnvColdFinger,SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"SToGS_Vacuum_Ge"),
"IntEnvColdFinger");
542 physiIntEnvColdFinger =
new G4PVPlacement(0,
543 G4ThreeVector(0,0,CF_OUT_HalfLength*CLHEP::mm),
544 logicIntEnvColdFinger,
551 G4VisAttributes *CF_intOUT_VisAtt=
new G4VisAttributes(G4Colour(0.0,1.0,1.0));
552 logicIntEnvColdFinger->SetVisAttributes(CF_intOUT_VisAtt);
557 G4double minRadiusDewar = 111.*CLHEP::mm;
558 G4double maxRadiusDewar = 125.*CLHEP::mm;
559 const G4double HalfLengthDewar = 186.5*CLHEP::mm;
560 G4double startPhiDewar = 0.*CLHEP::deg;
561 G4double deltaPhiDewar = 360.*CLHEP::deg;
567 G4double ZDewar[4] = { 0.0*CLHEP::mm,
572 G4double InnRadDewar[4] = { 0.0*CLHEP::mm,
579 G4double OutRadDewar[4] = {maxRadiusDewar,
586 G4Polycone* solidDewar =
new G4Polycone(
"Dewar_OUT",
597 G4LogicalVolume *logicDewar =
new G4LogicalVolume(solidDewar,SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"SToGS_Al"),
"Dewar_OUT");
598 Dewar_phys==
new G4PVPlacement(0,
599 G4ThreeVector(0,0,CapsuleLength+CF_OUT_HalfLength*2+0.001*CLHEP::mm),
607 G4VisAttributes *Dewar_VisAtt=
new G4VisAttributes(G4Colour(0.0,1.0,1.0));
608 logicDewar->SetVisAttributes(Dewar_VisAtt);
613 G4double minRadiusIntDewar = 0.*CLHEP::mm;
614 G4double maxRadiusIntDewar = 106.*CLHEP::mm;
615 G4double HalfLengthIntDewar = 181.*CLHEP::mm;
616 G4double startPhiIntDewar = 0.*CLHEP::deg;
617 G4double deltaPhiIntDewar = 360.*CLHEP::deg;
619 G4Tubs* IntDewar =
new G4Tubs(
"Int_Dewar",minRadiusIntDewar,maxRadiusIntDewar,
620 HalfLengthIntDewar,startPhiIntDewar,deltaPhiIntDewar);
622 G4LogicalVolume* logicIntDewar =
new G4LogicalVolume(IntDewar,SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"SToGS_Vacuum_Ge"),
"Int_Dewar");
623 IntDewar_phys==
new G4PVPlacement(0,
624 G4ThreeVector(0,0,HalfLengthDewar),
632 G4VisAttributes *IntDewar_VisAtt=
new G4VisAttributes(G4Colour( 1.0,0.0,1.0));
633 logicIntDewar->SetVisAttributes(IntDewar_VisAtt);
643 G4double zSides[3] = { 0.0*CLHEP::mm,
646 G4double rInnerBGO[3] = { CrystalEdgeOffset1 + CrystalEdgeOffset2 + CrystalToCapsuleLATERAL + Space,
647 CrystalEdgeOffset1 + CrystalEdgeOffset2 + CrystalToCapsuleLATERAL + Space ,
648 CrystalEdgeOffset1 + CrystalEdgeOffset2 + CrystalToCapsuleLATERAL + Space };
649 G4double rOuterBGO[3] = { CrystalEdgeOffset1 + CrystalEdgeOffset2 + CrystalToCapsuleLATERAL + Space+4.0*CLHEP::mm,
650 CrystalEdgeOffset1 + CrystalEdgeOffset2 + CrystalToCapsuleLATERAL +BGOWidth,
651 CrystalEdgeOffset1 + CrystalEdgeOffset2 + CrystalToCapsuleLATERAL + BGOWidth};
654 zSides[1] = BGOWidth / tan(CrystalEdgeAngle);
656 G4Polyhedra *bgo =
new G4Polyhedra(G4String(
"BGO"),
666 sprintf(sName,
"BGORear");
667 G4LogicalVolume *pBGO =
new G4LogicalVolume( bgo, SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"SToGS_BGO"), G4String(sName), 0, 0, 0 );
670 BGO_phys =
new G4PVPlacement(Cap_45deg,
671 G4ThreeVector(0.0*CLHEP::mm,0.0*CLHEP::mm,AlcapstoBGO),
679 G4VisAttributes *BGO_VisAtt=
new G4VisAttributes(G4Colour(0.0,0.0,1.0));
680 pBGO ->SetVisAttributes(BGO_VisAtt);
686 G4Tubs *hole_CsI=
new G4Tubs(G4String(
"ShapeCsI_hole"),
689 CsILength+0.3*CLHEP::mm,
693 G4Box *fullcsi=
new G4Box(G4String(
"FullCsIBack"),
694 CrystalEdgeOffset1 + CrystalEdgeOffset2 + CrystalToCapsuleLATERAL,
695 CrystalEdgeOffset1 + CrystalEdgeOffset2 + CrystalToCapsuleLATERAL,
699 G4SubtractionSolid *hole_cut_csi=
new G4SubtractionSolid (G4String(
"cut_csi"), fullcsi, hole_CsI, &rm,G4ThreeVector(0.,0.,0.));
701 sprintf(sName,
"CsIBack");
702 G4LogicalVolume *pCsIBack=
new G4LogicalVolume( hole_cut_csi, SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"SToGS_CsI"), G4String(sName), 0, 0, 0 );
704 CsIBack_phys =
new G4PVPlacement(0,
705 G4ThreeVector(0.,0.,CapsuleLength+CsILength/2),
712 G4VisAttributes *CsIBack_VisAtt=
new G4VisAttributes(G4Colour(1.0,0.0,1.0));
713 pCsIBack ->SetVisAttributes(CsIBack_VisAtt);
1569 G4double *xfront, G4double *yfront, G4double *xback, G4double *yback,
1571 G4double added_dilatation)
1573 G4String name = polycone->GetName(), tmp;
1575 const G4int nb_edges = 6; G4double lxfront[nb_edges], lyfront[nb_edges], lxback[nb_edges], lyback[nb_edges];
1577 if ( added_dilatation == 0.0 ) {
1578 for (G4int i = 0; i < nb_edges; i++) {
1579 lxfront[i] = xfront[i];
1580 lyfront[i] = yfront[i];
1581 lxback[i] = xback[i];
1582 lyback[i] = yback[i];
1587 for (G4int i = 0; i < nb_edges; i++) {
1588 D = std::sqrt( xfront[i]*xfront[i] + yfront[i]*yfront[i] );
1589 lxfront[i] = xfront[i] + added_dilatation*xfront[i]/D ;
1590 lyfront[i] = yfront[i] + added_dilatation*yfront[i]/D ;
1591 D = std::sqrt( xback[i]*xback[i] + yback[i]*yback[i] );
1592 lxback[i] = xback[i] + added_dilatation*xback[i]/D ;
1593 lyback[i] = yback[i] + added_dilatation*yback[i]/D ;
1597 G4double edge_length_x = 40*CLHEP::mm, edge_width_y = 10*CLHEP::mm, edge_depth_z = 1.2*zback/2.;
1600 G4VSolid *result = polycone;
1601 for (G4int i = 0; i < nb_edges; i++) {
1604 tmp = name; tmp +=
"_edge_";
1605 std::stringstream s1;
1609 G4Box *edge =
new G4Box(tmp,edge_length_x,edge_width_y,edge_depth_z);
1612 if ( i == nb_edges-1 ) {
1620 G4ThreeVector v_RotX_1((lxback[i]+lxback[inext])/2.-(lxfront[i]+lxfront[inext])/2.,
1621 (lyback[i]+lyback[inext])/2.-(lyfront[i]+lyfront[inext])/2.,zback);
1626 G4ThreeVector v_RotZ_0(lxfront[inext]+lxfront[i],lyfront[inext]+lyfront[i] , 0 );
1629 G4ThreeVector v_RotZ_1(lxfront[inext]-lxfront[i],lyfront[inext]-lyfront[i] , 0 );
1634 R.rotateX(v_RotX_1.theta());
1635 R.rotateZ(v_RotZ_1.phi());
1637 T.setX( (lxback[inext]+lxfront[i])/2. );
1638 T.setY( (lyback[inext]+lyfront[i])/2. );
1639 T.setZ( zback / 2. );
1641 G4ThreeVector offset( std::cos(v_RotZ_0.phi())*edge_width_y, std::sin(v_RotZ_0.phi())*edge_width_y , 0 );
1644 G4cout <<
"Building Edges " << tmp << G4endl;
1645 G4cout <<
" hexogone def @ 0 and " << zback
1646 <<
" " << lxfront[i] <<
" " << lyfront[i] <<
" " << lxback[i] <<
" " << lyback[i] << G4endl;
1647 G4cout <<
" RotX[theta] " << v_RotX_1.theta()/CLHEP::deg <<
" RotZ[phi] " << v_RotZ_1.phi()/CLHEP::deg << G4endl;
1648 G4cout <<
"Translation to bring to center " << T << G4endl;
1649 G4cout <<
"Additionnal offset due to edge width " << offset << G4endl;
1653 tmp = name; tmp +=
"_step_";
1654 std::stringstream s2;
1657 result =
new G4SubtractionSolid(tmp, result, edge, G4Transform3D(R,T) );
1882 G4VPhysicalVolume *theDetector = 0x0; G4bool do_caps =
true;
1883 G4String tmp, crystal_name =
"ARed", filename = geo_file;
1886 G4double px[6], py[6], pX[6], pY[6], pz[6], pZ[6];
1908 ifstream infil; infil.open(filename.data());
1909 if ( !infil.is_open() ) {
1910 G4cout <<
"[SToGS] *** Cannot open file " << filename.data() << endl;
1916 if ( detname.contains(
"Green") ) {
1917 crystal_name =
"BGreen";
1920 if ( detname.contains(
"Blue") ) {
1921 crystal_name =
"CBlue";
1924 if ( opt.contains(
"bare") )
1930 G4LogicalVolume *detlogicWorld;
1932 detWorld =
new G4Box(detname,10.*CLHEP::cm,10.*CLHEP::cm,25.*CLHEP::cm);
1934 new G4LogicalVolume(detWorld, SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"AIR"), detname, 0, 0, 0);
1935 detlogicWorld->SetVisAttributes(G4VisAttributes::Invisible);
1937 theDetector =
new G4PVPlacement(0,
1938 G4ThreeVector(0,0,0),
1946 int i1,i2,i3, nb_line = 0, nb_point = 0;
double x,y,z,X,Y,Z; std::string line;
1947 while( infil.good() ) {
1949 getline(infil,line);
1951 if ( line.size() < 2u )
1953 if ( line[0] ==
'#' )
1957 if(sscanf(line.data(),
"%d %d %d %lf %lf %lf %lf %lf %lf", &i1, &i2, &i3, &x, &y, &z, &X, &Y, &Z) != 9) {
1961 if(which_id != i1) {
1966 if(i2==0 && i3==0) {
1967 HoleR = x * CLHEP::mm;
1968 CylR = y * CLHEP::mm;
1969 CylL = z * CLHEP::mm;
1970 CylX = X * CLHEP::mm;
1971 CylY = Y * CLHEP::mm;
1972 CylZ = Z * CLHEP::mm;
1974 else if(i2==0 && i3==1) {
1975 HoleL = x * CLHEP::mm;
1976 ThickB = y * CLHEP::mm;
1977 ThickC = z * CLHEP::mm;
1978 CapS = X * CLHEP::mm;
1979 CapT = Y * CLHEP::mm;
1980 Tolerance = Z * CLHEP::mm;
1982 else if(i2==0 && i3==2) {
1989 px[i3] = x * CLHEP::mm;
1990 py[i3] = y * CLHEP::mm;
1991 pX[i3] = X * CLHEP::mm;
1992 pY[i3] = Y * CLHEP::mm;
1994 pz[i3] = z * CLHEP::mm;
1995 pZ[i3] = Z * CLHEP::mm;
2001 G4cout <<
" the file " << filename.data() <<
" has been read " << endl;
2004 G4RotationMatrix R; G4ThreeVector T; G4Transform3D Tr;
2008 G4double *zSliceGe =
new G4double[4];
2009 zSliceGe[0] = (0)*CLHEP::mm;
2010 zSliceGe[1] = (HoleL)*CLHEP::mm;
2011 zSliceGe[2] = (HoleL+0.1)*CLHEP::mm;
2012 zSliceGe[3] = (+CylL)*CLHEP::mm;
2014 G4double *InnRadGe =
new G4double[4];
2017 InnRadGe[2] = HoleR*CLHEP::mm;
2018 InnRadGe[3] = HoleR*CLHEP::mm;
2020 G4double *OutRadGe =
new G4double[4];
2021 OutRadGe[0] = CylR*CLHEP::mm;
2022 OutRadGe[1] = CylR*CLHEP::mm;
2023 OutRadGe[2] = CylR*CLHEP::mm;
2024 OutRadGe[3] = CylR*CLHEP::mm;
2028 G4Polycone *coax =
new G4Polycone(tmp, 0.*CLHEP::deg, 360.*CLHEP::deg, 4, zSliceGe, InnRadGe, OutRadGe ) ;
2031 tmp +=
"ShapeCrystal";
2032 G4VSolid *crystal = AGATAShaper(coax,px,py,pX,pY,CylL);
2033 crystal->SetName(tmp);
2037 G4LogicalVolume *crystal_logic =
2038 new G4LogicalVolume(crystal,
2039 SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"Ge"),tmp,0,0,0);
2040 G4VisAttributes *crystal_visatt =
new G4VisAttributes( G4Colour(ColX, ColY, ColZ,1) );
2041 crystal_logic->SetVisAttributes( crystal_visatt );
2045 G4LogicalVolume *capsule_logic = 0x0, *spacing_logic = 0x0;
2047 zSliceGe[0] = (0.0)*CLHEP::mm;
2048 zSliceGe[1] = (CylL + 2*CapS)*CLHEP::mm;
2053 OutRadGe[0] = (CylR + CapS)*CLHEP::mm;
2054 OutRadGe[1] = (CylR + CapS)*CLHEP::mm;
2057 tmp +=
"ShapeCoaxSpacing";
2058 G4Polycone *coax_spacing_shape =
new G4Polycone(tmp, 0.*CLHEP::deg, 360.*CLHEP::deg, 2, zSliceGe, InnRadGe, OutRadGe);
2061 tmp +=
"ShapeSpacing";
2062 G4VSolid *spacing = AGATAShaper(coax_spacing_shape,px,py,pX,pY,CylL,CapS);
2063 spacing->SetName(tmp);
2068 spacing_logic =
new G4LogicalVolume(spacing,
2069 SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"AIR"),tmp,0,0,0);
2070 G4VisAttributes *spacing_visatt =
new G4VisAttributes( G4Colour(1, 1, 1,0.5) );
2071 spacing_logic->SetVisAttributes( spacing_visatt );
2074 zSliceGe[0] = (0.0)*CLHEP::mm;
2075 zSliceGe[1] = (CylL + 2*(CapT + CapS))*CLHEP::mm;
2080 OutRadGe[0] = (CylR + CapT + CapS)*CLHEP::mm;
2081 OutRadGe[1] = (CylR + CapT + CapS)*CLHEP::mm;
2084 tmp +=
"ShapeCoaxEncapsulation";
2085 G4Polycone *coax_caps_shape =
new G4Polycone(tmp, 0.*CLHEP::deg, 360.*CLHEP::deg, 2, zSliceGe, InnRadGe, OutRadGe);
2088 tmp +=
"ShapeCapsule";
2089 G4VSolid *capsule = AGATAShaper(coax_caps_shape,px,py,pX,pY,CylL,(CapT+CapS));
2090 capsule->SetName(tmp);
2097 capsule_logic =
new G4LogicalVolume(capsule,
2098 SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"Al"),tmp,0,0,0);
2099 G4VisAttributes *capsule_visatt =
new G4VisAttributes( G4Colour(0.6, 0.6, 0.6, 0.75) );
2100 capsule_logic->SetVisAttributes( capsule_visatt );
2103 capsule_logic =
new G4LogicalVolume(capsule,
2104 SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"AIR"),tmp,0,0,0);
2105 G4VisAttributes *capsule_visatt =
new G4VisAttributes( G4Colour(1, 1, 1, 0.5) );
2106 capsule_logic->SetVisAttributes( capsule_visatt );
2110 if ( capsule_logic && spacing_logic ) {
2116 new G4PVPlacement(0,T,capsule_logic,tmp,detlogicWorld,
false,0);
2121 new G4PVPlacement(0,T,spacing_logic,tmp,capsule_logic,
false,-1);
2123 T.setZ( CapS + CapT );
2124 new G4PVPlacement(0,T,crystal_logic,crystal_name,spacing_logic,
false,0);
2132 G4VPhysicalVolume *theDetector = 0x0; std::vector < G4String > capsules(3);
2134 ifstream infil; infil.open(geo_file.data());
2135 if ( !infil.is_open() ) {
2136 G4cout <<
"[SToGS] *** Cannot open file " << geo_file.data()
2141 G4LogicalVolume *detlogicWorld;
2143 detWorld =
new G4Box(detname,30.*CLHEP::cm,30.*CLHEP::cm,50.*CLHEP::cm);
2145 new G4LogicalVolume(detWorld,
2146 SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"AIR"), detname, 0, 0, 0);
2147 detlogicWorld->SetVisAttributes(G4VisAttributes::Invisible);
2149 theDetector =
new G4PVPlacement(0,
2160 if ( opt.contains(
"bare") && !opt.contains(
"bare1") ) {
2161 capsules[0] =
"DetectorFactory/SemiConductors/Ge/AGATA-ARed_bare";
2162 capsules[1] =
"DetectorFactory/SemiConductors/Ge/AGATA-BGreen_bare";
2163 capsules[2] =
"DetectorFactory/SemiConductors/Ge/AGATA-CBlue_bare";
2167 capsules[0] =
"DetectorFactory/SemiConductors/Ge/AGATA-ARed";
2168 capsules[1] =
"DetectorFactory/SemiConductors/Ge/AGATA-BGreen";
2169 capsules[2] =
"DetectorFactory/SemiConductors/Ge/AGATA-CBlue";
2172 ReMap(Get(capsules[0]),0);
2173 ReMap(Get(capsules[1]),1);
2174 ReMap(Get(capsules[2]),2);
2176 G4int i1,i2,i3, which = 0; G4double x,y,z,ps, th, ph; std::string line;
2177 while( infil.good() ) {
2180 getline(infil,line);
2182 if ( line.size() < 2u )
2184 if ( line[0] ==
'#' )
2186 if(sscanf(line.data(),
"%d %d %d %lf %lf %lf %lf %lf %lf", &i1, &i2, &i3, &ps, &th, &ph, &x, &y, &z) != 9) {
2190 G4ThreeVector T;G4RotationMatrix R; R.set(0,0,0);
2193 T.setX(x*CLHEP::mm);
2194 T.setY(y*CLHEP::mm);
2195 T.setZ(z*CLHEP::mm);
2197 R.rotateZ(G4double(ps)*CLHEP::deg);
2198 R.rotateY(G4double(th)*CLHEP::deg);
2199 R.rotateZ(G4double(ph)*CLHEP::deg);
2201 G4Transform3D Tr(R,T);
2203 Set(capsules[which],theDetector,0,&T,&R);
2279 #include "SToGS_EUROBALL.icc"
2283 G4VPhysicalVolume *theDetector = 0x0; G4LogicalVolume *detlogicWorld; G4Box *detWorld;
2287 detWorld=
new G4Box(detname,10.*CLHEP::cm,10.*CLHEP::cm,1.*CLHEP::m);
2288 detlogicWorld=
new G4LogicalVolume(detWorld, SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"AIR"), detname, 0, 0, 0);
2290 detlogicWorld->SetVisAttributes(G4VisAttributes::Invisible);
2291 theDetector =
new G4PVPlacement(0,
2300 G4LogicalVolume *theCrystal = GetEUROBALL_TCrystal_LV();
2301 G4VisAttributes *visatt1 =
new G4VisAttributes( G4Colour(0.0, 1.0, 0.0, 1) );
2302 visatt1->SetVisibility(
true);
2303 theCrystal->SetVisAttributes( visatt1 );
2306 G4LogicalVolume *theBGO = GetEUROBALL_TBGO_LV();
2307 G4VisAttributes *visatt2 =
new G4VisAttributes( G4Colour(135./255, 233./255, 144./255, 0.8) );
2308 visatt2->SetVisibility(
true);
2309 theBGO->SetVisAttributes( visatt2 );
2316 new G4PVPlacement(0,T,theCrystal,
"Crystal",detlogicWorld,
false,0);
2320 T.setZ( -37.5*CLHEP::mm );
2321 new G4PVPlacement(0,T,theBGO,
"Shield",detlogicWorld,
false,1);
2323 if ( opt.contains(
"colli") ) {
2325 G4LogicalVolume *theCollimator = GetEUROBALL_TCOLLIMATOR_LV();
2326 G4VisAttributes *visatt3 =
new G4VisAttributes( G4Colour(239./255, 220./255, 18./255, 1) );
2327 visatt3->SetVisibility(
true);
2328 theCollimator->SetVisAttributes( visatt3 );
2332 T.setZ( -74.5*CLHEP::mm );
2333 new G4PVPlacement(0,T,theCollimator,
"Collimator",detlogicWorld,
false,-1);
2335 if ( !opt.contains(
"bare") ) {
2337 G4VisAttributes *visatt4 =
new G4VisAttributes( G4Colour(0.75, 0.75, 0.75, 0.7) );
2338 visatt4->SetVisibility(
true);
2340 G4LogicalVolume *theHousing1 = GetEUROBALL_TCAPSULECRYS_LV();
2341 theHousing1->SetVisAttributes( visatt4 );
2342 T.setZ( 0.5*CLHEP::mm );
2343 new G4PVPlacement(0,T,theHousing1,
"TCAPS",detlogicWorld,
false,-1);
2345 G4LogicalVolume *theHousing2 = GetEUROBALL_TCAPSULEINNERBGO_LV();
2346 theHousing2->SetVisAttributes( visatt4 );
2347 new G4PVPlacement(0,T,theHousing2,
"TBGOCAPSINNER",detlogicWorld,
false,-1);
2349 G4LogicalVolume *theHousing3 = GetEUROBALL_TCAPSULEOUTERBGO_LV();
2350 theHousing3->SetVisAttributes( visatt4 );
2351 T.setZ( -39.5*CLHEP::mm );
2352 new G4PVPlacement(0,T,theHousing3,
"TBGOCAPSOUTER",detlogicWorld,
false,-1);
2354 G4LogicalVolume *theHousing4 = GetEUROBALL_TCAPSULEBACK_LV();
2355 theHousing4->SetVisAttributes( visatt4 );
2356 T.setZ( 0.5*CLHEP::mm );
2357 new G4PVPlacement(0,T,theHousing4,
"TCAPSBACK",detlogicWorld,
false,-1);
2365 G4VPhysicalVolume *theDetector = 0x0; G4LogicalVolume *detlogicWorld; G4Box *detWorld;
2367 G4RotationMatrix Ra, Rb, Rc, Rd, RBGO;
2370 detWorld=
new G4Box(detname,20.*CLHEP::cm,20.*CLHEP::cm,1.*CLHEP::m);
2371 detlogicWorld=
new G4LogicalVolume(detWorld, SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"AIR"), detname, 0, 0, 0);
2373 detlogicWorld->SetVisAttributes(G4VisAttributes::Invisible);
2374 theDetector =
new G4PVPlacement(0,
2383 G4LogicalVolume *theCrystal = GetEUROBALL_QCrystal_LV();
2384 G4VisAttributes *visatt1 =
new G4VisAttributes( G4Colour(0.0, 0.0, 1.0, 1) );
2385 visatt1->SetVisibility(
true);
2386 theCrystal->SetVisAttributes( visatt1 );
2390 G4double crystal_offset = ClovCrystalRadiusOut-ClovCrystalCutOffset+ClovCrystalAdjacent/2;
2392 new G4PVPlacement(G4Transform3D(Ra,Ra(G4ThreeVector(crystal_offset,crystal_offset,0.))),
2393 theCrystal,
"a",detlogicWorld,
false,0);
2394 Rb.rotateZ(-90*CLHEP::deg);
2395 new G4PVPlacement(G4Transform3D(Rb,Rb(G4ThreeVector(crystal_offset,crystal_offset,0.))),
2396 theCrystal,
"b",detlogicWorld,
false,1);
2397 Rc.rotateZ(-180*CLHEP::deg);
2398 new G4PVPlacement(G4Transform3D(Rc,Rc(G4ThreeVector(crystal_offset,crystal_offset,0.))),
2399 theCrystal,
"c",detlogicWorld,
false,2);
2400 Rd.rotateZ(-270*CLHEP::deg);
2401 new G4PVPlacement(G4Transform3D(Rd,Rd(G4ThreeVector(crystal_offset,crystal_offset,0.))),
2402 theCrystal,
"d",detlogicWorld,
false,3);
2405 G4LogicalVolume *theBGO = GetEUROBALL_QBGO_LV();
2406 G4VisAttributes *visatt2 =
new G4VisAttributes( G4Colour(72./255, 61./255, 139./255, 0.8) );
2407 visatt2->SetVisibility(
true);
2408 theBGO->SetVisAttributes( visatt2 );
2412 T.setZ( -49.5*CLHEP::mm );
2413 RBGO.rotateZ(45.0*CLHEP::deg);
2414 new G4PVPlacement(G4Transform3D(RBGO,RBGO(T)),theBGO,
"Shield",detlogicWorld,
false,4);
2416 if ( opt.contains(
"colli") ) {
2418 G4LogicalVolume *theCollimator = GetEUROBALL_QCOLLIMATOR_LV();
2419 G4VisAttributes *visatt3 =
new G4VisAttributes( G4Colour(239./255, 220./255, 18./255, 1) );
2420 visatt3->SetVisibility(
true);
2421 theCollimator->SetVisAttributes( visatt3 );
2425 T.setZ( -91.5*CLHEP::mm );
2426 new G4PVPlacement(G4Transform3D(RBGO,RBGO(T)),theCollimator,
"Collimator",detlogicWorld,
false,-1);
2429 if ( !opt.contains(
"bare") ) {
2431 G4VisAttributes *visatt4 =
new G4VisAttributes( G4Colour(0.75, 0.75, 0.75, 0.7) );
2432 visatt4->SetVisibility(
true);
2434 G4LogicalVolume *theHousing0 = GetEUROBALL_QGECAN_LV();
2435 theHousing0->SetVisAttributes( visatt4 );
2436 T.setZ( -21.4*CLHEP::mm );
2437 new G4PVPlacement(G4Transform3D(RBGO,RBGO(T)),theHousing0,
"GeCan",detlogicWorld,
false,-1);
2439 G4LogicalVolume *theHousing1 = GetEUROBALL_QBGOCAN_LV();
2440 theHousing1->SetVisAttributes( visatt4 );
2441 T.setZ( -52.4*CLHEP::mm );
2442 new G4PVPlacement(G4Transform3D(RBGO,RBGO(T)),theHousing1,
"ShieldCanIn",detlogicWorld,
false,-1);
2444 G4LogicalVolume *theHousing2 = GetEUROBALL_QBGOCANOUT_LV();
2445 theHousing2->SetVisAttributes( visatt4 );
2446 T.setZ( -51.9*CLHEP::mm );
2447 new G4PVPlacement(G4Transform3D(RBGO,RBGO(T)),theHousing2,
"ShieldCanOut",detlogicWorld,
false,-1);
2456 G4VPhysicalVolume *theDetector = 0x0; G4LogicalVolume *detlogicWorld; G4Box *detWorld;
2458 G4RotationMatrix Ra, Rb, Rc, Rd, Re, Rf, Rg;
2461 detWorld=
new G4Box(detname,10.*CLHEP::cm,10.*CLHEP::cm,2.*CLHEP::m);
2462 detlogicWorld=
new G4LogicalVolume(detWorld, SToGS::MaterialConsultant::theConsultant()->FindOrBuildMaterial(
"AIR"), detname, 0, 0, 0);
2464 detlogicWorld->SetVisAttributes(G4VisAttributes::Invisible);
2465 theDetector =
new G4PVPlacement(0,
2474 G4LogicalVolume *theCrystal = GetEUROBALL_CCrystal_LV();
2475 G4VisAttributes *visatt1 =
new G4VisAttributes( G4Colour(220./255, 20./255, 60./255, 1) );
2476 visatt1->SetVisibility(
true);
2477 theCrystal->SetVisAttributes( visatt1 );
2482 Ra.rotateX(-AngleClus2Clus);
2484 T = Ra(G4ThreeVector(0,0,445.)) - G4ThreeVector(0,0,445.);
2485 new G4PVPlacement(G4Transform3D(Ra,T),
2486 theCrystal,
"a",detlogicWorld,
false,0);
2487 Rb.rotateX(-AngleClus2Clus);
2488 Rb.rotateZ(60.0*CLHEP::deg);
2489 T = Rb(G4ThreeVector(0,0,445.)) - G4ThreeVector(0,0,445.);
2490 new G4PVPlacement(G4Transform3D(Rb,T),
2491 theCrystal,
"b",detlogicWorld,
false,1);
2492 Rc.rotateX(-AngleClus2Clus);
2493 Rc.rotateZ(120.0*CLHEP::deg);
2494 T = Rc(G4ThreeVector(0,0,445.)) - G4ThreeVector(0,0,445.);
2495 new G4PVPlacement(G4Transform3D(Rc,T),
2496 theCrystal,
"c",detlogicWorld,
false,2);
2497 Rd.rotateX(-AngleClus2Clus);
2498 Rd.rotateZ(180.0*CLHEP::deg);
2499 T = Rd(G4ThreeVector(0,0,445.)) - G4ThreeVector(0,0,445.);
2500 new G4PVPlacement(G4Transform3D(Rd,T),
2501 theCrystal,
"d",detlogicWorld,
false,3);
2502 Re.rotateX(-AngleClus2Clus);
2503 Re.rotateZ(240.0*CLHEP::deg);
2504 T = Re(G4ThreeVector(0,0,445.)) - G4ThreeVector(0,0,445.);
2505 new G4PVPlacement(G4Transform3D(Re,T),
2506 theCrystal,
"e",detlogicWorld,
false,4);
2507 Rf.rotateX(-AngleClus2Clus);
2508 Rf.rotateZ(300.0*CLHEP::deg);
2509 T = Rf(G4ThreeVector(0,0,445.)) - G4ThreeVector(0,0,445.);
2510 new G4PVPlacement(G4Transform3D(Rf,T),
2511 theCrystal,
"f",detlogicWorld,
false,5);
2513 new G4PVPlacement(G4Transform3D(Rg,Rg(G4ThreeVector(0,0,0.))),
2514 theCrystal,
"g",detlogicWorld,
false,6);
2516 G4LogicalVolume *theBGO = GetEUROBALL_CBGO_LV();
2517 G4VisAttributes *visatt2 =
new G4VisAttributes( G4Colour(255./255, 127./255, 80./255, 0.8) );
2518 visatt2->SetVisibility(
true);
2519 theBGO->SetVisAttributes( visatt2 );
2523 T.setZ( -20.0*CLHEP::mm );
2524 new G4PVPlacement(0,T,theBGO,
"Shield",detlogicWorld,
false,7);
2532 if ( opt.contains(
"colli") ) {
2534 G4LogicalVolume *theCollimator = GetEUROBALL_CCOLLIMATOR_LV();
2535 G4VisAttributes *visatt3 =
new G4VisAttributes( G4Colour(239./255, 220./255, 18./255, 1) );
2536 visatt3->SetVisibility(
true);
2537 theCollimator->SetVisAttributes( visatt3 );
2541 T.setZ( -55*CLHEP::mm );
2542 new G4PVPlacement(0,T,theCollimator,
"Collimator",detlogicWorld,
false,-1);
2579 G4VPhysicalVolume *theDetector = 0x0; G4String detname;
2581 if ( name ==
"EXOCLOVER" ) {
2582 detname = GetDetName(
"EXOCLOVER",version_string);
2584 MakeEXOCLOVER(detname,version_string);
2595 if ( name.contains(
"AGATA") ) {
2596 if ( name.contains(
"ARed") || name.contains(
"BGreen") || name.contains(
"CBlue") ) {
2598 detname = GetDetName(name,version_string);
2600 MakeAGATACapsule(detname,version_string);
2603 if ( name ==
"ATC" ) {
2604 detname = GetDetName(name,version_string);
2606 MakeAGATACluster(detname,version_string);
2608 if ( name.contains(
"EURO-") ) {
2609 if ( name.contains(
"EURO-PI") ) {
2610 detname = GetDetName(name,version_string);
2612 MakeEURO_PI(detname,version_string);
2614 if ( name.contains(
"EURO-PII") ) {
2615 detname = GetDetName(name,version_string);
2617 MakeEURO_PII(detname,version_string);
2619 if ( name.contains(
"EURO-PIII") ) {
2620 detname = GetDetName(name,version_string);
2622 MakeEURO_PIII(detname,version_string);
2634 MakeInStore(
"EURO-PI",
"bare");
2636 MakeInStore(
"EURO-PI",
"");
2638 MakeInStore(
"EURO-PI",
"colli");
2640 MakeInStore(
"EURO-PII",
"bare");
2642 MakeInStore(
"EURO-PII",
"");
2644 MakeInStore(
"EURO-PII",
"colli");
2647 MakeInStore(
"EURO-PIII",
"");
2649 MakeInStore(
"EURO-PIII",
"colli");
2653 MakeInStore(
"EXOCLOVER",
"A-bare-GANIL");
2655 MakeInStore(
"EXOCLOVER",
"A-AC-GANIL");
2666 MakeInStore(
"AGATA-ARed",
"bare");
2668 MakeInStore(
"AGATA-BGreen",
"bare");
2670 MakeInStore(
"AGATA-CBlue",
"bare");
2672 MakeInStore(
"ATC",
"bare");
2676 MakeInStore(
"AGATA-ARed",
"");
2678 MakeInStore(
"AGATA-BGreen",
"");
2680 MakeInStore(
"AGATA-CBlue",
"");
2683 MakeInStore(
"ATC",
"");
G4VPhysicalVolume * MakeAGATACapsule(G4String which_capsule, G4String opt, G4String geo_file="DetectorFactory/SemiConductors/Ge/Builders/agata_capsule.geo")
From asolid file provided by AGATA, get a capsule.
G4VPhysicalVolume * MakeEURO_PII(G4String detname, G4String opt="")
void Clean()
clear factory i.e. in memory collections of physicals and assemblies
Base classe to build all Ge like detectors.
static DetectorFactory * theMainFactory()
to get the main factory
virtual G4VPhysicalVolume * Make(G4String, G4String)
Should be implemented in any sub factory. It built (C++) a detector and return it.
static G4int SetGCopyNb(G4int val)
static G4VSensitiveDetector * GetCopClusterSD(G4String name="/SToGS/SD/CopCluster")
to get a general SToGS Calorimeter. In Multi-threading mode, return a new instance otherwise a global...
G4VSolid * AGATAShaper(G4Polycone *polycone, G4double *xfront, G4double *yfront, G4double *xback, G4double *yback, G4double zback, G4double added_dilatation=0.0)
virtual void MakeStore()
build the default store i.e. all the Ge detectors.
G4VPhysicalVolume * MakeEURO_PI(G4String detname, G4String opt="")
static G4VSensitiveDetector * GetTrackerSD(G4String name="/SToGS/SD/Tracker")
to get a general SToGS tracker. In Multi-threading mode, return a new instance otherwise a global one...
G4VPhysicalVolume * MakeAGATACluster(G4String detname, G4String opt, G4String geo_file="DetectorFactory/SemiConductors/Ge/Builders/agata_cluster.geo")
from acluster file, provided by AGATA, get a triple cluter
G4VPhysicalVolume * MakeEXOCLOVER(G4String detname, G4String opt="")
A EXOGAM Clover.
G4VPhysicalVolume * MakeEURO_PIII(G4String detname, G4String opt="")