|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ISF_BASESIMULATIONSVC_H
6 #define ISF_BASESIMULATIONSVC_H 1
13 #include "GaudiKernel/ServiceHandle.h"
14 #include "GaudiKernel/ToolHandle.h"
15 #include "GaudiKernel/IChronoStatSvc.h"
28 class IParticleBroker;
45 base_class(
name,pSvcLocator),
52 "A unique string to identify the simulator.");
56 "Handle to a StoreGateSvc instance: it will be used to retrieve data during the course of the job" );
59 "Handle to a StoreGateSvc/DetectorStore instance: it will be used to retrieve data during the course of the job" );
73 if ( AthService::sysInitialize().isFailure() ) {
75 return StatusCode::FAILURE;
79 return StatusCode::FAILURE;
82 return StatusCode::SUCCESS;
90 {
return StatusCode::SUCCESS; }
94 {
return StatusCode::SUCCESS; }
99 return StatusCode::SUCCESS;
110 if ( this->
simulate(*
part, mcEventCollection).isFailure()) {
113 " -> particle : " << *
part );
117 return ( success ) ? StatusCode::SUCCESS : StatusCode::FAILURE;
151 if (!thandle.empty() && thandle.retrieve().isFailure()){
153 return StatusCode::FAILURE;
156 return StatusCode::SUCCESS;
162 if (!thandleArray.empty() && thandleArray.retrieve().isFailure()){
164 return StatusCode::FAILURE;
167 return StatusCode::SUCCESS;
174 coll = coll ? coll :
new T;
176 if (
evtStore()->record( coll, collName).isFailure()){
178 return StatusCode::FAILURE;
181 return StatusCode::SUCCESS;
188 if (!forceBreak && !
evtStore()->contains<T>(collName)) {
191 return StatusCode::SUCCESS;
195 return StatusCode::FAILURE;
198 return StatusCode::SUCCESS;
234 return StatusCode::SUCCESS;
239 #endif //> !ISF_BASESIMULATIONSVC_H
def retrieve(aClass, aKey=None)
virtual StatusCode setupEvent() override
Setup Event chain - in case of a begin-of event action is needed.
virtual StatusCode sysInitialize() override
Gaudi sysInitialize() methods.
std::string & simSvcDescriptor() override
Return the simulation service descriptor.
const StoreGateSvc_t & evtStore() const
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
ServiceHandle< StoreGateSvc > StoreGateSvc_t
BaseSimulationSvc()
Default constructor.
StoreGateSvc_t & detStore()
StatusCode recordCollection(T *&coll, const std::string &collName) const
templated record collection method, will create a new one if not existing
virtual StatusCode releaseEvent() override
Release Event chain - in case of an end-of event action is needed.
#define ATH_MSG_VERBOSE(x)
const StoreGateSvc_t & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
StoreGateSvc_t & evtStore()
virtual StatusCode simulate(ISFParticle &isp, McEventCollection *mcEventCollection) override
Simulation call for individual particles.
StatusCode retrieveCollection(T *&coll, const std::string &collName, bool forceBreak=true) const
templated retrieve collection method, boolean steers that force break
virtual StatusCode simulateVector(const ISFParticleVector &particles, McEventCollection *mcEventCollection, McEventCollection *) override
Simulation call for vectors of particles.
virtual StatusCode setParticleBroker(IParticleBroker *broker) override
Inform the SimulationSvc about the ParticleBroker svc.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
std::string m_simDescr
The simulator service descriptor.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
std::string m_screenOutputPrefix
Screen output refinement - can be changed by declareProperty()
const ChronoEntity * chronoStop(const IChronoSvc::ChronoTag &tag)
wrapper call to stop chrono with given tag
const ChronoEntity * chronoStart(const IChronoSvc::ChronoTag &tag)
wrapper call to start chrono with given tag
std::string m_chronoSvcName
Name of the timing service - can be set by declareProperty()
#define ATH_MSG_WARNING(x)
virtual ~BaseSimulationSvc()
Destructor.
IChronoStatSvc * m_chrono
The timing service for general usage.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode retrieveTool(ToolHandle< T > &thandle)
templated Tool retrieval - gives unique handling & look and feel
BaseSimulationSvc(const std::string &name, ISvcLocator *pSvcLocator)
defines and typedefs for IOVSvc
StatusCode retrieveTools(ToolHandleArray< T > &thandleArray)
templated Tool retrieval - gives unique handling & look and feel
IParticleBroker * m_particleBroker
The particle service used to push particles into the simulation.