16 #ifndef JETSCAPEWRITERROOTHEPMC_H
17 #define JETSCAPEWRITERROOTHEPMC_H
25 #include "HepMC3/GenEvent.h"
26 #include "HepMC3/ReaderAscii.h"
27 #include "HepMC3/WriterRootTree.h"
28 #include "HepMC3/Print.h"
31 using HepMC3::GenEvent;
32 using HepMC3::GenVertex;
33 using HepMC3::GenParticle;
34 using HepMC3::GenVertexPtr;
35 using HepMC3::GenParticlePtr;
44 :
JetScapeWriter(m_file_name_out), HepMC3::WriterRootTree(m_file_name_out) {
45 SetId(
"HepMC ROOT writer");
64 void Write(weak_ptr<PartonShower>
ps);
65 void Write(weak_ptr<Hadron>
h);
76 inline HepMC3::GenVertexPtr
78 double x = vtx->x_in().x();
79 double y = vtx->x_in().y();
80 double z = vtx->x_in().z();
81 double t = vtx->x_in().t();
82 HepMC3::FourVector vtxPosition(x, y, z, t);
84 return make_shared<GenVertex>(vtxPosition);
87 inline HepMC3::GenParticlePtr
92 inline HepMC3::GenParticlePtr
94 HepMC3::FourVector pmom(particle.px(), particle.py(), particle.pz(),
96 return make_shared<GenParticle>(pmom, particle.
pid(), particle.
pstat());
99 inline HepMC3::GenParticlePtr
104 inline HepMC3::GenParticlePtr
106 HepMC3::FourVector pmom(particle.px(), particle.py(), particle.pz(),
108 return make_shared<GenParticle>(pmom, particle.
pid(), particle.
pstat());