IAP GITLAB

Commit 676b2903 authored by Tanguy Pierog's avatar Tanguy Pierog

add correction for UNIT problem with HEPMC 2.06


git-svn-id: https://devel-ik.fzk.de/svn/mc/crmc/tags/r2790@2822 c7a5e08c-de06-0410-9364-b41cf42a0b17
parent 9e026aea
......@@ -7,15 +7,18 @@ using namespace std;
void AddEvent(const int nEvent, HepMC::IO_HEPEVT& hepevtio, HepMC::IO_GenEvent& ascii_out)
{
HepMC::GenEvent* evt = NULL;
evt = hepevtio.read_next_event(); // here hepevt_ a COMMON fortran block gets read in
if (!evt)
throw std::runtime_error("!!!Could not read next event");
#ifdef HEPMC_HAS_UNITS
// define the units (Pythia uses GeV and mm)
evt->use_units(HepMC::Units::GEV, HepMC::Units::MM);
HepMC::GenEvent* evt = new HepMC::GenEvent(HepMC::Units::GEV, HepMC::Units::MM);
#else
HepMC::GenEvent* evt = new HepMC::GenEvent();
#endif
const bool res = hepevtio.fill_next_event(evt); // here hepevt_ a COMMON fortran block gets read in
if (! res) {
delete evt;
throw std::runtime_error("!!!Could not read next event");
}
#ifdef HEPMC_HAS_CROSS_SECTION
// set cross section information for this event
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment