// -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/RivetAIDA.hh" #include "Rivet/Tools/Logging.hh" #include "HepMC/IO_AsciiParticles.h" namespace Rivet { class READ_HEPMC : public Analysis { public: /// Constructor READ_HEPMC() : Analysis("READ_HEPMC") { } void init() { } /// Perform the per-event analysis ---------------------------------------------------------------------- void analyze(const Event& event) { // print out the hepmc record on screen // event.genEvent().print() ; // need to create a pointer for using IO_ascii const HepMC::GenEvent* pevt= &event.genEvent(); // print out the hepmc record in a human readbale format on file:IO_AsciiParticles.dat ascii_io.write_event (pevt); } void finalize() { } private: HepMC::IO_AsciiParticles ascii_io; }; // This global object acts as a hook for the plugin system AnalysisBuilder plugin_READ_HEPMC; }