HepMC3 event record library
test
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
"
8
#include "
HepMC3/GenParticle.h
"
9
#include "
HepMC3/GenVertex.h
"
10
#include "
HepMC3/ReaderAsciiHepMC2.h
"
11
#include "
HepMC3/WriterAsciiHepMC2.h
"
12
#include "HepMC3TestUtils.h"
13
using namespace
HepMC3
;
14
int
main()
15
{
16
Setup::set_debug_level
(60);
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
}
GenEvent.h
Definition of class GenEvent.
GenParticle.h
Definition of class GenParticle.
GenVertex.h
Definition of class GenVertex.
Print.h
Definition of static class Print.
ReaderAsciiHepMC2.h
Definition of class ReaderAsciiHepMC2.
WriterAsciiHepMC2.h
Definition of class WriterAsciiHepMC2.
HepMC3::ReaderAsciiHepMC2
Parser for HepMC2 I/O files.
Definition:
ReaderAsciiHepMC2.h:30
HepMC3::Setup::set_debug_level
static void set_debug_level(const int level)
Set debug level.
Definition:
Setup.cc:22
HepMC3
HepMC3 main namespace.
Definition:
AnalysisExample.h:19
Generated on Wed Jan 18 2023 00:00:00 for HepMC3 event record library by
1.9.6