12#include "GaudiKernel/DataSvc.h"
36 return StatusCode::SUCCESS;
45 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"found an McEventCollecion in store" <<
endmsg;
48 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"create new McEventCollecion in store" <<
endmsg;
51 if (status.isFailure()) {
52 msg(MSG::ERROR) <<
"Could not record McEventCollection" <<
endmsg;
57 HepMC3::GenEvent* evt =
new HepMC3::GenEvent();
60 if (!evt->run_info()) evt->set_run_info(
m_hepmcio->run_info());
63 evt->set_units(HepMC3::Units::MEV, HepMC3::Units::MM);
65 const auto cs = evt->cross_section();
76 HepMC::GenEvent* evt =
m_hepmcio->read_next_event();
80 evt->use_units(HepMC::Units::MEV,HepMC::Units::MM);
83 HepMC::GenCrossSection* cs=evt->cross_section();
86 xs=cs->cross_section();
92 return StatusCode::SUCCESS;
99 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 finalize() override
HepMCReadFromFile(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute() override
std::unique_ptr< HepMC::IO_GenEvent > 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