10 #include <online_book/awesome/geometry/AWESOMEGeometryCreator.h>
13 #include <framework/gearbox/Unit.h>
14 #include <framework/logging/Logger.h>
15 #include <geometry/CreatorFactory.h>
16 #include <geometry/Materials.h>
17 #include <geometry/utilities.h>
21 #include <G4PVPlacement.hh>
22 #include <G4Transform3D.hh>
23 #include <G4UserLimits.hh>
26 using namespace Belle2::AWESOME;
29 geometry::CreatorFactory<AWESOMEGeometryCreator> AWESOMEFactory(
"AWESOMECreator");
32 m_sensitiveDetector{nullptr}
46 double stepSize = content.getLength(
"stepSize", 5 *
Unit::um);
49 B2INFO(
"Contents of bar:");
50 for (
double value : content.getArray(
"bar")) {
51 B2INFO(
LogVar(
"Value", value));
54 for (
const GearDir& activeParams : content.getNodes(
"Active")) {
57 G4Box* activeShape =
new G4Box(
"ActiveBox",
58 activeParams.getLength(
"width") /
Unit::mm / 2.0,
59 activeParams.getLength(
"length") /
Unit::mm / 2.0,
60 activeParams.getLength(
"height") /
Unit::mm / 2.0
62 std::string material = activeParams.getString(
"Material");
68 active->SetUserLimits(
new G4UserLimits(stepSize));
70 new G4PVPlacement(G4Translate3D(0, 0, activeParams.getLength(
"z") /
Unit::mm),
71 active,
"ActivePlacement", &topVolume,
false, 1);
void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes)
Create the AWESOME detector geometry in the world volume.
AWESOMESensitiveDetector * m_sensitiveDetector
The AWESOME sensitive detector.
virtual ~AWESOMEGeometryCreator()
Default destructor.
AWESOMEGeometryCreator()
Default constructor.
Sensitive Detector implementation of the AWESOME detector.
GearDir is the basic class used for accessing the parameter store.
static const double mm
[millimeters]
static const double um
[micrometers]
static G4Material * get(const std::string &name)
Find given material.
Class to store variables with their name which were sent to the logging service.
void setColor(G4LogicalVolume &volume, const std::string &color)
Set the color of a logical volume.
GeometryTypes
Flag indiciating the type of geometry to be used.
Abstract base class for different kinds of events.