ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
G4AtlasSvc Class Reference

#include <G4AtlasSvc.h>

Inheritance diagram for G4AtlasSvc:
Collaboration diagram for G4AtlasSvc:

Public Member Functions

 G4AtlasSvc (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~G4AtlasSvc ()=default
 
StatusCode initialize () override final
 

Private Attributes

ServiceHandle< IDetectorGeometrySvcm_detGeoSvc {this, "DetectorGeometrySvc", "DetectorGeometrySvc"}
 
ServiceHandle< IPhysicsListSvcm_physicsListSvc {this, "PhysicsListSvc", "PhysicsListSvc"}
 
ServiceHandle< IUserLimitsSvcm_userLimitsSvc {this, "UserLimitsSvc", "UserLimitsSvc"}
 
Gaudi::Property< bool > m_isMT {this, "isMT", false}
 
Gaudi::Property< bool > m_activateParallelGeometries {this, "ActivateParallelWorlds", false, "Toggle on/off the G4 parallel geometry system"}
 

Detailed Description

Definition at line 18 of file G4AtlasSvc.h.

Constructor & Destructor Documentation

◆ G4AtlasSvc()

G4AtlasSvc::G4AtlasSvc ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 14 of file G4AtlasSvc.cxx.

15  : base_class(name,pSvcLocator)
16 {
17 }

◆ ~G4AtlasSvc()

virtual G4AtlasSvc::~G4AtlasSvc ( )
virtualdefault

Member Function Documentation

◆ initialize()

StatusCode G4AtlasSvc::initialize ( )
finaloverride

Definition at line 19 of file G4AtlasSvc.cxx.

19  {
20  // go through all tools and retrieve them
21  // This fires initialize() for each of those tools
22 
23  ATH_MSG_DEBUG( "this is G4AtlasSvc::initialize() " );
24  auto* rm = G4RunManager::GetRunManager();
25  if (!rm) {
26  ATH_MSG_ERROR("Run manager retrieval has failed");
27  return StatusCode::FAILURE;
28  }
29  rm->Initialize(); // Initialization differs slightly in multi-threading.
30  // TODO: add more details about why this is here.
31  if (!m_isMT && rm->ConfirmBeamOnCondition()) {
32  rm->RunInitialization();
33  }
34 
35  ATH_CHECK(m_detGeoSvc.retrieve());
36 
37  ATH_CHECK(m_physicsListSvc.retrieve());
38  ATH_CHECK(m_userLimitsSvc.retrieve());
39 
41  G4VModularPhysicsList* thePhysicsList=dynamic_cast<G4VModularPhysicsList*>(m_physicsListSvc->GetPhysicsList());
42  if (!thePhysicsList) {
43  ATH_MSG_FATAL("Failed dynamic_cast!! this is not a G4VModularPhysicsList!");
44  return StatusCode::FAILURE;
45  }
46 #if G4VERSION_NUMBER >= 1010
47  std::vector<std::string>& parallelWorldNames=m_detGeoSvc->GetParallelWorldNames();
48  for (auto& it: parallelWorldNames) {
49  thePhysicsList->RegisterPhysics(new G4ParallelWorldPhysics(it,true));
50  }
51 #endif
52  }
53 
54  return StatusCode::SUCCESS;
55 }

Member Data Documentation

◆ m_activateParallelGeometries

Gaudi::Property<bool> G4AtlasSvc::m_activateParallelGeometries {this, "ActivateParallelWorlds", false, "Toggle on/off the G4 parallel geometry system"}
private

Definition at line 32 of file G4AtlasSvc.h.

◆ m_detGeoSvc

ServiceHandle<IDetectorGeometrySvc> G4AtlasSvc::m_detGeoSvc {this, "DetectorGeometrySvc", "DetectorGeometrySvc"}
private

Definition at line 28 of file G4AtlasSvc.h.

◆ m_isMT

Gaudi::Property<bool> G4AtlasSvc::m_isMT {this, "isMT", false}
private

Definition at line 31 of file G4AtlasSvc.h.

◆ m_physicsListSvc

ServiceHandle<IPhysicsListSvc> G4AtlasSvc::m_physicsListSvc {this, "PhysicsListSvc", "PhysicsListSvc"}
private

Definition at line 29 of file G4AtlasSvc.h.

◆ m_userLimitsSvc

ServiceHandle<IUserLimitsSvc> G4AtlasSvc::m_userLimitsSvc {this, "UserLimitsSvc", "UserLimitsSvc"}
private

Definition at line 30 of file G4AtlasSvc.h.


The documentation for this class was generated from the following files:
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
G4AtlasSvc::m_isMT
Gaudi::Property< bool > m_isMT
Definition: G4AtlasSvc.h:31
G4AtlasSvc::m_detGeoSvc
ServiceHandle< IDetectorGeometrySvc > m_detGeoSvc
Definition: G4AtlasSvc.h:28
skel.it
it
Definition: skel.GENtoEVGEN.py:396
G4AtlasSvc::m_userLimitsSvc
ServiceHandle< IUserLimitsSvc > m_userLimitsSvc
Definition: G4AtlasSvc.h:30
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
G4AtlasSvc::m_physicsListSvc
ServiceHandle< IPhysicsListSvc > m_physicsListSvc
Definition: G4AtlasSvc.h:29
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
G4AtlasSvc::m_activateParallelGeometries
Gaudi::Property< bool > m_activateParallelGeometries
Definition: G4AtlasSvc.h:32