|
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) {};
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;
90 if ( this->
simulate(*
part, mcEventCollection).isFailure()) {
93 " -> particle : " << *
part );
97 return ( success ) ? StatusCode::SUCCESS : StatusCode::FAILURE;
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;
166 if (!forceBreak && !
evtStore()->contains<T>(collName)) {
169 return StatusCode::SUCCESS;
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;
218 #endif //> !ISF_BASESIMULATIONSVC_H
def retrieve(aClass, aKey=None)
ServiceHandle< StoreGateSvc > & evtStore()
Gaudi::Property< std::string > m_simDescr
The simulator service descriptor.
ServiceHandle< IChronoStatSvc > m_chrono
The timing service for general usage.
virtual StatusCode setupEvent() override
Setup Event chain - in case of a begin-of event action is needed.
virtual StatusCode sysInitialize() override
Gaudi sysInitialize() methods.
BaseSimulationSvc()
Default constructor.
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 StatusCode releaseEvent() override
Release Event chain - in case of an end-of event action is needed.
#define ATH_MSG_VERBOSE(x)
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.
::StatusCode StatusCode
StatusCode definition for legacy code.
const ServiceHandle< StoreGateSvc > & evtStore() const
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
Gaudi::Property< std::string > m_screenOutputPrefix
Screen output refinement.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
const ChronoEntity * chronoStop(const IChronoSvc::ChronoTag &tag)
wrapper call to stop chrono with given tag
ServiceHandle< StoreGateSvc > m_detStore
Handle to StoreGate (detector store by default)
const ChronoEntity * chronoStart(const IChronoSvc::ChronoTag &tag)
wrapper call to start chrono with given tag
const std::string & simSvcDescriptor() override
Return the simulation service descriptor.
#define ATH_MSG_WARNING(x)
virtual ~BaseSimulationSvc()
Destructor.
ServiceHandle< StoreGateSvc > m_evtStore
Handle to StoreGate (event 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.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.