11 #include <beast/srsensor/geometry/Fei4Creator.h>
12 #include <beast/srsensor/simulation/SensitiveDetector.h>
14 #include <geometry/Materials.h>
15 #include <geometry/CreatorFactory.h>
16 #include <framework/gearbox/GearDir.h>
17 #include <framework/logging/Logger.h>
19 #include <boost/format.hpp>
20 #include <boost/foreach.hpp>
21 #include <boost/algorithm/string.hpp>
23 #include <G4LogicalVolume.hh>
24 #include <G4PVPlacement.hh>
28 #include <G4UserLimits.hh>
31 using namespace boost;
44 geometry::CreatorFactory<Fei4Creator>
Fei4Factory(
"FEI4Creator");
46 Fei4Creator::Fei4Creator(): m_sensitive(0)
51 Fei4Creator::~Fei4Creator()
59 double stepSize = content.getLength(
"stepSize", 5 * CLHEP::um);
63 vector<double> bar_fei4 = content.getArray(
"bar_fei4");
64 B2INFO(
"Contents of bar_fei4: ");
65 BOOST_FOREACH(
double value, bar_fei4) {
66 B2INFO(
"value: " << value);
70 BOOST_FOREACH(
const GearDir & activeParams, content.getNodes(
"Active")) {
73 G4Box* s_FEI4 =
new G4Box(
"s_FEI4",
74 activeParams.
getLength(
"fei4_dx")*CLHEP::cm,
75 activeParams.
getLength(
"fei4_dy")*CLHEP::cm,
76 activeParams.
getLength(
"fei4_dz")*CLHEP::cm);
78 string matFEI4 = activeParams.
getString(
"MaterialFEI4");
82 l_FEI4->SetUserLimits(
new G4UserLimits(stepSize));
85 G4ThreeVector FEI4pos = G4ThreeVector(
86 activeParams.
getLength(
"x_fei4") * CLHEP::cm,
87 activeParams.
getLength(
"y_fei4") * CLHEP::cm,
88 activeParams.
getLength(
"z_fei4") * CLHEP::cm
91 G4RotationMatrix* rot_fei4 =
new G4RotationMatrix();
92 rot_fei4->rotateX(activeParams.
getAngle(
"AngleX"));
93 rot_fei4->rotateY(activeParams.
getAngle(
"AngleY"));
94 rot_fei4->rotateZ(activeParams.
getAngle(
"AngleZ"));
97 new G4PVPlacement(rot_fei4, FEI4pos, l_FEI4,
"p_FEI4", &topVolume,
false, fei4Nb);