18 #include "G4PVPlacement.hh"
21 using namespace DD4hep::Simulation;
22 using namespace DD4hep::Geometry;
27 : m_lcdd(lcdd_ref), m_dataPtr(0) {
47 throw runtime_error(
"Geant4Mapping: Attempt to access an invalid data block!");
79 throw runtime_error(
format(
"Geant4Mapping",
"Cannot create volume manager without Geant4 geometry info [Invalid-Info]"));
86 for (Geant4GeometryMaps::PlacementMap::const_iterator i = m.begin(); i != m.end(); ++i)
87 if ((*i).second == node)
Handle class holding a placed volume (also called physical volume)
The Geant4VolumeManager to facilitate optimized lookups of cell IDs from touchables.
Geant4GeometryInfo & init()
Create and attach new data block. Delete old data block if present.
Geant4Mapping(LCDD &lcdd)
Initializing Constructor.
static LCDD & getInstance(void)
—Factory method----—
std::map< PlacedVolume, G4VPhysicalVolume * > PlacementMap
std::string format(const std::string &src, const std::string &fmt,...)
Build formatted string.
void checkValidity() const
When resolving pointers, we must check for the validity of the data block.
virtual ~Geant4Mapping()
Standard destructor.
void attach(Geant4GeometryInfo *data)
Set a new data block.
Geant4GeometryMaps::PlacementMap g4Placements
Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects...
The main interface to the DD4hep detector description package.
Concreate class holding the relation information between geant4 objects and dd4hep objects...
Geometry mapping from DD4hep to Geant 4.
PlacedVolume placement(const G4VPhysicalVolume *node) const
Accessor to resolve geometry placements.
Geant4VolumeManager volumeManager() const
Access the volume manager.
Geant4GeometryInfo * m_dataPtr
Geant4GeometryMaps::Geant4PathMap g4Paths
static Geant4Mapping & instance()
Possibility to define a singleton instance.
Geant4GeometryInfo & data() const
Access to the data pointer.
Geometry::PlacedVolume PlacedVolume
Geant4GeometryInfo * detach()
Release data and pass over the ownership.