ATLAS Offline Software
G4RunManagerHelper.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // G4RunManagerHelper.cxx, (c) ATLAS Detector software
8 
9 // class header
10 #include "G4RunManagerHelper.h"
11 
12 // package includes
13 #include "G4DetectorConstruction.h"
14 
15 // Geant4 includes
16 #include "G4VUserPhysicsList.hh"
17 #include "QGSP_BERT.hh"
18 
20  const std::string& name,
21  const IInterface* parent)
22  : base_class(type,name,parent),
23  m_g4RunManager(0),
24  m_fastG4RunManager(0)
25 {
26 }
27 
29 {
30 }
31 
33 {
34  ATH_MSG_INFO("Initializing G4RunManagerHelper");
35 
36  return StatusCode::SUCCESS;
37 }
38 
39 
40 G4AtlasRunManager* iGeant4::G4RunManagerHelper::g4RunManager ATLAS_NOT_THREAD_SAFE ()
41 
42 {
43  if (m_g4RunManager) return m_g4RunManager;
44 
45  m_g4RunManager = G4AtlasRunManager::GetG4AtlasRunManager();
46 
47  ATH_MSG_INFO("Initializing G4RunManager");
48 
49  return m_g4RunManager;
50 
51 }
52 
53 
54 G4RunManager* iGeant4::G4RunManagerHelper::fastG4RunManager ATLAS_NOT_THREAD_SAFE ()
55 
56 {
57  if (m_g4RunManager) return m_g4RunManager;
58 
59  if (m_fastG4RunManager) return m_fastG4RunManager;
60 
61  m_fastG4RunManager = new G4RunManager;
62 
63  ATH_MSG_INFO("Initializing fast version of G4RunManager");
64 
65  // initialize here
66  G4VUserPhysicsList *thePL = new QGSP_BERT;
67 
68  m_fastG4RunManager->SetUserInitialization(thePL);
69  m_fastG4RunManager->SetUserInitialization(new G4DetectorConstruction());
70 
71  // initialize Geant4
72  m_fastG4RunManager->Initialize();
73 
74  return m_fastG4RunManager;
75 
76 }
G4DetectorConstruction.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
iGeant4::G4RunManagerHelper::G4RunManagerHelper
G4RunManagerHelper(const std::string &type, const std::string &name, const IInterface *parent)
Definition: G4RunManagerHelper.cxx:19
ATLAS_NOT_THREAD_SAFE
G4AtlasRunManager *iGeant4::G4RunManagerHelper::g4RunManager ATLAS_NOT_THREAD_SAFE()
Install fatal handler with default options.
Definition: G4RunManagerHelper.cxx:40
G4AtlasRunManager
ATLAS custom singleton run manager.
Definition: G4AtlasRunManager.h:30
iGeant4::G4RunManagerHelper::~G4RunManagerHelper
virtual ~G4RunManagerHelper()
Definition: G4RunManagerHelper.cxx:28
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
G4DetectorConstruction
Definition: G4DetectorConstruction.h:24
test_pyathena.parent
parent
Definition: test_pyathena.py:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
iGeant4::G4RunManagerHelper::initialize
virtual StatusCode initialize() override
Definition: G4RunManagerHelper.cxx:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
G4RunManagerHelper.h