9#include <beast/claw/geometry/ClawCreator.h>
10#include <beast/claw/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 "G4SubtractionSolid.hh"
23#include <G4UserLimits.hh>
26#include <G4VisAttributes.hh>
59 double stepSize = content.getLength(
"stepSize", 5 * CLHEP::um);
61 G4VisAttributes* red =
new G4VisAttributes(G4Colour(1, 0, 0));
62 red->SetForceAuxEdgeVisible(
true);
63 G4VisAttributes* green =
new G4VisAttributes(G4Colour(0, 1, 0));
64 green->SetForceAuxEdgeVisible(
true);
65 G4VisAttributes* gray =
new G4VisAttributes(G4Colour(.5, .5, .5));
66 gray->SetForceAuxEdgeVisible(
true);
68 G4VisAttributes* coppercolor =
new G4VisAttributes(G4Colour(218. / 255., 138. / 255., 103. / 255.));
69 coppercolor->SetForceAuxEdgeVisible(
true);
73 for (
const GearDir& activeParams : content.getNodes(
"Active")) {
134 int Nscint = activeParams.getInt(
"Nscint");
135 G4double x = activeParams.getLength(
"x") * CLHEP::cm;
136 G4double y = activeParams.getLength(
"y") * CLHEP::cm;
137 G4double z = activeParams.getLength(
"z_claw") * CLHEP::cm;
145 G4double dx_board = activeParams.getLength(
"dx_board") / 2.*CLHEP::cm;
146 G4double dy_board = activeParams.getLength(
"dy_board") / 2.*CLHEP::cm;
147 G4double dz_board = activeParams.getLength(
"dz_board") / 2.*CLHEP::cm;
148 G4double dz_Culayer = activeParams.getLength(
"dz_Culayer") / 2.*CLHEP::cm;
149 G4double dx_scint = activeParams.getLength(
"dx_scint") / 2.*CLHEP::cm;
150 G4double dy_scint = activeParams.getLength(
"dy_scint") / 2.*CLHEP::cm;
151 G4double dz_scint = activeParams.getLength(
"dz_scint") / 2.*CLHEP::cm;
152 G4double Al_width = activeParams.getLength(
"Al_width") / 2.*CLHEP::cm;
153 G4double dx_Al = dx_scint + Al_width;
154 G4double dy_Al = dy_scint + Al_width;
155 G4double dz_Al = dz_scint + Al_width;
156 G4double dx_air = dx_Al;
157 G4double dy_air = dy_Al * Nscint;
158 G4double dz_air = dz_board + 2. * dz_Culayer + dz_Al;
163 G4Box* s_air =
new G4Box(
"s_air", dx_air, dy_air, dz_air);
168 G4Box* s_board =
new G4Box(
"s_board", dx_board, dy_board, dz_board);
170 l_board->SetVisAttributes(green);
172 G4double r_board = dz_air - 2. * dz_Culayer - dz_board;
175 G4Box* s_Culayer =
new G4Box(
"s_Culayer", dx_board, dy_board, dz_Culayer);
177 l_Culayer->SetVisAttributes(coppercolor);
179 G4double r_Culayer_bot = r_board - dz_board - dz_Culayer;
180 G4double r_Culayer_top = r_board + dz_board + dz_Culayer;
184 G4VSolid* s_scint =
new G4Box(
"s_scint", dx_scint, dy_scint, dz_scint);
185 G4VSolid* s_Al =
new G4Box(
"s_Al", dx_Al, dy_Al, dz_Al);
186 s_Al =
new G4SubtractionSolid(
"s_Al", s_Al, s_scint, 0, G4ThreeVector(0, 0, 0));
188 l_Al->SetVisAttributes(gray);
191 l_scint->SetVisAttributes(red);
193 l_scint->SetUserLimits(
new G4UserLimits(stepSize));
195 G4double r_Al = r_Culayer_bot - dz_Culayer - dz_Al;
197 double z_0 = -dy_air + dy_Al;
203 G4Transform3D transform = G4Translate3D(x, y, z);
204 new G4PVPlacement(transform, l_air,
"p_air", &topVolume,
false, 1);
205 new G4PVPlacement(0, G4ThreeVector(0, 0, r_board), l_board,
"p_board", l_air,
false, 1);
206 new G4PVPlacement(0, G4ThreeVector(0, 0, r_Culayer_bot), l_Culayer,
"p_Culayer_bot", l_air,
false, 1);
207 new G4PVPlacement(0, G4ThreeVector(0, 0, r_Culayer_top), l_Culayer,
"p_Culayer_top", l_air,
false, 1);
209 for (
int j = 0; j < Nscint; j++) {
210 double i_z = z_0 + j * 2. * dy_Al;
212 new G4PVPlacement(0, G4ThreeVector(0, i_z, r_Al), l_Al,
"p_Al", l_air,
false, 1);
213 new G4PVPlacement(0, G4ThreeVector(0, i_z, r_Al), l_scint,
"p_scint", l_air,
false, detID);
214 B2INFO(
"Phase1-CLAWS-" << detID <<
" placed at: " << transform.getTranslation() <<
" mm");
GearDir is the basic class used for accessing the parameter store.
virtual ~ClawCreator()
Destructor.
ClawCreator()
Constructor.
virtual void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type)
Creation of the detector geometry from Gearbox (XML).
SensitiveDetector * m_sensitive
SensitiveDetector CLAW.
Sensitive Detector implementation of the CLAW detector.
static G4Material * get(const std::string &name)
Find given material.
geometry::CreatorFactory< ClawCreator > ClawFactory("CLAWCreator")
Creator creates the CLAW 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.