9#include <beast/bgo/geometry/BgoCreator.h>
10#include <beast/bgo/simulation/SensitiveDetector.h>
12#include <geometry/CreatorFactory.h>
13#include <framework/gearbox/GearDir.h>
14#include <framework/logging/Logger.h>
16#include <G4LogicalVolume.hh>
17#include <G4PVPlacement.hh>
21#include <G4UserLimits.hh>
22#include "G4NistManager.hh"
55 G4NistManager* man = G4NistManager::Instance();
57 G4bool isotopes =
false;
59 G4Element* O = man->FindOrBuildElement(
"O", isotopes);
60 G4Element* Bi = man->FindOrBuildElement(
"Bi", isotopes);
61 G4Element* Ge = man->FindOrBuildElement(
"Ge", isotopes);
63 G4Material* BGO_BGO =
new G4Material(
"BGO_BGO",
64 7.13 * CLHEP::g / CLHEP::cm3,
66 BGO_BGO->AddElement(O, 12);
67 BGO_BGO->AddElement(Bi, 4);
68 BGO_BGO->AddElement(Ge, 3);
71 double stepSize = content.getLength(
"stepSize", 5 * CLHEP::um);
75 vector<double> bar = content.getArray(
"bar");
76 B2INFO(
"Contents of bar: ");
77 for (
double value : bar) {
78 B2INFO(
"value: " << value);
82 for (
const GearDir& activeParams : content.getNodes(
"Active")) {
85 G4Trap* s_BGO =
new G4Trap(
"s_BGO",
86 activeParams.getLength(
"cDz") / 2.*CLHEP::cm,
87 activeParams.getLength(
"cDtheta"),
88 activeParams.getLength(
"cDphi"),
89 activeParams.getLength(
"cDy1") / 2.*CLHEP::cm,
90 activeParams.getLength(
"cDx2") / 2.*CLHEP::cm,
91 activeParams.getLength(
"cDx1") / 2.*CLHEP::cm, 0,
92 activeParams.getLength(
"cDy2") / 2.*CLHEP::cm,
93 activeParams.getLength(
"cDx4") / 2.*CLHEP::cm,
94 activeParams.getLength(
"cDx3") / 2.*CLHEP::cm, 0);
97 G4LogicalVolume* l_BGO =
new G4LogicalVolume(s_BGO, BGO_BGO,
"l_BGO", 0,
m_sensitive);
103 l_BGO->SetUserLimits(
new G4UserLimits(stepSize));
117 double px = activeParams.getDouble(
"px");
118 double py = activeParams.getDouble(
"py");
119 double pz = activeParams.getDouble(
"pz");
120 double angle = activeParams.getDouble(
"angle");
121 double rx = activeParams.getDouble(
"rx");
122 double ry = activeParams.getDouble(
"ry");
123 double rz = activeParams.getDouble(
"rz");
125 G4RotationMatrix* pRot =
new G4RotationMatrix();
126 pRot->rotate(-angle, G4ThreeVector(rx, ry, rz));
128 new G4PVPlacement(pRot, G4ThreeVector(px, py, pz), l_BGO,
"p_BGO", &topVolume,
false, detID);
130 B2INFO(
"BGO-" << detID <<
" placed at: (" << px <<
"," << py <<
"," << pz <<
")" <<
" mm ");
132 B2INFO(
" rotation of " << -angle <<
" degree a long (" << rx <<
"," << ry <<
"," << rz <<
") axis");
GearDir is the basic class used for accessing the parameter store.
virtual ~BgoCreator()
Destructor.
virtual void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type)
Creation of the detector geometry from Gearbox (XML).
SensitiveDetector * m_sensitive
SensitiveDetector BGO.
Sensitive Detector implementation of the BGO detector.
geometry::CreatorFactory< BgoCreator > BgoFactory("BGOCreator")
Creator creates the BGO 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.