HepMC3 event record library
testSingleVertexHepMC2.cc
1// -*- C++ -*-
2//
3// This file is part of HepMC
4// Copyright (C) 2014-2021 The HepMC collaboration (see AUTHORS for details)
5//
6#include "HepMC3/Print.h"
7#include "HepMC3/GenEvent.h"
9#include "HepMC3/GenVertex.h"
12#include "HepMC3TestUtils.h"
13using namespace HepMC3;
14int main()
15{
17 ReaderAsciiHepMC2 inputA("inputSingleVertexHepMC2.hepmc");
18 if(inputA.failed()) return 1;
19 std::vector<std::shared_ptr<GenEvent> > evts;
20 while( !inputA.failed() )
21 {
22 std::shared_ptr<GenEvent> evt= std::make_shared<GenEvent>();
23 inputA.read_event(*evt);
24 if( inputA.failed() ) {
25 printf("End of file reached. Exit.\n");
26 break;
27 }
28 evts.push_back(evt);
29 }
30 inputA.close();
31
32 if (evts[0]->particles().size()==120&&evts[0]->vertices().size()==1) return EXIT_SUCCESS;
33 return EXIT_FAILURE;
34}
Definition of class GenEvent.
Definition of class GenParticle.
Definition of class GenVertex.
Definition of static class Print.
Definition of class ReaderAsciiHepMC2.
Definition of class WriterAsciiHepMC2.
Parser for HepMC2 I/O files.
static void set_debug_level(const int level)
Set debug level.
Definition: Setup.cc:22
HepMC3 main namespace.