Belle II Software development
DosiCreator Class Reference

The creator for the DOSI geometry. More...

#include <DosiCreator.h>

Inheritance diagram for DosiCreator:
CreatorBase

Public Member Functions

 DosiCreator ()
 Constructor.
 
virtual ~DosiCreator ()
 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 DOSI.
 

Detailed Description

The creator for the DOSI geometry.

Definition at line 27 of file DosiCreator.h.

Constructor & Destructor Documentation

◆ DosiCreator()

Constructor.

Definition at line 47 of file DosiCreator.cc.

47 : m_sensitive(0)
48 {
49 //m_sensitive = new SensitiveDetector();
50 }
SensitiveDetector * m_sensitive
SensitiveDetector DOSI.
Definition: DosiCreator.h:46

◆ ~DosiCreator()

~DosiCreator ( )
virtual

Destructor.

Definition at line 52 of file DosiCreator.cc.

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

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 57 of file DosiCreator.cc.

58 {
59
61
62 //lets get the stepsize parameter with a default value of 5 µm
63 double stepSize = content.getLength("stepSize", 5 * CLHEP::um);
64
65 G4VisAttributes* red = new G4VisAttributes(G4Colour(1, 0, 0));
66 red->SetForceAuxEdgeVisible(true);
67 G4VisAttributes* green = new G4VisAttributes(G4Colour(0, 1, 0));
68 green->SetForceAuxEdgeVisible(true);
69 G4VisAttributes* gray = new G4VisAttributes(G4Colour(.5, .5, .5));
70 gray->SetForceAuxEdgeVisible(true);
71 G4VisAttributes* coppercolor = new G4VisAttributes(G4Colour(218. / 255., 138. / 255., 103. / 255.));
72 coppercolor->SetForceAuxEdgeVisible(true);
73
74 //Lets loop over all the Active nodes
75 BOOST_FOREACH(const GearDir & activeParams, content.getNodes("Active")) {
76 G4double dx_dosi = activeParams.getLength("dx_dosi") / 2.*CLHEP::cm;
77 G4double dy_dosi = activeParams.getLength("dy_dosi") / 2.*CLHEP::cm;
78 G4double dz_dosi = activeParams.getLength("dz_dosi") / 2.*CLHEP::cm;
79 double thetaZ = activeParams.getAngle("ThetaZ");
80 G4VSolid* s_dosi = new G4Box("s_dosi", dx_dosi, dy_dosi, dz_dosi);
81 //G4LogicalVolume* l_dosi = new G4LogicalVolume(s_dosi, geometry::Materials::get("BGO"), "l_dosi", 0, m_sensitive);
82 G4LogicalVolume* l_dosi = new G4LogicalVolume(s_dosi, geometry::Materials::get("G4_SILICON_DIOXIDE"), "l_dosi", 0, m_sensitive);
83
84 l_dosi->SetVisAttributes(green);
85 //Lets limit the Geant4 stepsize inside the volume
86 l_dosi->SetUserLimits(new G4UserLimits(stepSize));
87 double z_pos[100];
88 double r_pos[100];
89 int dim = 0;
90 for (double z : activeParams.getArray("z", {0})) {
91 z *= CLHEP::cm;
92 z_pos[dim] = z;
93 dim++;
94 }
95 dim = 0;
96 for (double r : activeParams.getArray("r", {0})) {
97 r *= CLHEP::cm;
98 r_pos[dim] = r + dz_dosi;
99 dim++;
100 }
101
102 int detID = 0;
103 G4Transform3D transform;
104 for (double phi : activeParams.getArray("Phi", {M_PI / 2})) {
105 //phi *= CLHEP::deg;
106 for (int i = 0; i < dim; i++) {
107 transform = G4RotateZ3D(phi - M_PI / 2) * G4Translate3D(0, r_pos[i], z_pos[i]) * G4RotateX3D(-M_PI / 2 - thetaZ);
108 new G4PVPlacement(transform, l_dosi, TString::Format("p_dosi_%d", detID).Data(), &topVolume, false, detID);
109 detID++;
110 }
111 }
112 }
113 }
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 DOSI.

Definition at line 46 of file DosiCreator.h.


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