21 #include "smash/particles.h"
22 #include "smash/library.h"
27 using namespace Jetscape;
35 JSINFO <<
"SMASH: picking SMASH-specific configuration from xml file";
37 GetXMLElementText({
"Afterburner",
"SMASH",
"SMASH_config_file"});
39 GetXMLElementText({
"Afterburner",
"SMASH",
"SMASH_particles_file"});
41 GetXMLElementText({
"Afterburner",
"SMASH",
"SMASH_decaymodes_file"});
46 auto config = smash::setup_config_and_logging(smash_config_file,
51 auto random_seed = (*GetMt19937Generator())();
52 config.set_value({
"General",
"Randomseed"}, random_seed);
55 end_time_ = GetXMLElementDouble({
"Afterburner",
"SMASH",
"end_time"});
56 config.set_value({
"General",
"End_Time"}, end_time_);
58 JSINFO <<
"End time until which SMASH propagates is " << end_time_ <<
" fm/c";
60 GetXMLElementInt({
"Afterburner",
"SMASH",
"only_decays"});
61 if (only_final_decays_) {
62 JSINFO <<
"SMASH will only perform resonance decays, no propagation";
66 smash::initialize_particles_decays_and_tabulations(
config, smash_version,
69 JSINFO <<
"Seting up SMASH Experiment object";
73 make_shared<smash::Experiment<AfterburnerModus>>(
config, output_path);
74 JSINFO <<
"Finish initializing SMASH";
85 JSINFO <<
"SMASH: obtained " << n_events <<
" events from particlization";
87 smash::Particles *smash_particles = smash_experiment_->first_ensemble();
89 JSINFO <<
"Event " <<
i <<
" SMASH starts with "
91 smash_experiment_->initialize_new_event();
92 if (!only_final_decays_) {
93 smash_experiment_->run_time_evolution(end_time_);
95 smash_experiment_->do_final_decays();
96 smash_experiment_->final_output();
97 smash_particles_to_JS_hadrons(*smash_particles,
100 smash_experiment_->increase_event_number();
105 JSINFO <<
"SMASH hadronic afterburner printout";
111 f->WriteComment(
"JetScape module: " + GetId());
114 for (
const auto hadron :
event) {
115 f->WriteWhiteSpace(
"[" +
to_string(++i) +
"] H");
123 smash::Particles &smash_particles) {
124 smash_particles.reset();
125 for (
const auto JS_hadron : JS_hadrons) {
128 const double mass = JS_hadron->restmass();
129 smash::PdgCode pdgcode = smash::PdgCode::from_decimal(JS_hadron->pid());
130 this->try_create_particle(smash_particles, pdgcode, r.
t(), r.
x(), r.
y(),
131 r.
z(),
mass, JS_hadron->e(), JS_hadron->px(),
132 JS_hadron->py(), JS_hadron->pz());
137 const smash::Particles &smash_particles,
140 for (
const auto &
particle : smash_particles) {
141 const int hadron_label = 0;
142 const int hadron_status = 27;
143 const int hadron_id =
particle.pdgcode().get_decimal();
145 const FourVector hadron_p(p.x1(), p.x2(), p.x3(), p.x0()),
146 hadron_r(
r.x1(),
r.x2(),
r.x3(),
r.x0());
147 const double hadron_mass = p.abs();
148 JS_hadrons.push_back(make_shared<Hadron>(hadron_label, hadron_id,
149 hadron_status, hadron_p, hadron_r,