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

The creator for the SDD geometry. More...

#include <SddCreator.h>

Inheritance diagram for SddCreator:
Collaboration diagram for SddCreator:

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

Detailed Description

The creator for the SDD geometry.

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

58  {
59  //lets get the stepsize parameter with a default value of 5 µm
60  double stepSize = content.getLength("stepSize", 5 * CLHEP::um);
61 
62  //no get the array. Notice that the default framework unit is cm, so the
63  //values will be automatically converted
64  vector<double> bar_sdd = content.getArray("bar_sdd");
65  B2INFO("Contents of bar_sdd: ");
66  BOOST_FOREACH(double value, bar_sdd) {
67  B2INFO("value: " << value);
68  }
69  int sddNb = 0;
70  //Lets loop over all the Active nodes
71  BOOST_FOREACH(const GearDir & activeParams, content.getNodes("Active")) {
72 
73  //create sdd volume
74  G4double startAngle = 0.*CLHEP::deg;
75  G4double spanningAngle = 360.*CLHEP::deg;
76  G4Tubs* s_SDD = new G4Tubs("s_SDD",
77  activeParams.getLength("sdd_innerRadius")*CLHEP::cm,
78  activeParams.getLength("sdd_outerRadius")*CLHEP::cm,
79  activeParams.getLength("sdd_hz")*CLHEP::cm,
80  startAngle, spanningAngle);
81 
82  string matSDD = activeParams.getString("MaterialSDD");
83  G4LogicalVolume* l_SDD = new G4LogicalVolume(s_SDD, geometry::Materials::get(matSDD), "l_SDD", 0, m_sensitive);
84 
85  //Lets limit the Geant4 stepsize inside the volume
86  l_SDD->SetUserLimits(new G4UserLimits(stepSize));
87 
88  //position sdd volume
89  G4ThreeVector SDDpos = G4ThreeVector(
90  activeParams.getLength("x_sdd") * CLHEP::cm,
91  activeParams.getLength("y_sdd") * CLHEP::cm,
92  activeParams.getLength("z_sdd") * CLHEP::cm
93  );
94 
95  G4RotationMatrix* rot_sdd = new G4RotationMatrix();
96  rot_sdd->rotateX(activeParams.getAngle("AngleX"));
97  rot_sdd->rotateY(activeParams.getAngle("AngleY"));
98  rot_sdd->rotateZ(activeParams.getAngle("AngleZ"));
99  //geometry::setColor(*l_SDD, "#006699");
100 
101  new G4PVPlacement(rot_sdd, SDDpos, l_SDD, "p_SDD", &topVolume, false, sddNb);
102 
103  sddNb++;
104  }
105  }

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