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>
17#include <G4LogicalVolume.hh>
18#include <G4PVPlacement.hh>
21#include <G4UserLimits.hh>
55 double stepSize = content.getLength(
"stepSize", 5 * CLHEP::um);
59 vector<double> bar_sdd = content.getArray(
"bar_sdd");
60 B2INFO(
"Contents of bar_sdd: ");
61 for (
double value : bar_sdd) {
62 B2INFO(
"value: " << value);
66 for (
const GearDir& activeParams : content.getNodes(
"Active")) {
69 G4double startAngle = 0.*CLHEP::deg;
70 G4double spanningAngle = 360.*CLHEP::deg;
71 G4Tubs* s_SDD =
new G4Tubs(
"s_SDD",
72 activeParams.getLength(
"sdd_innerRadius")*CLHEP::cm,
73 activeParams.getLength(
"sdd_outerRadius")*CLHEP::cm,
74 activeParams.getLength(
"sdd_hz")*CLHEP::cm,
75 startAngle, spanningAngle);
77 string matSDD = activeParams.getString(
"MaterialSDD");
81 l_SDD->SetUserLimits(
new G4UserLimits(stepSize));
84 G4ThreeVector SDDpos = G4ThreeVector(
85 activeParams.getLength(
"x_sdd") * CLHEP::cm,
86 activeParams.getLength(
"y_sdd") * CLHEP::cm,
87 activeParams.getLength(
"z_sdd") * CLHEP::cm
90 G4RotationMatrix* rot_sdd =
new G4RotationMatrix();
91 rot_sdd->rotateX(activeParams.getAngle(
"AngleX"));
92 rot_sdd->rotateY(activeParams.getAngle(
"AngleY"));
93 rot_sdd->rotateZ(activeParams.getAngle(
"AngleZ"));
96 new G4PVPlacement(rot_sdd, SDDpos, l_SDD,
"p_SDD", &topVolume,
false, sddNb);
GearDir is the basic class used for accessing the parameter store.
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 indicating 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.