ATLAS Offline Software
FastCaloSim.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 G4FASTSIMULATION_FASTCALOSIM_H
6 #define G4FASTSIMULATION_FASTCALOSIM_H
7 
8 // Service handle to define smart pointer to FastCaloSim parametrisation service
9 #include "GaudiKernel/ServiceHandle.h"
10 // Geant4 fast simulation base class
11 #include "G4VFastSimulationModel.hh"
12 // FastCaloSim parametrisation service interface
14 // FastCaloSim extrapolation tool interface
16 // FastCaloSim ATLAS transportation tool interface
18 // Geant4 transportation tool interface
20 // Geant4 Punchthrough G4 Tool
22 
23 // Random generator service interface
25 // FastCaloSim tool
26 #include "FastCaloSimTool.h"
27 
28 
30 class G4FieldTrack;
31 class G4SafetyHelper;
32 
33 class FastCaloSim: public G4VFastSimulationModel
34 {
35  public:
36 
37  FastCaloSim(const std::string& name,
38  G4Region* region,
39  const ServiceHandle<IAthRNGSvc>& rndmGenSvc,
40  const std::string& randomEngineName,
41  const PublicToolHandle<IFastCaloSimCaloTransportation>& FastCaloSimCaloTransportation,
42  const PublicToolHandle<IFastCaloSimCaloExtrapolation>& FastCaloSimCaloExtrapolation,
43  const PublicToolHandle<IG4CaloTransportTool>& G4CaloTransportTool,
44  const PublicToolHandle<IPunchThroughSimWrapper>& PunchThroughSimWrapper,
45  const ServiceHandle<ISF::IFastCaloSimParamSvc>& FastCaloSimSvc,
46  const std::string& CaloCellContainerSDName,
47  bool doG4Transport,
48  bool doPhotons,
49  bool doElectrons,
50  bool doHadrons,
51  float AbsEtaMin,
52  float AbsEtaMax,
53  float EkinMinPhotons,
54  float EkinMaxPhotons,
55  float EkinMinElectrons,
56  float EkinMaxElectrons,
57  bool doPunchThrough,
60 
61  G4bool IsApplicable(const G4ParticleDefinition&) override final;
62  void DoIt(const G4FastTrack&, G4FastStep&) override final;
63  void StartOfAthenaEvent(const EventContext& ctx);
64  void EndOfAthenaEvent(const EventContext& ctx);
65 
69  G4bool ModelTrigger(const G4FastTrack &) override final;
70 
73 
75  G4bool passedIDCaloBoundary(const G4FastTrack& fastTrack);
76 
77  private:
78 
79  // Random generator services
81  std::string m_randomEngineName;
83 
84  // FastCaloSimCaloTransportation tool to transport particles through the detector with the ATLAS tracking tools
85  PublicToolHandle<IFastCaloSimCaloTransportation> m_FastCaloSimCaloTransportation;
86  // FastCaloSimCaloExtrapolation tool to extrapolate particle shower positions to layers
87  PublicToolHandle<IFastCaloSimCaloExtrapolation> m_FastCaloSimCaloExtrapolation;
88  // Geant4 transportation tool
89  PublicToolHandle<IG4CaloTransportTool> m_G4CaloTransportTool;
90  // Geant4 Punchthrough G4 Tool
91  PublicToolHandle<IPunchThroughSimWrapper> m_PunchThroughSimWrapper;
92 
93  // Main FastCaloSim service
95  // Name of associated CaloCellContainer sensitive detector
97  // Boolean flag to enable Geant4 transportation
99 
100  // Boundaries to enable AF3 transportation
104  float m_AbsEtaMin;
105  float m_AbsEtaMax;
110 
111  //For PunchThrough
113 
114  // Fast simulation FastCaloSimTool
116 };
117 
118 #endif //G4FASTSIMULATION_FASTCALOSIM_H
119 
FastCaloSimCaloExtrapolation
Definition: FastCaloSimCaloExtrapolation.h:32
FastCaloSim::m_EkinMaxElectrons
float m_EkinMaxElectrons
Definition: FastCaloSim.h:109
FastCaloSim
Definition: FastCaloSim.h:34
FastCaloSim::m_doPhotons
bool m_doPhotons
Definition: FastCaloSim.h:101
IFastCaloSimCaloExtrapolation.h
FastCaloSim::StartOfAthenaEvent
void StartOfAthenaEvent(const EventContext &ctx)
Definition: FastCaloSim.cxx:85
FastCaloSim::m_FastCaloSimTool
FastCaloSimTool * m_FastCaloSimTool
Definition: FastCaloSim.h:115
IFastCaloSimParamSvc.h
FastCaloSim::m_AbsEtaMin
float m_AbsEtaMin
Definition: FastCaloSim.h:104
FastCaloSim::m_FastCaloSimSvc
ServiceHandle< ISF::IFastCaloSimParamSvc > m_FastCaloSimSvc
Definition: FastCaloSim.h:94
CaloCellContainerSD
Definition: CaloCellContainerSD.h:22
FastCaloSim::getCaloCellContainerSD
CaloCellContainerSD * getCaloCellContainerSD()
Retrieves the associated sensitive detector responsible for writing out the CaloCellContainer.
Definition: FastCaloSim.cxx:326
FastCaloSim::m_FastCaloSimCaloTransportation
PublicToolHandle< IFastCaloSimCaloTransportation > m_FastCaloSimCaloTransportation
Definition: FastCaloSim.h:85
IPunchThroughSimWrapper.h
IFastCaloSimCaloTransportation.h
FastCaloSim::m_doPunchThrough
bool m_doPunchThrough
Definition: FastCaloSim.h:112
FastCaloSim::m_randomEngineName
std::string m_randomEngineName
Definition: FastCaloSim.h:81
FastCaloSim::m_CaloCellContainerSDName
std::string m_CaloCellContainerSDName
Definition: FastCaloSim.h:96
FastCaloSim::m_AbsEtaMax
float m_AbsEtaMax
Definition: FastCaloSim.h:105
FastCaloSim::EndOfAthenaEvent
void EndOfAthenaEvent(const EventContext &ctx)
Definition: FastCaloSim.cxx:93
FastCaloSim::FastCaloSim
FastCaloSim(const std::string &name, G4Region *region, const ServiceHandle< IAthRNGSvc > &rndmGenSvc, const std::string &randomEngineName, const PublicToolHandle< IFastCaloSimCaloTransportation > &FastCaloSimCaloTransportation, const PublicToolHandle< IFastCaloSimCaloExtrapolation > &FastCaloSimCaloExtrapolation, const PublicToolHandle< IG4CaloTransportTool > &G4CaloTransportTool, const PublicToolHandle< IPunchThroughSimWrapper > &PunchThroughSimWrapper, const ServiceHandle< ISF::IFastCaloSimParamSvc > &FastCaloSimSvc, const std::string &CaloCellContainerSDName, bool doG4Transport, bool doPhotons, bool doElectrons, bool doHadrons, float AbsEtaMin, float AbsEtaMax, float EkinMinPhotons, float EkinMaxPhotons, float EkinMinElectrons, float EkinMaxElectrons, bool doPunchThrough, FastCaloSimTool *FastCaloSimTool)
Definition: FastCaloSim.cxx:38
FastCaloSim::m_PunchThroughSimWrapper
PublicToolHandle< IPunchThroughSimWrapper > m_PunchThroughSimWrapper
Definition: FastCaloSim.h:91
FastCaloSim::m_EkinMinElectrons
float m_EkinMinElectrons
Definition: FastCaloSim.h:108
FastCaloSim::m_FastCaloSimCaloExtrapolation
PublicToolHandle< IFastCaloSimCaloExtrapolation > m_FastCaloSimCaloExtrapolation
Definition: FastCaloSim.h:87
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
IG4CaloTransportTool.h
PunchThroughSimWrapper
Class to wrap PunchThrough simulation inside FastCaloSim; Runs both PunchThroughG4Classifier and Punc...
Definition: PunchThroughSimWrapper.h:35
FastCaloSim::ModelTrigger
G4bool ModelTrigger(const G4FastTrack &) override final
Determines the applicability of the fast sim model to this particular track.
Definition: FastCaloSim.cxx:121
FastCaloSim::m_doG4Transport
bool m_doG4Transport
Definition: FastCaloSim.h:98
FastCaloSim::m_doElectrons
bool m_doElectrons
Definition: FastCaloSim.h:102
FastCaloSim::m_EkinMaxPhotons
float m_EkinMaxPhotons
Definition: FastCaloSim.h:107
FastCaloSim::m_doHadrons
bool m_doHadrons
Definition: FastCaloSim.h:103
FastCaloSimCaloTransportation
Definition: FastCaloSimCaloTransportation.h:21
FastCaloSim::m_rngWrapper
ATHRNG::RNGWrapper * m_rngWrapper
Definition: FastCaloSim.h:82
FastCaloSim::m_EkinMinPhotons
float m_EkinMinPhotons
Definition: FastCaloSim.h:106
FastCaloSim::DoIt
void DoIt(const G4FastTrack &, G4FastStep &) override final
Definition: FastCaloSim.cxx:218
FastCaloSim::~FastCaloSim
~FastCaloSim()
Definition: FastCaloSim.h:59
FastCaloSim::m_G4CaloTransportTool
PublicToolHandle< IG4CaloTransportTool > m_G4CaloTransportTool
Definition: FastCaloSim.h:89
FastCaloSimTool.h
FastCaloSim::passedIDCaloBoundary
G4bool passedIDCaloBoundary(const G4FastTrack &fastTrack)
Check if the particle is located at the proper ID-Calo parametrization boundary and is travelling out...
Definition: FastCaloSim.cxx:346
G4CaloTransportTool
A tool which transports particles through the Geant4 geometry.
Definition: G4CaloTransportTool.h:25
FastCaloSim::IsApplicable
G4bool IsApplicable(const G4ParticleDefinition &) override final
Definition: FastCaloSim.cxx:99
FastCaloSimTool
Definition: FastCaloSimTool.h:27
FastCaloSim::m_rndmGenSvc
ServiceHandle< IAthRNGSvc > m_rndmGenSvc
Definition: FastCaloSim.h:80
IAthRNGSvc.h
ServiceHandle< IAthRNGSvc >