6 #include <phparameter/PHParameters.h>
18 #include <Geant4/G4Box.hh>
19 #include <Geant4/G4LogicalVolume.hh>
20 #include <Geant4/G4Material.hh>
21 #include <Geant4/G4PVPlacement.hh>
22 #include <Geant4/G4PhysicalConstants.hh>
23 #include <Geant4/G4RotationMatrix.hh>
24 #include <Geant4/G4String.hh>
25 #include <Geant4/G4SubtractionSolid.hh>
26 #include <Geant4/G4SystemOfUnits.hh>
27 #include <Geant4/G4ThreeVector.hh>
28 #include <Geant4/G4Transform3D.hh>
29 #include <Geant4/G4Tubs.hh>
30 #include <Geant4/G4Types.hh>
31 #include <Geant4/G4VPhysicalVolume.hh>
46 , m_Params(parameters)
48 , m_Angle(M_PI_4 * radian)
50 , m_HPlate(400.0 *
mm)
51 , m_WPlate(100.0 *
mm)
52 , m_TAbsorber(5.0 *
mm)
53 , m_HAbsorber(150.0 *
mm)
54 , m_WAbsorber(100.0 *
mm)
56 , m_HFiber(400.0 *
mm)
57 , m_WFiber(100.0 *
mm)
58 , m_GFiber(0.0001 *
mm)
66 , m_PlaceHole(122.56 *
mm)
72 , m_ActiveFlag(m_Params->get_int_param(
"active"))
73 , m_AbsorberActiveFlag(m_Params->get_int_param(
"absorberactive"))
74 , m_SupportActiveFlag(m_Params->get_int_param(
"supportactive"))
76 , m_SuperDetector(
"NONE")
84 G4LogicalVolume* mylogvol = volume->GetLogicalVolume();
119 std::cout <<
"PHG4ZDCDetector: Begin Construction" << std::endl;
122 if (
m_Layer != PHG4ZDCDefs::NORTH &&
125 std::cout <<
"use either PHG4ZDCDefs::NORTH or PHG4ZDCDefs::SOUTH for ZDC Subsystem" << std::endl;
140 G4double RTT = 1. / sin(
m_Angle);
141 G4double First_Pos = -RTT * Det_Length / 2;
142 G4double Room = 3.5 *
mm;
145 G4VSolid* ExitWindow_nocut_solid =
new G4Tubs(G4String(
"ExitWindow_nocut_solid"),
148 G4VSolid* Hole_solid =
new G4Tubs(G4String(
"Hole_solid"),
150 G4VSolid* ExitWindow_1cut_solid =
new G4SubtractionSolid(
"ExitWindow_1cut_solid", ExitWindow_nocut_solid, Hole_solid, 0, G4ThreeVector(
m_PlaceHole, 0, 0));
152 G4VSolid* ExitWindow_2cut_solid =
new G4SubtractionSolid(
"ExitWindow_2cut_solid", ExitWindow_1cut_solid, Hole_solid, 0, G4ThreeVector(-
m_PlaceHole, 0, 0));
154 G4LogicalVolume* ExitWindow_log =
new G4LogicalVolume(ExitWindow_2cut_solid,
GetDetectorMaterial(
"G4_STAINLESS-STEEL"), G4String(
"ExitWindow_log"), 0, 0, 0);
158 G4RotationMatrix Window_rotm;
163 if (
m_Layer == PHG4ZDCDefs::NORTH)
166 ExitWindow_log,
"Window_North", logicWorld, 0, PHG4ZDCDefs::NORTH,
OverlapCheck());
169 else if (
m_Layer == PHG4ZDCDefs::SOUTH)
172 ExitWindow_log,
"Window_South", logicWorld, 0, PHG4ZDCDefs::SOUTH,
OverlapCheck());
179 G4double Mother_Z = Mother_2Z / 2. + Room;
180 G4VSolid* ZDC_envelope_solid =
new G4Box(G4String(
"ZDC_envelope_solid"),
185 G4LogicalVolume* ZDC_envelope_log =
new G4LogicalVolume(ZDC_envelope_solid, WorldMaterial, G4String(
"ZDC_envelope_log"), 0, 0, 0);
191 G4RotationMatrix ZDC_rotm;
197 G4VSolid* fiber_plate_solid =
new G4Box(G4String(
"fiber_plate_solid"),
202 G4LogicalVolume* fiber_plate_log =
new G4LogicalVolume(fiber_plate_solid, WorldMaterial, G4String(
"fiber_plate_log"), 0, 0, 0);
205 G4VSolid* fb_plate_solid =
new G4Box(G4String(
"fb_plate_solid"),
210 G4LogicalVolume* fb_plate_log =
new G4LogicalVolume(fb_plate_solid, Fe, G4String(
"fb_plate_log"), 0, 0, 0);
215 G4VSolid* absorber_solid =
new G4Box(G4String(
"absorber_solid"),
220 G4LogicalVolume* absorber_log =
new G4LogicalVolume(absorber_solid, W, G4String(
"absorber_log"), 0, 0, 0);
226 G4VSolid* SMD_solid =
new G4Box(G4String(
"SMD_solid"),
231 G4LogicalVolume* SMD_log =
new G4LogicalVolume(SMD_solid, WorldMaterial, G4String(
"SMD_log"), 0, 0, 0);
234 G4double scintx = 15 *
mm;
235 G4double scinty = 20 *
mm;
236 G4VSolid* Scint_solid =
new G4Box(G4String(
"Scint_solid"),
241 G4LogicalVolume* Scint_log =
new G4LogicalVolume(Scint_solid, Scint, G4String(
"Scint_log"), 0, 0, 0);
246 double scint_XPos = -
m_WSMD / 2.;
247 double scint_Xstep = scintx / 2.;
248 double scint_Ystep = scinty / 2.;
252 for (
int i = 0; i < Nx; i++)
254 scint_XPos += scint_Xstep;
255 double scint_YPos = -
m_HSMD / 2.;
256 for (
int j = 0; j < Ny; j++)
258 int copyno = Nx * j + i;
259 scint_YPos += scint_Ystep;
260 G4RotationMatrix SMDRotation;
261 new G4PVPlacement(G4Transform3D(SMDRotation, G4ThreeVector(scint_XPos, scint_YPos, 0.0)),
267 scint_YPos += scint_Ystep;
269 scint_XPos += scint_Xstep;
273 G4VSolid* single_fiber_solid =
new G4Tubs(G4String(
"single_fiber_solid"),
276 G4LogicalVolume* single_fiber_log =
new G4LogicalVolume(single_fiber_solid, PMMA, G4String(
"single_fiber_log"), 0, 0, 0);
281 G4RotationMatrix* FiberRotation =
new G4RotationMatrix();
282 FiberRotation->rotateX(90. * deg);
285 G4double fiber_XPos = -
m_WFiber / 2.;
286 G4double fiber_step =
m_DFiber / 2.;
289 for (
int i = 0; i < Nfiber; i++)
291 fiber_XPos += fiber_step;
294 new G4PVPlacement(FiberRotation, G4ThreeVector(fiber_XPos, 0.0, 0.0),
296 G4String(
"single_fiber_scint"),
299 fiber_XPos += fiber_step;
303 G4RotationMatrix* PlateRotation =
new G4RotationMatrix();
305 PlateRotation->rotateX(-
m_Angle);
308 G4double Plate_Step =
m_TPlate * RTT;
310 G4double Gap_Step = TGap * RTT;
311 G4double SMD_Step = m_TSMD * RTT;
312 G4double ZPos = First_Pos - Plate_Step / 2.;
323 int copyno_plate = 0;
324 for (
int i = 0; i <
m_NMod; i++)
329 ZPos += (SMD_Step / 2.);
330 new G4PVPlacement(PlateRotation, G4ThreeVector(0.0, SMD_YPos, SMD_ZPos + ZPos),
335 ZPos += (SMD_Step / 2.);
338 ZPos += (Plate_Step / 2.);
339 new G4PVPlacement(PlateRotation, G4ThreeVector(0.0, Plate_YPos, Plate_ZPos + ZPos),
341 G4String(
"front_plate"),
344 ZPos += (Plate_Step / 2.);
346 for (
int j = 0; j <
m_NLay; j++)
349 ZPos += (Absorber_Step / 2.);
350 new G4PVPlacement(PlateRotation, G4ThreeVector(0.0, 0.0, ZPos),
352 G4String(
"single_absorber"),
355 ZPos += (Absorber_Step / 2.);
358 ZPos += (Gap_Step / 2.);
359 int copyno = 27 * i + j;
360 std::string name_fiber_plate =
"Fiber_Plate_" +
std::to_string(copyno);
361 new G4PVPlacement(PlateRotation, G4ThreeVector(0.0, Gap_YPos, Gap_ZPos + ZPos),
366 ZPos += (Gap_Step / 2.);
369 ZPos += (Plate_Step / 2.);
370 new G4PVPlacement(PlateRotation, G4ThreeVector(0.0, Plate_YPos, Plate_ZPos + ZPos),
372 G4String(
"back_plate"),
376 ZPos += (Plate_Step / 2.);
381 if (
m_Layer == PHG4ZDCDefs::NORTH)
384 ZDC_envelope_log,
"ZDC_Envelope_North", logicWorld, 0, PHG4ZDCDefs::NORTH,
OverlapCheck());
386 else if (
m_Layer == PHG4ZDCDefs::SOUTH)
388 ZDC_rotm.rotateY(180 * deg);
390 ZDC_envelope_log,
"ZDC_Envelope_South", logicWorld, 0, PHG4ZDCDefs::SOUTH,
OverlapCheck());