Belle II Software light-2406-ragdoll
AWESOMEGeometryCreator Class Reference

The creator for the AWESOME detector geometry. More...

#include <AWESOMEGeometryCreator.h>

Inheritance diagram for AWESOMEGeometryCreator:
Collaboration diagram for AWESOMEGeometryCreator:

Public Member Functions

 AWESOMEGeometryCreator ()
 Default constructor.
 
 AWESOMEGeometryCreator (AWESOMEGeometryCreator &)=delete
 Copy constructor, deleted.
 
AWESOMEGeometryCreatoroperator= (AWESOMEGeometryCreator &)=delete
 Assignment operator, deleted.
 
virtual ~AWESOMEGeometryCreator ()
 Default destructor.
 
void create (const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes)
 Create the AWESOME detector geometry in the world volume.
 
 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.
 

Private Attributes

AWESOMESensitiveDetectorm_sensitiveDetector
 The AWESOME sensitive detector.
 

Detailed Description

The creator for the AWESOME detector geometry.

Definition at line 26 of file AWESOMEGeometryCreator.h.

Constructor & Destructor Documentation

◆ AWESOMEGeometryCreator()

Default constructor.

Definition at line 31 of file AWESOMEGeometryCreator.cc.

31 :
32 m_sensitiveDetector{nullptr}
33{
35}
AWESOMESensitiveDetector * m_sensitiveDetector
The AWESOME sensitive detector.
Sensitive Detector implementation of the AWESOME detector.

◆ ~AWESOMEGeometryCreator()

~AWESOMEGeometryCreator ( )
virtual

Default destructor.

Definition at line 37 of file AWESOMEGeometryCreator.cc.

38{
41}

Member Function Documentation

◆ create()

void create ( const GearDir content,
G4LogicalVolume &  topVolume,
geometry::GeometryTypes   
)
virtual

Create the AWESOME detector geometry in the world volume.

Parameters
contentGearbox path to the detector geometry.
topVolumeGeant4 world volume.

Implements CreatorBase.

Definition at line 43 of file AWESOMEGeometryCreator.cc.

44{
45 /* Let's get the stepsize parameter with a default value of 5 µm. */
46 double stepSize = content.getLength("stepSize", 5 * Unit::um);
47 /* Now get the array. Notice that the default framework unit is cm,
48 * so the values will be automatically converted. */
49 B2INFO("Contents of bar:");
50 for (double value : content.getArray("bar")) {
51 B2INFO(LogVar("Value", value));
52 }
53 /* Let's loop over all the Active nodes. */
54 for (const GearDir& activeParams : content.getNodes("Active")) {
55 /* Lets create a Box with dimensions taken from the parameters.
56 * WARNING: Geant4 is in mm so you have to convert the parameters. */
57 G4Box* activeShape = new G4Box("ActiveBox",
58 activeParams.getLength("width") / Unit::mm / 2.0,
59 activeParams.getLength("length") / Unit::mm / 2.0,
60 activeParams.getLength("height") / Unit::mm / 2.0
61 );
62 std::string material = activeParams.getString("Material");
63 G4LogicalVolume* active = new G4LogicalVolume(activeShape, geometry::Materials::get(material),
64 "ActiveVolume", 0, m_sensitiveDetector);
65 /* setColor is an utility function which allows to easily set the color for visualization. */
66 geometry::setColor(*active, "#006699");
67 /* Le's limit the Geant4 stepsize inside the volume. */
68 active->SetUserLimits(new G4UserLimits(stepSize));
69 /* And finally place the volume in the world one. */
70 new G4PVPlacement(G4Translate3D(0, 0, activeParams.getLength("z") / Unit::mm),
71 active, "ActivePlacement", &topVolume, false, 1);
72 }
73}
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:31
static const double mm
[millimeters]
Definition: Unit.h:70
static const double um
[micrometers]
Definition: Unit.h:71
static G4Material * get(const std::string &name)
Find given material.
Definition: Materials.h:63
Class to store variables with their name which were sent to the logging service.
void setColor(G4LogicalVolume &volume, const std::string &color)
Set the color of a logical volume.
Definition: utilities.cc:100

◆ 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, and MyDBCreator.

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 GeoMagneticField, and MyDBCreator.

Definition at line 24 of file CreatorBase.cc.

24{}

Member Data Documentation

◆ m_sensitiveDetector

AWESOMESensitiveDetector* m_sensitiveDetector
private

The AWESOME sensitive detector.

Definition at line 60 of file AWESOMEGeometryCreator.h.


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