ATLAS Offline Software
Loading...
Searching...
No Matches
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)
15 : FastSimulationBase(type, name, parent)
16{
17}
18
20{
21 ATH_MSG_VERBOSE( name() << "::initialize()" );
22 CHECK( m_showerLibSvc.retrieve() );
23
24 m_configuration.m_showerLibSvcName = m_showerLibSvc.name();
25
26 m_configuration.m_e_FlagShowerLib = m_e_FlagShowerLib;
27 m_configuration.m_e_MinEneShowerLib = m_e_MinEneShowerLib;
28 m_configuration.m_e_MaxEneShowerLib = m_e_MaxEneShowerLib;
29
30 m_configuration.m_g_FlagShowerLib = m_g_FlagShowerLib;
31 m_configuration.m_g_MinEneShowerLib = m_g_MinEneShowerLib;
32 m_configuration.m_g_MaxEneShowerLib = m_g_MaxEneShowerLib;
33
34 m_configuration.m_Neut_FlagShowerLib = m_Neut_FlagShowerLib;
35 m_configuration.m_Neut_MinEneShowerLib = m_Neut_MinEneShowerLib;
36 m_configuration.m_Neut_MaxEneShowerLib = m_Neut_MaxEneShowerLib;
37
38 m_configuration.m_Pion_FlagShowerLib = m_Pion_FlagShowerLib;
39 m_configuration.m_Pion_MinEneShowerLib = m_Pion_MinEneShowerLib;
40 m_configuration.m_Pion_MaxEneShowerLib = m_Pion_MaxEneShowerLib;
41
42 m_configuration.m_containLow = m_containLow;
43 m_configuration.m_absLowEta = m_absLowEta;
44 m_configuration.m_containHigh = m_containHigh;
45 m_configuration.m_absHighEta = m_absHighEta;
46 m_configuration.m_containCrack = m_containCrack;
47 m_configuration.m_absCrackEta1 = m_absCrackEta1;
48 m_configuration.m_absCrackEta2 = m_absCrackEta2;
49
50 m_configuration.m_generated_starting_points_file = m_generated_starting_points_file;
51 m_configuration.m_generated_starting_points_ratio = m_generated_starting_points_ratio;
52 m_configuration.m_detector_tag = m_detector_tag;
53 m_configuration.m_applyRRWeights = m_applyRRWeights;
54
55 return FastSimulationBase::initialize();
56}
57
58G4VFastSimulationModel* 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}
#define ATH_MSG_FATAL(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
FastSimulationBase(const std::string &type, const std::string &name, const IInterface *parent)
G4Region * getRegion() const
This is the interface for the fast simulation dedicated sensitive detector.
LArFastShowerTool(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
Gaudi::Property< double > m_g_MinEneShowerLib
Gaudi::Property< double > m_Pion_MinEneShowerLib
Gaudi::Property< double > m_Neut_MaxEneShowerLib
StatusCode initialize() override final
Gaudi::Property< int > m_detector_tag
virtual G4VFastSimulationModel * makeFastSimModel() override final
Method to make the actual fast simulation model itself, which will be owned by the tool.
Gaudi::Property< double > m_e_MinEneShowerLib
Gaudi::Property< bool > m_Neut_FlagShowerLib
Gaudi::Property< bool > m_g_FlagShowerLib
Gaudi::Property< double > m_e_MaxEneShowerLib
Gaudi::Property< std::string > m_fastSimDedicatedSD
Shower library sensitive detector for this shower.
Gaudi::Property< float > m_generated_starting_points_ratio
Gaudi::Property< double > m_absCrackEta2
Gaudi::Property< bool > m_containCrack
Gaudi::Property< bool > m_Pion_FlagShowerLib
ServiceHandle< ILArG4ShowerLibSvc > m_showerLibSvc
Pointer to the shower library service.
FastShowerConfigStruct m_configuration
Gaudi::Property< double > m_g_MaxEneShowerLib
Gaudi::Property< bool > m_containHigh
Gaudi::Property< double > m_absCrackEta1
Gaudi::Property< bool > m_e_FlagShowerLib
Gaudi::Property< double > m_Neut_MinEneShowerLib
Gaudi::Property< double > m_Pion_MaxEneShowerLib
Gaudi::Property< bool > m_containLow
Gaudi::Property< std::string > m_generated_starting_points_file
Gaudi::Property< bool > m_applyRRWeights
Gaudi::Property< double > m_absLowEta
Gaudi::Property< double > m_absHighEta
NEEDS DOCUMENTATION.