5 #include <phparameter/PHParameters.h>
13 #include <Geant4/G4LogicalVolume.hh>
14 #include <Geant4/G4Material.hh>
15 #include <Geant4/G4NistManager.hh>
16 #include <Geant4/G4PVPlacement.hh>
17 #include <Geant4/G4Polyhedra.hh>
18 #include <Geant4/G4RotationMatrix.hh>
19 #include <Geant4/G4String.hh>
20 #include <Geant4/G4SystemOfUnits.hh>
21 #include <Geant4/G4ThreeVector.hh>
22 #include <Geant4/G4Tubs.hh>
23 #include <Geant4/G4Types.hh>
24 #include <Geant4/G4VPhysicalVolume.hh>
35 , m_ActiveFlag(m_Params->get_int_param(
"active"))
36 , m_SupportActiveFlag(m_Params->get_int_param(
"supportactive"))
76 G4double len_bbcd = z_bbcd[1] - z_bbcd[0];
100 G4double len_bbca = z_bbca[3] - z_bbca[0];
106 std::cout <<
"placement of BBCA failed" << std::endl;
113 const G4double rInner_bbcq[] = {0., 0.};
122 G4double len_bbcq = z_bbcq[1] - z_bbcq[0];
123 zpos += len_bbca * 0.5 + len_bbcq * 0.5;
128 std::cout <<
"placement of BBCQ failed" << std::endl;
135 G4Tubs *bbcp =
new G4Tubs(
"bbcp", rInner_bbcp, rOuter_bbcp, len_bbcp * 0.5, 0 *
deg, 360 *
deg);
142 zpos += len_bbcq * 0.5 + len_bbcp * 0.5;
147 std::cout <<
"placement of BBCP failed" << std::endl;
154 G4Tubs *bbcr =
new G4Tubs(
"bbcr", rInner_bbcr, rOuter_bbcr, len_bbcr * 0.5, 0 *
deg, 360 *
deg);
171 zpos += len_bbcp * 0.5 + len_bbcr * 0.5;
176 std::cout <<
"placement of BBCR failed" << std::endl;
181 const G4double rInner_bbch[] = {1.375 *
cm, 1.375 *
cm};
191 G4double len_bbch = z_bbch[1] - z_bbch[0];
192 zpos = z_bbcd[0] + 0.3 *
cm + len_bbch * 0.5;
197 std::cout <<
"placement of BBCH failed" << std::endl;
204 float TubeLoc[64][2] = {
254 { -2.45951, -12.78 },
257 { -4.91902, -11.36 },
274 const float tube_zpos =
m_bbcz + len_bbcd / 2.0 - len_bbca;
278 for (
int iarm = 0; iarm < 2; iarm++)
296 for (
int itube = 0; itube < NPMT; itube++)
299 float tube_xpos = xside * TubeLoc[itube][0] *
cm;
300 float tube_ypos = TubeLoc[itube][1] *
cm;
302 bbcd_lv,
"BBCD", logicWorld,
false, iarm * NPMT + itube,
OverlapCheck());
322 bbc_outer_shell_lv,
"BBC_OUTER_SHELL", logicWorld,
false, 0,
OverlapCheck());
324 bbc_inner_shell_lv,
"BBC_INNER_SHELL", logicWorld,
false, 0,
OverlapCheck());
328 bbc_outer_shell_lv,
"BBC_OUTER_SHELL", logicWorld,
false, 1,
OverlapCheck());
330 bbc_inner_shell_lv,
"BBC_INNER_SHELL", logicWorld,
false, 0,
OverlapCheck());
332 if (!outer_shell_vol[0] || !outer_shell_vol[1] || !inner_shell_vol[0] || !inner_shell_vol[1])
334 std::cout <<
"problem placing BBC Sheels" << std::endl;
347 bbc_plate_lv,
"BBC_FPLATE", logicWorld,
false, 0,
OverlapCheck());
349 bbc_plate_lv,
"BBC_BPLATE", logicWorld,
false, 0,
OverlapCheck());
353 bbc_plate_lv,
"BBC_FPLATE", logicWorld,
false, 1,
OverlapCheck());
355 bbc_plate_lv,
"BBC_BPLATE", logicWorld,
false, 0,
OverlapCheck());
361 G4Tubs *bbc_cablecond =
new G4Tubs(
"bbc_cablecond",0.,r_CableConductor,len_cable*0.5,0*
deg,360*
deg);
367 G4Tubs *bbc_cableshield =
new G4Tubs(
"bbc_cableshield",rIn_CableShield,rOut_CableShield,len_cable*0.5,0*
deg,360*
deg);
371 ypos = len_cable/2 + 5*
cm;
379 for (
int iarm=0; iarm<2; iarm++)
387 for (
int iring=1; iring<5; iring++)
389 float ring_radius = iring*0.67*
cm;
390 int ncables = 2*
M_PI*ring_radius/(0.635*
cm);
391 double dphi = 2*
M_PI/ncables;
396 for (
int ic=0; ic<ncables; ic++)
398 xpos = cos(dphi*ic)*ring_radius;
399 zpos = sin(dphi*ic)*ring_radius + zsign*(
m_bbcz + 30*
cm);
403 new G4PVPlacement(rot_cable,
G4ThreeVector(xpos, ypos, zpos), bbc_cableshield_lv,
"BBC_Cable_Shield", logicWorld,
false, icable++,
OverlapCheck());
409 if ( !fplate_vol[0] || !fplate_vol[1] || !bplate_vol[0] || !bplate_vol[1] )
411 std::cout <<
"problem placing BBC Sheets" << std::endl;
421 std::cout <<
"INSIDE BBC" << std::endl;
428 std::cout <<
"Bbc Detector:" << std::endl;
429 if (what ==
"ALL" || what ==
"VOLUME")
431 std::cout <<
"Version 0.1" << std::endl;