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

The creator for the DOSI geometry. More...

#include <DosiCreator.h>

Inheritance diagram for DosiCreator:
Collaboration diagram for DosiCreator:

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

Detailed Description

The creator for the DOSI geometry.

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

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

◆ 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::dosi::DosiCreator::m_sensitive
SensitiveDetector * m_sensitive
SensitiveDetector DOSI.
Definition: DosiCreator.h:36
Belle2::geometry::Materials::get
static G4Material * get(const std::string &name)
Find given material.
Definition: Materials.h:65