9#include <beast/srsensor/geometry/Fei4Creator.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 <boost/format.hpp>
18#include <boost/foreach.hpp>
19#include <boost/algorithm/string.hpp>
21#include <G4LogicalVolume.hh>
22#include <G4PVPlacement.hh>
26#include <G4UserLimits.hh>
60 double stepSize = content.getLength(
"stepSize", 5 * CLHEP::um);
64 vector<double> bar_fei4 = content.getArray(
"bar_fei4");
65 B2INFO(
"Contents of bar_fei4: ");
66 BOOST_FOREACH(
double value, bar_fei4) {
67 B2INFO(
"value: " << value);
71 BOOST_FOREACH(
const GearDir & activeParams, content.getNodes(
"Active")) {
74 G4Box* s_FEI4 =
new G4Box(
"s_FEI4",
75 activeParams.
getLength(
"fei4_dx")*CLHEP::cm,
76 activeParams.
getLength(
"fei4_dy")*CLHEP::cm,
77 activeParams.
getLength(
"fei4_dz")*CLHEP::cm);
79 string matFEI4 = activeParams.
getString(
"MaterialFEI4");
83 l_FEI4->SetUserLimits(
new G4UserLimits(stepSize));
86 G4ThreeVector FEI4pos = G4ThreeVector(
87 activeParams.
getLength(
"x_fei4") * CLHEP::cm,
88 activeParams.
getLength(
"y_fei4") * CLHEP::cm,
89 activeParams.
getLength(
"z_fei4") * CLHEP::cm
92 G4RotationMatrix* rot_fei4 =
new G4RotationMatrix();
93 rot_fei4->rotateX(activeParams.
getAngle(
"AngleX"));
94 rot_fei4->rotateY(activeParams.
getAngle(
"AngleY"));
95 rot_fei4->rotateZ(activeParams.
getAngle(
"AngleZ"));
98 new G4PVPlacement(rot_fei4, FEI4pos, l_FEI4,
"p_FEI4", &topVolume,
false, fei4Nb);
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.
Fei4Creator()
Constructor.
virtual void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type)
Creation of the detector geometry from Gearbox (XML).
virtual ~Fei4Creator()
Destructor.
SensitiveDetector * m_sensitive
SensitiveDetector FEI4.
Sensitive Detector implementation of the SRSENSOR detector.
GeometryTypes
Flag indiciating the type of geometry to be used.
geometry::CreatorFactory< Fei4Creator > Fei4Factory("FEI4Creator")
Creator creates the FEI4 geometry.
Abstract base class for different kinds of events.
Very simple class to provide an easy way to register creators with the CreatorManager.