ATLAS Offline Software
FastCaloSimTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "FastCaloSimTool.h"
6 #include "FastCaloSim.h"
7 
9 
10 
11 FastCaloSimTool::FastCaloSimTool(const std::string& type, const std::string& name, const IInterface *parent)
13 {
14 }
15 
17  // Get current event context
18  const EventContext& ctx = Gaudi::Hive::currentContext();
19 
20  if( !getFastSimModel() ){
21  ATH_MSG_ERROR ("BeginOfAthenaEvent: FastSimModel was never created!");
22  return StatusCode::FAILURE;
23  }
24  else{
25  FastCaloSim *localFastSimModel = dynamic_cast<FastCaloSim*>(getFastSimModel());
26  if(!localFastSimModel){
27  ATH_MSG_ERROR ("BeginOfAthenaEvent: Failed to cast m_FastSimModel into G4VFastSimulationModel.");
28  return StatusCode::FAILURE;
29  }
30  localFastSimModel->StartOfAthenaEvent(ctx);
31  }
32 
33  return StatusCode::SUCCESS;
34 }
35 
37 
38  // Get current event context
39  const EventContext& ctx = Gaudi::Hive::currentContext();
40 
41  if( !getFastSimModel() ){
42  ATH_MSG_ERROR ("EndOfAthenaEvent: FastSimModel was never created!");
43  return StatusCode::FAILURE;
44  }
45  else{
46  FastCaloSim *localFastSimModel = dynamic_cast<FastCaloSim*>(getFastSimModel());
47  if(!localFastSimModel){
48  ATH_MSG_ERROR ("EndOfAthenaEvent: Failed to cast m_FastSimModel into G4VFastSimulationModel.");
49  return StatusCode::FAILURE;
50  }
51  localFastSimModel->EndOfAthenaEvent(ctx);
52  }
53 
54  return StatusCode::SUCCESS;
55 }
56 
57 
58 G4VFastSimulationModel* FastCaloSimTool::makeFastSimModel()
59 {
60  ATH_MSG_DEBUG("Initializing Fast Sim Model");
61 
62 
63  // Create the FastCaloSim fast simulation model
65 }
FastCaloSim
Definition: FastCaloSim.h:31
FastCaloSim::StartOfAthenaEvent
void StartOfAthenaEvent(const EventContext &ctx)
Definition: FastCaloSim.cxx:57
FastSimulationBase
Definition: FastSimulationBase.h:26
FastCaloSimTool::m_FastCaloSimSvc
ServiceHandle< ISF::IFastCaloSimParamSvc > m_FastCaloSimSvc
Definition: FastCaloSimTool.h:44
FastCaloSimTool::m_FastCaloSimCaloExtrapolation
PublicToolHandle< IFastCaloSimCaloExtrapolation > m_FastCaloSimCaloExtrapolation
Definition: FastCaloSimTool.h:48
FastCaloSimTool::m_G4CaloTransportTool
PublicToolHandle< IG4CaloTransportTool > m_G4CaloTransportTool
Definition: FastCaloSimTool.h:50
FastCaloSimTool::m_rndmGenSvc
ServiceHandle< IAthRNGSvc > m_rndmGenSvc
Definition: FastCaloSimTool.h:52
FastCaloSimTool::EndOfAthenaEvent
virtual StatusCode EndOfAthenaEvent() override final
End of an athena event - do any thing that needs to be done at the end of each athena event.
Definition: FastCaloSimTool.cxx:36
FastCaloSimTool::FastCaloSimTool
FastCaloSimTool(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
Definition: FastCaloSimTool.cxx:11
FastCaloSim.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
FastCaloSim::EndOfAthenaEvent
void EndOfAthenaEvent(const EventContext &ctx)
Definition: FastCaloSim.cxx:66
FastCaloSimTool::makeFastSimModel
virtual G4VFastSimulationModel * makeFastSimModel() override final
Method to make the actual fast simulation model itself, which will be owned by the tool.
Definition: FastCaloSimTool.cxx:58
FastCaloSimTool::m_doG4Transport
Gaudi::Property< bool > m_doG4Transport
Definition: FastCaloSimTool.h:58
FastCaloSimTool::BeginOfAthenaEvent
virtual StatusCode BeginOfAthenaEvent() override final
Begin of an athena event - do any thing that needs to be done at the beginning of each athena event.
Definition: FastCaloSimTool.cxx:16
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
FastSimulationBase::getFastSimModel
G4VFastSimulationModel * getFastSimModel()
Retrieve the current Fast Simulation Model.
Definition: FastSimulationBase.cxx:73
RNGWrapper.h
FastCaloSimTool::m_CaloCellContainerSDName
Gaudi::Property< std::string > m_CaloCellContainerSDName
Definition: FastCaloSimTool.h:56
FastCaloSimTool::m_randomEngineName
Gaudi::Property< std::string > m_randomEngineName
Definition: FastCaloSimTool.h:54
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
FastCaloSimTool.h
ISF::FastCaloSim
@ FastCaloSim
Definition: SimulationFlavor.h:24
FastCaloSimTool::m_FastCaloSimCaloTransportation
PublicToolHandle< IFastCaloSimCaloTransportation > m_FastCaloSimCaloTransportation
Definition: FastCaloSimTool.h:46