6#ifndef ATLASHEPMC_IOGENEVENT_H
7#define ATLASHEPMC_IOGENEVENT_H
9#include "HepMC3/Version.h"
10#include "HepMC3/Reader.h"
11#include "HepMC3/Writer.h"
12#include "HepMC3/ReaderAsciiHepMC2.h"
13#include "HepMC3/WriterAsciiHepMC2.h"
18typedef HepMC3::WriterAsciiHepMC2 WriterAsciiHepMC2;
19typedef HepMC3::ReaderAsciiHepMC2 ReaderAsciiHepMC2;
22 IO_GenEvent(
const std::string& filename=
"IO_GenEvent.dat",
23 std::ios::openmode mode=std::ios::out ) :
24 m_writer(std::make_unique<HepMC3::WriterAsciiHepMC2>(
filename))
26 if (mode!=std::ios::out) printf(
"In AtlasHepMC/IO_GenEvent.h in IO_GenEvent(filename,mode) mode should be std::ios::out\n");
28 IO_GenEvent( std::ostream & os ) :
29 m_writer(std::make_unique<HepMC3::WriterAsciiHepMC2>(
os))
34 void write_event(
const HepMC3::GenEvent* evt ) {
35 m_writer->write_event(*evt);
38 std::unique_ptr<HepMC3::WriterAsciiHepMC2> m_writer;