|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef GENERATORMODULES_GENBASE_H
6 #define GENERATORMODULES_GENBASE_H
9 #include "GaudiKernel/ServiceHandle.h"
10 #include "GaudiKernel/IPartPropSvc.h"
11 #include "GaudiKernel/IIncidentSvc.h"
21 #include "HepPDT/ParticleData.hh"
22 #include "HepPDT/ParticleDataTable.hh"
54 GenBase(
const std::string&
name, ISvcLocator* pSvcLocator);
78 ATH_MSG_ERROR(
"McEventCollection is empty during first event access");
79 return *(
events()->begin());
85 ATH_MSG_ERROR(
"Const McEventCollection is empty during first event access");
139 BooleanProperty
m_mkMcEvent{
this,
"MakeMcEvent",
false,
"Create a new MC event collection if it doesn't exist"};
Property holding a SG store/key/clid from which a ReadHandle is made.
virtual ~GenBase()
Virtual destructor.
void mmTocm(HepMC::GenEvent *evt)
Scale event lengths by x 1/10.
const_pointer_type cptr()
Dereference the pointer.
void GeVToMeV(HepMC::GenEvent *evt)
Scale event energies/momenta by x 1000.
const McEventCollection * events_const() const
Access the current event's McEventCollection (const)
virtual StatusCode execute() override
HepMC::GenEvent *event ATLAS_NOT_CONST_THREAD_SAFE()
Access the current signal event (first in the McEventCollection)
std::string m_mcEventKey
StoreGate key for the MC event collection (defaults to GEN_EVENT)
const std::string & key() const
Return the StoreGate ID for the referenced object.
void MeVToGeV(HepMC::GenEvent *evt)
Scale event energies/momenta by x 1/1000.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
BooleanProperty m_mkMcEvent
Flag to determine if a new MC event collection should be made if it doesn't exist.
ServiceHandle< IPartPropSvc > m_ppSvc
Handle on the particle property service.
Base class for common behaviour of MC truth algorithms.
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadHandleKey< McEventCollection > m_mcevents_const
Const handle to the MC event collection.
McEventCollection *events ATLAS_NOT_CONST_THREAD_SAFE()
Access the current event's McEventCollection.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const HepPDT::ParticleDataTable & particleTable() const
Get a particle data table.
Helpers for checking error return status codes and reporting errors.
const ServiceHandle< IPartPropSvc > partPropSvc() const
Access the particle property service.
const HepPDT::ParticleDataTable & pdt() const
Shorter alias to get a particle data table.
GenBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
void cmTomm(HepMC::GenEvent *evt)
Scale event lengths by x 10.
const McEventCollection * events_const(const EventContext &ctx) const
Define macros for attributes used to control the static checker.
const HepPDT::ParticleData * particleData(int pid) const
Access an element in the particle data table.
virtual StatusCode initialize() override
const HepMC::GenEvent * event_const() const
Access the current signal event (const)
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.