Belle II Software development
|
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pitch size. More...
#include <GeoCache.h>
Public Member Functions | |
~GeoCache () | |
destructor to clean up structures | |
void | clear () |
Clean up internal structures. | |
void | findVolumes (G4VPhysicalVolume *envelope) |
Search a given Geometry for Sensors. | |
void | addSensor (SensorInfoBase *sensorinfo) |
Add a SensorInfo instance to the list of known sensors This method will manually add a SensorInfo instance to the list of known sensors. | |
const std::set< Belle2::VxdID > | getLayers (SensorInfoBase::SensorType sensortype=SensorInfoBase::VXD) |
Return a set of all known Layers. | |
const std::set< Belle2::VxdID > & | getLadders (Belle2::VxdID layer) const |
Return a set of all ladder IDs belonging to a given layer. | |
const std::set< Belle2::VxdID > & | getSensors (Belle2::VxdID ladder) const |
Return a set of all sensor IDs belonging to a given ladder. | |
bool | validSensorID (Belle2::VxdID id) const |
Check that id is a valid sensor number. | |
const std::vector< VxdID > | getListOfSensors () const |
Get list of all sensors. | |
const SensorInfoBase & | getSensorInfo (Belle2::VxdID id) const |
Return a referecne to the SensorInfo of a given SensorID. | |
const std::map< VxdID, TGeoHMatrix > & | getHalfShellPlacements () const |
Retrieve stored half-shell placements into world volume. | |
const std::vector< std::pair< VxdID, TGeoHMatrix > > & | getLadderPlacements (VxdID halfShell) const |
Retrieve stored ladder placements into half-shell. | |
const std::vector< std::pair< VxdID, TGeoHMatrix > > & | getSensorPlacements (VxdID ladder) const |
Retrieve stored sensor placements into ladders. | |
void | addHalfShellPlacement (VxdID halfShell, const G4Transform3D &placement) |
Remember how half-shell is placed into world volume. | |
void | addLadderPlacement (VxdID halfShell, VxdID ladder, const G4Transform3D &placement) |
Remember how ladder is placed into half-shell. | |
void | addSensorPlacement (VxdID ladder, VxdID sensor, const G4Transform3D &placement) |
Remember how sensor is placed into ladder. | |
void | setupReconstructionTransformations () |
Initialize from DB for reconstruction Updates all SensorInfo transformations for reconstruction from DB object(s) (recalculating new global positions) and registers itself for subsequent updates of DB objects to keep the hierarchy up-to-date. | |
const GeoTools * | getGeoTools () |
Return a raw pointer to a GeoTools object. | |
Static Public Member Functions | |
static TGeoHMatrix | g4Transform3DToTGeo (const G4Transform3D &g4) |
Covenient function to convert G4Transform3D to TGeoHMatrix. | |
static TGeoHMatrix | getTGeoFromRigidBodyParams (double dU, double dV, double dW, double dAlpha, double dBeta, double dGamma) |
Convert 6 rigid body params (alignment corrections) to corresponding TGeoHMatrix Angles in radians, length units in centimeters. | |
static GeoCache & | getInstance () |
Return a reference to the singleton instance. | |
Private Types | |
typedef std::unordered_map< VxdID::baseType, SensorInfoBase * > | SensorInfoMap |
Hash map to store pointers to all existing SensorInfos with constant lookup complexity. | |
typedef std::map< Belle2::VxdID, std::set< Belle2::VxdID > > | SensorHierachy |
Map to store a set of unique VxdIDs belonging to one VxdID. | |
Private Member Functions | |
GeoCache () | |
Singleton class, hidden constructor. | |
GeoCache (const GeoCache &)=delete | |
Singleton class, hidden copy constructor. | |
GeoCache & | operator= (const GeoCache &)=delete |
Singleton class, hidden assignment operator. | |
Private Attributes | |
std::set< Belle2::VxdID > | m_pxdLayers |
Set of all PXD layer IDs. | |
std::set< Belle2::VxdID > | m_svdLayers |
Set of all SVD layer IDs. | |
std::set< Belle2::VxdID > | m_telLayers |
Set of all Tel layer IDs. | |
SensorHierachy | m_ladders |
Map of all Ladder IDs belonging to a given Layer ID. | |
SensorHierachy | m_sensors |
Map of all Sensor IDs belonging to a given Ladder ID. | |
std::map< VxdID, TGeoHMatrix > | m_halfShellPlacements {} |
Map of shell ids and their placements in top volume. | |
std::map< VxdID, std::vector< std::pair< VxdID, TGeoHMatrix > > > | m_ladderPlacements {} |
Map of shell ids and their associated ladder ids and their placements. | |
std::map< VxdID, std::vector< std::pair< VxdID, TGeoHMatrix > > > | m_sensorPlacements {} |
Map of ladder ids and their associated sensor ids and their placements. | |
SensorInfoMap | m_sensorInfo |
Map to find the SensorInfo for a given Sensor ID. | |
std::unique_ptr< GeoTools > | m_geoToolsPtr |
Pointer to a GeoTools object. | |
DBObjPtr< VXDAlignment > | m_vxdAlignments |
DBObjPtr for the alignment. | |
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pitch size.
Definition at line 39 of file GeoCache.h.
|
private |
Map to store a set of unique VxdIDs belonging to one VxdID.
Like ladders belong to layers, etc.
Definition at line 153 of file GeoCache.h.
|
private |
Hash map to store pointers to all existing SensorInfos with constant lookup complexity.
Definition at line 151 of file GeoCache.h.
|
inline |
|
private |
Singleton class, hidden constructor.
Definition at line 32 of file GeoCache.cc.
void addHalfShellPlacement | ( | VxdID | halfShell, |
const G4Transform3D & | placement | ||
) |
Remember how half-shell is placed into world volume.
Definition at line 232 of file GeoCache.cc.
Remember how ladder is placed into half-shell.
Definition at line 225 of file GeoCache.cc.
void addSensor | ( | SensorInfoBase * | sensorinfo | ) |
Add a SensorInfo instance to the list of known sensors This method will manually add a SensorInfo instance to the list of known sensors.
It should not be needed except for testing purposes.
sensorinfo | SensorInfoBase instance to add to the list of known sensors. |
Definition at line 147 of file GeoCache.cc.
void clear | ( | ) |
Clean up internal structures.
Definition at line 38 of file GeoCache.cc.
void findVolumes | ( | G4VPhysicalVolume * | envelope | ) |
Search a given Geometry for Sensors.
This method will search a given Physical Volume and add all sensitive Volumes where the SensitiveDetector implementation inherits from vxd::SensitiveDetector to the cache.
The given volume must be a volume placed directly in the top volume, otherwise the transformations cannot be determined correctly.
This method should be called by the geometry creator once all sensitive volumes are placed
Definition at line 78 of file GeoCache.cc.
|
static |
Covenient function to convert G4Transform3D to TGeoHMatrix.
Definition at line 349 of file GeoCache.cc.
|
inline |
Return a raw pointer to a GeoTools object.
Definition at line 142 of file GeoCache.h.
const map< VxdID, TGeoHMatrix > & getHalfShellPlacements | ( | ) | const |
Retrieve stored half-shell placements into world volume.
Definition at line 239 of file GeoCache.cc.
|
static |
Return a reference to the singleton instance.
Definition at line 214 of file GeoCache.cc.
Retrieve stored ladder placements into half-shell.
Definition at line 250 of file GeoCache.cc.
const set< VxdID > & getLadders | ( | Belle2::VxdID | layer | ) | const |
Return a set of all ladder IDs belonging to a given layer.
Definition at line 193 of file GeoCache.cc.
const set< VxdID > getLayers | ( | SensorInfoBase::SensorType | sensortype = SensorInfoBase::VXD | ) |
Return a set of all known Layers.
Definition at line 176 of file GeoCache.cc.
const vector< VxdID > getListOfSensors | ( | ) | const |
Get list of all sensors.
Intended mostly for Python, where std::sets don't work.
Definition at line 59 of file GeoCache.cc.
const SensorInfoBase & getSensorInfo | ( | Belle2::VxdID | id | ) | const |
Return a referecne to the SensorInfo of a given SensorID.
Definition at line 67 of file GeoCache.cc.
Retrieve stored sensor placements into ladders.
Definition at line 241 of file GeoCache.cc.
const set< VxdID > & getSensors | ( | Belle2::VxdID | ladder | ) | const |
Return a set of all sensor IDs belonging to a given ladder.
Definition at line 204 of file GeoCache.cc.
|
static |
Convert 6 rigid body params (alignment corrections) to corresponding TGeoHMatrix Angles in radians, length units in centimeters.
Definition at line 372 of file GeoCache.cc.
void setupReconstructionTransformations | ( | ) |
Initialize from DB for reconstruction Updates all SensorInfo transformations for reconstruction from DB object(s) (recalculating new global positions) and registers itself for subsequent updates of DB objects to keep the hierarchy up-to-date.
So the hierarchy is as follows: Belle 2 / | | \ Ying Yang Pat Mat ... other sub-detectors / | / | | \ | \ ...... ladders ...... / / | / | | \ | \ \ ......... sensors ........
Definition at line 259 of file GeoCache.cc.
bool validSensorID | ( | Belle2::VxdID | id | ) | const |
Check that id is a valid sensor number.
id | sensor id to be checked against current GeoCache information |
Definition at line 52 of file GeoCache.cc.
|
private |
Pointer to a GeoTools object.
Definition at line 183 of file GeoCache.h.
|
private |
Map of shell ids and their placements in top volume.
Definition at line 174 of file GeoCache.h.
Map of shell ids and their associated ladder ids and their placements.
Definition at line 176 of file GeoCache.h.
|
private |
Map of all Ladder IDs belonging to a given Layer ID.
Definition at line 169 of file GeoCache.h.
|
private |
Set of all PXD layer IDs.
Definition at line 163 of file GeoCache.h.
|
private |
Map to find the SensorInfo for a given Sensor ID.
Definition at line 180 of file GeoCache.h.
Map of ladder ids and their associated sensor ids and their placements.
Definition at line 178 of file GeoCache.h.
|
private |
Map of all Sensor IDs belonging to a given Ladder ID.
Definition at line 171 of file GeoCache.h.
|
private |
Set of all SVD layer IDs.
Definition at line 165 of file GeoCache.h.
|
private |
Set of all Tel layer IDs.
Definition at line 167 of file GeoCache.h.
|
private |
DBObjPtr for the alignment.
Definition at line 186 of file GeoCache.h.