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
38
49class G4RunAlg : public AthAlgorithm
50{
51public:
52
55
57 virtual bool isClonable() const override { return true; }
58
65 virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE () override;
66
68 virtual StatusCode execute(const EventContext& ctx) override;
69
70private:
73 void releaseGeoModel();
74
77 Gaudi::Property<bool> m_flagAbortedEvents{this, "FlagAbortedEvents", false, ""};
78 Gaudi::Property<bool> m_killAbortedEvents{this, "KillAbortedEvents", false, ""};
79 Gaudi::Property<bool> m_releaseGeoModel{this, "ReleaseGeoModel", true, ""};
80 Gaudi::Property<bool> m_useShadowEvent{this, "UseShadowEvent", false, "New approach to selecting particles for simulation"};
81 Gaudi::Property<std::string> m_randomStreamName{this, "RandomStreamName", "Geant4", ""};
82 Gaudi::Property<std::string> m_simplifiedGeoPath{this, "SimplifiedGeoPath", "", "Path to the simplified geometry file"};
83 Gaudi::Property<std::map<std::string, std::string>> m_verbosities {this, "Verbosities", {}, "Map of G4 Verbosities to set for the simulation"};
84
85 SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfo", "EventInfo", "EventInfo key"};
86 SG::ReadHandleKey<McEventCollection> m_inputTruthCollectionKey{this, "InputTruthCollection", "BeamTruthEvent", "Input hard scatter collection"};
87 SG::WriteHandleKey<McEventCollection> m_outputTruthCollectionKey{this, "OutputTruthCollection", "TruthEvent", "Output hard scatter truth collection"};
88
90 ServiceHandle<ISF::IInputConverter> m_inputConverter{this, "InputConverter", "ISF_InputConverter", ""};
92 ServiceHandle<ISF::ITruthSvc> m_truthRecordSvc{this, "TruthRecordService", "ISF_TruthRecordSvc", ""};
94 ServiceHandle<Simulation::IZeroLifetimePatcher> m_qspatcher{this, "QuasiStablePatcher", "", "Quasi-Stable Particle Simulation Patcher"};
96 ServiceHandle<IAthRNGSvc> m_rndmGenSvc{this, "AtRndmGenSvc", "AthRNGSvc", ""};
98 ServiceHandle<G4UA::IUserActionSvc> m_userActionSvc{this, "UserActionSvc", "G4UA::UserActionSvc", ""};
99
101 PublicToolHandle<IFastSimulationMasterTool> m_fastSimTool{this, "FastSimMasterTool", "FastSimulationMasterTool", ""};
103 PublicToolHandle<IG4RunTool> m_g4RunTool{this, "G4RunTool", "G4RunTool", ""};
105 PublicToolHandle<ISensitiveDetectorMasterTool> m_senDetTool{this, "SenDetMasterTool", "SensitiveDetectorMasterTool", ""};
107 ToolHandle<ISF::IGenEventFilter> m_truthPreselectionTool{this, "TruthPreselectionTool", "", "Tool for filtering out quasi-stable particle daughters"};
109};
110
111#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.
Primary Athena algorithm for ATLAS simulation.
Definition G4RunAlg.h:50
Gaudi::Property< std::string > m_simplifiedGeoPath
Definition G4RunAlg.h:82
Gaudi::Property< bool > m_releaseGeoModel
Definition G4RunAlg.h:79
ToolHandle< ISF::IGenEventFilter > m_truthPreselectionTool
Tool for filtering out quasi-stable particle daughters.
Definition G4RunAlg.h:107
ServiceHandle< Simulation::IZeroLifetimePatcher > m_qspatcher
Quasi-Stable Particle Simulation Patcher.
Definition G4RunAlg.h:94
ServiceHandle< IAthRNGSvc > m_rndmGenSvc
Random number service.
Definition G4RunAlg.h:96
PublicToolHandle< IG4RunTool > m_g4RunTool
G4Atlas Tool for thread management and data interface.
Definition G4RunAlg.h:103
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:239
Gaudi::Property< bool > m_useShadowEvent
Definition G4RunAlg.h:80
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition G4RunAlg.h:85
PublicToolHandle< ISensitiveDetectorMasterTool > m_senDetTool
Sensitive Detector Master Tool.
Definition G4RunAlg.h:105
ServiceHandle< G4UA::IUserActionSvc > m_userActionSvc
User Action Service.
Definition G4RunAlg.h:98
ServiceHandle< ISF::ITruthSvc > m_truthRecordSvc
Central Truth Service.
Definition G4RunAlg.h:92
virtual StatusCode execute(const EventContext &ctx) override
Simulate one Athena event.
Definition G4RunAlg.cxx:89
virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE() override
Initialize the algorithm.
Gaudi::Property< std::map< std::string, std::string > > m_verbosities
Definition G4RunAlg.h:83
Gaudi::Property< bool > m_killAbortedEvents
Definition G4RunAlg.h:78
Gaudi::Property< std::string > m_randomStreamName
Definition G4RunAlg.h:81
PublicToolHandle< IFastSimulationMasterTool > m_fastSimTool
Fast Simulation Master Tool.
Definition G4RunAlg.h:101
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Standard algorithm constructor.
SG::WriteHandleKey< McEventCollection > m_outputTruthCollectionKey
Definition G4RunAlg.h:87
ServiceHandle< ISF::IInputConverter > m_inputConverter
Service to convert ISF_Particles into a G4Event.
Definition G4RunAlg.h:90
SG::ReadHandleKey< McEventCollection > m_inputTruthCollectionKey
Definition G4RunAlg.h:86
virtual bool isClonable() const override
this Alg is Clonable (for AthenaMT)
Definition G4RunAlg.h:57
Gaudi::Property< bool > m_flagAbortedEvents
Definition G4RunAlg.h:77
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()