Belle II Software  release-08-01-10
DiamondCreator Class Reference

The creator for the DIAMOND geometry. More...

#include <DiamondCreator.h>

Inheritance diagram for DiamondCreator:
Collaboration diagram for DiamondCreator:

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). 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 DIAMOND.
 

Detailed Description

The creator for the DIAMOND geometry.

Definition at line 27 of file DiamondCreator.h.

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
SensitiveDetector * m_sensitive
SensitiveDetector DIAMOND.
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 GeoVXDServiceCreator, GeoHeavyMetalShieldCreator, GeoTOPCreator, GeoSVDCreator, GeoSTRCreator, GeoServiceMaterialCreator, GeoCOILCreator, GeoPXDCreator, GeoKLMCreator, GeoEKLMCreator, GeoBKLMCreator, GeoFarBeamLineCreator, GeoCryostatCreator, GeoBeamPipeCreator, MyDBCreator, GeoECLCreator, GeoCDCCreatorReducedCDC, GeoCDCCreator, BeamabortCreator, GeoARICHCreator, and GeoMagneticField.

Definition at line 17 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 GeoVXDServiceCreator, GeoHeavyMetalShieldCreator, GeoTOPCreator, GeoSVDCreator, GeoSTRCreator, GeoServiceMaterialCreator, GeoCOILCreator, GeoPXDCreator, GeoKLMCreator, GeoEKLMCreator, GeoBKLMCreator, GeoFarBeamLineCreator, GeoCryostatCreator, GeoBeamPipeCreator, MyDBCreator, GeoMagneticField, GeoECLCreator, GeoCDCCreatorReducedCDC, GeoCDCCreator, BeamabortCreator, and GeoARICHCreator.

Definition at line 24 of file CreatorBase.cc.


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