Belle II Software development
|
Class to manage the creation and conversion of the geometry. More...
#include <GeometryManager.h>
Public Member Functions | |
G4VPhysicalVolume * | getTopVolume () |
Return a pointer to the top volume. | |
void | createGeometry (const GearDir ¶ms, GeometryTypes type=FullGeometry) |
Create Geometry. | |
void | createGeometry (const GeoConfiguration ¶ms, GeometryTypes type=FullGeometry, bool useDB=true) |
Create Geometry. | |
GeoConfiguration | createGeometryConfig (const GearDir &detectorDir, const IntervalOfValidity &iov) |
Create Geometry configuration object. | |
void | setDetectorComponents (const std::vector< std::string > &components) |
Set the names of the components to create. | |
void | setExcludedComponents (const std::vector< std::string > &components) |
Set the names of the components to exclude from creation. | |
void | setAdditionalComponents (const std::vector< std::string > &components) |
Set the names of addtional components to be added to the default set. | |
void | setDensityScaling (const std::map< std::string, double > &components) |
Set the density scaling: This is intended for systematic studies only and will scale the density of all materials for each component in the map by the given factor. | |
void | setAssignRegions (bool assignRegions) |
Choose whether a region should be assigned to each creator. | |
void | clear () |
Delete the existing Geant4 Geometry. | |
void | createTGeoRepresentation () |
Create a TGeo representation of the native geometry description. | |
G4VisAttributes * | newVisAttributes () |
Create an anonymous G4VisAttributes for an existing G4LogicalVolume. | |
Static Public Member Functions | |
static GeometryManager & | getInstance () |
Return a reference to the instance. | |
Private Member Functions | |
GeometryManager () | |
Default constructor declared private since class is a Singleton. | |
GeometryManager (const GeometryManager &)=delete | |
Copy constructor declared private since class is a Singleton. | |
GeometryManager & | operator= (const GeometryManager &)=delete |
Assignment operator declared private since class is a Singleton. | |
~GeometryManager () | |
Destructor: make sure we clean up memory at the end. | |
Private Attributes | |
G4VPhysicalVolume * | m_topVolume |
Pointer to the top volume of the native geometry description. | |
std::vector< CreatorBase * > | m_creators |
List of all creators, to be freed when geometry is destucted. | |
std::set< std::string > | m_components |
List of names of components to be created, all other components will be ignored. | |
std::set< std::string > | m_excluded |
List of names of components to be excluded from creation. | |
std::set< std::string > | m_additional |
List of additional components to be added to the default set of components. | |
std::map< std::string, double > | m_densityScaling |
Scaling factors for densities. | |
bool | m_assignRegions {false} |
Bool to indicate whether we automatically assign a region with the creator name to all volumes created by that creator. | |
std::vector< G4VisAttributes * > | m_VisAttributes |
List of visualization attributes. | |
Friends | |
struct | std::default_delete< GeometryManager > |
Allow destruction of instance. | |
Class to manage the creation and conversion of the geometry.
This class is a singleton
Definition at line 47 of file GeometryManager.h.
|
inlineprivate |
Default constructor declared private since class is a Singleton.
Definition at line 171 of file GeometryManager.h.
|
inlineprivate |
Destructor: make sure we clean up memory at the end.
Definition at line 177 of file GeometryManager.h.
void clear | ( | ) |
Delete the existing Geant4 Geometry.
Definition at line 102 of file GeometryManager.cc.
void createGeometry | ( | const GearDir & | params, |
GeometryTypes | type = FullGeometry |
||
) |
Create Geometry.
This function will create the geometry representation. First the Materials will be created, than the top volume will be defined and all components of the detector will be built by calling the corresponding creator
params | GearDir pointing to the top element of the geometry parameters |
type | Type of the geometry to be built |
Definition at line 219 of file GeometryManager.cc.
void createGeometry | ( | const GeoConfiguration & | params, |
GeometryTypes | type = FullGeometry , |
||
bool | useDB = true |
||
) |
Create Geometry.
This function will create the geometry representation from an existing configuration object. First the Materials will be created, than the top volume will be defined and all components of the detector will be built by calling the corresponding creator
params | geometry configuration object |
type | Type of the geometry to be built |
useDB | whether the creators should be using the Database or Gearbox |
Definition at line 225 of file GeometryManager.cc.
GeoConfiguration createGeometryConfig | ( | const GearDir & | detectorDir, |
const IntervalOfValidity & | iov | ||
) |
Create Geometry configuration object.
This function will convert a Gearbox representation of the geometry to an object containing all necessary parameters
detectorDir | GearDir pointing to the top element of the geometry parameters |
iov | Interval of validity for the created object |
Definition at line 122 of file GeometryManager.cc.
void createTGeoRepresentation | ( | ) |
Create a TGeo representation of the native geometry description.
This method will convert the existing Geometry to a ROOT TGeo representation which can be accessed using the global gGeoManager provided by ROOT.
Definition at line 348 of file GeometryManager.cc.
|
static |
Return a reference to the instance.
Definition at line 96 of file GeometryManager.cc.
|
inline |
Return a pointer to the top volume.
Returns 0 if no geometry has been created so far
Definition at line 56 of file GeometryManager.h.
G4VisAttributes * newVisAttributes | ( | ) |
Create an anonymous G4VisAttributes for an existing G4LogicalVolume.
Definition at line 371 of file GeometryManager.cc.
|
inline |
Set the names of addtional components to be added to the default set.
This member allows to set a list of component names. When creating the the geometry, components matching names in the list will be added if they are not disabled by default. If a list of components is already provided this list is ignored.
components | List of detector components to be added in addition |
Definition at line 125 of file GeometryManager.h.
|
inline |
Choose whether a region should be assigned to each creator.
If set to true, all volumes created by each creator are assigned a region with the name of the creator
Definition at line 143 of file GeometryManager.h.
|
inline |
Set the density scaling: This is intended for systematic studies only and will scale the density of all materials for each component in the map by the given factor.
Definition at line 134 of file GeometryManager.h.
|
inline |
Set the names of the components to create.
This member allows to set a list of component names. When creating the the geometry, only components matching names in the list will be created. All other components found in the parameters will be ignored
components | List of detector components to be created |
Definition at line 98 of file GeometryManager.h.
|
inline |
Set the names of the components to exclude from creation.
This member allows to set a list of component names. When creating the the geometry, components matching names in the list will be ignored
components | List of detector components to be excluded |
Definition at line 110 of file GeometryManager.h.
|
friend |
Allow destruction of instance.
Definition at line 196 of file GeometryManager.h.
|
private |
List of additional components to be added to the default set of components.
Definition at line 188 of file GeometryManager.h.
|
private |
Bool to indicate whether we automatically assign a region with the creator name to all volumes created by that creator.
Definition at line 194 of file GeometryManager.h.
|
private |
List of names of components to be created, all other components will be ignored.
Definition at line 184 of file GeometryManager.h.
|
private |
List of all creators, to be freed when geometry is destucted.
Definition at line 182 of file GeometryManager.h.
|
private |
Scaling factors for densities.
Definition at line 190 of file GeometryManager.h.
|
private |
List of names of components to be excluded from creation.
Definition at line 186 of file GeometryManager.h.
|
private |
Pointer to the top volume of the native geometry description.
Definition at line 180 of file GeometryManager.h.
|
private |
List of visualization attributes.
Definition at line 196 of file GeometryManager.h.