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
#include "
HepMC3/PrintStreams.h
"
12
using namespace
HepMC3
;
13
int
main
()
14
{
15
GenEvent
p_event(Units::GEV, Units::MM);
16
for
(
int
i=0; i<10; i++)
17
{
18
FourVector
vector(1.0,1.0,1.0,1.0);
19
GenVertexPtr vertex=std::make_shared<GenVertex>();
20
vertex->set_position(vector);
21
vertex->set_id(i);
22
for
(
int
j=0; j<3; j++)
23
{
24
GenParticlePtr particle = std::make_shared<GenParticle>(vector,1,2);
25
vertex->add_particle_in(particle);
26
}
27
for
(
int
j=0; j<3; j++)
28
{
29
GenParticlePtr particle = std::make_shared<GenParticle>(vector,1,2);
30
vertex->add_particle_out(particle);
31
}
32
p_event.add_vertex(vertex);
33
}
34
Print::listing(p_event);
35
//
36
Print::content(p_event);
37
std::cout<<p_event;
38
// cleanup
39
p_event.clear();
40
return
0;
41
}
GenEvent.h
Definition of class GenEvent.
GenParticle.h
Definition of class GenParticle.
GenVertex.h
Definition of class GenVertex.
PrintStreams.h
Implementation of ostreams for the objects.
Print.h
Definition of static class Print.
HepMC3::FourVector
Generic 4-vector.
Definition:
FourVector.h:36
HepMC3::GenEvent
Stores event-related information.
Definition:
GenEvent.h:41
HepMC3
HepMC3 main namespace.
Definition:
AnalysisExample.h:19
main
int main(int argc, char **argv)
Definition:
rootIOTree_example_read.cc:23
Generated on Wed Dec 1 2021 20:16:07 for HepMC3 event record library by
1.9.2