StRoot
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
StarGenerator
HepMC2_06_09
test
testPrintBug.cc
1
//
2
// Thanks to Bob McElrath and Frank Siegert for this test
3
//
4
5
#include <fstream>
6
7
#include "HepMC/GenEvent.h"
8
#include "HepMC/SimpleVector.h"
9
10
int
main()
11
{
12
HepMC::GenEvent
* p_event;
13
14
p_event =
new
HepMC::GenEvent
();
15
p_event->
use_units
(HepMC::Units::GEV, HepMC::Units::MM);
16
17
// define an output stream
18
std::ofstream os(
"testPrintBug.out"
);
19
20
for
(
int
i=0; i<10; i++) {
21
HepMC::FourVector
vector(1.0,1.0,1.0,1.0);
22
HepMC::GenVertex
*
vertex
=
new
HepMC::GenVertex
(vector,i);
23
for
(
int
j=0; j<3; j++) {
24
HepMC::GenParticle
* particle =
new
HepMC::GenParticle
(vector,1,2);
25
vertex->
add_particle_in
(particle);
26
}
27
for
(
int
j=0; j<3; j++) {
28
HepMC::GenParticle
* particle =
new
HepMC::GenParticle
(vector,1,2);
29
vertex->
add_particle_out
(particle);
30
}
31
p_event->
add_vertex
(vertex);
32
}
33
p_event->
print
(os);
34
// cleanup
35
delete
p_event;
36
return
0;
37
}
vertex
Definition:
L3_Banks.hh:256
HepMC::GenVertex::add_particle_in
void add_particle_in(GenParticle *inparticle)
add incoming particle
Definition:
GenVertex.cc:273
HepMC::GenVertex
GenVertex contains information about decay vertices.
Definition:
GenVertex.h:52
HepMC::GenEvent
The GenEvent class is the core of HepMC.
Definition:
GenEvent.h:155
HepMC::GenVertex::add_particle_out
void add_particle_out(GenParticle *outparticle)
add outgoing particle
Definition:
GenVertex.cc:284
HepMC::GenEvent::add_vertex
bool add_vertex(GenVertex *vtx)
adds to evt and adopts
Definition:
GenEvent.cc:334
HepMC::GenEvent::print
void print(std::ostream &ostr=std::cout) const
dumps to ostr
Definition:
GenEvent.cc:277
HepMC::FourVector
FourVector is a simple representation of a physics 4 vector.
Definition:
SimpleVector.h:42
HepMC::GenEvent::use_units
void use_units(Units::MomentumUnit, Units::LengthUnit)
Definition:
GenEvent.h:856
HepMC::GenParticle
The GenParticle class contains information about generated particles.
Definition:
GenParticle.h:60
Generated by
1.8.5