Belle II Software  release-05-01-25
BgoCreator Class Reference

The creator for the BGO geometry. More...

#include <BgoCreator.h>

Inheritance diagram for BgoCreator:
Collaboration diagram for BgoCreator:

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 BGO.
 

Detailed Description

The creator for the BGO geometry.

Definition at line 29 of file BgoCreator.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 56 of file BgoCreator.cc.

57  {
58  // **Materials from the NIST database**
59  G4NistManager* man = G4NistManager::Instance();
60 
61  G4bool isotopes = false;
62 
63  G4Element* O = man->FindOrBuildElement("O" , isotopes);
64  G4Element* Bi = man->FindOrBuildElement("Bi", isotopes);
65  G4Element* Ge = man->FindOrBuildElement("Ge", isotopes);
66 
67  G4Material* BGO_BGO = new G4Material("BGO_BGO",//name
68  7.13 * CLHEP::g / CLHEP::cm3, //density
69  3);//number of elements
70  BGO_BGO->AddElement(O, 12);
71  BGO_BGO->AddElement(Bi, 4);
72  BGO_BGO->AddElement(Ge, 3);
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  vector<double> bar = content.getArray("bar");
80  B2INFO("Contents of bar: ");
81  BOOST_FOREACH(double value, bar) {
82  B2INFO("value: " << value);
83  }
84  int detID = 0;
85  //Lets loop over all the Active nodes
86  BOOST_FOREACH(const GearDir & activeParams, content.getNodes("Active")) {
87 
88  //create bgo volume
89  G4Trap* s_BGO = new G4Trap("s_BGO",
90  activeParams.getLength("cDz") / 2.*CLHEP::cm ,
91  activeParams.getLength("cDtheta") ,
92  activeParams.getLength("cDphi") ,
93  activeParams.getLength("cDy1") / 2.*CLHEP::cm ,
94  activeParams.getLength("cDx2") / 2.*CLHEP::cm ,
95  activeParams.getLength("cDx1") / 2.*CLHEP::cm , 0,
96  activeParams.getLength("cDy2") / 2.*CLHEP::cm ,
97  activeParams.getLength("cDx4") / 2.*CLHEP::cm ,
98  activeParams.getLength("cDx3") / 2.*CLHEP::cm , 0);
99 
100  //G4LogicalVolume* l_BGO = new G4LogicalVolume(s_BGO, geometry::Materials::get("BGO"), "l_BGO", 0, m_sensitive);
101  G4LogicalVolume* l_BGO = new G4LogicalVolume(s_BGO, BGO_BGO, "l_BGO", 0, m_sensitive);
102 
103  //cout << "BGO volume " << s_BGO->GetCubicVolume() / CLHEP::cm / CLHEP::cm / CLHEP::cm
104  //<< " density " << geometry::Materials::get("BGO")->GetDensity() / CLHEP::g * CLHEP::cm * CLHEP::cm * CLHEP::cm << endl;
105 
106  //Lets limit the Geant4 stepsize inside the volume
107  l_BGO->SetUserLimits(new G4UserLimits(stepSize));
108 
109  //position bgo volume
110  /*
111  G4Transform3D theta_init = G4RotateX3D(- activeParams.getLength("cDtheta"));
112  G4Transform3D phi_init = G4RotateZ3D(activeParams.getLength("k_phi_init"));
113  G4Transform3D tilt_z = G4RotateY3D(activeParams.getLength("k_z_TILTED"));
114  G4Transform3D tilt_phi = G4RotateZ3D(activeParams.getLength("k_phi_TILTED"));
115  G4Transform3D position = G4Translate3D(activeParams.getLength("k_zC") * tan(activeParams.getLength("k_z_TILTED")) * CLHEP::cm, 0,
116  activeParams.getLength("k_zC") * CLHEP::cm);
117  G4Transform3D pos_phi = G4RotateZ3D(activeParams.getLength("k_phiC"));
118  G4Transform3D Tr = pos_phi * position * tilt_phi * tilt_z * phi_init * theta_init;
119  //cout << "rotation " << Tr.getRotation() << " translation " << Tr.getTranslation() << endl;
120  */
121  double px = activeParams.getDouble("px");
122  double py = activeParams.getDouble("py");
123  double pz = activeParams.getDouble("pz");
124  double angle = activeParams.getDouble("angle");
125  double rx = activeParams.getDouble("rx");
126  double ry = activeParams.getDouble("ry");
127  double rz = activeParams.getDouble("rz");
128 
129  G4RotationMatrix* pRot = new G4RotationMatrix();
130  pRot->rotate(-angle, G4ThreeVector(rx, ry, rz));
131  //G4Transform3D transform = G4Translate3D(px, py, pz) * G4Rotate3D(-angle, G4ThreeVector(rx, ry, rz));
132  new G4PVPlacement(pRot, G4ThreeVector(px, py, pz), l_BGO, "p_BGO", &topVolume, false, detID);
133  //new G4PVPlacement(transform, l_BGO, "p_BGO", &topVolume, false, detID);
134  B2INFO("BGO-" << detID << " placed at: (" << px << "," << py << "," << pz << ")" << " mm ");
135  //B2INFO("BGO-" << detID << " placed at: " << transform.getTranslation() << " mm ");
136  B2INFO(" rotation of " << -angle << " degree a long (" << rx << "," << ry << "," << rz << ") axis");
137  detID++;
138  }
139  }

◆ 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::bgo::BgoCreator::m_sensitive
SensitiveDetector * m_sensitive
SensitiveDetector BGO.
Definition: BgoCreator.h:36