Belle II Software development
CaveCreator Class Reference

The creator for the CAVE geometry. More...

#include <CaveCreator.h>

Inheritance diagram for CaveCreator:
CreatorBase

Public Member Functions

 CaveCreator ()
 Constructor.
 
virtual ~CaveCreator ()
 Destructor.
 
virtual void create (const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type)
 Creation of the detector geometry from Gearbox (XML).
 
 BELLE2_DEFINE_EXCEPTION (DBNotImplemented, "Cannot create geometry from Database.")
 Exception that will be thrown in createFromDB if member is not yet implemented by creator.
 
virtual void createFromDB (const std::string &name, G4LogicalVolume &topVolume, GeometryTypes type)
 Function to create the geometry from the Database.
 
virtual void createPayloads (const GearDir &content, const IntervalOfValidity &iov)
 Function to create the geometry database.
 

Protected Attributes

SensitiveDetectorm_sensitive
 SensitiveDetector cave.
 

Detailed Description

The creator for the CAVE geometry.

Definition at line 27 of file CaveCreator.h.

Constructor & Destructor Documentation

◆ CaveCreator()

Constructor.

Definition at line 38 of file CaveCreator.cc.

38 : m_sensitive(0)
39 {
40 //m_sensitive = new SensitiveDetector();
41 }
SensitiveDetector * m_sensitive
SensitiveDetector cave.
Definition: CaveCreator.h:48

◆ ~CaveCreator()

~CaveCreator ( )
virtual

Destructor.

Definition at line 43 of file CaveCreator.cc.

44 {
45 if (m_sensitive) delete m_sensitive;
46 }

Member Function Documentation

◆ create()

void create ( const GearDir content,
G4LogicalVolume &  topVolume,
geometry::GeometryTypes  type 
)
virtual

Creation of the detector geometry from Gearbox (XML).

Parameters
[in]contentXML data directory.
[in]topVolumeGeant world volume.
[in]typeGeometry type.

Implements CreatorBase.

Definition at line 48 of file CaveCreator.cc.

49 {
50
52
53 G4double density;
54 G4double A;
55 G4int Z;
56
57 G4String name, symbol;
58
59 A = 1.01 * CLHEP::g / CLHEP::mole;
60 G4Element* elH = new G4Element(name = "Hydrogen", symbol = "H", Z = 1, A);
61
62 A = 12.01 * CLHEP::g / CLHEP::mole;
63 G4Element* elC = new G4Element(name = "Carbon", symbol = "C", Z = 6, A);
64
65 A = 16.00 * CLHEP::g / CLHEP::mole;
66 G4Element* elO = new G4Element(name = "Oxygen", symbol = "O", Z = 8, A);
67
68 A = 22.99 * CLHEP::g / CLHEP::mole;
69 G4Element* elNa = new G4Element(name = "Natrium", symbol = "Na", Z = 11, A);
70
71 A = 200.59 * CLHEP::g / CLHEP::mole;
72 G4Element* elHg = new G4Element(name = "Hg", symbol = "Hg", Z = 80, A);
73
74 A = 26.98 * CLHEP::g / CLHEP::mole;
75 G4Element* elAl = new G4Element(name = "Aluminium", symbol = "Al", Z = 13, A);
76
77 A = 28.09 * CLHEP::g / CLHEP::mole;
78 G4Element* elSi = new G4Element(name = "Silicon", symbol = "Si", Z = 14, A);
79
80 A = 39.1 * CLHEP::g / CLHEP::mole;
81 G4Element* elK = new G4Element(name = "K", symbol = "K", Z = 19, A);
82
83 A = 69.72 * CLHEP::g / CLHEP::mole;
84 G4Element* elCa = new G4Element(name = "Calzium", symbol = "Ca", Z = 31, A);
85
86 A = 55.85 * CLHEP::g / CLHEP::mole;
87 G4Element* elFe = new G4Element(name = "Iron", symbol = "Fe", Z = 26, A);
88
89 density = 2.03 * CLHEP::g / CLHEP::cm3;
90 G4Material* Concrete = new G4Material("Concrete", density, 10);
91 Concrete->AddElementByMassFraction(elH, 0.01);
92 Concrete->AddElementByMassFraction(elO, 0.529);
93 Concrete->AddElementByMassFraction(elNa, 0.016);
94 Concrete->AddElementByMassFraction(elHg, 0.002);
95 Concrete->AddElementByMassFraction(elAl, 0.034);
96 Concrete->AddElementByMassFraction(elSi, 0.337);
97 Concrete->AddElementByMassFraction(elK, 0.013);
98 Concrete->AddElementByMassFraction(elCa, 0.044);
99 Concrete->AddElementByMassFraction(elFe, 0.014);
100 Concrete->AddElementByMassFraction(elC, 0.001);
101
102
103 //lets get the stepsize parameter with a default value of 5 µm
104 double stepSize = content.getLength("stepSize", 5 * CLHEP::um);
105
106 //no get the array. Notice that the default framework unit is cm, so the
107 //values will be automatically converted
108 vector<double> bar = content.getArray("bar");
109 B2INFO("Contents of bar: ");
110 for (double value : bar) {
111 B2INFO("value: " << value);
112 }
113 int detID = 0;
114 //Lets loop over all the Active nodes
115 for (const GearDir& activeParams : content.getNodes("Active")) {
116
117 //create cave volume
118 G4Box* s_CAVE = new G4Box("s_CAVE",
119 activeParams.getLength("px")*CLHEP::cm,
120 activeParams.getLength("py")*CLHEP::cm,
121 activeParams.getLength("pz")*CLHEP::cm);
122
123 //G4LogicalVolume* l_CAVE = new G4LogicalVolume(s_CAVE, geometry::Materials::get("CAVE"), "l_CAVE", 0, m_sensitive);
124 G4LogicalVolume* l_CAVE = new G4LogicalVolume(s_CAVE, Concrete, "l_CAVE", 0, 0);
125
126 //Lets limit the Geant4 stepsize inside the volume
127 l_CAVE->SetUserLimits(new G4UserLimits(stepSize));
128
129 //position cave volume
130 G4ThreeVector CAVEpos = G4ThreeVector(
131 activeParams.getLength("x_cave") * CLHEP::cm,
132 activeParams.getLength("y_cave") * CLHEP::cm,
133 activeParams.getLength("z_cave") * CLHEP::cm
134 );
135
136 G4RotationMatrix* rot_cave = new G4RotationMatrix();
137 rot_cave->rotateX(activeParams.getLength("AngleX"));
138 rot_cave->rotateY(activeParams.getLength("AngleY"));
139 rot_cave->rotateZ(activeParams.getLength("AngleZ"));
140 //geometry::setColor(*l_CAVE, "#006699");
141 //double angle = activeParams.getDouble("angle");
142 //double rx = activeParams.getDouble("rx");
143 //double ry = activeParams.getDouble("ry");
144 //double rz = activeParams.getDouble("rz");
145 //rot_cave->rotate(-angle, G4ThreeVector(rx, ry, rz));
146 new G4PVPlacement(rot_cave, CAVEpos, l_CAVE, "p_CAVE", &topVolume, false, detID);
147
148 detID++;
149 }
150 }
VXD::SensitiveDetector< PXDSimHit, PXDTrueHit > SensitiveDetector
The PXD Sensitive Detector class.

◆ createFromDB()

void createFromDB ( const std::string &  name,
G4LogicalVolume &  topVolume,
GeometryTypes  type 
)
virtualinherited

Function to create the geometry from the Database.

Parameters
namename of the component in the database, could be used to disambiguate multiple components created with the same creator
topVolumeTop volume in which the geometry has to be placed
typeType of geometry to be build

Reimplemented in GeoMagneticField, GeoARICHCreator, BeamabortCreator, GeoCDCCreator, GeoCDCCreatorReducedCDC, GeoECLCreator, MyDBCreator, GeoBeamPipeCreator, GeoCryostatCreator, GeoFarBeamLineCreator, GeoBKLMCreator, GeoEKLMCreator, GeoKLMCreator, GeoPXDCreator, GeoCOILCreator, GeoServiceMaterialCreator, GeoSTRCreator, GeoSVDCreator, GeoTOPCreator, GeoHeavyMetalShieldCreator, and GeoVXDServiceCreator.

Definition at line 17 of file CreatorBase.cc.

18 {
19 //Do nothing but raise exception that we don't do anything
20 throw DBNotImplemented();
21 }

◆ createPayloads()

void createPayloads ( const GearDir content,
const IntervalOfValidity iov 
)
virtualinherited

Function to create the geometry database.

This function should be implemented to convert Gearbox parameters to one or more database payloads

Parameters
contentGearDir pointing to the parameters which should be used for construction
iovinterval of validity to use when generating payloads

Reimplemented in GeoARICHCreator, BeamabortCreator, GeoCDCCreator, GeoCDCCreatorReducedCDC, GeoECLCreator, GeoMagneticField, MyDBCreator, GeoBeamPipeCreator, GeoCryostatCreator, GeoFarBeamLineCreator, GeoBKLMCreator, GeoEKLMCreator, GeoKLMCreator, GeoPXDCreator, GeoCOILCreator, GeoServiceMaterialCreator, GeoSTRCreator, GeoSVDCreator, GeoTOPCreator, GeoHeavyMetalShieldCreator, and GeoVXDServiceCreator.

Definition at line 24 of file CreatorBase.cc.

24{}

Member Data Documentation

◆ m_sensitive

SensitiveDetector* m_sensitive
protected

SensitiveDetector cave.

Definition at line 48 of file CaveCreator.h.


The documentation for this class was generated from the following files: