9#include <beast/srsensor/geometry/DiamondCreator.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>
22#include <G4UserLimits.hh>
55 double stepSize = content.getLength(
"stepSize", 5 * CLHEP::um);
59 vector<double> bar_diamond = content.getArray(
"bar_diamond");
60 B2INFO(
"Contents of bar_diamond: ");
61 for (
double value : bar_diamond) {
62 B2INFO(
"value: " << value);
66 for (
const GearDir& activeParams : content.getNodes(
"Active")) {
69 G4Box* s_DIAMOND =
new G4Box(
"s_DIAMOND",
70 activeParams.getLength(
"diamond_dx")*CLHEP::cm,
71 activeParams.getLength(
"diamond_dy")*CLHEP::cm,
72 activeParams.getLength(
"diamond_dz")*CLHEP::cm);
74 string matDIAMOND = activeParams.getString(
"MaterialDIAMOND");
78 l_DIAMOND->SetUserLimits(
new G4UserLimits(stepSize));
81 G4ThreeVector DIAMONDpos = G4ThreeVector(
82 activeParams.getLength(
"x_diamond") * CLHEP::cm,
83 activeParams.getLength(
"y_diamond") * CLHEP::cm,
84 activeParams.getLength(
"z_diamond") * CLHEP::cm
87 G4RotationMatrix* rot_diamond =
new G4RotationMatrix();
88 rot_diamond->rotateX(activeParams.getAngle(
"AngleX"));
89 rot_diamond->rotateY(activeParams.getAngle(
"AngleY"));
90 rot_diamond->rotateZ(activeParams.getAngle(
"AngleZ"));
93 new G4PVPlacement(rot_diamond, DIAMONDpos, l_DIAMOND,
"p_DIAMOND", &topVolume,
false, diamondNb);
GearDir is the basic class used for accessing the parameter store.
static G4Material * get(const std::string &name)
Find given material.
DiamondCreator()
Constructor.
virtual void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type)
Creation of the detector geometry from Gearbox (XML).
virtual ~DiamondCreator()
Destructor.
SensitiveDetector * m_sensitive
SensitiveDetector DIAMOND.
Sensitive Detector implementation of the SRSENSOR detector.
GeometryTypes
Flag indicating the type of geometry to be used.
geometry::CreatorFactory< DiamondCreator > DiamondFactory("DIAMONDCreator")
Creator creates the DIAMOND geometry.
Abstract base class for different kinds of events.
Very simple class to provide an easy way to register creators with the CreatorManager.