Belle II Software development
DiamondCreator Class Reference

The creator for the DIAMOND geometry. More...

#include <DiamondCreator.h>

Inheritance diagram for DiamondCreator:
CreatorBase

Public Member Functions

 DiamondCreator ()
 Constructor.
 
virtual ~DiamondCreator ()
 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 DIAMOND.
 

Detailed Description

The creator for the DIAMOND geometry.

Definition at line 27 of file DiamondCreator.h.

Constructor & Destructor Documentation

◆ DiamondCreator()

Constructor.

Definition at line 44 of file DiamondCreator.cc.

44 : m_sensitive(0)
45 {
46 //m_sensitive = new SensitiveDetector();
47 }
SensitiveDetector * m_sensitive
SensitiveDetector DIAMOND.

◆ ~DiamondCreator()

~DiamondCreator ( )
virtual

Destructor.

Definition at line 49 of file DiamondCreator.cc.

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

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 54 of file DiamondCreator.cc.

55 {
56
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_diamond = content.getArray("bar_diamond");
65 B2INFO("Contents of bar_diamond: ");
66 BOOST_FOREACH(double value, bar_diamond) {
67 B2INFO("value: " << value);
68 }
69 int diamondNb = 200;
70 //Lets loop over all the Active nodes
71 BOOST_FOREACH(const GearDir & activeParams, content.getNodes("Active")) {
72
73 //create diamond volume
74 G4Box* s_DIAMOND = new G4Box("s_DIAMOND",
75 activeParams.getLength("diamond_dx")*CLHEP::cm,
76 activeParams.getLength("diamond_dy")*CLHEP::cm,
77 activeParams.getLength("diamond_dz")*CLHEP::cm);
78
79 string matDIAMOND = activeParams.getString("MaterialDIAMOND");
80 G4LogicalVolume* l_DIAMOND = new G4LogicalVolume(s_DIAMOND, geometry::Materials::get(matDIAMOND), "l_DIAMOND", 0, m_sensitive);
81
82 //Lets limit the Geant4 stepsize inside the volume
83 l_DIAMOND->SetUserLimits(new G4UserLimits(stepSize));
84
85 //position diamond volume
86 G4ThreeVector DIAMONDpos = G4ThreeVector(
87 activeParams.getLength("x_diamond") * CLHEP::cm,
88 activeParams.getLength("y_diamond") * CLHEP::cm,
89 activeParams.getLength("z_diamond") * CLHEP::cm
90 );
91
92 G4RotationMatrix* rot_diamond = new G4RotationMatrix();
93 rot_diamond->rotateX(activeParams.getAngle("AngleX"));
94 rot_diamond->rotateY(activeParams.getAngle("AngleY"));
95 rot_diamond->rotateZ(activeParams.getAngle("AngleZ"));
96 //geometry::setColor(*l_DIAMOND, "#006699");
97
98 new G4PVPlacement(rot_diamond, DIAMONDpos, l_DIAMOND, "p_DIAMOND", &topVolume, false, diamondNb);
99
100 diamondNb++;
101 }
102
103 }
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 DIAMOND.

Definition at line 46 of file DiamondCreator.h.


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