HepMC3 event record library
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
test
testSingleVertexHepMC2.cc
1
// -*- C++ -*-
2
//
3
// This file is part of HepMC
4
// Copyright (C) 2014-2020 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
}
GenParticle.h
Definition of class GenParticle.
HepMC3::Setup::set_debug_level
static void set_debug_level(const int level)
Set debug level.
Definition:
Setup.cc:22
GenVertex.h
Definition of class GenVertex.
HepMC3::ReaderAsciiHepMC2
Parser for HepMC2 I/O files.
Definition:
ReaderAsciiHepMC2.h:30
ReaderAsciiHepMC2.h
Definition of class ReaderAsciiHepMC2.
WriterAsciiHepMC2.h
Definition of class WriterAsciiHepMC2.
Print.h
Definition of static class Print.
main
int main(int argc, char **argv)
Definition:
rootIOTree_example_read.cc:23
GenEvent.h
Definition of class GenEvent.
Generated on Mon Jan 4 2021 09:07:32 for HepMC3 event record library by
1.8.5