HepMC3 event record library
testConvert2.cc
1// -*- C++ -*-
2//
3// This file is part of HepMC
4// Copyright (C) 2014-2021 The HepMC collaboration (see AUTHORS for details)
5//
8#include "HepMC3TestUtils.h"
9int 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}
Implementation of compatibility layer (in-memory conversion functions) between HepMC2 and HepMC3.
HepMC3::GenEvent * ConvertHepMCGenEvent_2to3(const HepMC::GenEvent &evt, std::shared_ptr< HepMC3::GenRunInfo > run)
Definition of class WriterAsciiHepMC2.
Stores event-related information.
Definition: GenEvent.h:41
GenEvent I/O serialization for structured text files.