12#include "GaudiKernel/DataSvc.h"
32 return StatusCode::SUCCESS;
41 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"found an McEventCollecion in store" <<
endmsg;
44 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"create new McEventCollecion in store" <<
endmsg;
47 if (status.isFailure()) {
48 msg(MSG::ERROR) <<
"Could not record McEventCollection" <<
endmsg;
52 HepMC3::GenEvent* evt =
new HepMC3::GenEvent();
55 if (!evt->run_info()) evt->set_run_info(
m_hepmcio->run_info());
58 evt->set_units(HepMC3::Units::MEV, HepMC3::Units::MM);
60 const auto cs = evt->cross_section();
68 return StatusCode::SUCCESS;
75 return StatusCode::SUCCESS;
#define CHECK(...)
Evaluate an expression and check for errors.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
bool msgLvl(const MSG::Level lvl) const
value_type push_back(value_type pElem)
Add an element to the end of the collection.
std::string m_mcEventKey
StoreGate key for the MC event collection (defaults to GEN_EVENT).
virtual StatusCode initialize() override
GenBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
virtual StatusCode finalize() override
HepMCReadFromFile(const std::string &name, ISvcLocator *pSvcLocator)
std::shared_ptr< HepMC3::Reader > m_hepmcio
virtual StatusCode initialize() override
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