5#ifndef ISF_BASESIMULATIONSVC_H
6#define ISF_BASESIMULATIONSVC_H 1
12#include "GaudiKernel/ServiceHandle.h"
13#include <GaudiKernel/StatusCode.h>
14#include "GaudiKernel/ToolHandle.h"
15#include "GaudiKernel/IChronoStatSvc.h"
45 base_class(name,pSvcLocator) {};
53 if ( AthService::sysInitialize().isFailure() ) {
55 return StatusCode::FAILURE;
57 if (
m_chrono.retrieve().isFailure()){
59 return StatusCode::FAILURE;
62 return StatusCode::SUCCESS;
70 {
return StatusCode::SUCCESS; }
74 {
return StatusCode::SUCCESS; }
79 return StatusCode::SUCCESS;
86 StatusCode
sc = StatusCode::SUCCESS;
90 if ( this->
simulate(*part, mcEventCollection).isFailure()) {
93 " -> particle : " << *part );
94 sc = StatusCode::FAILURE;
104 const ChronoEntity*
chronoStart(
const IChronoSvc::ChronoTag& tag ) {
110 const ChronoEntity*
chronoStop(
const IChronoSvc::ChronoTag& tag ) {
129 if (!thandle.empty() && thandle.retrieve().isFailure()){
131 return StatusCode::FAILURE;
134 return StatusCode::SUCCESS;
140 if (!thandleArray.empty() && thandleArray.retrieve().isFailure()){
142 return StatusCode::FAILURE;
145 return StatusCode::SUCCESS;
152 coll = coll ? coll :
new T;
154 if (
evtStore()->record( coll, collName).isFailure()){
156 return StatusCode::FAILURE;
159 return StatusCode::SUCCESS;
169 return StatusCode::SUCCESS;
171 if (
evtStore()->retrieve(coll, collName).isFailure()){
173 return StatusCode::FAILURE;
176 return StatusCode::SUCCESS;
185 "Handle to a StoreGateSvc instance: it will be used to retrieve data during the course of the job"};
189 "Handle to a StoreGateSvc/DetectorStore instance: it will be used to retrieve data during the course of the job"};
194 Gaudi::Property<std::string>
m_simDescr{
this,
"Identifier", {},
195 "A unique string to identify the simulator."};
199 "Prefix for log output"};
213 return StatusCode::SUCCESS;
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
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.