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 doPunchThrough,
51 
52  G4bool IsApplicable(const G4ParticleDefinition&) override final;
53  void DoIt(const G4FastTrack&, G4FastStep&) override final;
54  void StartOfAthenaEvent(const EventContext& ctx);
55  void EndOfAthenaEvent(const EventContext& ctx);
56 
60  G4bool ModelTrigger(const G4FastTrack &) override final;
61 
64 
66  G4bool passedIDCaloBoundary(const G4FastTrack& fastTrack);
67 
68  private:
69 
70  // Random generator services
72  std::string m_randomEngineName;
74 
75  // FastCaloSimCaloTransportation tool to transport particles through the detector with the ATLAS tracking tools
76  PublicToolHandle<IFastCaloSimCaloTransportation> m_FastCaloSimCaloTransportation;
77  // FastCaloSimCaloExtrapolation tool to extrapolate particle shower positions to layers
78  PublicToolHandle<IFastCaloSimCaloExtrapolation> m_FastCaloSimCaloExtrapolation;
79  // Geant4 transportation tool
80  PublicToolHandle<IG4CaloTransportTool> m_G4CaloTransportTool;
81  // Geant4 Punchthrough G4 Tool
82  PublicToolHandle<IPunchThroughSimWrapper> m_PunchThroughSimWrapper;
83 
84  // Main FastCaloSim service
86  // Name of associated CaloCellContainer sensitive detector
88  // Boolean flag to enable Geant4 transportation
90 
91  //For PunchThrough
93 
94  // Fast simulation FastCaloSimTool
96 };
97 
98 #endif //G4FASTSIMULATION_FASTCALOSIM_H
99 
FastCaloSimCaloExtrapolation
Definition: FastCaloSimCaloExtrapolation.h:32
FastCaloSim
Definition: FastCaloSim.h:34
IFastCaloSimCaloExtrapolation.h
FastCaloSim::StartOfAthenaEvent
void StartOfAthenaEvent(const EventContext &ctx)
Definition: FastCaloSim.cxx:63
FastCaloSim::m_FastCaloSimTool
FastCaloSimTool * m_FastCaloSimTool
Definition: FastCaloSim.h:95
IFastCaloSimParamSvc.h
FastCaloSim::m_FastCaloSimSvc
ServiceHandle< ISF::IFastCaloSimParamSvc > m_FastCaloSimSvc
Definition: FastCaloSim.h:85
CaloCellContainerSD
Definition: CaloCellContainerSD.h:22
FastCaloSim::getCaloCellContainerSD
CaloCellContainerSD * getCaloCellContainerSD()
Retrieves the associated sensitive detector responsible for writing out the CaloCellContainer.
Definition: FastCaloSim.cxx:289
FastCaloSim::m_FastCaloSimCaloTransportation
PublicToolHandle< IFastCaloSimCaloTransportation > m_FastCaloSimCaloTransportation
Definition: FastCaloSim.h:76
IPunchThroughSimWrapper.h
IFastCaloSimCaloTransportation.h
FastCaloSim::m_doPunchThrough
bool m_doPunchThrough
Definition: FastCaloSim.h:92
FastCaloSim::m_randomEngineName
std::string m_randomEngineName
Definition: FastCaloSim.h:72
FastCaloSim::m_CaloCellContainerSDName
std::string m_CaloCellContainerSDName
Definition: FastCaloSim.h:87
FastCaloSim::EndOfAthenaEvent
void EndOfAthenaEvent(const EventContext &ctx)
Definition: FastCaloSim.cxx:71
FastCaloSim::m_PunchThroughSimWrapper
PublicToolHandle< IPunchThroughSimWrapper > m_PunchThroughSimWrapper
Definition: FastCaloSim.h:82
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 doPunchThrough, FastCaloSimTool *FastCaloSimTool)
Definition: FastCaloSim.cxx:35
FastCaloSim::m_FastCaloSimCaloExtrapolation
PublicToolHandle< IFastCaloSimCaloExtrapolation > m_FastCaloSimCaloExtrapolation
Definition: FastCaloSim.h:78
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:99
FastCaloSim::m_doG4Transport
bool m_doG4Transport
Definition: FastCaloSim.h:89
FastCaloSimCaloTransportation
Definition: FastCaloSimCaloTransportation.h:21
FastCaloSim::m_rngWrapper
ATHRNG::RNGWrapper * m_rngWrapper
Definition: FastCaloSim.h:73
FastCaloSim::DoIt
void DoIt(const G4FastTrack &, G4FastStep &) override final
Definition: FastCaloSim.cxx:181
FastCaloSim::~FastCaloSim
~FastCaloSim()
Definition: FastCaloSim.h:50
FastCaloSim::m_G4CaloTransportTool
PublicToolHandle< IG4CaloTransportTool > m_G4CaloTransportTool
Definition: FastCaloSim.h:80
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:309
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:77
FastCaloSimTool
Definition: FastCaloSimTool.h:27
FastCaloSim::m_rndmGenSvc
ServiceHandle< IAthRNGSvc > m_rndmGenSvc
Definition: FastCaloSim.h:71
IAthRNGSvc.h
ServiceHandle< IAthRNGSvc >