HepMC3 event record library
testConvert2.cc
1 // -*- C++ -*-
2 //
3 // This file is part of HepMC
4 // Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
5 //
7 #include "HepMCCompatibility.h"
8 #include "HepMC3TestUtils.h"
9 int main()
10 {
11  std::ifstream inputA( "inputConvert2.hepmc" );
12  if( !inputA ) return 1;
13  HepMC3::WriterAsciiHepMC2 outputA("frominputConvert2.hepmc");
14  std::shared_ptr<HepMC3::GenRunInfo> run =std::make_shared<HepMC3::GenRunInfo>();
15  while(inputA)
16  {
17  HepMC::GenEvent evt;
18  evt.clear();
19  evt.read( inputA );
20  if( !evt.is_valid() ) break;
22  if (!evt3) return 4;
23  outputA.write_event(*evt3);
24  delete evt3;
25  }
26  inputA.close();
27  outputA.close();
28  return COMPARE_ASCII_FILES("frominputConvert2.hepmc","inputConvert2.hepmc");
29 }
GenEvent I/O serialization for structured text files.
Stores event-related information.
Definition: GenEvent.h:41
HepMC3::GenEvent * ConvertHepMCGenEvent_2to3(const HepMC::GenEvent &evt, std::shared_ptr< HepMC3::GenRunInfo > run)
Definition of class WriterAsciiHepMC2.
int main(int argc, char **argv)
Implementation of compatibility layer (in-memory conversion functions) between HePMC2 and HepMC3...