|
[Rivet-svn] r2267 - trunk/testblackhole at projects.hepforge.org blackhole at projects.hepforge.orgWed Feb 24 16:20:34 GMT 2010
Author: fsiegert Date: Wed Feb 24 16:20:33 2010 New Revision: 2267 Log: Use different HepMC method to iterate over file. This way it seems to also work in HepMC<2.05. I have no idea why the other method doesn't work in those versions, probably a HepMC bug. Modified: trunk/test/testApi.cc Modified: trunk/test/testApi.cc ============================================================================== --- trunk/test/testApi.cc Mon Feb 22 15:20:44 2010 (r2266) +++ trunk/test/testApi.cc Wed Feb 24 16:20:33 2010 (r2267) @@ -17,11 +17,14 @@ std::istream* file = new std::fstream("testApi.hepmc", std::ios::in); HepMC::IO_GenEvent hepmcio(*file); - HepMC::GenEvent evt; + HepMC::GenEvent* evt = hepmcio.read_next_event(); double sum_of_weights = 0.0; - while (hepmcio.fill_next_event(&evt)) { - rivet.analyze(evt); - sum_of_weights+=evt.weights()[0]; + while (evt) { + rivet.analyze(*evt); + sum_of_weights+=evt->weights()[0]; + // clean up and get next event + delete evt; + hepmcio >> evt; } delete file;
More information about the Rivet-svn mailing list |