233 filename_(path / (name +
".root")),
234 write_collisions_(name ==
"Collisions" || name ==
"Dileptons" ||
236 write_particles_(name ==
"Particles"),
237 write_initial_conditions_(name ==
"SMASH_IC"),
238 particles_only_final_(out_par.part_only_final),
239 autosave_frequency_(1000),
240 part_extended_(out_par.part_extended),
241 coll_extended_(out_par.coll_extended),
242 ic_extended_(out_par.ic_extended) {
284 "form_time[npart]/D");
287 "proc_id_origin[npart]/I");
289 "proc_type_origin[npart]/I");
291 "time_last_coll[npart]/D");
293 "pdg_mother1[npart]/I");
295 "pdg_mother2[npart]/I");
325 "form_time[npart]/D");
328 "proc_id_origin[npart]/I");
330 "proc_type_origin[npart]/I");
332 "time_last_coll[npart]/D");
334 "pdg_mother1[npart]/I");
336 "pdg_mother2[npart]/I");
353 const int event_number,
const EventInfo &event) {
358 test_p_ =
event.test_particles;
362 E_tot_ =
event.total_energy;
375 const std::unique_ptr<Clock> &,
379 test_p_ =
event.test_particles;
383 E_tot_ =
event.total_energy;
395 test_p_ =
event.test_particles;
399 E_tot_ =
event.total_energy;
424 "End time might be too small for initial conditions output. "
425 "Hypersurface has not yet been crossed by ",
426 particles.
size(),
" particle(s).");
444 template <
typename T>
450 bool exceeded_buffer_message =
true;
452 for (
const auto &
p : particles) {
455 if (exceeded_buffer_message) {
457 <<
"\nThe number of particles N = " << particles.size()
460 << std::ceil(particles.size() /
462 <<
" separate ROOT Tree entries will be created at this output."
463 <<
"\nMaximum buffer size (max_buffer_size_) can be changed in "
464 <<
"rootoutput.h\n\n";
465 exceeded_buffer_message =
false;
474 p0_[i] =
p.momentum().x0();
475 px_[i] =
p.momentum().x1();
476 py_[i] =
p.momentum().x2();
477 pz_[i] =
p.momentum().x3();
479 t_[i] =
p.position().x0();
480 x_[i] =
p.position().x1();
481 y_[i] =
p.position().x2();
482 z_[i] =
p.position().x3();
485 const auto h =
p.get_history();
507 const ParticleList &outgoing,
509 const double partial_weight) {
511 nin_ = incoming.size();
512 nout_ = outgoing.size();
524 for (
const ParticleList &plist : {incoming, outgoing}) {
525 for (
const auto &
p : plist) {
529 p0_[i] =
p.momentum().x0();
530 px_[i] =
p.momentum().x1();
531 py_[i] =
p.momentum().x2();
532 pz_[i] =
p.momentum().x3();
534 t_[i] =
p.position().x0();
535 x_[i] =
p.position().x1();
536 y_[i] =
p.position().x2();
537 z_[i] =
p.position().x3();
540 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.
const bf::path filename_
Filename of 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.
bf::path filename_unfinished_
Filename of output as long as simulation is still running.
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.
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.
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.
RootOutput(const bf::path &path, const std::string &name, const OutputParameters &out_par)
Construct ROOT output.
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
Hypersurface crossing Particles are removed from the evolution and printed to a separate output to se...
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.