HepMC3 event record library
test
testPrintBug.cc
1
//
2
// Thanks to Bob McElrath and Frank Siegert for this test
3
// andrii.verbytskyi@mpp.mpg.gov, Nov. 2018
4
5
#include <fstream>
6
7
#include "
HepMC3/GenEvent.h
"
8
#include "
HepMC3/GenParticle.h
"
9
#include "
HepMC3/GenVertex.h
"
10
#include "
HepMC3/Print.h
"
11
using namespace
HepMC3
;
12
int
main
()
13
{
14
GenEvent
p_event(Units::GEV, Units::MM);
15
for
(
int
i=0; i<10; i++)
16
{
17
FourVector
vector(1.0,1.0,1.0,1.0);
18
GenVertexPtr vertex=std::make_shared<GenVertex>();
19
vertex->set_position(vector);
20
vertex->set_id(i);
21
for
(
int
j=0; j<3; j++)
22
{
23
GenParticlePtr particle = std::make_shared<GenParticle>(vector,1,2);
24
vertex->add_particle_in(particle);
25
}
26
for
(
int
j=0; j<3; j++)
27
{
28
GenParticlePtr particle = std::make_shared<GenParticle>(vector,1,2);
29
vertex->add_particle_out(particle);
30
}
31
p_event.add_vertex(vertex);
32
}
33
Print::listing
(p_event);
34
// cleanup
35
p_event.clear();
36
return
0;
37
}
HepMC3
HepMC3 main namespace.
Definition:
WriterDOT.h:19
GenParticle.h
Definition of class GenParticle.
GenVertex.h
Definition of class GenVertex.
HepMC3::Print::listing
static void listing(std::ostream &os, const GenEvent &event, unsigned short precision=2)
Print event in listing (HepMC2) format.
Definition:
Print.cc:51
HepMC3::GenEvent
Stores event-related information.
Definition:
GenEvent.h:42
HepMC3::FourVector
Generic 4-vector.
Definition:
FourVector.h:34
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 Fri Apr 5 2019 18:24:36 for HepMC3 event record library by
1.8.15