HepMC3 event record library
OutputValidationTool.cc
1 // -*- C++ -*-
2 //
3 // This file is part of HepMC
4 // Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
5 //
6 #include "OutputValidationTool.h"
7 
8 OutputValidationTool::OutputValidationTool( const std::string &filename ):m_filename(filename),m_timer("IO time") {
9 }
10 
12  HEPMC2CODE( m_file = new IO_GenEvent((std::string("outputHepMC2")+m_filename).c_str(), std::ios::out); )
13  HEPMC3CODE( std::shared_ptr<GenRunInfo> run = std::make_shared<GenRunInfo>(); m_file = new WriterAsciiHepMC2(std::string("outputHepMC3")+m_filename,run);)
14 }
15 
17  m_timer.start();
18  HEPMC2CODE(HepMC::GenEvent* hepmcevt=&hepmc; (*m_file)<<hepmcevt;)
19  HEPMC3CODE(m_file->write_event(hepmc);)
20  return 0;
21 }
22 
24  delete m_file;
25 }
GenEvent I/O serialization for structured text files.
int process(GenEvent &hepmc)
Process event.
void start()
Definition: Timer.h:44
void initialize()
Initialize.
Stores event-related information.
Definition: GenEvent.h:41
OutputValidationTool(const std::string &filename)
Constructor.
std::string m_filename
Used file.