89 filename_(path / (name +
".root")),
90 write_collisions_(name ==
"Collisions" || name ==
"Dileptons" ||
92 write_particles_(name ==
"Particles"),
93 write_initial_conditions_(name ==
"SMASH_IC"),
94 particles_only_final_(out_par.part_only_final),
95 autosave_frequency_(1000),
96 part_extended_(out_par.part_extended),
97 coll_extended_(out_par.coll_extended),
98 ic_extended_(out_par.ic_extended) {
131 "coll_per_part[npart]/I");
133 "formation_time[npart]/D");
135 "xsec_factor[npart]/D");
137 "proc_id_origin[npart]/I");
139 "proc_type_origin[npart]/I");
141 "time_last_coll[npart]/D");
143 "pdg_mother1[npart]/I");
145 "pdg_mother2[npart]/I");
174 "coll_per_part[npart]/I");
176 "formation_time[npart]/D");
178 "xsec_factor[npart]/D");
180 "proc_id_origin[npart]/I");
182 "proc_type_origin[npart]/I");
184 "time_last_coll[npart]/D");
186 "pdg_mother1[npart]/I");
188 "pdg_mother2[npart]/I");
205 const int event_number) {
220 const std::unique_ptr<Clock> &,
230 double impact_parameter,
bool empty_event) {
250 if (particles.
size() != 0) {
251 const auto &log = logger<LogArea::HyperSurfaceCrossing>();
253 "End time might be too small for initial conditions output. " 254 "Hypersurface has not yet been crossed by ",
255 particles.
size(),
" particle(s).");
273 template <
typename T>
280 for (
const auto &
p : particles) {
287 t[i] =
p.position().x0();
288 x[i] =
p.position().x1();
289 y[i] =
p.position().x2();
290 z[i] =
p.position().x3();
292 p0[i] =
p.momentum().x0();
293 px[i] =
p.momentum().x1();
294 py[i] =
p.momentum().x2();
295 pz[i] =
p.momentum().x3();
297 pdgcode[i] =
p.pdgcode().get_decimal();
301 const auto h =
p.get_history();
323 const ParticleList &outgoing,
325 const double partial_weight) {
327 nin = incoming.size();
328 nout = outgoing.size();
340 for (
const ParticleList &plist : {incoming, outgoing}) {
341 for (
const auto &
p : plist) {
342 t[i] =
p.position().x0();
343 x[i] =
p.position().x1();
344 y[i] =
p.position().x2();
345 z[i] =
p.position().x3();
347 p0[i] =
p.momentum().x0();
348 px[i] =
p.momentum().x1();
349 py[i] =
p.momentum().x2();
350 pz[i] =
p.momentum().x3();
352 pdgcode[i] =
p.pdgcode().get_decimal();
356 const auto h =
p.get_history();
std::array< double, max_buffer_size_ > formation_time_
Buffer for filling TTree. See class documentation for definitions.
const bf::path filename_
Filename of output.
bool write_initial_conditions_
Option to write particles tree for initial conditions.
A class to pre-calculate and store parameters relevant for density calculation.
int nout
Buffer for filling TTree. See class documentation for definitions.
void particles_to_tree(T &particles)
Writes particles to a tree defined by treename.
bool empty_event_
Buffer for filling TTree. See class documentation for definitions.
int current_event_
Number of current event.
std::array< int, max_buffer_size_ > proc_id_origin_
Buffer for filling TTree. See class documentation for definitions.
bool write_particles_
Option to write particles tree.
std::array< double, max_buffer_size_ > py
Buffer for filling TTree. See class documentation for definitions.
std::unique_ptr< TFile > root_out_file_
Pointer to root output file.
void at_eventstart(const Particles &particles, const int event_number) override
update event number and writes intermediate particles to a tree.
std::array< double, max_buffer_size_ > x
Buffer for filling TTree. See class documentation for definitions.
int npart
Buffer for filling TTree. See class documentation for definitions.
std::array< double, max_buffer_size_ > p0
Buffer for filling TTree. See class documentation for definitions.
virtual double get_partial_weight() const =0
Return the specific weight for the chosen outgoing channel, which is mainly used for the partial weig...
std::array< double, max_buffer_size_ > time_last_coll_
Buffer for filling TTree. See class documentation for definitions.
TTree * particles_tree_
TTree for particles output.
void init_trees()
Basic initialization routine, creating the TTree objects for particles and collisions.
int nin
Buffer for filling TTree. See class documentation for definitions.
virtual ProcessType get_type() const
Get the process type.
Hypersurface crossing Particles are removed from the evolution and printed to a separate output to se...
const bool coll_extended_
Whether extended collisions output is on.
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.
const bool part_extended_
Whether extended particle output is on.
std::array< double, max_buffer_size_ > t
Buffer for filling TTree. See class documentation for definitions.
RootOutput(const bf::path &path, const std::string &name, const OutputParameters &out_par)
Construct ROOT output.
int output_counter_
Number of output in a given event.
std::array< double, max_buffer_size_ > z
Buffer for filling TTree. See class documentation for definitions.
std::array< int, max_buffer_size_ > proc_type_origin_
Buffer for filling TTree. See class documentation for definitions.
void at_intermediate_time(const Particles &particles, const std::unique_ptr< Clock > &clock, const DensityParameters &dens_param) override
Writes intermediate particles to a tree defined by treename, if it is allowed (i.e., particles_only_final_ is false).
Helper structure for Experiment to hold output options and parameters.
Action is the base class for a generic process that takes a number of incoming particles and transfor...
virtual double get_total_weight() const =0
Return the total weight value, which is mainly used for the weight output entry.
std::array< double, max_buffer_size_ > y
Buffer for filling TTree. See class documentation for definitions.
const bool ic_extended_
Whether extended ic output is on.
bool write_collisions_
Option to write collisions tree.
std::array< double, max_buffer_size_ > px
Buffer for filling TTree. See class documentation for definitions.
double wgt
Buffer for filling TTree. See class documentation for definitions.
bf::path filename_unfinished_
Filename of output as long as simulation is still running.
void at_interaction(const Action &action, const double density) override
Writes collisions to a tree defined by treename.
double impact_b
Buffer for filling TTree. See class documentation for definitions.
void at_eventend(const Particles &particles, const int event_number, double impact_parameter, bool empty_event) override
update event number and impact parameter, and writes intermediate particles to a tree.
TTree * collisions_tree_
TTree for collision output.
int tcounter
Buffer for filling TTree. See class documentation for definitions.
std::array< double, max_buffer_size_ > xsec_factor_
Buffer for filling TTree. See class documentation for definitions.
bool particles_only_final_
Print only final particles in the event, no intermediate output.
const ParticleList & incoming_particles() const
Get the list of particles that go into the action.
std::array< int, max_buffer_size_ > charge
Buffer for filling TTree. See class documentation for definitions.
The Particles class abstracts the storage and manipulation of particles.
std::array< int, max_buffer_size_ > pdg_mother1_
Buffer for filling TTree. See class documentation for definitions.
int ev
Buffer for filling TTree. See class documentation for definitions.
std::array< double, max_buffer_size_ > pz
Buffer for filling TTree. See class documentation for definitions.
const ParticleList & outgoing_particles() const
Get the list of particles that resulted from the action.
std::array< int, max_buffer_size_ > pdgcode
Buffer for filling TTree. See class documentation for definitions.
int autosave_frequency_
Root file cannot be read if it was not properly closed and finalized.
Abstraction of generic output.
std::array< int, max_buffer_size_ > coll_per_part_
Buffer for filling TTree. See class documentation for definitions.
static const int max_buffer_size_
Maximal buffer size.
std::array< int, max_buffer_size_ > pdg_mother2_
Buffer for filling TTree. See class documentation for definitions.
double par_wgt
Buffer for filling TTree. See class documentation for definitions.