5#ifndef ISF_BASESIMULATIONSVC_H
6#define ISF_BASESIMULATIONSVC_H 1
13#include "GaudiKernel/ServiceHandle.h"
14#include <GaudiKernel/StatusCode.h>
15#include "GaudiKernel/ToolHandle.h"
16#include "GaudiKernel/IChronoStatSvc.h"
46 base_class(name,pSvcLocator) {};
54 if ( AthService::sysInitialize().isFailure() ) {
56 return StatusCode::FAILURE;
58 if (
m_chrono.retrieve().isFailure()){
60 return StatusCode::FAILURE;
63 return StatusCode::SUCCESS;
71 {
return StatusCode::SUCCESS; }
75 {
return StatusCode::SUCCESS; }
80 return StatusCode::SUCCESS;
87 StatusCode
sc = StatusCode::SUCCESS;
91 if ( this->
simulate(*part, mcEventCollection).isFailure()) {
94 " -> particle : " << *part );
95 sc = StatusCode::FAILURE;
105 const ChronoEntity*
chronoStart(
const IChronoSvc::ChronoTag& tag ) {
111 const ChronoEntity*
chronoStop(
const IChronoSvc::ChronoTag& tag ) {
130 if (!thandle.empty() && thandle.retrieve().isFailure()){
132 return StatusCode::FAILURE;
135 return StatusCode::SUCCESS;
141 if (!thandleArray.empty() && thandleArray.retrieve().isFailure()){
143 return StatusCode::FAILURE;
146 return StatusCode::SUCCESS;
153 coll = coll ? coll :
new T;
155 if (
evtStore()->record( coll, collName).isFailure()){
157 return StatusCode::FAILURE;
160 return StatusCode::SUCCESS;
170 return StatusCode::SUCCESS;
172 if (
evtStore()->retrieve(coll, collName).isFailure()){
174 return StatusCode::FAILURE;
177 return StatusCode::SUCCESS;
186 "Handle to a StoreGateSvc instance: it will be used to retrieve data during the course of the job"};
190 "Handle to a StoreGateSvc/DetectorStore instance: it will be used to retrieve data during the course of the job"};
195 Gaudi::Property<std::string>
m_simDescr{
this,
"Identifier", {},
196 "A unique string to identify the simulator."};
200 "Prefix for log output"};
214 return StatusCode::SUCCESS;
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
defines and typedefs for IOVSvc
virtual StatusCode sysInitialize() override
Gaudi sysInitialize() methods.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
IParticleBroker * m_particleBroker
The particle service used to push particles into the simulation.
virtual StatusCode setupEvent() override
Setup Event chain - in case of a begin-of event action is needed.
ServiceHandle< StoreGateSvc > m_evtStore
Handle to StoreGate (event store by default)
StatusCode retrieveCollection(T *&coll, const std::string &collName, bool forceBreak=true) const
templated retrieve collection method, boolean steers that force break
Gaudi::Property< std::string > m_screenOutputPrefix
Screen output refinement.
virtual StatusCode simulateVector(const ISFParticleVector &particles, McEventCollection *mcEventCollection, McEventCollection *) override
Simulation call for vectors of particles.
StatusCode retrieveTools(ToolHandleArray< T > &thandleArray)
templated Tool retrieval - gives unique handling & look and feel
StatusCode retrieveTool(ToolHandle< T > &thandle)
templated Tool retrieval - gives unique handling & look and feel
const ChronoEntity * chronoStop(const IChronoSvc::ChronoTag &tag)
wrapper call to stop chrono with given tag
ServiceHandle< StoreGateSvc > & evtStore()
Gaudi::Property< std::string > m_simDescr
The simulator service descriptor.
const ChronoEntity * chronoStart(const IChronoSvc::ChronoTag &tag)
wrapper call to start chrono with given tag
ServiceHandle< StoreGateSvc > m_detStore
Handle to StoreGate (detector store by default)
StatusCode recordCollection(T *&coll, const std::string &collName) const
templated record collection method, will create a new one if not existing
ServiceHandle< StoreGateSvc > & detStore()
virtual ~BaseSimulationSvc()
Destructor.
virtual StatusCode releaseEvent() override
Release Event chain - in case of an end-of event action is needed.
virtual StatusCode simulate(ISFParticle &isp, McEventCollection *mcEventCollection) override
Simulation call for individual particles.
BaseSimulationSvc()
Default constructor.
const ServiceHandle< StoreGateSvc > & evtStore() const
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
BaseSimulationSvc(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode setParticleBroker(IParticleBroker *broker) override
Inform the SimulationSvc about the ParticleBroker svc.
const std::string & simSvcDescriptor() override
Return the simulation service descriptor.
ServiceHandle< IChronoStatSvc > m_chrono
The timing service for general usage.
The generic ISF particle definition,.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.