Belle II Software development
BgoCreator Class Reference

The creator for the BGO geometry. More...

#include <BgoCreator.h>

Inheritance diagram for BgoCreator:
CreatorBase

Public Member Functions

 BgoCreator ()
 Constructor.
 
virtual ~BgoCreator ()
 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 BGO.
 

Detailed Description

The creator for the BGO geometry.

Definition at line 27 of file BgoCreator.h.

Constructor & Destructor Documentation

◆ BgoCreator()

Constructor.

Definition at line 39 of file BgoCreator.cc.

39 : m_sensitive(0)
40 {
41 //m_sensitive = new SensitiveDetector();
42 }
SensitiveDetector * m_sensitive
SensitiveDetector BGO.
Definition: BgoCreator.h:46

◆ ~BgoCreator()

~BgoCreator ( )
virtual

Destructor.

Definition at line 44 of file BgoCreator.cc.

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

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 49 of file BgoCreator.cc.

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

Definition at line 46 of file BgoCreator.h.


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