Belle II Software  release-05-02-19
He3tubeCreator Class Reference

The creator for the HE3TUBE geometry. More...

#include <He3tubeCreator.h>

Inheritance diagram for He3tubeCreator:
Collaboration diagram for He3tubeCreator:

Public Member Functions

virtual void create (const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type)
 Function to actually create the geometry, has to be overridden by derived classes. More...
 
 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. More...
 
virtual void createPayloads (const GearDir &content, const IntervalOfValidity &iov)
 Function to create the geometry database. More...
 

Protected Attributes

SensitiveDetectorm_sensitive
 SensitiveDetector He-3 tube.
 

Detailed Description

The creator for the HE3TUBE geometry.

Definition at line 29 of file He3tubeCreator.h.

Member Function Documentation

◆ create()

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

Function to actually create the geometry, has to be overridden by derived classes.

Parameters
contentGearDir pointing to the parameters which should be used for construction
topVolumeTop volume in which the geometry has to be placed
typeType of geometry to be build

Implements CreatorBase.

Definition at line 60 of file He3tubeCreator.cc.

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

◆ 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 GeoEKLMCreator, GeoFarBeamLineCreator, GeoCryostatCreator, MyDBCreator, GeoARICHCreator, GeoBeamPipeCreator, GeoServiceMaterialCreator, GeoBKLMCreator, GeoPXDCreator, GeoSVDCreator, GeoTOPCreator, GeoSTRCreator, GeoHeavyMetalShieldCreator, GeoCDCCreator, GeoCOILCreator, GeoVXDServiceCreator, GeoKLMCreator, GeoECLCreator, and GeoMagneticField.

Definition at line 27 of file CreatorBase.cc.

◆ 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 GeoEKLMCreator, GeoFarBeamLineCreator, GeoCryostatCreator, MyDBCreator, GeoARICHCreator, GeoTOPCreator, GeoCDCCreator, GeoBeamPipeCreator, GeoServiceMaterialCreator, GeoMagneticField, GeoBKLMCreator, GeoKLMCreator, GeoECLCreator, GeoPXDCreator, GeoSVDCreator, GeoSTRCreator, GeoCOILCreator, GeoHeavyMetalShieldCreator, and GeoVXDServiceCreator.

Definition at line 34 of file CreatorBase.cc.


The documentation for this class was generated from the following files:
Belle2::he3tube::He3tubeCreator::m_sensitive
SensitiveDetector * m_sensitive
SensitiveDetector He-3 tube.
Definition: He3tubeCreator.h:36
Belle2::geometry::Materials::get
static G4Material * get(const std::string &name)
Find given material.
Definition: Materials.h:65