ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
ISF::BaseSimulatorTool Class Reference

#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. More...
 
virtual StatusCode sysInitialize () override
 Gaudi sysInitialize() methods. More...
 
virtual StatusCode initialize () override
 
virtual StatusCode setupEvent (const EventContext &) override
 Setup Event chain - in case of a begin-of event action is needed. More...
 
virtual StatusCode setupEventST () override
 Setup Event chain - in case of a begin-of event action is needed (called by ISimulationSvc) More...
 
virtual StatusCode simulate (ISFParticle &, ISFParticleContainer &, McEventCollection *) override
 
virtual StatusCode simulateVector (const ISFParticleVector &particles, ISFParticleContainer &secondaries, McEventCollection *mcEventCollection, McEventCollection *) override
 Simulation call for vectors of particles. More...
 
virtual StatusCode releaseEvent (const EventContext &) override
 Release Event chain - in case of an end-of event action is needed. More...
 
virtual StatusCode releaseEventST () override
 Release Event chain - in case of an end-of event action is needed (called by ISimulationSvc) More...
 
const ChronoEntity * chronoStart (const IChronoSvc::ChronoTag &tag)
 wrapper call to start chrono with given tag More...
 
const ChronoEntity * chronoStop (const IChronoSvc::ChronoTag &tag)
 wrapper call to stop chrono with given tag More...
 

Protected Attributes

std::string m_chronoSvcName {"ChronoStatSvc"}
 Name of the timing service - can be set by declareProperty() More...
 
IChronoStatSvc * m_chrono {}
 The timing service for general usage. More...
 

Private Member Functions

 BaseSimulatorTool ()
 Default constructor. More...
 

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  // Service handling
44  declareProperty("ChronoStatService", m_chronoSvcName );
45  }

◆ ~BaseSimulatorTool()

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

Destructor.

Definition at line 48 of file BaseSimulatorTool.h.

48 {}

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

100  {
101  if (m_chrono) return m_chrono->chronoStart( tag);
102  return nullptr;
103  }

◆ chronoStop()

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

wrapper call to stop chrono with given tag

Definition at line 106 of file BaseSimulatorTool.h.

106  {
107  if (m_chrono) return m_chrono->chronoStop( tag);
108  return nullptr;
109  }

◆ initialize()

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

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

Definition at line 59 of file BaseSimulatorTool.h.

60  {
61  return StatusCode::SUCCESS;
62  }

◆ releaseEvent()

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

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

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

Definition at line 92 of file BaseSimulatorTool.h.

93  { 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::FastCaloSimV2Tool.

Definition at line 96 of file BaseSimulatorTool.h.

97  { return releaseEvent(Gaudi::Hive::currentContext()); }

◆ setupEvent()

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

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

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

Definition at line 65 of file BaseSimulatorTool.h.

66  { 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::FastCaloSimV2Tool.

Definition at line 69 of file BaseSimulatorTool.h.

70  { return setupEvent(Gaudi::Hive::currentContext()); }

◆ simulate()

virtual StatusCode ISF::BaseSimulatorTool::simulate ( ISFParticle ,
ISFParticleContainer ,
McEventCollection  
)
inlineoverridevirtual

◆ simulateVector()

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

Simulation call for vectors of particles.

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

Definition at line 77 of file BaseSimulatorTool.h.

78  {
79  // this implementation is a wrapper in case the simulator does
80  // implement particle-vector input
81 
82  // simulate each particle individually
83  for (auto* cisp : particles) {
84  ATH_MSG_VERBOSE( "Starting simulation of particle: " << (*cisp) );
85  ATH_CHECK(this->simulate(*cisp, secondaries, mcEventCollection));
86  }
87  return StatusCode::SUCCESS;
88 
89  }

◆ sysInitialize()

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

Gaudi sysInitialize() methods.

Definition at line 51 of file BaseSimulatorTool.h.

52  {
54  ATH_CHECK( serviceLocator()->service(m_chronoSvcName, m_chrono ) );
55  return StatusCode::SUCCESS;
56  }

Member Data Documentation

◆ m_chrono

IChronoStatSvc* ISF::BaseSimulatorTool::m_chrono {}
protected

The timing service for general usage.

Definition at line 120 of file BaseSimulatorTool.h.

◆ m_chronoSvcName

std::string ISF::BaseSimulatorTool::m_chronoSvcName {"ChronoStatSvc"}
protected

Name of the timing service - can be set by declareProperty()

Definition at line 117 of file BaseSimulatorTool.h.


The documentation for this class was generated from the following file:
ISF::BaseSimulatorTool::m_chronoSvcName
std::string m_chronoSvcName
Name of the timing service - can be set by declareProperty()
Definition: BaseSimulatorTool.h:117
ISF::BaseSimulatorTool::releaseEvent
virtual StatusCode releaseEvent(const EventContext &) override
Release Event chain - in case of an end-of event action is needed.
Definition: BaseSimulatorTool.h:92
ISF::BaseSimulatorTool::m_chrono
IChronoStatSvc * m_chrono
The timing service for general usage.
Definition: BaseSimulatorTool.h:120
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize
virtual StatusCode sysInitialize() override
Perform system initialization for an algorithm.
ISF::BaseSimulatorTool::setupEvent
virtual StatusCode setupEvent(const EventContext &) override
Setup Event chain - in case of a begin-of event action is needed.
Definition: BaseSimulatorTool.h:65
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
ISF::BaseSimulatorTool::simulate
virtual StatusCode simulate(ISFParticle &, ISFParticleContainer &, McEventCollection *) override
Definition: BaseSimulatorTool.h:73