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");
329 "form_time[npart]/D");
332 "proc_id_origin[npart]/I");
334 "proc_type_origin[npart]/I");
336 "time_last_coll[npart]/D");
338 "pdg_mother1[npart]/I");
340 "pdg_mother2[npart]/I");
342 "baryon_number[npart]/I");
359 const int event_number,
const EventInfo &event) {
364 test_p_ =
event.test_particles;
368 E_tot_ =
event.total_energy;
381 const std::unique_ptr<Clock> &,
385 test_p_ =
event.test_particles;
389 E_tot_ =
event.total_energy;
401 test_p_ =
event.test_particles;
405 E_tot_ =
event.total_energy;
430 "End time might be too small for initial conditions output. "
431 "Hypersurface has not yet been crossed by ",
432 particles.
size(),
" particle(s).");
450 template <
typename T>
456 bool exceeded_buffer_message =
true;
458 for (
const auto &
p : particles) {
461 if (exceeded_buffer_message) {
463 <<
"\nThe number of particles N = " << particles.size()
466 << std::ceil(particles.size() /
468 <<
" separate ROOT Tree entries will be created at this output."
469 <<
"\nMaximum buffer size (max_buffer_size_) can be changed in "
470 <<
"rootoutput.h\n\n";
471 exceeded_buffer_message =
false;
480 p0_[i] =
p.momentum().x0();
481 px_[i] =
p.momentum().x1();
482 py_[i] =
p.momentum().x2();
483 pz_[i] =
p.momentum().x3();
485 t_[i] =
p.position().x0();
486 x_[i] =
p.position().x1();
487 y_[i] =
p.position().x2();
488 z_[i] =
p.position().x3();
491 const auto h =
p.get_history();
514 const ParticleList &outgoing,
516 const double partial_weight) {
518 nin_ = incoming.size();
519 nout_ = outgoing.size();
531 for (
const ParticleList &plist : {incoming, outgoing}) {
532 for (
const auto &
p : plist) {
536 p0_[i] =
p.momentum().x0();
537 px_[i] =
p.momentum().x1();
538 py_[i] =
p.momentum().x2();
539 pz_[i] =
p.momentum().x3();
541 t_[i] =
p.position().x0();
542 x_[i] =
p.position().x1();
543 y_[i] =
p.position().x2();
544 z_[i] =
p.position().x3();
547 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.
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.