ATLAS Offline Software
Loading...
Searching...
No Matches
ISF::BaseSimulatorTool Class Reference

Concrete base class for all simulator Tools. More...

#include <BaseSimulatorTool.h>

Inheritance diagram for ISF::BaseSimulatorTool:
Collaboration diagram for ISF::BaseSimulatorTool:

Public Member Functions

 BaseSimulatorTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~BaseSimulatorTool ()
 Destructor.
virtual StatusCode sysInitialize () override
 Gaudi sysInitialize() methods.
virtual StatusCode initialize () override
virtual StatusCode setupEvent (const EventContext &) override
 Setup Event chain - in case of a begin-of event action is needed.
virtual StatusCode setupEventST () override
 Setup Event chain - in case of a begin-of event action is needed (called by ISimulationSvc)
virtual StatusCode simulate (const EventContext &, ISFParticle &, ISFParticleContainer &, McEventCollection *) override
virtual StatusCode simulateVector (const EventContext &ctx, const ISFParticleVector &particles, ISFParticleContainer &secondaries, McEventCollection *mcEventCollection, McEventCollection *) override
 Simulation call for vectors of particles.
virtual StatusCode releaseEvent (const EventContext &) override
 Release Event chain - in case of an end-of event action is needed.
virtual StatusCode releaseEventST () override
 Release Event chain - in case of an end-of event action is needed (called by ISimulationSvc)
const ChronoEntity * chronoStart (const IChronoSvc::ChronoTag &tag)
 wrapper call to start chrono with given tag
const ChronoEntity * chronoStop (const IChronoSvc::ChronoTag &tag)
 wrapper call to stop chrono with given tag

Protected Attributes

ServiceHandle< IChronoStatSvc > m_chrono {this, "ChronoStatService", "ChronoStatSvc"}
 The timing service for general usage.

Private Member Functions

 BaseSimulatorTool ()
 Default constructor.

Detailed Description

Concrete base class for all simulator Tools.

Definition at line 36 of file BaseSimulatorTool.h.

Constructor & Destructor Documentation

◆ BaseSimulatorTool() [1/2]

ISF::BaseSimulatorTool::BaseSimulatorTool ( const std::string & type,
const std::string & name,
const IInterface * parent )
inline

Definition at line 40 of file BaseSimulatorTool.h.

41 : base_class(type, name, parent)
42 {
43 }

◆ ~BaseSimulatorTool()

virtual ISF::BaseSimulatorTool::~BaseSimulatorTool ( )
inlinevirtual

Destructor.

Definition at line 46 of file BaseSimulatorTool.h.

46{}

◆ BaseSimulatorTool() [2/2]

ISF::BaseSimulatorTool::BaseSimulatorTool ( )
private

Default constructor.

Member Function Documentation

◆ chronoStart()

const ChronoEntity * ISF::BaseSimulatorTool::chronoStart ( const IChronoSvc::ChronoTag & tag)
inline

wrapper call to start chrono with given tag

Definition at line 98 of file BaseSimulatorTool.h.

98 {
99 if (m_chrono) return m_chrono->chronoStart( tag);
100 return nullptr;
101 }
ServiceHandle< IChronoStatSvc > m_chrono
The timing service for general usage.

◆ chronoStop()

const ChronoEntity * ISF::BaseSimulatorTool::chronoStop ( const IChronoSvc::ChronoTag & tag)
inline

wrapper call to stop chrono with given tag

Definition at line 104 of file BaseSimulatorTool.h.

104 {
105 if (m_chrono) return m_chrono->chronoStop( tag);
106 return nullptr;
107 }

◆ initialize()

virtual StatusCode ISF::BaseSimulatorTool::initialize ( )
inlineoverridevirtual

◆ releaseEvent()

virtual StatusCode ISF::BaseSimulatorTool::releaseEvent ( const EventContext & )
inlineoverridevirtual

Release Event chain - in case of an end-of event action is needed.

Reimplemented in iGeant4::G4LegacyTransportTool, iGeant4::G4TransportTool, ISF::ActsFatrasSimTool, ISF::BaseSimulatorG4Tool, ISF::FastCaloSimV2Tool, ISF::FatrasSimTool, and ISF::ParticleKillerSimTool.

Definition at line 90 of file BaseSimulatorTool.h.

91 { return StatusCode::FAILURE; }

◆ releaseEventST()

virtual StatusCode ISF::BaseSimulatorTool::releaseEventST ( )
inlineoverridevirtual

Release Event chain - in case of an end-of event action is needed (called by ISimulationSvc)

Reimplemented in ISF::BaseSimulatorG4Tool, and ISF::FastCaloSimV2Tool.

Definition at line 94 of file BaseSimulatorTool.h.

95 { return releaseEvent(Gaudi::Hive::currentContext()); }
virtual StatusCode releaseEvent(const EventContext &) override
Release Event chain - in case of an end-of event action is needed.

◆ setupEvent()

virtual StatusCode ISF::BaseSimulatorTool::setupEvent ( const EventContext & )
inlineoverridevirtual

Setup Event chain - in case of a begin-of event action is needed.

Reimplemented in iGeant4::G4LegacyTransportTool, iGeant4::G4TransportTool, ISF::ActsFatrasSimTool, ISF::BaseSimulatorG4Tool, ISF::FastCaloSimV2Tool, ISF::FatrasSimTool, and ISF::ParticleKillerSimTool.

Definition at line 63 of file BaseSimulatorTool.h.

64 { return StatusCode::FAILURE; }

◆ setupEventST()

virtual StatusCode ISF::BaseSimulatorTool::setupEventST ( )
inlineoverridevirtual

Setup Event chain - in case of a begin-of event action is needed (called by ISimulationSvc)

Reimplemented in ISF::BaseSimulatorG4Tool, and ISF::FastCaloSimV2Tool.

Definition at line 67 of file BaseSimulatorTool.h.

68 { return setupEvent(Gaudi::Hive::currentContext()); }
virtual StatusCode setupEvent(const EventContext &) override
Setup Event chain - in case of a begin-of event action is needed.

◆ simulate()

virtual StatusCode ISF::BaseSimulatorTool::simulate ( const EventContext & ,
ISFParticle & ,
ISFParticleContainer & ,
McEventCollection *  )
inlineoverridevirtual

Reimplemented in ISF::ActsFatrasSimTool, ISF::BaseSimulatorG4Tool, ISF::FastCaloSimV2Tool, ISF::FatrasSimTool, and ISF::ParticleKillerSimTool.

Definition at line 71 of file BaseSimulatorTool.h.

72 { return StatusCode::FAILURE; }

◆ simulateVector()

virtual StatusCode ISF::BaseSimulatorTool::simulateVector ( const EventContext & ctx,
const ISFParticleVector & particles,
ISFParticleContainer & secondaries,
McEventCollection * mcEventCollection,
McEventCollection *  )
inlineoverridevirtual

Simulation call for vectors of particles.

Reimplemented in ISF::ActsFatrasSimTool, ISF::BaseSimulatorG4Tool, and ISF::ParticleKillerSimTool.

Definition at line 75 of file BaseSimulatorTool.h.

76 {
77 // this implementation is a wrapper in case the simulator does
78 // implement particle-vector input
79
80 // simulate each particle individually
81 for (auto* cisp : particles) {
82 ATH_MSG_VERBOSE( "Starting simulation of particle: " << (*cisp) );
83 ATH_CHECK(this->simulate(ctx, *cisp, secondaries, mcEventCollection));
84 }
85 return StatusCode::SUCCESS;
86
87 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
virtual StatusCode simulate(const EventContext &, ISFParticle &, ISFParticleContainer &, McEventCollection *) override

◆ sysInitialize()

virtual StatusCode ISF::BaseSimulatorTool::sysInitialize ( )
inlineoverridevirtual

Gaudi sysInitialize() methods.

Definition at line 49 of file BaseSimulatorTool.h.

50 {
52 ATH_CHECK( m_chrono.retrieve() );
53 return StatusCode::SUCCESS;
54 }
virtual StatusCode sysInitialize() override

Member Data Documentation

◆ m_chrono

ServiceHandle<IChronoStatSvc> ISF::BaseSimulatorTool::m_chrono {this, "ChronoStatService", "ChronoStatSvc"}
protected

The timing service for general usage.

Definition at line 115 of file BaseSimulatorTool.h.

115{this, "ChronoStatService", "ChronoStatSvc"};

The documentation for this class was generated from the following file: