235 filename_(path / (name +
".root")),
236 write_collisions_(name ==
"Collisions" || name ==
"Dileptons" ||
238 write_particles_(name ==
"Particles"),
239 write_initial_conditions_(name ==
"SMASH_IC"),
240 particles_only_final_(out_par.part_only_final),
241 autosave_frequency_(1000),
242 part_extended_(out_par.part_extended),
243 coll_extended_(out_par.coll_extended),
244 ic_extended_(out_par.ic_extended) {
286 "form_time[npart]/D");
289 "proc_id_origin[npart]/I");
291 "proc_type_origin[npart]/I");
293 "time_last_coll[npart]/D");
295 "pdg_mother1[npart]/I");
297 "pdg_mother2[npart]/I");
299 "baryon_number[npart]/I");
301 "strangeness[npart]/I");
331 "form_time[npart]/D");
334 "proc_id_origin[npart]/I");
336 "proc_type_origin[npart]/I");
338 "time_last_coll[npart]/D");
340 "pdg_mother1[npart]/I");
342 "pdg_mother2[npart]/I");
344 "baryon_number[npart]/I");
346 "strangeness[npart]/I");
363 const int event_number,
const EventInfo &event) {
368 test_p_ =
event.test_particles;
372 E_tot_ =
event.total_energy;
385 const std::unique_ptr<Clock> &,
389 test_p_ =
event.test_particles;
393 E_tot_ =
event.total_energy;
405 test_p_ =
event.test_particles;
409 E_tot_ =
event.total_energy;
434 "End time might be too small for initial conditions output. "
435 "Hypersurface has not yet been crossed by ",
436 particles.
size(),
" particle(s).");
454 template <
typename T>
460 bool exceeded_buffer_message =
true;
462 for (
const auto &
p : particles) {
465 if (exceeded_buffer_message) {
467 <<
"\nThe number of particles N = " << particles.size()
470 << std::ceil(particles.size() /
472 <<
" separate ROOT Tree entries will be created at this output."
473 <<
"\nMaximum buffer size (max_buffer_size_) can be changed in "
474 <<
"rootoutput.h\n\n";
475 exceeded_buffer_message =
false;
484 p0_[i] =
p.momentum().x0();
485 px_[i] =
p.momentum().x1();
486 py_[i] =
p.momentum().x2();
487 pz_[i] =
p.momentum().x3();
489 t_[i] =
p.position().x0();
490 x_[i] =
p.position().x1();
491 y_[i] =
p.position().x2();
492 z_[i] =
p.position().x3();
495 const auto h =
p.get_history();
519 const ParticleList &outgoing,
521 const double partial_weight) {
523 nin_ = incoming.size();
524 nout_ = outgoing.size();
536 for (
const ParticleList &plist : {incoming, outgoing}) {
537 for (
const auto &
p : plist) {
541 p0_[i] =
p.momentum().x0();
542 px_[i] =
p.momentum().x1();
543 py_[i] =
p.momentum().x2();
544 pz_[i] =
p.momentum().x3();
546 t_[i] =
p.position().x0();
547 x_[i] =
p.position().x1();
548 y_[i] =
p.position().x2();
549 z_[i] =
p.position().x3();
552 const auto h =
p.get_history();
Action is the base class for a generic process that takes a number of incoming particles and transfor...
virtual ProcessType get_type() const
Get the process type.
virtual double get_total_weight() const =0
Return the total weight value, which is mainly used for the weight output entry.
const ParticleList & incoming_particles() const
Get the list of particles that go into the action.
virtual double get_partial_weight() const =0
Return the specific weight for the chosen outgoing channel, which is mainly used for the partial weig...
const ParticleList & outgoing_particles() const
Get the list of particles that resulted from the action.
A class to pre-calculate and store parameters relevant for density calculation.
Abstraction of generic output.
The Particles class abstracts the storage and manipulation of particles.
void at_interaction(const Action &action, const double density) override
Writes collisions to a tree defined by treename.
std::vector< double > t_
Property that is written to ROOT output.
std::vector< double > y_
Property that is written to ROOT output.
double current_t_
Property that is written to ROOT output.
OutputOnlyFinal particles_only_final_
Print only final particles in the event, no intermediate output.
int current_event_
Number of current event.
TTree * collisions_tree_
TTree for collision output.
double E_kinetic_tot_
Property that is written to ROOT output.
int test_p_
Property that is written to ROOT output.
void collisions_to_tree(const ParticleList &incoming, const ParticleList &outgoing, const double weight, const double partial_weight)
Writes collisions to a tree defined by treename.
int autosave_frequency_
Root file cannot be read if it was not properly closed and finalized.
std::vector< int > proc_type_origin_
Property that is written to ROOT output.
double modus_l_
Property that is written to ROOT output.
std::vector< double > time_last_coll_
Property that is written to ROOT output.
std::vector< int > coll_per_part_
Property that is written to ROOT output.
int tcounter_
Property that is written to ROOT output.
std::vector< int > baryon_number_
Property that is written to ROOT output.
int npart_
Property that is written to ROOT output.
std::vector< int > pdg_mother1_
Property that is written to ROOT output.
int nin_
Property that is written to ROOT output.
int ev_
Property that is written to ROOT output.
bool write_collisions_
Option to write collisions tree.
std::vector< int > charge_
Property that is written to ROOT output.
std::vector< double > px_
Property that is written to ROOT output.
const std::filesystem::path filename_
Filename of output.
std::vector< int > strangeness_
Property that is written to ROOT output.
bool write_initial_conditions_
Option to write particles tree for initial conditions.
double wgt_
Property that is written to ROOT output.
std::vector< double > py_
Property that is written to ROOT output.
std::vector< int > proc_id_origin_
Property that is written to ROOT output.
void particles_to_tree(T &particles)
Writes particles to a tree defined by treename.
const bool part_extended_
Whether extended particle output is on.
void at_eventstart(const Particles &particles, const int event_number, const EventInfo &event) override
update event number and writes intermediate particles to a tree.
double impact_b_
Property that is written to ROOT output.
RootOutput(const std::filesystem::path &path, const std::string &name, const OutputParameters &out_par)
Construct ROOT output.
std::vector< double > z_
Property that is written to ROOT output.
std::vector< double > formation_time_
Property that is written to ROOT output.
void at_eventend(const Particles &particles, const int event_number, const EventInfo &event) override
update event number and impact parameter, and writes intermediate particles to a tree.
std::vector< double > x_
Property that is written to ROOT output.
std::vector< double > p0_
Property that is written to ROOT output.
bool empty_event_
Property that is written to ROOT output.
static const int max_buffer_size_
Maximal buffer size.
std::unique_ptr< TFile > root_out_file_
Pointer to root output file.
std::vector< double > xsec_factor_
Property that is written to ROOT output.
double E_fields_tot_
Property that is written to ROOT output.
std::filesystem::path filename_unfinished_
Filename of output as long as simulation is still running.
const bool coll_extended_
Whether extended collisions output is on.
double par_wgt_
Property that is written to ROOT output.
void init_trees()
Basic initialization routine, creating the TTree objects for particles and collisions.
int output_counter_
Number of output in a given event.
void at_intermediate_time(const Particles &particles, const std::unique_ptr< Clock > &clock, const DensityParameters &dens_param, const EventInfo &event) override
Writes intermediate particles to a tree defined by treename, if it is allowed (i.e....
double E_tot_
Property that is written to ROOT output.
TTree * particles_tree_
TTree for particles output.
std::vector< double > pz_
Property that is written to ROOT output.
int nout_
Property that is written to ROOT output.
const bool ic_extended_
Whether extended ic output is on.
bool write_particles_
Option to write particles tree.
std::vector< int > pdgcode_
Property that is written to ROOT output.
std::vector< int > pdg_mother2_
Property that is written to ROOT output.
@ IfNotEmpty
Print only final-state particles, and those only if the event is not empty.
@ No
Print initial, intermediate and final-state particles.
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
static constexpr int LHyperSurfaceCrossing
@ HyperSurfaceCrossing
See here for a short description.
static constexpr int LOutput
Structure to contain custom data for output.
bool empty_event
True if no collisions happened.
bool impose_kinematic_cut_for_SMASH_IC
Whether or not kinematic cuts are employed for SMASH IC.
Helper structure for Experiment to hold output options and parameters.