ATLAS Offline Software
SimKernelMT.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
11 #ifndef ISF_SIMKERNELMT_H
12 #define ISF_SIMKERNELMT_H 1
13 
14 // Interfaces to ISF Tools and Services
24 
25 // DetectorDescription
27 
28 // McEventCollection
31 
32 // TrackRecordCollection (and TrackRecord)
34 
35 // Framework includes
37 #include "StoreGate/ReadHandle.h"
38 #include "StoreGate/WriteHandle.h"
39 #include "GaudiKernel/ServiceHandle.h"
40 
41 // STL includes
42 #include <array>
43 #include <map>
44 
45 // forward declarations
46 namespace ISFTesting {
47  class SimKernelMT_test;
48 }
49 
50 
51 namespace ISF {
52 
61 class SimKernelMT final : public AthAlgorithm {
62 
65 
66 public:
68  SimKernelMT( const std::string& name, ISvcLocator* pSvcLocator );
69 
71  virtual ~SimKernelMT();
72 
74  StatusCode initialize() override;
75 
80  StatusCode execute() override;
81 
83  StatusCode finalize() override;
84 
85  bool isClonable() const override { return true; }
86 
87 private:
90 
92  SG::ReadHandleKey<McEventCollection> m_inputEvgenKey{this, "InputEvgenCollection", "", "Input EVGEN collection."};
94  SG::WriteHandleKey<McEventCollection> m_outputTruthKey{this, "OutputTruthCollection", "", "Output Truth collection."};
96  SG::WriteHandleKey<TrackRecordCollection> m_caloEntryLayerKey{this, "CaloEntryLayerKey", "CaloEntryLayer", ""};
97  SG::WriteHandleKey<TrackRecordCollection> m_muonEntryLayerKey{this, "MuonEntryLayerKey", "MuonEntryLayer", ""};
98  SG::WriteHandleKey<TrackRecordCollection> m_muonExitLayerKey{this, "MuonExitLayerKey", "MuonExitLayer", ""};
99 
100  BooleanProperty m_useShadowEvent{this, "UseShadowEvent", false, "New approach to selecting particles for simulation" };
102  Gaudi::Property<bool> m_forceGeoIDSvc{this, "AlwaysUseGeoIDSvc", false, "Force geoID recalculation for each particle" };
103 
104  ToolHandle<IGenEventFilter> m_truthPreselectionTool{this, "TruthPreselectionTool", "", "Tool for filtering out quasi-stable particle daughters"};
105 
107  ServiceHandle<IInputConverter> m_inputConverter{this, "InputConverter", "", "Input McEventCollection->ISFParticleContainer conversion service."};
108 
110  ServiceHandle<ITruthSvc> m_truthRecordSvc{this,"TruthRecordService", "ISF_MC15aPlusTruthService", ""};
111 
113  ServiceHandle<Simulation::IZeroLifetimePatcher> m_qspatcher{this, "QuasiStablePatcher", "", "Quasi-Stable Particle Simulation Patcher"};
114 
116  ToolHandleArray<ISimulatorTool> m_simulationTools{this, "SimulationTools", {}, ""};
117 
120 
122  PublicToolHandle<IEntryLayerTool> m_entryLayerTool{this, "EntryLayerTool", "ISF_EntryLayerToolMT", ""};
123 
125  ServiceHandle<IGeoIDSvc> m_geoIDSvc{this, "GeoIDSvc", "", "Service to set particle GeoIDs"};
126 
128  ToolHandle<IParticleOrderingTool> m_orderingTool{this, "ParticleOrderingTool", "", "Tool to set order of particles"};
129 
131  std::array<ToolHandleArray<ISimulationSelector>, AtlasDetDescr::fNumAtlasRegions> m_simSelectors;
132 
134  std::map<ISF::SimulationFlavor, ISimulatorTool*> m_simToolMap;
135 
137  size_t m_maxParticleVectorSize{10240};
138 };
139 
140 } // namespace ISF
141 
142 #endif // ISF_SIMKERNELMT_H
AtlasDetDescr::fNumAtlasRegions
@ fNumAtlasRegions
Definition: AtlasRegion.h:39
ISF::SimKernelMT::m_simulationTools
ToolHandleArray< ISimulatorTool > m_simulationTools
Simulation Tools.
Definition: SimKernelMT.h:116
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
ISF::SimKernelMT::m_inputConverter
ServiceHandle< IInputConverter > m_inputConverter
Input converter service (from Generator->ISF particle types)
Definition: SimKernelMT.h:107
ISF::SimKernelMT::m_muonExitLayerKey
SG::WriteHandleKey< TrackRecordCollection > m_muonExitLayerKey
Definition: SimKernelMT.h:98
AtlasRegion.h
ISF::SimKernelMT::m_outputTruthKey
SG::WriteHandleKey< McEventCollection > m_outputTruthKey
Output Simulation Truth collection.
Definition: SimKernelMT.h:94
ISF::ISimulatorTool
Definition: ISimulatorTool.h:24
ISF::ISFParticle
Definition: ISFParticle.h:42
IInputConverter.h
ISF::SimKernelMT::m_simSelectors
std::array< ToolHandleArray< ISimulationSelector >, AtlasDetDescr::fNumAtlasRegions > m_simSelectors
The simulation selectors defining the "routing chain".
Definition: SimKernelMT.h:131
SG::ReadHandleKey< McEventCollection >
ISF::SimKernelMT::identifySimulator
ISimulatorTool & identifySimulator(const ISF::ISFParticle &particle)
Returns the simulator to use for the given particle.
Definition: SimKernelMT.cxx:319
ISimulatorTool.h
IEntryLayerTool.h
ISF::SimKernelMT::m_particleKillerTool
ISimulatorTool * m_particleKillerTool
When no appropriate simulator can be found for a given particle, the particle is sent to this "partic...
Definition: SimKernelMT.h:119
ISF::SimKernelMT::m_useShadowEvent
BooleanProperty m_useShadowEvent
Definition: SimKernelMT.h:100
AthAlgorithm.h
ISF::SimKernelMT::m_truthRecordSvc
ServiceHandle< ITruthSvc > m_truthRecordSvc
Central truth service.
Definition: SimKernelMT.h:110
WriteHandle.h
Handle class for recording to StoreGate.
SG::WriteHandleKey< McEventCollection >
ISF::SimKernelMT::~SimKernelMT
virtual ~SimKernelMT()
Implements empty destructor.
Definition: SimKernelMT.cxx:40
McEventCollection.h
ISF::SimKernelMT::m_maxParticleVectorSize
size_t m_maxParticleVectorSize
Number of particles simultaneously sent to simulator.
Definition: SimKernelMT.h:137
ISF::SimKernelMT::isClonable
bool isClonable() const override
Definition: SimKernelMT.h:85
ISimulationSelector.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ISF::SimKernelMT::m_qspatcher
ServiceHandle< Simulation::IZeroLifetimePatcher > m_qspatcher
Quasi-Stable Particle Simulation Patcher.
Definition: SimKernelMT.h:113
ISF::SimKernelMT::SimKernelMT
SimKernelMT(const std::string &name, ISvcLocator *pSvcLocator)
Implements standard AthAlgorithm constructor.
Definition: SimKernelMT.cxx:25
IGeoIDSvc.h
IParticleOrderingTool.h
ISF::SimKernelMT
Core Athena algorithm for the Integrated Simulation Framework.
Definition: SimKernelMT.h:61
AthAlgorithm
Definition: AthAlgorithm.h:47
ISF::SimKernelMT::finalize
StatusCode finalize() override
Implements empty finalize (implementation required by AthAlgorithm)
Definition: SimKernelMT.cxx:313
ISF::SimKernelMT::m_entryLayerTool
PublicToolHandle< IEntryLayerTool > m_entryLayerTool
AthenaTool responsible for writing Calo/Muon Entry/Exit Layer collection.
Definition: SimKernelMT.h:122
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
IZeroLifetimePatcher.h
TrackRecordCollection.h
ISF::SimKernelMT::m_geoIDSvc
ServiceHandle< IGeoIDSvc > m_geoIDSvc
Service to set particle GeoIDs.
Definition: SimKernelMT.h:125
ISF::SimKernelMT::m_caloEntryLayerKey
SG::WriteHandleKey< TrackRecordCollection > m_caloEntryLayerKey
Output TrackRecordCollections.
Definition: SimKernelMT.h:96
ISF::SimKernelMT::SimKernelMT_test
friend class ISFTesting::SimKernelMT_test
Allow the test class access to all methods.
Definition: SimKernelMT.h:64
ISF
ISFParticleOrderedQueue.
Definition: PrimaryParticleInformation.h:13
ISF::SimKernelMT::m_forceGeoIDSvc
Gaudi::Property< bool > m_forceGeoIDSvc
Force geoID recalculation for each particle.
Definition: SimKernelMT.h:102
ISF::SimKernelMT::m_simToolMap
std::map< ISF::SimulationFlavor, ISimulatorTool * > m_simToolMap
Map of the simulation flavours used in this job to the corresponding Simulation Services.
Definition: SimKernelMT.h:134
ISFTesting
Core Athena algorithm for the Integrated Simulation Framework.
Definition: CollectionMerger.h:37
ISF::SimKernelMT::execute
StatusCode execute() override
Check the validity of the MC truth event in the current Athena event.
Definition: SimKernelMT.cxx:132
ITruthSvc.h
ReadHandle.h
Handle class for reading from StoreGate.
ISF::SimKernelMT::m_inputEvgenKey
SG::ReadHandleKey< McEventCollection > m_inputEvgenKey
Input Generator Truth collection.
Definition: SimKernelMT.h:92
ISF::SimKernelMT::m_orderingTool
ToolHandle< IParticleOrderingTool > m_orderingTool
Tool to set particle ordering.
Definition: SimKernelMT.h:128
SimulationFlavor.h
IGenEventFilter.h
ISF::SimKernelMT::m_truthPreselectionTool
ToolHandle< IGenEventFilter > m_truthPreselectionTool
Definition: SimKernelMT.h:104
ISF::SimKernelMT::m_muonEntryLayerKey
SG::WriteHandleKey< TrackRecordCollection > m_muonEntryLayerKey
Definition: SimKernelMT.h:97
ISF::SimKernelMT::initialize
StatusCode initialize() override
Check user configuration and configure the algorithm state accordingly.
Definition: SimKernelMT.cxx:44
ServiceHandle
Definition: ClusterMakerTool.h:37