12#include <vxd/dataobjects/VxdID.h>
13#include <vxd/geometry/SensorInfoBase.h>
14#include <vxd/geometry/GeoTools.h>
18#include <unordered_map>
20#include <framework/database/DBObjPtr.h>
21#include <alignment/dbobjects/VXDAlignment.h>
23class G4VPhysicalVolume;
25namespace HepGeom {
class Transform3D; }
26typedef HepGeom::Transform3D G4Transform3D;
Class for accessing objects in the database.
Class to facilitate easy access to sensor information of the VXD like coordinate transformations or p...
GeoCache(const GeoCache &)=delete
Singleton class, hidden copy constructor.
DBObjPtr< VXDAlignment > m_vxdAlignments
DBObjPtr for the alignment.
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,...
std::unique_ptr< GeoTools > m_geoToolsPtr
Pointer to a GeoTools object.
const std::set< Belle2::VxdID > getLayers(SensorInfoBase::SensorType sensortype=SensorInfoBase::VXD)
Return a set of all known Layers.
const std::vector< VxdID > getListOfSensors() const
Get list of all sensors.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a reference to the SensorInfo of a given SensorID.
void addSensorPlacement(VxdID ladder, VxdID sensor, const G4Transform3D &placement)
Remember how sensor is placed into ladder.
const std::set< Belle2::VxdID > & getSensors(Belle2::VxdID ladder) const
Return a set of all sensor IDs belonging to a given ladder.
~GeoCache()
destructor to clean up structures
GeoCache & operator=(const GeoCache &)=delete
Singleton class, hidden assignment operator.
void setupReconstructionTransformations()
Initialize from DB for reconstruction Updates all SensorInfo transformations for reconstruction from ...
static TGeoHMatrix g4Transform3DToTGeo(const G4Transform3D &g4)
Convenient function to convert G4Transform3D to TGeoHMatrix.
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 ins...
std::unordered_map< VxdID::baseType, SensorInfoBase * > SensorInfoMap
Hash map to store pointers to all existing SensorInfos with constant lookup complexity.
static GeoCache & getInstance()
Return a reference to the singleton instance.
const std::vector< std::pair< VxdID, TGeoHMatrix > > & getSensorPlacements(VxdID ladder) const
Retrieve stored sensor placements into ladders.
std::set< Belle2::VxdID > m_pxdLayers
Set of all PXD layer IDs.
const GeoTools * getGeoTools()
Return a raw pointer to a GeoTools object.
void addHalfShellPlacement(VxdID halfShell, const G4Transform3D &placement)
Remember how half-shell is placed into world volume.
GeoCache()
Singleton class, hidden constructor.
std::map< VxdID, std::vector< std::pair< VxdID, TGeoHMatrix > > > m_ladderPlacements
Map of shell ids and their associated ladder ids and their placements.
const std::map< VxdID, TGeoHMatrix > & getHalfShellPlacements() const
Retrieve stored half-shell placements into world volume.
std::set< Belle2::VxdID > m_telLayers
Set of all Tel layer IDs.
SensorHierachy m_sensors
Map of all Sensor IDs belonging to a given Ladder ID.
SensorInfoMap m_sensorInfo
Map to find the SensorInfo for a given Sensor ID.
const std::vector< std::pair< VxdID, TGeoHMatrix > > & getLadderPlacements(VxdID halfShell) const
Retrieve stored ladder placements into half-shell.
SensorHierachy m_ladders
Map of all Ladder IDs belonging to a given Layer ID.
void clear()
Clean up internal structures.
std::map< VxdID, TGeoHMatrix > m_halfShellPlacements
Map of shell ids and their placements in top volume.
std::map< Belle2::VxdID, std::set< Belle2::VxdID > > SensorHierachy
Map to store a set of unique VxdIDs belonging to one VxdID.
bool validSensorID(Belle2::VxdID id) const
Check that id is a valid sensor number.
void addLadderPlacement(VxdID halfShell, VxdID ladder, const G4Transform3D &placement)
Remember how ladder is placed into half-shell.
const std::set< Belle2::VxdID > & getLadders(Belle2::VxdID layer) const
Return a set of all ladder IDs belonging to a given layer.
std::map< VxdID, std::vector< std::pair< VxdID, TGeoHMatrix > > > m_sensorPlacements
Map of ladder ids and their associated sensor ids and their placements.
std::set< Belle2::VxdID > m_svdLayers
Set of all SVD layer IDs.
Base class to provide Sensor Information for PXD and SVD.
SensorType
Enum specifying the type of sensor the SensorInfo represents.
@ VXD
Any type of VXD Sensor.
Class to uniquely identify a any structure of the PXD and SVD.
Namespace to provide code needed by both Vertex Detectors, PXD and SVD, and also testbeam telescopes.
Abstract base class for different kinds of events.