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

The creator for the SVD geometry of the Belle II detector. More...

#include <GeoSVDCreator.h>

Inheritance diagram for GeoSVDCreator:
Collaboration diagram for GeoSVDCreator:

Public Member Functions

 GeoSVDCreator ()
 Constructor of the GeoSVDCreator class.
 
virtual ~GeoSVDCreator ()
 The destructor of the GeoSVDCreator class.
 
virtual void create (const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type) override
 The old create member: create the configuration object(s) on the fly and call the geometry creation routine.
 
virtual void createPayloads (const GearDir &content, const IntervalOfValidity &iov) override
 Create the configuration objects and save them in the Database. More...
 
virtual void createFromDB (const std::string &name, G4LogicalVolume &topVolume, geometry::GeometryTypes type) override
 Create the geometry from the Database.
 
virtual VXD::GeoVXDAssembly createLayerSupport (int, const SVDGeometryPar &parameters)
 Create support structure for a SVD Layer. More...
 
virtual VXD::GeoVXDAssembly createLadderSupport (int, const SVDGeometryPar &parameters)
 Create support structure for a SVD Ladder. More...
 
virtual VXD::GeoVXDAssembly createHalfShellSupport (const SVDGeometryPar &parameters)
 Create support structure for SVD Half Shell, that means everything that does not depend on layer or sensor alignment. More...
 
virtual VXD::SensorInfoBasecreateSensorInfo (const VXDGeoSensorPar &sensor) override
 Read the sensor definitions from the database. More...
 
SVDSensorInfoParreadSensorInfo (const GearDir &sensor)
 Read the sensor definitions from gearbox. More...
 
virtual VXD::SensitiveDetectorBasecreateSensitiveDetector (VxdID sensorID, const VXDGeoSensor &sensor, const VXDGeoSensorPlacement &placement) override
 Return a SensitiveDetector implementation for a given sensor. More...
 
void readHalfShellSupport (const GearDir &support, SVDGeometryPar &svdGeometryPar)
 Create support structure for SVD Half Shell, that means everything that does not depend on layer or sensor alignment. More...
 
void readLayerSupport (int layer, const GearDir &support, SVDGeometryPar &svdGeometryPar)
 Create support structure for a SVD Layer. More...
 
void readLadderSupport (int layer, const GearDir &support, SVDGeometryPar &svdGeometryPar)
 Create support structure for a SVD Ladder. More...
 
virtual void setCurrentLayer (int layer, const VXDGeometryPar &parameters)
 Read parameters for given layer and store in m_ladder.
 
G4Transform3D placeLadder (int ladderID, double phi, G4LogicalVolume *volume, const G4Transform3D &placement, const VXDGeometryPar &parameters)
 Place ladder corresponding to the given ladder id into volume setLayer has to be called first to set the correct layer id.
 
G4Transform3D getPosition (const VXDGeoComponent &mother, const VXDGeoComponent &daughter, const VXDGeoPlacement &placement, bool originCenter)
 Return the position where a daughter component is to be placed. More...
 
G4Transform3D getAlignment (const VXDAlignmentPar &params)
 Get Alignment from paylead object. More...
 
GeoVXDAssembly createSubComponents (const std::string &name, VXDGeoComponent &component, std::vector< VXDGeoPlacement > placements, bool originCenter=true, bool allowOutside=false)
 Place a list of subcomponents into an component. More...
 
G4VSolid * createTrapezoidal (const std::string &name, double width, double width2, double length, double &height, double angle=0)
 Create a trapezoidal solid. More...
 
void createDiamonds (const VXDGeoRadiationSensorsPar &params, G4LogicalVolume &topVolume, G4LogicalVolume &envelopeVolume)
 Create diamond radiation sensors.
 
std::vector< VXDGeoPlacementPargetSubComponents (const GearDir &path)
 Return vector of VXDGeoPlacements with all the components defined inside a given path.
 
virtual void readLadder (int layer, GearDir components, VXDGeometryPar &geoparameters)
 Read parameters for a ladder in layer with given ID from gearbox and layer store them in payload.
 
virtual void readLadderComponents (int layerID, int ladderID, GearDir content, VXDGeometryPar &vxdGeometryPar)
 Read parameters for ladder components and their alignment corresponding to the given ladder id.
 
void readComponent (const std::string &name, GearDir components, VXDGeometryPar &vxdGeometryPar)
 Read parameters for component name from Gearbox into geometry payload. More...
 
void readSubComponents (const std::vector< VXDGeoPlacementPar > &placements, const GearDir &componentsDir, VXDGeometryPar &vxdGeometryPar)
 Read parameters for all components in placement container from Gearbox into payload. 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.
 

Protected Attributes

std::string m_prefix
 Prefix to prepend to all volume names.
 
GearDir m_alignment
 GearDir pointing to the alignment parameters.
 
GearDir m_components
 GearDir pointing to the toplevel of the components.
 
std::map< std::string, VXDGeoComponentm_componentCache
 Cache of all previously created components.
 
std::map< std::string, VXDGeoSensorm_sensorMap
 Map containing Information about all defined sensor types.
 
VXDGeoLadder m_ladder
 Parameters of the currently active ladder.
 
std::vector< Simulation::SensitiveDetectorBase * > m_sensitive
 List to all created sensitive detector instances.
 
GeoVXDRadiationSensors m_radiationsensors
 Diamond radiation sensor "sub creator".
 
std::string m_defaultMaterial
 Name of the Material to be used for Air.
 
float m_distanceTolerance {(float)(5 * Unit::um)}
 tolerance for Geant4 steps to be merged to a single step
 
float m_electronTolerance {100}
 tolerance for the energy deposition in electrons to be merged in a single step
 
float m_minimumElectrons {10}
 minimum number of electrons to be deposited by a particle to be saved
 
double m_activeStepSize {5 * Unit::um}
 Stepsize to be used inside active volumes.
 
bool m_activeChips {false}
 Make also chips sensitive.
 
bool m_seeNeutrons {false}
 Make sensitive detectors also see neutrons.
 
bool m_onlyPrimaryTrueHits {false}
 If true only create TrueHits from primary particles and ignore secondaries.
 
bool m_onlyActiveMaterial {false}
 If this is true, only active Materials will be placed for tracking studies. More...
 
std::vector< G4UserLimits * > m_UserLimits
 Vector of G4UserLimit pointers.
 
std::string m_currentHalfShell {""}
 Current half-shell being processed (need to know ladder parent for hierarchy)
 
std::map< std::string, Belle2::VxdIDm_halfShellVxdIDs
 Used for translation of half-shell name into a VxdID to consitently handle it in hierarchy. More...
 

Private Member Functions

SVDGeometryPar createConfiguration (const GearDir &param)
 Create a parameter object from the Gearbox XML parameters.
 
void createGeometry (const SVDGeometryPar &parameters, G4LogicalVolume &topVolume, geometry::GeometryTypes type)
 Create the geometry from a parameter object.
 

Private Attributes

std::vector< SensorInfo * > m_SensorInfo
 Vector of pointers to SensorInfo objects.
 

Detailed Description

The creator for the SVD geometry of the Belle II detector.


Definition at line 28 of file GeoSVDCreator.h.

Member Function Documentation

◆ createHalfShellSupport()

VXD::GeoVXDAssembly createHalfShellSupport ( const SVDGeometryPar parameters)
virtual

Create support structure for SVD Half Shell, that means everything that does not depend on layer or sensor alignment.

Parameters
parameters

Definition at line 635 of file GeoSVDCreator.cc.

636  {
637  VXD::GeoVXDAssembly supportAssembly;
638 
639  //Half shell support is easy as we just add all the defined RotationSolids
640  double minZ(0), maxZ(0);
641 
642  const std::vector<VXDRotationSolidPar>& RotationSolids = parameters.getRotationSolids();
643 
644  for (const VXDRotationSolidPar& component : RotationSolids) {
645 
646  string name = component.getName();
647  string material = component.getMaterial();
648 
649  G4Polycone* solid = geometry::createRotationSolid(name,
650  component.getInnerPoints(),
651  component.getOuterPoints(),
652  component.getMinPhi(),
653  component.getMaxPhi(),
654  minZ, maxZ
655  );
656 
657  G4LogicalVolume* volume = new G4LogicalVolume(
658  solid, geometry::Materials::get(material), m_prefix + ". " + name);
659  geometry::setColor(*volume, component.getColor());
660  supportAssembly.add(volume);
661  }
662  return supportAssembly;
663  }
std::string m_prefix
Prefix to prepend to all volume names.
static G4Material * get(const std::string &name)
Find given material.
Definition: Materials.h:63
G4Polycone * createRotationSolid(const std::string &name, const GearDir &params, double &minZ, double &maxZ)
Create a solid by roating two polylines around the Z-Axis.
Definition: utilities.cc:203
void setColor(G4LogicalVolume &volume, const std::string &color)
Set the color of a logical volume.
Definition: utilities.cc:100

◆ createLadderSupport()

VXD::GeoVXDAssembly createLadderSupport ( int  layer,
const SVDGeometryPar parameters 
)
virtual

Create support structure for a SVD Ladder.

Parameters
layerLayer ID to create the support
parameters

Definition at line 797 of file GeoSVDCreator.cc.

◆ createLayerSupport()

VXD::GeoVXDAssembly createLayerSupport ( int  layer,
const SVDGeometryPar parameters 
)
virtual

Create support structure for a SVD Layer.

Parameters
layerLayer ID to create the support
parameters

Definition at line 667 of file GeoSVDCreator.cc.

◆ createPayloads()

virtual void createPayloads ( const GearDir content,
const IntervalOfValidity iov 
)
inlineoverridevirtual

Create the configuration objects and save them in the Database.

If more than one object is needed adjust accordingly

Reimplemented from CreatorBase.

Definition at line 52 of file GeoSVDCreator.h.

53  {
54  DBImportObjPtr<SVDGeometryPar> importObj;
55  importObj.construct(createConfiguration(content));
56  importObj.import(iov);
57  }
SVDGeometryPar createConfiguration(const GearDir &param)
Create a parameter object from the Gearbox XML parameters.

◆ createSensitiveDetector()

VXD::SensitiveDetectorBase * createSensitiveDetector ( VxdID  sensorID,
const VXDGeoSensor sensor,
const VXDGeoSensorPlacement placement 
)
overridevirtual

Return a SensitiveDetector implementation for a given sensor.

Parameters
sensorIDSensorID for the sensor
sensorInformation about the sensor to create the Sensitive Detector for
placementInformation on how to place the sensor

Implements GeoVXDCreator.

Definition at line 136 of file GeoSVDCreator.cc.

◆ createSensorInfo()

VXD::SensorInfoBase * createSensorInfo ( const VXDGeoSensorPar sensor)
overridevirtual

Read the sensor definitions from the database.

Parameters
sensorReference to the database containing the parameters

Implements GeoVXDCreator.

Definition at line 59 of file GeoSVDCreator.cc.

◆ createSubComponents()

GeoVXDAssembly createSubComponents ( const std::string &  name,
VXDGeoComponent component,
std::vector< VXDGeoPlacement placements,
bool  originCenter = true,
bool  allowOutside = false 
)
inherited

Place a list of subcomponents into an component.

If the volume of the given component is NULL, a new container will be created to fit all subcomponents. It will have air as medium. If at least one subcomponent with this placement is found the whole component is wrapped in a container volume with Air medium which extends above and below to fit the subcomponents

Parameters
nameName for the potential new volume or as prefix for the container to extend the component
componentComponent to fit the subcomponents into
placementsPlacement information for all subcomponents
originCenterbool
allowOutsidebool
Returns
offset in w which was applied to the component when extending it

Definition at line 74 of file GeoVXDCreator.cc.

◆ createTrapezoidal()

G4VSolid * createTrapezoidal ( const std::string &  name,
double  width,
double  width2,
double  length,
double &  height,
double  angle = 0 
)
inherited

Create a trapezoidal solid.

Parameters
namename of the Geant4 solid
widthfull forward width of the shape in mm
width2full backward width of the shape in mm
lengthlength of the shape in mm
[in,out]heightof the shape in mm. If angle is not 0 this value might be changed if the actual height will be smaller due to the slanted edges
angleangle of the sides along w with respect to to the uv plane. 0 means normal box shaped, !=0 means the upper endcap of the solid will be smaller since all edges will be slanted by angle
Returns
A G4VShape which could be a G4Box, a G4Trd or a G4Trap depending on the parameters

Definition at line 254 of file GeoVXDCreator.cc.

◆ getAlignment()

G4Transform3D getAlignment ( const VXDAlignmentPar params)
inherited

Get Alignment from paylead object.

Parameters
paramsPayload object
Returns
Transformation matrix for component

Definition at line 172 of file GeoVXDCreator.cc.

◆ getPosition()

G4Transform3D getPosition ( const VXDGeoComponent mother,
const VXDGeoComponent daughter,
const VXDGeoPlacement placement,
bool  originCenter 
)
inherited

Return the position where a daughter component is to be placed.

Parameters
motherMother component
daughterDaughter component
placementVXDGeoPlacement
originCenterbool
Returns
Transformation matrix to place the daughter relative to the origin to the mother

Definition at line 179 of file GeoVXDCreator.cc.

◆ readComponent()

void readComponent ( const std::string &  name,
GearDir  components,
VXDGeometryPar vxdGeometryPar 
)
inherited

Read parameters for component name from Gearbox into geometry payload.

The name is assumed to be unique and Volumes are cached.

Parameters
nameName of the component
componentsPath to components
vxdGeometryParVXD geometry parameters

Definition at line 532 of file GeoVXDCreator.cc.

◆ readHalfShellSupport()

void readHalfShellSupport ( const GearDir support,
SVDGeometryPar svdGeometryPar 
)

Create support structure for SVD Half Shell, that means everything that does not depend on layer or sensor alignment.

Parameters
supportReference to the database containing the parameters
svdGeometryPar

Definition at line 509 of file GeoSVDCreator.cc.

◆ readLadderSupport()

void readLadderSupport ( int  layer,
const GearDir support,
SVDGeometryPar svdGeometryPar 
)

Create support structure for a SVD Ladder.

Parameters
layerLayer ID to create the support for
supportReference to the database containing the parameters
svdGeometryPar

Definition at line 581 of file GeoSVDCreator.cc.

◆ readLayerSupport()

void readLayerSupport ( int  layer,
const GearDir support,
SVDGeometryPar svdGeometryPar 
)

Create support structure for a SVD Layer.

Parameters
layerLayer ID to create the support for
supportReference to the database containing the parameters
svdGeometryPar

Definition at line 536 of file GeoSVDCreator.cc.

◆ readSensorInfo()

SVDSensorInfoPar * readSensorInfo ( const GearDir sensor)

Read the sensor definitions from gearbox.

Parameters
sensorReference to the database containing the parameters

Definition at line 96 of file GeoSVDCreator.cc.

◆ readSubComponents()

void readSubComponents ( const std::vector< VXDGeoPlacementPar > &  placements,
const GearDir componentsDir,
VXDGeometryPar vxdGeometryPar 
)
inherited

Read parameters for all components in placement container from Gearbox into payload.

Parameters
placementscontainer holding names of all components to be cached
componentsDirPath to Gearbox where parameters are to be found
vxdGeometryPar

Definition at line 523 of file GeoVXDCreator.cc.

Member Data Documentation

◆ m_halfShellVxdIDs

std::map<std::string, Belle2::VxdID> m_halfShellVxdIDs
protectedinherited
Initial value:
{
{{"PXD.Ying"}, {Belle2::VxdID(1, 0, 0, 1)}},
{{"PXD.Yang"}, {Belle2::VxdID(1, 0, 0, 2)}},
{{"SVD.Pat"}, {Belle2::VxdID(3, 0, 0, 1)}},
{{"SVD.Mat"}, {Belle2::VxdID(3, 0, 0, 2)}}
}
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33

Used for translation of half-shell name into a VxdID to consitently handle it in hierarchy.

Definition at line 222 of file GeoVXDCreator.h.

◆ m_onlyActiveMaterial

bool m_onlyActiveMaterial {false}
protectedinherited

If this is true, only active Materials will be placed for tracking studies.

Dead Material will be ignored

Definition at line 216 of file GeoVXDCreator.h.


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