9#include <beast/cave/geometry/CaveCreator.h>
10#include <beast/cave/simulation/SensitiveDetector.h>
12#include <geometry/CreatorFactory.h>
13#include <framework/gearbox/GearDir.h>
14#include <framework/logging/Logger.h>
16#include <boost/format.hpp>
17#include <boost/foreach.hpp>
18#include <boost/algorithm/string.hpp>
20#include <G4LogicalVolume.hh>
21#include <G4PVPlacement.hh>
25#include <G4UserLimits.hh>
62 G4String name, symbol;
64 A = 1.01 * CLHEP::g / CLHEP::mole;
65 G4Element* elH =
new G4Element(name =
"Hydrogen", symbol =
"H", Z = 1, A);
67 A = 12.01 * CLHEP::g / CLHEP::mole;
68 G4Element* elC =
new G4Element(name =
"Carbon", symbol =
"C", Z = 6, A);
70 A = 16.00 * CLHEP::g / CLHEP::mole;
71 G4Element* elO =
new G4Element(name =
"Oxygen", symbol =
"O", Z = 8, A);
73 A = 22.99 * CLHEP::g / CLHEP::mole;
74 G4Element* elNa =
new G4Element(name =
"Natrium", symbol =
"Na", Z = 11, A);
76 A = 200.59 * CLHEP::g / CLHEP::mole;
77 G4Element* elHg =
new G4Element(name =
"Hg", symbol =
"Hg", Z = 80, A);
79 A = 26.98 * CLHEP::g / CLHEP::mole;
80 G4Element* elAl =
new G4Element(name =
"Aluminium", symbol =
"Al", Z = 13, A);
82 A = 28.09 * CLHEP::g / CLHEP::mole;
83 G4Element* elSi =
new G4Element(name =
"Silicon", symbol =
"Si", Z = 14, A);
85 A = 39.1 * CLHEP::g / CLHEP::mole;
86 G4Element* elK =
new G4Element(name =
"K", symbol =
"K", Z = 19, A);
88 A = 69.72 * CLHEP::g / CLHEP::mole;
89 G4Element* elCa =
new G4Element(name =
"Calzium", symbol =
"Ca", Z = 31, A);
91 A = 55.85 * CLHEP::g / CLHEP::mole;
92 G4Element* elFe =
new G4Element(name =
"Iron", symbol =
"Fe", Z = 26, A);
94 density = 2.03 * CLHEP::g / CLHEP::cm3;
95 G4Material* Concrete =
new G4Material(
"Concrete", density, 10);
96 Concrete->AddElementByMassFraction(elH, 0.01);
97 Concrete->AddElementByMassFraction(elO, 0.529);
98 Concrete->AddElementByMassFraction(elNa, 0.016);
99 Concrete->AddElementByMassFraction(elHg, 0.002);
100 Concrete->AddElementByMassFraction(elAl, 0.034);
101 Concrete->AddElementByMassFraction(elSi, 0.337);
102 Concrete->AddElementByMassFraction(elK, 0.013);
103 Concrete->AddElementByMassFraction(elCa, 0.044);
104 Concrete->AddElementByMassFraction(elFe, 0.014);
105 Concrete->AddElementByMassFraction(elC, 0.001);
109 double stepSize = content.getLength(
"stepSize", 5 * CLHEP::um);
113 vector<double> bar = content.getArray(
"bar");
114 B2INFO(
"Contents of bar: ");
115 BOOST_FOREACH(
double value, bar) {
116 B2INFO(
"value: " << value);
120 BOOST_FOREACH(
const GearDir & activeParams, content.getNodes(
"Active")) {
123 G4Box* s_CAVE =
new G4Box(
"s_CAVE",
129 G4LogicalVolume* l_CAVE =
new G4LogicalVolume(s_CAVE, Concrete,
"l_CAVE", 0, 0);
132 l_CAVE->SetUserLimits(
new G4UserLimits(stepSize));
135 G4ThreeVector CAVEpos = G4ThreeVector(
136 activeParams.
getLength(
"x_cave") * CLHEP::cm,
137 activeParams.
getLength(
"y_cave") * CLHEP::cm,
138 activeParams.
getLength(
"z_cave") * CLHEP::cm
141 G4RotationMatrix* rot_cave =
new G4RotationMatrix();
142 rot_cave->rotateX(activeParams.
getLength(
"AngleX"));
143 rot_cave->rotateY(activeParams.
getLength(
"AngleY"));
144 rot_cave->rotateZ(activeParams.
getLength(
"AngleZ"));
151 new G4PVPlacement(rot_cave, CAVEpos, l_CAVE,
"p_CAVE", &topVolume,
false, detID);
GearDir is the basic class used for accessing the parameter store.
virtual ~CaveCreator()
Destructor.
virtual void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type)
Creation of the detector geometry from Gearbox (XML).
CaveCreator()
Constructor.
SensitiveDetector * m_sensitive
SensitiveDetector cave.
Sensitive Detector implementation of the CAVE detector.
double getLength(const std::string &path="") const noexcept(false)
Get the parameter path as a double converted to the standard length unit.
geometry::CreatorFactory< CaveCreator > CaveFactory("CAVECreator")
Creator creates the cave geometry.
GeometryTypes
Flag indiciating the type of geometry to be used.
Abstract base class for different kinds of events.
Very simple class to provide an easy way to register creators with the CreatorManager.