30 #include <Geant4/G4LogicalVolume.hh>
31 #include <Geant4/G4Material.hh>
32 #include <Geant4/G4PVPlacement.hh>
33 #include <Geant4/G4PhysicalConstants.hh>
34 #include <Geant4/G4String.hh>
35 #include <Geant4/G4SystemOfUnits.hh>
36 #include <Geant4/G4ThreeVector.hh>
37 #include <Geant4/G4Transform3D.hh>
38 #include <Geant4/G4Tubs.hh>
39 #include <Geant4/G4Types.hh>
40 #include <Geant4/G4UserLimits.hh>
53 const std::string &dnam,
66 std::cout <<
"PHG4SpacalDetector::Constructor - Fatal Error - invalid geometry object!" << std::endl;
128 std::cout <<
"PHG4SpacalDetector::Construct::" <<
GetName()
129 <<
" - Start. Print Geometry:" << std::endl;
135 std::cout <<
"PHG4SpacalDetector::Construct - ERROR - not yet support unsymmetric system. Let me know if you need it. - Jin" << std::endl;
141 std::cout <<
"PHG4SpacalDetector::Construct - ERROR - zmin >= zmax!" << std::endl;
146 G4Tubs *cylinder_solid =
new G4Tubs(G4String(
GetName()),
152 assert(cylinder_mat);
154 G4LogicalVolume *cylinder_logic =
new G4LogicalVolume(cylinder_solid, cylinder_mat,
GetName(), 0, 0, 0);
170 std::cout <<
"PHG4SpacalDetector::Construct::" <<
GetName()
171 <<
" - start constructing " <<
_geom->
get_sector_map().size() <<
" sectors in total. " << std::endl;
176 G4LogicalVolume *sec_logic = psec.first;
177 const G4Transform3D &sec_trans = psec.second;
181 const int sec = val.first;
182 const double rot = val.second;
184 G4Transform3D sec_place = G4RotateZ3D(rot) * sec_trans;
186 std::ostringstream
name;
187 name <<
GetName() <<
"_sec" << sec;
188 G4PVPlacement *calo_phys =
nullptr;
191 calo_phys =
new G4PVPlacement(0, G4ThreeVector(0, -(
_geom->
get_radius()) *
cm, 0), sec_logic,
192 G4String(name.str()), logicWorld,
false, sec,
197 calo_phys =
new G4PVPlacement(sec_place, sec_logic,
198 G4String(name.str()), cylinder_logic,
false, sec,
210 std::ostringstream geonode;
226 geonode.str(),
"PHObject");
238 std::ostringstream geonode;
254 geonode.str(),
"PHObject");
266 std::cout <<
"PHG4SpacalDetector::Construct::" <<
GetName()
267 <<
" - Completed. Print Geometry:" << std::endl;
272 std::pair<G4LogicalVolume *, G4Transform3D>
275 G4Tubs *sec_solid =
new G4Tubs(G4String(
GetName() + std::string(
"_sec")),
280 assert(cylinder_mat);
282 G4LogicalVolume *sec_logic =
new G4LogicalVolume(sec_solid, cylinder_mat,
283 G4String(G4String(
GetName() + std::string(
"_sec"))), 0, 0,
nullptr);
288 G4LogicalVolume *fiber_logic =
Construct_Fiber(fiber_length, std::string(
""));
298 G4Transform3D fiber_place(G4RotateZ3D(rot) * G4TranslateZ3D(z) * G4TranslateX3D(
_geom->
get_half_radius() *
cm) * G4RotateY3D(halfpi));
300 std::ostringstream
name;
301 name <<
GetName() <<
"_fiber_" << fiber_count;
303 G4PVPlacement *fiber_physi =
new G4PVPlacement(fiber_place, fiber_logic,
304 G4String(name.str()), sec_logic,
false, fiber_count,
317 std::cout <<
"PHG4SpacalDetector::Construct_AzimuthalSeg::" <<
GetName()
318 <<
" - constructed " << fiber_count <<
" fibers" << std::endl;
323 <<
"fiber_length = " << fiber_length /
cm << std::endl;
325 <<
"z_step = " << z_step << std::endl;
330 <<
"_geom->get_azimuthal_distance() = "
337 return std::make_pair(sec_logic, G4Transform3D::Identity);
343 G4Tubs *fiber_solid =
new G4Tubs(G4String(
GetName() + std::string(
"_fiber") +
id),
349 G4LogicalVolume *fiber_logic =
new G4LogicalVolume(fiber_solid, clading_mat,
350 G4String(G4String(
GetName() + std::string(
"_fiber") +
id)), 0, 0,
357 G4Tubs *core_solid =
new G4Tubs(
358 G4String(
GetName() + std::string(
"_fiber_core") +
id), 0,
364 G4LogicalVolume *core_logic =
new G4LogicalVolume(core_solid, core_mat,
365 G4String(G4String(
GetName() + std::string(
"_fiber_core") +
id)), 0, 0,
373 G4PVPlacement *core_physi =
new G4PVPlacement(0, G4ThreeVector(), core_logic,
374 G4String(G4String(
GetName() + std::string(
"_fiber_core") +
id)), fiber_logic,
375 false, 0, overlapcheck_fiber);
383 std::cout <<
"PHG4SpacalDetector::Print::" <<
GetName() <<
" - Print Geometry:" << std::endl;