9#include <beast/he3tube/geometry/He3tubeCreator.h>
10#include <beast/he3tube/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>
21#include <G4UserLimits.hh>
25#include <G4VisAttributes.hh>
60 G4double abundance, density;
63 G4Isotope* iHe3 =
new G4Isotope(
"iHe3", z = 2, n = 3, a = 3.0160293 * CLHEP::g / CLHEP::mole);
64 G4Element* eHe3 =
new G4Element(
"eHe3", symbol =
"eHe3", ncomponents = 1);
65 eHe3->AddIsotope(iHe3, abundance = 100.);
66 G4Material* gHe3 =
new G4Material(
"gHe3", density = 0.00066 * CLHEP::g / CLHEP::cm3, ncomponents = 1);
67 gHe3->AddElement(eHe3, 1);
70 double stepSize = content.getLength(
"stepSize", 5 * CLHEP::um);
76 for (
const GearDir& activeParams : content.getNodes(
"Active")) {
79 G4double startAngle = 0.*CLHEP::deg;
80 G4double spanningAngle = 360.*CLHEP::deg;
81 G4Tubs* s_He3TUBE =
new G4Tubs(
"s_He3TUBE",
82 activeParams.getLength(
"tube_innerRadius")*CLHEP::cm,
83 activeParams.getLength(
"tube_outerRadius")*CLHEP::cm,
84 activeParams.getLength(
"tube_hz")*CLHEP::cm,
85 startAngle, spanningAngle);
87 string matTube = activeParams.getString(
"MaterialTube");
90 G4VisAttributes* l_He3TubeVisAtt =
new G4VisAttributes(G4Colour(0, 1.0, 1.0, 1.0));
91 l_He3TUBE->SetVisAttributes(l_He3TubeVisAtt);
94 G4ThreeVector He3TUBEpos = G4ThreeVector(
95 activeParams.getLength(
"x_he3tube") * CLHEP::cm,
96 activeParams.getLength(
"y_he3tube") * CLHEP::cm,
97 activeParams.getLength(
"z_he3tube") * CLHEP::cm
100 G4RotationMatrix* rot_he3tube =
new G4RotationMatrix();
101 rot_he3tube->rotateX(activeParams.getAngle(
"AngleX"));
102 rot_he3tube->rotateY(activeParams.getAngle(
"AngleY"));
103 rot_he3tube->rotateZ(activeParams.getAngle(
"AngleZ"));
107 new G4PVPlacement(rot_he3tube, He3TUBEpos, l_He3TUBE,
"p_He3TUBE", &topVolume,
false, 1);
109 B2INFO(
"HE3-tube-" << detID <<
" placed at: " << He3TUBEpos <<
" mm");
112 G4double EndcapinnerRadius = 0.;
113 G4Tubs* s_He3endcap =
new G4Tubs(
"s_He3endcap",
115 activeParams.getLength(
"tube_outerRadius")*CLHEP::cm,
116 activeParams.getLength(
"endcap_hz")*CLHEP::cm,
117 startAngle, spanningAngle);
121 l_He3endcap->SetVisAttributes(l_He3TubeVisAtt);
124 G4ThreeVector He3endcapposTop = G4ThreeVector(
125 activeParams.getLength(
"x_he3tube") * CLHEP::cm,
126 activeParams.getLength(
"y_he3tube") * CLHEP::cm,
127 activeParams.getLength(
"z_he3tube") * CLHEP::cm + activeParams.getLength(
"tube_hz") * CLHEP::cm +
128 activeParams.getLength(
"endcap_hz") * CLHEP::cm
131 G4ThreeVector He3endcapposBot = G4ThreeVector(
132 activeParams.getLength(
"x_he3tube") * CLHEP::cm,
133 activeParams.getLength(
"y_he3tube") * CLHEP::cm,
134 activeParams.getLength(
"z_he3tube") * CLHEP::cm - activeParams.getLength(
"tube_hz") * CLHEP::cm -
135 activeParams.getLength(
"endcap_hz") * CLHEP::cm
138 new G4PVPlacement(rot_he3tube, He3endcapposTop, l_He3endcap,
"p_He3endcapTop", &topVolume,
false, 1);
139 new G4PVPlacement(rot_he3tube, He3endcapposBot, l_He3endcap,
"p_He3endcapBot", &topVolume,
false, 1);
142 G4double GasinnerRadius = 0.;
143 G4Tubs* s_iHe3Gas =
new G4Tubs(
"s_iHe3Gas",
145 activeParams.getLength(
"tube_innerRadius")*CLHEP::cm,
146 activeParams.getLength(
"tube_hz")*CLHEP::cm,
147 startAngle, spanningAngle);
150 G4LogicalVolume* l_iHe3Gas =
new G4LogicalVolume(s_iHe3Gas, gHe3,
"l_iHe3Gas");
151 l_iHe3Gas->SetVisAttributes(l_He3TubeVisAtt);
153 new G4PVPlacement(rot_he3tube, He3TUBEpos, l_iHe3Gas,
"p_iHe3Gas", &topVolume,
false, 1);
156 G4Tubs* s_He3Gas =
new G4Tubs(
"s_He3Gas",
158 activeParams.getLength(
"gas_outerRadius")*CLHEP::cm,
159 activeParams.getLength(
"gas_hz")*CLHEP::cm,
160 startAngle, spanningAngle);
162 G4LogicalVolume* l_He3Gas =
new G4LogicalVolume(s_He3Gas, gHe3,
"l_He3Gas", 0,
m_sensitive);
163 l_He3Gas->SetVisAttributes(l_He3TubeVisAtt);
165 l_He3Gas->SetUserLimits(
new G4UserLimits(stepSize));
167 new G4PVPlacement(0, G4ThreeVector(0, 0, activeParams.getLength(
"SV_offset_inZ")*CLHEP::cm), l_He3Gas,
"p_He3Gas", l_iHe3Gas,
false,
169 B2INFO(
"HE3-tube-Sensitive-Volume-" << detID <<
" placed at: (" << He3TUBEpos.getX() <<
"," << He3TUBEpos.getY() <<
"," <<
170 He3TUBEpos.getZ() + activeParams.getLength(
"SV_offset_inZ")*CLHEP::cm <<
") mm");
GearDir is the basic class used for accessing the parameter store.
static G4Material * get(const std::string &name)
Find given material.
virtual ~He3tubeCreator()
Destructor.
He3tubeCreator()
Constructor.
virtual void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type)
Creation of the detector geometry from Gearbox (XML).
SensitiveDetector * m_sensitive
SensitiveDetector He-3 tube.
Sensitive Detector implementation of the HE3TUBE detector.
GeometryTypes
Flag indicating the type of geometry to be used.
geometry::CreatorFactory< He3tubeCreator > He3tubeFactory("HE3TUBECreator")
Creator creates the He-3 tube geometry.
Abstract base class for different kinds of events.
Very simple class to provide an easy way to register creators with the CreatorManager.