ATLAS Offline Software
Loading...
Searching...
No Matches
G4RunAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef G4ATLASALG_G4RunAlg_H
6#define G4ATLASALG_G4RunAlg_H
7
8// Base class header
10
11// STL headers
12#include <map>
13#include <string>
14
15// Gaudi headers
16#include "Gaudi/Property.h"
17#include "GaudiKernel/ServiceHandle.h"
18#include "GaudiKernel/StatusCode.h"
19#include "GaudiKernel/ToolHandle.h"
20
21// Athena headers
33
34// ISF includes
39
50class G4RunAlg : public AthAlgorithm
51{
52public:
53
56
58 virtual bool isClonable() const override { return true; }
59
66 virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE () override;
67
69 virtual StatusCode execute() override;
70
71private:
74 void releaseGeoModel();
75
78 Gaudi::Property<bool> m_flagAbortedEvents{this, "FlagAbortedEvents", false, ""};
79 Gaudi::Property<bool> m_killAbortedEvents{this, "KillAbortedEvents", false, ""};
80 Gaudi::Property<bool> m_releaseGeoModel{this, "ReleaseGeoModel", true, ""};
81 Gaudi::Property<bool> m_useShadowEvent{this, "UseShadowEvent", false, "New approach to selecting particles for simulation"};
82 Gaudi::Property<std::string> m_randomStreamName{this, "RandomStreamName", "Geant4", ""};
83 Gaudi::Property<std::string> m_simplifiedGeoPath{this, "SimplifiedGeoPath", "", "Path to the simplified geometry file"};
84 Gaudi::Property<std::map<std::string, std::string>> m_verbosities {this, "Verbosities", {}, "Map of G4 Verbosities to set for the simulation"};
85
86 SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfo", "EventInfo", "EventInfo key"};
87 SG::ReadHandleKey<McEventCollection> m_inputTruthCollectionKey{this, "InputTruthCollection", "BeamTruthEvent", "Input hard scatter collection"};
88 SG::WriteHandleKey<McEventCollection> m_outputTruthCollectionKey{this, "OutputTruthCollection", "TruthEvent", "Output hard scatter truth collection"};
89
91 ServiceHandle<ISF::IGeoIDSvc> m_geoIDSvc{this, "GeoIDSvc", "ISF_GeoIDSvc", ""};
93 ServiceHandle<ISF::IInputConverter> m_inputConverter{this, "InputConverter", "ISF_InputConverter", ""};
95 ServiceHandle<ISF::ITruthSvc> m_truthRecordSvc{this, "TruthRecordService", "ISF_TruthRecordSvc", ""};
97 ServiceHandle<Simulation::IZeroLifetimePatcher> m_qspatcher{this, "QuasiStablePatcher", "", "Quasi-Stable Particle Simulation Patcher"};
99 ServiceHandle<IAthRNGSvc> m_rndmGenSvc{this, "AtRndmGenSvc", "AthRNGSvc", ""};
101 ServiceHandle<G4UA::IUserActionSvc> m_userActionSvc{this, "UserActionSvc", "G4UA::UserActionSvc", ""};
102
104 PublicToolHandle<IFastSimulationMasterTool> m_fastSimTool{this, "FastSimMasterTool", "FastSimulationMasterTool", ""};
106 PublicToolHandle<IG4RunTool> m_g4RunTool{this, "G4RunTool", "G4RunTool", ""};
108 PublicToolHandle<ISensitiveDetectorMasterTool> m_senDetTool{this, "SenDetMasterTool", "SensitiveDetectorMasterTool", ""};
110 ToolHandle<ISF::IGenEventFilter> m_truthPreselectionTool{this, "TruthPreselectionTool", "", "Tool for filtering out quasi-stable particle daughters"};
112};
113
114#endif// G4ATLASALG_G4RunAlg_H
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Define macros for attributes used to control the static checker.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Primary Athena algorithm for ATLAS simulation.
Definition G4RunAlg.h:51
ServiceHandle< ISF::IGeoIDSvc > m_geoIDSvc
Geo ID Service.
Definition G4RunAlg.h:91
Gaudi::Property< std::string > m_simplifiedGeoPath
Definition G4RunAlg.h:83
Gaudi::Property< bool > m_releaseGeoModel
Definition G4RunAlg.h:80
ToolHandle< ISF::IGenEventFilter > m_truthPreselectionTool
Tool for filtering out quasi-stable particle daughters.
Definition G4RunAlg.h:110
ServiceHandle< Simulation::IZeroLifetimePatcher > m_qspatcher
Quasi-Stable Particle Simulation Patcher.
Definition G4RunAlg.h:97
ServiceHandle< IAthRNGSvc > m_rndmGenSvc
Random number service.
Definition G4RunAlg.h:99
PublicToolHandle< IG4RunTool > m_g4RunTool
G4Atlas Tool for thread management and data interface.
Definition G4RunAlg.h:106
void releaseGeoModel()
Releases the GeoModel geometry from memory once it has been used to build the G4 geometry and is no-l...
Definition G4RunAlg.cxx:237
Gaudi::Property< bool > m_useShadowEvent
Definition G4RunAlg.h:81
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition G4RunAlg.h:86
PublicToolHandle< ISensitiveDetectorMasterTool > m_senDetTool
Sensitive Detector Master Tool.
Definition G4RunAlg.h:108
ServiceHandle< G4UA::IUserActionSvc > m_userActionSvc
User Action Service.
Definition G4RunAlg.h:101
ServiceHandle< ISF::ITruthSvc > m_truthRecordSvc
Central Truth Service.
Definition G4RunAlg.h:95
virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE() override
Initialize the algorithm.
virtual StatusCode execute() override
Simulate one Athena event.
Definition G4RunAlg.cxx:96
Gaudi::Property< std::map< std::string, std::string > > m_verbosities
Definition G4RunAlg.h:84
Gaudi::Property< bool > m_killAbortedEvents
Definition G4RunAlg.h:79
Gaudi::Property< std::string > m_randomStreamName
Definition G4RunAlg.h:82
PublicToolHandle< IFastSimulationMasterTool > m_fastSimTool
Fast Simulation Master Tool.
Definition G4RunAlg.h:104
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Standard algorithm constructor.
SG::WriteHandleKey< McEventCollection > m_outputTruthCollectionKey
Definition G4RunAlg.h:88
ServiceHandle< ISF::IInputConverter > m_inputConverter
Service to convert ISF_Particles into a G4Event.
Definition G4RunAlg.h:93
SG::ReadHandleKey< McEventCollection > m_inputTruthCollectionKey
Definition G4RunAlg.h:87
virtual bool isClonable() const override
this Alg is Clonable (for AthenaMT)
Definition G4RunAlg.h:58
Gaudi::Property< bool > m_flagAbortedEvents
Definition G4RunAlg.h:78
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
void initialize()