Belle II Software development
He3tubeCreator Class Reference

The creator for the HE3TUBE geometry. More...

#include <He3tubeCreator.h>

Inheritance diagram for He3tubeCreator:
CreatorBase

Public Member Functions

 He3tubeCreator ()
 Constructor.
 
virtual ~He3tubeCreator ()
 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 He-3 tube.
 

Detailed Description

The creator for the HE3TUBE geometry.

Definition at line 27 of file He3tubeCreator.h.

Constructor & Destructor Documentation

◆ He3tubeCreator()

Constructor.

Definition at line 48 of file He3tubeCreator.cc.

48 : m_sensitive(0)
49 {
50 //m_sensitive = new SensitiveDetector();
51 }
SensitiveDetector * m_sensitive
SensitiveDetector He-3 tube.

◆ ~He3tubeCreator()

~He3tubeCreator ( )
virtual

Destructor.

Definition at line 53 of file He3tubeCreator.cc.

54 {
55 if (m_sensitive) delete m_sensitive;
56 }

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 58 of file He3tubeCreator.cc.

59 {
60
62
63 G4String symbol;
64 G4double a, z, n;
65 G4double abundance, density;
66 G4int ncomponents;
67
68 G4Isotope* iHe3 = new G4Isotope("iHe3", z = 2, n = 3, a = 3.0160293 * CLHEP::g / CLHEP::mole);
69 G4Element* eHe3 = new G4Element("eHe3", symbol = "eHe3", ncomponents = 1);
70 eHe3->AddIsotope(iHe3, abundance = 100.);
71 G4Material* gHe3 = new G4Material("gHe3", density = 0.00066 * CLHEP::g / CLHEP::cm3, ncomponents = 1);
72 gHe3->AddElement(eHe3, 1);
73
74 //lets get the stepsize parameter with a default value of 5 µm
75 double stepSize = content.getLength("stepSize", 5 * CLHEP::um);
76
77 //no get the array. Notice that the default framework unit is cm, so the
78 //values will be automatically converted
79 int detID = 0;
80 //Lets loop over all the Active nodes
81 BOOST_FOREACH(const GearDir & activeParams, content.getNodes("Active")) {
82
83 //create he3tube
84 G4double startAngle = 0.*CLHEP::deg;
85 G4double spanningAngle = 360.*CLHEP::deg;
86 G4Tubs* s_He3TUBE = new G4Tubs("s_He3TUBE",
87 activeParams.getLength("tube_innerRadius")*CLHEP::cm,
88 activeParams.getLength("tube_outerRadius")*CLHEP::cm,
89 activeParams.getLength("tube_hz")*CLHEP::cm,
90 startAngle, spanningAngle);
91
92 string matTube = activeParams.getString("MaterialTube");
93 G4LogicalVolume* l_He3TUBE = new G4LogicalVolume(s_He3TUBE, geometry::Materials::get(matTube), "l_He3TUBE");
94
95 G4VisAttributes* l_He3TubeVisAtt = new G4VisAttributes(G4Colour(0, 1.0, 1.0, 1.0));
96 l_He3TUBE->SetVisAttributes(l_He3TubeVisAtt);
97
98 //position he3tube volume
99 G4ThreeVector He3TUBEpos = G4ThreeVector(
100 activeParams.getLength("x_he3tube") * CLHEP::cm,
101 activeParams.getLength("y_he3tube") * CLHEP::cm,
102 activeParams.getLength("z_he3tube") * CLHEP::cm
103 );
104
105 G4RotationMatrix* rot_he3tube = new G4RotationMatrix();
106 rot_he3tube->rotateX(activeParams.getAngle("AngleX"));
107 rot_he3tube->rotateY(activeParams.getAngle("AngleY"));
108 rot_he3tube->rotateZ(activeParams.getAngle("AngleZ"));
109
110 //geometry::setColor(*l_HE3TUBE, "#006699");
111
112 new G4PVPlacement(rot_he3tube, He3TUBEpos, l_He3TUBE, "p_He3TUBE", &topVolume, false, 1);
113
114 B2INFO("HE3-tube-" << detID << " placed at: " << He3TUBEpos << " mm");
115
116 //create endcaps
117 G4double EndcapinnerRadius = 0.;
118 G4Tubs* s_He3endcap = new G4Tubs("s_He3endcap",
119 EndcapinnerRadius,
120 activeParams.getLength("tube_outerRadius")*CLHEP::cm,
121 activeParams.getLength("endcap_hz")*CLHEP::cm,
122 startAngle, spanningAngle);
123
124 G4LogicalVolume* l_He3endcap = new G4LogicalVolume(s_He3endcap, geometry::Materials::get(matTube), "l_He3endcap");
125
126 l_He3endcap->SetVisAttributes(l_He3TubeVisAtt);
127
128 //position endcaps
129 G4ThreeVector He3endcapposTop = G4ThreeVector(
130 activeParams.getLength("x_he3tube") * CLHEP::cm,
131 activeParams.getLength("y_he3tube") * CLHEP::cm,
132 activeParams.getLength("z_he3tube") * CLHEP::cm + activeParams.getLength("tube_hz") * CLHEP::cm +
133 activeParams.getLength("endcap_hz") * CLHEP::cm
134 );
135
136 G4ThreeVector He3endcapposBot = G4ThreeVector(
137 activeParams.getLength("x_he3tube") * CLHEP::cm,
138 activeParams.getLength("y_he3tube") * CLHEP::cm,
139 activeParams.getLength("z_he3tube") * CLHEP::cm - activeParams.getLength("tube_hz") * CLHEP::cm -
140 activeParams.getLength("endcap_hz") * CLHEP::cm
141 );
142
143 new G4PVPlacement(rot_he3tube, He3endcapposTop, l_He3endcap, "p_He3endcapTop", &topVolume, false, 1);
144 new G4PVPlacement(rot_he3tube, He3endcapposBot, l_He3endcap, "p_He3endcapBot", &topVolume, false, 1);
145
146 //create he3 inactif gas
147 G4double GasinnerRadius = 0.;
148 G4Tubs* s_iHe3Gas = new G4Tubs("s_iHe3Gas",
149 GasinnerRadius,
150 activeParams.getLength("tube_innerRadius")*CLHEP::cm,
151 activeParams.getLength("tube_hz")*CLHEP::cm,
152 startAngle, spanningAngle);
153
154 //string matGas = activeParams.getString("MaterialGas");
155 G4LogicalVolume* l_iHe3Gas = new G4LogicalVolume(s_iHe3Gas, gHe3, "l_iHe3Gas");
156 l_iHe3Gas->SetVisAttributes(l_He3TubeVisAtt);
157
158 new G4PVPlacement(rot_he3tube, He3TUBEpos, l_iHe3Gas, "p_iHe3Gas", &topVolume, false, 1);
159
160 //create he3 actif gas
161 G4Tubs* s_He3Gas = new G4Tubs("s_He3Gas",
162 GasinnerRadius,
163 activeParams.getLength("gas_outerRadius")*CLHEP::cm,
164 activeParams.getLength("gas_hz")*CLHEP::cm,
165 startAngle, spanningAngle);
166
167 G4LogicalVolume* l_He3Gas = new G4LogicalVolume(s_He3Gas, gHe3, "l_He3Gas", 0, m_sensitive);
168 l_He3Gas->SetVisAttributes(l_He3TubeVisAtt);
169 //Lets limit the Geant4 stepsize inside the volume
170 l_He3Gas->SetUserLimits(new G4UserLimits(stepSize));
171
172 new G4PVPlacement(0, G4ThreeVector(0, 0, activeParams.getLength("SV_offset_inZ")*CLHEP::cm), l_He3Gas, "p_He3Gas", l_iHe3Gas, false,
173 detID);
174 B2INFO("HE3-tube-Sensitive-Volume-" << detID << " placed at: (" << He3TUBEpos.getX() << "," << He3TUBEpos.getY() << "," <<
175 He3TUBEpos.getZ() + activeParams.getLength("SV_offset_inZ")*CLHEP::cm << ") mm");
176 detID++;
177 }
178 }
static G4Material * get(const std::string &name)
Find given material.
Definition: Materials.h:63
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 ore 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 He-3 tube.

Definition at line 46 of file He3tubeCreator.h.


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