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 35 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 39 of file BaseSimulatorTool.h.

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

◆ ~BaseSimulatorTool()

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

Destructor.

Definition at line 45 of file BaseSimulatorTool.h.

45{}

◆ 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 97 of file BaseSimulatorTool.h.

97 {
98 if (m_chrono) return m_chrono->chronoStart( tag);
99 return nullptr;
100 }
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 103 of file BaseSimulatorTool.h.

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

◆ 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 89 of file BaseSimulatorTool.h.

90 { 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 93 of file BaseSimulatorTool.h.

94 { 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 62 of file BaseSimulatorTool.h.

63 { 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 66 of file BaseSimulatorTool.h.

67 { 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 70 of file BaseSimulatorTool.h.

71 { 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 74 of file BaseSimulatorTool.h.

75 {
76 // this implementation is a wrapper in case the simulator does
77 // implement particle-vector input
78
79 // simulate each particle individually
80 for (auto* cisp : particles) {
81 ATH_MSG_VERBOSE( "Starting simulation of particle: " << (*cisp) );
82 ATH_CHECK(this->simulate(ctx, *cisp, secondaries, mcEventCollection));
83 }
84 return StatusCode::SUCCESS;
85
86 }
#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 48 of file BaseSimulatorTool.h.

49 {
51 ATH_CHECK( m_chrono.retrieve() );
52 return StatusCode::SUCCESS;
53 }
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 114 of file BaseSimulatorTool.h.

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

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