Belle II Software development
SddCreator Class Reference

The creator for the SDD geometry. More...

#include <SddCreator.h>

Inheritance diagram for SddCreator:
CreatorBase

Public Member Functions

 SddCreator ()
 Constructor.
 
virtual ~SddCreator ()
 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 SDD.
 

Detailed Description

The creator for the SDD geometry.

Definition at line 27 of file SddCreator.h.

Constructor & Destructor Documentation

◆ SddCreator()

Constructor.

Definition at line 45 of file SddCreator.cc.

45 : m_sensitive(0)
46 {
47 //m_sensitive = new SensitiveDetector();
48 }
SensitiveDetector * m_sensitive
SensitiveDetector SDD.
Definition: SddCreator.h:46

◆ ~SddCreator()

~SddCreator ( )
virtual

Destructor.

Definition at line 50 of file SddCreator.cc.

51 {
52 if (m_sensitive) delete m_sensitive;
53 }

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 55 of file SddCreator.cc.

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

Definition at line 46 of file SddCreator.h.


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