CMS 3D CMS Logo

DD4hep_DDDWorld.h
Go to the documentation of this file.
1 #ifndef SIMG4CORE_DD4HEP_DDDWORLD_H
2 #define SIMG4CORE_DD4HEP_DDDWORLD_H
3 
4 #include "G4VPhysicalVolume.hh"
5 #include "DDG4/Geant4GeometryInfo.h"
6 
7 namespace cms {
8  class DDDetector;
9 }
10 
11 namespace cms {
12  class DDDWorld {
13  public:
14  DDDWorld(const cms::DDDetector*, dd4hep::sim::Geant4GeometryMaps::VolumeMap&);
15  ~DDDWorld();
16  static void workerSetAsWorld(G4VPhysicalVolume* pv);
17  const G4VPhysicalVolume* getWorldVolume() const { return m_world; }
18 
19  // In order to share the world volume with the worker threads, we
20  // need a non-const pointer. Thread-safety is handled inside Geant4
21  // with TLS. Should we consider a friend declaration here in order
22  // to avoid misuse?
23  G4VPhysicalVolume* getWorldVolumeForWorker() const { return m_world; }
24 
25  private:
26  void setAsWorld(G4VPhysicalVolume* pv);
27  G4VPhysicalVolume* m_world;
28  };
29 } // namespace cms
30 
31 #endif
DDDWorld(const cms::DDDetector *, dd4hep::sim::Geant4GeometryMaps::VolumeMap &)
def pv(vc)
Definition: MetAnalyzer.py:7
Namespace of DDCMS conversion namespace.
G4VPhysicalVolume * getWorldVolumeForWorker() const
static void workerSetAsWorld(G4VPhysicalVolume *pv)
G4VPhysicalVolume * m_world
const G4VPhysicalVolume * getWorldVolume() const
void setAsWorld(G4VPhysicalVolume *pv)