Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:22

0001 #ifndef SIMG4CORE_DD4HEP_DDDWORLD_H
0002 #define SIMG4CORE_DD4HEP_DDDWORLD_H
0003 
0004 #include "G4VPhysicalVolume.hh"
0005 #include "DDG4/Geant4GeometryInfo.h"
0006 
0007 namespace cms {
0008   class DDDetector;
0009 }
0010 
0011 namespace cms {
0012   class DDDWorld {
0013   public:
0014     DDDWorld(const cms::DDDetector*, dd4hep::sim::Geant4GeometryMaps::VolumeMap&);
0015     ~DDDWorld();
0016     static void workerSetAsWorld(G4VPhysicalVolume* pv);
0017     const G4VPhysicalVolume* getWorldVolume() const { return m_world; }
0018 
0019     // In order to share the world volume with the worker threads, we
0020     // need a non-const pointer. Thread-safety is handled inside Geant4
0021     // with TLS. Should we consider a friend declaration here in order
0022     // to avoid misuse?
0023     G4VPhysicalVolume* getWorldVolumeForWorker() const { return m_world; }
0024 
0025   private:
0026     void setAsWorld(G4VPhysicalVolume* pv);
0027     G4VPhysicalVolume* m_world;
0028   };
0029 }  // namespace cms
0030 
0031 #endif