11 #include <beast/srsensor/geometry/SddCreator.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>
20 #include <boost/format.hpp>
21 #include <boost/foreach.hpp>
22 #include <boost/algorithm/string.hpp>
24 #include <G4LogicalVolume.hh>
25 #include <G4PVPlacement.hh>
28 #include <G4UserLimits.hh>
32 using namespace boost;
45 geometry::CreatorFactory<SddCreator>
SddFactory(
"SDDCreator");
47 SddCreator::SddCreator(): m_sensitive(0)
52 SddCreator::~SddCreator()
60 double stepSize = content.getLength(
"stepSize", 5 * CLHEP::um);
64 vector<double> bar_sdd = content.getArray(
"bar_sdd");
65 B2INFO(
"Contents of bar_sdd: ");
66 BOOST_FOREACH(
double value, bar_sdd) {
67 B2INFO(
"value: " << value);
71 BOOST_FOREACH(
const GearDir & activeParams, content.getNodes(
"Active")) {
74 G4double startAngle = 0.*CLHEP::deg;
75 G4double spanningAngle = 360.*CLHEP::deg;
76 G4Tubs* s_SDD =
new G4Tubs(
"s_SDD",
77 activeParams.
getLength(
"sdd_innerRadius")*CLHEP::cm,
78 activeParams.
getLength(
"sdd_outerRadius")*CLHEP::cm,
79 activeParams.
getLength(
"sdd_hz")*CLHEP::cm,
80 startAngle, spanningAngle);
82 string matSDD = activeParams.
getString(
"MaterialSDD");
86 l_SDD->SetUserLimits(
new G4UserLimits(stepSize));
89 G4ThreeVector SDDpos = G4ThreeVector(
90 activeParams.
getLength(
"x_sdd") * CLHEP::cm,
91 activeParams.
getLength(
"y_sdd") * CLHEP::cm,
92 activeParams.
getLength(
"z_sdd") * CLHEP::cm
95 G4RotationMatrix* rot_sdd =
new G4RotationMatrix();
96 rot_sdd->rotateX(activeParams.
getAngle(
"AngleX"));
97 rot_sdd->rotateY(activeParams.
getAngle(
"AngleY"));
98 rot_sdd->rotateZ(activeParams.
getAngle(
"AngleZ"));
101 new G4PVPlacement(rot_sdd, SDDpos, l_SDD,
"p_SDD", &topVolume,
false, sddNb);