9#include <beast/srsensor/geometry/SddCreator.h>
10#include <beast/srsensor/simulation/SensitiveDetector.h>
12#include <geometry/Materials.h>
13#include <geometry/CreatorFactory.h>
14#include <framework/gearbox/GearDir.h>
15#include <framework/logging/Logger.h>
18#include <boost/format.hpp>
19#include <boost/foreach.hpp>
20#include <boost/algorithm/string.hpp>
22#include <G4LogicalVolume.hh>
23#include <G4PVPlacement.hh>
26#include <G4UserLimits.hh>
61 double stepSize = content.getLength(
"stepSize", 5 * CLHEP::um);
65 vector<double> bar_sdd = content.getArray(
"bar_sdd");
66 B2INFO(
"Contents of bar_sdd: ");
67 BOOST_FOREACH(
double value, bar_sdd) {
68 B2INFO(
"value: " << value);
72 BOOST_FOREACH(
const GearDir & activeParams, content.getNodes(
"Active")) {
75 G4double startAngle = 0.*CLHEP::deg;
76 G4double spanningAngle = 360.*CLHEP::deg;
77 G4Tubs* s_SDD =
new G4Tubs(
"s_SDD",
78 activeParams.
getLength(
"sdd_innerRadius")*CLHEP::cm,
79 activeParams.
getLength(
"sdd_outerRadius")*CLHEP::cm,
80 activeParams.
getLength(
"sdd_hz")*CLHEP::cm,
81 startAngle, spanningAngle);
83 string matSDD = activeParams.
getString(
"MaterialSDD");
87 l_SDD->SetUserLimits(
new G4UserLimits(stepSize));
90 G4ThreeVector SDDpos = G4ThreeVector(
91 activeParams.
getLength(
"x_sdd") * CLHEP::cm,
92 activeParams.
getLength(
"y_sdd") * CLHEP::cm,
93 activeParams.
getLength(
"z_sdd") * CLHEP::cm
96 G4RotationMatrix* rot_sdd =
new G4RotationMatrix();
97 rot_sdd->rotateX(activeParams.
getAngle(
"AngleX"));
98 rot_sdd->rotateY(activeParams.
getAngle(
"AngleY"));
99 rot_sdd->rotateZ(activeParams.
getAngle(
"AngleZ"));
102 new G4PVPlacement(rot_sdd, SDDpos, l_SDD,
"p_SDD", &topVolume,
false, sddNb);
GearDir is the basic class used for accessing the parameter store.
virtual std::string getString(const std::string &path="") const noexcept(false) override
Get the parameter path as a string.
double getAngle(const std::string &path="") const noexcept(false)
Get the parameter path as a double converted to the standard angle unit.
double getLength(const std::string &path="") const noexcept(false)
Get the parameter path as a double converted to the standard length unit.
static G4Material * get(const std::string &name)
Find given material.
virtual ~SddCreator()
Destructor.
virtual void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type)
Creation of the detector geometry from Gearbox (XML).
SensitiveDetector * m_sensitive
SensitiveDetector SDD.
Sensitive Detector implementation of the SRSENSOR detector.
GeometryTypes
Flag indiciating the type of geometry to be used.
geometry::CreatorFactory< SddCreator > SddFactory("SDDCreator")
Creator creates the SDD geometry.
Abstract base class for different kinds of events.
Very simple class to provide an easy way to register creators with the CreatorManager.