12 #include "HepMC3/Print.h"
53 const int total_N,
const int proj_N)
55 filename_(path / (name +
".asciiv3")),
67 const int pdg_nuclear_code_prefix = 10 * 1E8;
69 const int pdg_nuclear_code_lambda = 0 * 1E7;
70 const int pdg_nuclear_code_charge = nz * 1E4;
71 const int pdg_nuclear_code_baryon = na * 1E1;
73 const int pdg_nuclear_code_isomer = 0 * 1E0;
75 return pdg_nuclear_code_prefix + pdg_nuclear_code_lambda +
76 pdg_nuclear_code_charge + pdg_nuclear_code_baryon +
77 pdg_nuclear_code_isomer;
81 const int event_number,
const EventInfo &) {
83 make_unique<HepMC3::GenEvent>(HepMC3::Units::GEV, HepMC3::Units::MM);
88 std::shared_ptr<HepMC3::GenCrossSection> cross_section =
89 std::make_shared<HepMC3::GenCrossSection>();
91 const double dummy_xs = 1.0;
92 cross_section->set_cross_section(dummy_xs, dummy_xs);
95 vertex_ = std::make_shared<HepMC3::GenVertex>();
108 total_mom_proj += data.momentum();
109 if (data.is_proton()) {
111 }
else if (!data.is_neutron()) {
112 throw std::invalid_argument(
113 "HepMC output in SMASH only supports colliding nuclei consisting "
117 total_mom_targ += data.momentum();
118 if (data.is_proton()) {
120 }
else if (!data.is_neutron()) {
121 throw std::invalid_argument(
122 "HepMC output in SMASH only supports colliding nuclei consisting "
128 const int proj_nuclear_pdg_code =
130 const int targ_nuclear_pdg_code =
133 HepMC3::GenParticlePtr projectile_p = std::make_shared<HepMC3::GenParticle>(
134 HepMC3::FourVector(total_mom_proj.
x1(), total_mom_proj.
x2(),
135 total_mom_proj.
x3(), total_mom_proj.
x0()),
137 vertex_->add_particle_in(projectile_p);
138 HepMC3::GenParticlePtr target_p = std::make_shared<HepMC3::GenParticle>(
139 HepMC3::FourVector(total_mom_targ.
x1(), total_mom_targ.
x2(),
140 total_mom_targ.
x3(), total_mom_targ.
x0()),
142 vertex_->add_particle_in(target_p);
148 HepMC3::GenParticlePtr
p = std::make_shared<HepMC3::GenParticle>(
149 HepMC3::FourVector(mom.
x1(), mom.
x2(), mom.
x3(), mom.
x0()),
160 std::shared_ptr<HepMC3::GenHeavyIon> heavy_ion =
161 std::make_shared<HepMC3::GenHeavyIon>();
165 heavy_ion->set(-1, -1, -1, -1, -1, -1, -1, -1, -1,
170 HepMC3::GenParticlePtr
p = std::make_shared<HepMC3::GenParticle>(
171 HepMC3::FourVector(mom.
x1(), mom.
x2(), mom.
x3(), mom.
x0()),