ATLAS Offline Software
LArFastShowerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "LArFastShowerTool.h"
9 #include "LArFastShower.h"
10 #include "G4SDManager.hh"
11 
13  , const std::string& name
14  , const IInterface *parent)
16 {
17 }
18 
20 {
21  ATH_MSG_VERBOSE( name() << "::initialize()" );
22  CHECK( m_showerLibSvc.retrieve() );
23 
25 
29 
33 
37 
41 
49 
54 
56 }
57 
58 G4VFastSimulationModel* LArFastShowerTool::makeFastSimModel()
59 {
60  ATH_MSG_DEBUG( "Initializing Fast Sim Model" );
61  IFastSimDedicatedSD* fastSD = dynamic_cast<IFastSimDedicatedSD*>(G4SDManager::GetSDMpointer()->FindSensitiveDetector(m_fastSimDedicatedSD.value(), false));
62  if (fastSD) {
63  ATH_MSG_DEBUG( "SD " << m_fastSimDedicatedSD << " already created." );
64  } else if ("BarrelFastSimDedicatedSD" == m_fastSimDedicatedSD){
65  fastSD = new BarrelFastSimDedicatedSD( &*detStore(), msgLevel(MSG::DEBUG) );
66  } else if ("EndcapFastSimDedicatedSD" == m_fastSimDedicatedSD){
67  fastSD = new EndcapFastSimDedicatedSD( &*detStore(), msgLevel(MSG::DEBUG) );
68  } else if ("FCALFastSimDedicatedSD" == m_fastSimDedicatedSD){
69  fastSD = new FCALFastSimDedicatedSD( &*detStore(), msgLevel(MSG::DEBUG) );
70  } else {
71  ATH_MSG_FATAL( "Fast sim SD type " << m_fastSimDedicatedSD << " not found!" );
72  throw std::runtime_error("Bad SD name");
73  }
74  G4SDManager::GetSDMpointer()->AddNewDetector(fastSD);
75 
76  // Create a fresh Fast Sim Model
77  return new LArFastShower(name(), getRegion(), m_configuration, fastSD);
78 }
LArFastShowerTool.h
FastShowerConfigStruct::m_g_MaxEneShowerLib
double m_g_MaxEneShowerLib
lower energy limit for photon frozen showers
Definition: FastShowerConfigStruct.h:18
FastShowerConfigStruct::m_absLowEta
double m_absLowEta
Definition: FastShowerConfigStruct.h:30
LArFastShowerTool::m_containCrack
Gaudi::Property< bool > m_containCrack
Definition: LArFastShowerTool.h:62
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
EndcapFastSimDedicatedSD.h
FastShowerConfigStruct::m_absCrackEta1
double m_absCrackEta1
Definition: FastShowerConfigStruct.h:34
LArFastShowerTool::m_detector_tag
Gaudi::Property< int > m_detector_tag
Definition: LArFastShowerTool.h:70
LArFastShowerTool::m_containLow
Gaudi::Property< bool > m_containLow
Definition: LArFastShowerTool.h:58
LArFastShowerTool::m_configuration
FastShowerConfigStruct m_configuration
Definition: LArFastShowerTool.h:75
LArFastShowerTool::m_generated_starting_points_ratio
Gaudi::Property< float > m_generated_starting_points_ratio
Definition: LArFastShowerTool.h:68
FastShowerConfigStruct::m_detector_tag
int m_detector_tag
name for the detector tag for the ShowerLibSvc
Definition: FastShowerConfigStruct.h:38
EndcapFastSimDedicatedSD
NEEDS DOCUMENTATION.
Definition: EndcapFastSimDedicatedSD.h:24
LArFastShowerTool::m_Neut_MinEneShowerLib
Gaudi::Property< double > m_Neut_MinEneShowerLib
Definition: LArFastShowerTool.h:51
LArFastShowerTool::m_g_FlagShowerLib
Gaudi::Property< bool > m_g_FlagShowerLib
Definition: LArFastShowerTool.h:46
LArFastShowerTool::m_containHigh
Gaudi::Property< bool > m_containHigh
Definition: LArFastShowerTool.h:60
initialize
void initialize()
Definition: run_EoverP.cxx:894
FastShowerConfigStruct::m_Pion_FlagShowerLib
bool m_Pion_FlagShowerLib
switch for pion frozen showers
Definition: FastShowerConfigStruct.h:25
LArFastShowerTool::m_Pion_FlagShowerLib
Gaudi::Property< bool > m_Pion_FlagShowerLib
Definition: LArFastShowerTool.h:54
FastSimulationBase
Definition: FastSimulationBase.h:27
IFastSimDedicatedSD
This is the interface for the fast simulation dedicated sensitive detector.
Definition: IFastSimDedicatedSD.h:13
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
LArFastShowerTool::m_Pion_MinEneShowerLib
Gaudi::Property< double > m_Pion_MinEneShowerLib
Definition: LArFastShowerTool.h:55
LArFastShowerTool::m_e_MinEneShowerLib
Gaudi::Property< double > m_e_MinEneShowerLib
Definition: LArFastShowerTool.h:43
FCALFastSimDedicatedSD
NEEDS DOCUMENTATION.
Definition: FCALFastSimDedicatedSD.h:22
LArFastShowerTool::m_absCrackEta1
Gaudi::Property< double > m_absCrackEta1
Definition: LArFastShowerTool.h:63
LArFastShowerTool::m_g_MinEneShowerLib
Gaudi::Property< double > m_g_MinEneShowerLib
Definition: LArFastShowerTool.h:47
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
LArFastShowerTool::m_Pion_MaxEneShowerLib
Gaudi::Property< double > m_Pion_MaxEneShowerLib
Definition: LArFastShowerTool.h:56
FastShowerConfigStruct::m_applyRRWeights
bool m_applyRRWeights
Definition: FastShowerConfigStruct.h:41
FastShowerConfigStruct::m_Neut_MaxEneShowerLib
double m_Neut_MaxEneShowerLib
upper energy limit for neutron frozen showers
Definition: FastShowerConfigStruct.h:23
LArFastShowerTool::makeFastSimModel
virtual G4VFastSimulationModel * makeFastSimModel() override final
Method to make the actual fast simulation model itself, which will be owned by the tool.
Definition: LArFastShowerTool.cxx:58
LArFastShowerTool::m_absLowEta
Gaudi::Property< double > m_absLowEta
Definition: LArFastShowerTool.h:59
FastShowerConfigStruct::m_Neut_MinEneShowerLib
double m_Neut_MinEneShowerLib
lower energy limit for neutron frozen showers
Definition: FastShowerConfigStruct.h:22
FastShowerConfigStruct::m_absHighEta
double m_absHighEta
Definition: FastShowerConfigStruct.h:32
BarrelFastSimDedicatedSD.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArFastShowerTool::initialize
StatusCode initialize() override final
Definition: LArFastShowerTool.cxx:19
FastShowerConfigStruct::m_absCrackEta2
double m_absCrackEta2
Definition: FastShowerConfigStruct.h:35
FastShowerConfigStruct::m_showerLibSvcName
std::string m_showerLibSvcName
Definition: FastShowerConfigStruct.h:40
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
LArFastShowerTool::m_fastSimDedicatedSD
Gaudi::Property< std::string > m_fastSimDedicatedSD
Shower library sensitive detector for this shower.
Definition: LArFastShowerTool.h:37
LArFastShowerTool::m_applyRRWeights
Gaudi::Property< bool > m_applyRRWeights
Definition: LArFastShowerTool.h:72
LArFastShower
NEEDS DOCUMENTATION.
Definition: LArFastShower.h:31
FastShowerConfigStruct::m_g_MinEneShowerLib
double m_g_MinEneShowerLib
upper energy limit for photon frozen showers
Definition: FastShowerConfigStruct.h:19
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
LArFastShower.h
FastShowerConfigStruct::m_generated_starting_points_ratio
float m_generated_starting_points_ratio
switch for shower starting point record
Definition: FastShowerConfigStruct.h:37
FastShowerConfigStruct::m_Neut_FlagShowerLib
bool m_Neut_FlagShowerLib
switch for neutron frozen showers
Definition: FastShowerConfigStruct.h:21
FastShowerConfigStruct::m_Pion_MinEneShowerLib
double m_Pion_MinEneShowerLib
lower energy limit for pion frozen showers
Definition: FastShowerConfigStruct.h:26
LArFastShowerTool::m_absHighEta
Gaudi::Property< double > m_absHighEta
Definition: LArFastShowerTool.h:61
FastShowerConfigStruct::m_g_FlagShowerLib
bool m_g_FlagShowerLib
switch for photon frozen showers
Definition: FastShowerConfigStruct.h:17
LArFastShowerTool::m_e_MaxEneShowerLib
Gaudi::Property< double > m_e_MaxEneShowerLib
Definition: LArFastShowerTool.h:44
FCALFastSimDedicatedSD.h
FastShowerConfigStruct::m_generated_starting_points_file
std::string m_generated_starting_points_file
switch for shower starting point record
Definition: FastShowerConfigStruct.h:36
LArFastShowerTool::LArFastShowerTool
LArFastShowerTool(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
Definition: LArFastShowerTool.cxx:12
LArFastShowerTool::m_generated_starting_points_file
Gaudi::Property< std::string > m_generated_starting_points_file
Definition: LArFastShowerTool.h:66
LArFastShowerTool::m_Neut_FlagShowerLib
Gaudi::Property< bool > m_Neut_FlagShowerLib
Definition: LArFastShowerTool.h:50
FastShowerConfigStruct::m_e_FlagShowerLib
bool m_e_FlagShowerLib
switch for electron frozen showers
Definition: FastShowerConfigStruct.h:13
LArFastShowerTool::m_g_MaxEneShowerLib
Gaudi::Property< double > m_g_MaxEneShowerLib
Definition: LArFastShowerTool.h:48
BarrelFastSimDedicatedSD
NEEDS DOCUMENTATION.
Definition: BarrelFastSimDedicatedSD.h:26
FastShowerConfigStruct::m_e_MaxEneShowerLib
double m_e_MaxEneShowerLib
upper energy limit for electron frozen showers
Definition: FastShowerConfigStruct.h:15
LArFastShowerTool::m_showerLibSvc
ServiceHandle< ILArG4ShowerLibSvc > m_showerLibSvc
Pointer to the shower library service.
Definition: LArFastShowerTool.h:39
DEBUG
#define DEBUG
Definition: page_access.h:11
FastShowerConfigStruct::m_containLow
bool m_containLow
switch for containment check at low eta
Definition: FastShowerConfigStruct.h:29
FastShowerConfigStruct::m_containCrack
bool m_containCrack
switch for containment check in crack region
Definition: FastShowerConfigStruct.h:33
FastSimulationBase::getRegion
G4Region * getRegion() const
Definition: FastSimulationBase.cxx:22
FastShowerConfigStruct::m_e_MinEneShowerLib
double m_e_MinEneShowerLib
lower energy limit for electron frozen showers
Definition: FastShowerConfigStruct.h:14
LArFastShowerTool::m_Neut_MaxEneShowerLib
Gaudi::Property< double > m_Neut_MaxEneShowerLib
Definition: LArFastShowerTool.h:52
FastShowerConfigStruct::m_containHigh
bool m_containHigh
switch for containment check at high eta
Definition: FastShowerConfigStruct.h:31
LArFastShowerTool::m_absCrackEta2
Gaudi::Property< double > m_absCrackEta2
Definition: LArFastShowerTool.h:64
FastShowerConfigStruct::m_Pion_MaxEneShowerLib
double m_Pion_MaxEneShowerLib
upper energy limit for pion frozen showers
Definition: FastShowerConfigStruct.h:27
LArFastShowerTool::m_e_FlagShowerLib
Gaudi::Property< bool > m_e_FlagShowerLib
Definition: LArFastShowerTool.h:42