Version: SMASH-1.8
smash::RootOutput Class Reference

#include <rootoutput.h>

\brief SMASH output to ROOT file

SMASH supports ROOT output as an option (see http://root.cern.ch). The ROOT framework needs to be installed when building SMASH, otherwise ROOT support will be disabled.

This class produces file smash_run.root, which contains a ROOT TTree. TTree contains information about particles during simulation from all SMASH events. Output is happening in blocks. All particles in a block are at the same time and in the same event. However, it is possible that different blocks are at the same time and from the same event. Particle information is stored in TBranches. For each particle characteristic there is a separate branch. Currently these are t,x,y,z (coordinates), p0,px,py,pz (4-momentum), pdgid - PDG code of particle, that characterizes its sort, charge - electric charge of the particle, ev - number of event particle encountered in, tcounter - number of output block in a given event, npart - number of particles, impact_b - impact parameter, and empty_event - whether there was no interaction between the projectile and the target.

Here is an example of ROOT macro to read the ROOT output of SMASH:

int rootfile_analysis_example() {
// open SMASH output file to be read in
TFile *input_file = TFile::Open("../build/data/0/smash_run.root");
if (input_file->IsOpen()) {
printf("Successfully opened file %s\n", input_file->GetName());
} else {
printf("Error at opening file %s\n", input_file->GetName());
}
// Get a tree from file
TTree *tree = static_cast<TTree*>(input_file->Get("particles"));
// Get number of entries in a tree
Int_t nentries = tree->GetEntries();
printf("Number of entries in a tree is %d\n", nentries);
// This draws p_T distribution at initialization
// tree->Draw("sqrt(px*px + py*py)","tcounter==0");
// This draws 3D momentum space distribution at initialization
tree->Draw("px:py:pz","tcounter==0");
return 0;
}

For examples of extracting info from .root file see root.cern.ch To view ROOT file use TBrowser:

root -l
new TBrowser

If option write_collisions is set True, then in addition to particles TTree a collision TTree is created. Information about each collision is written as one leaf: nin, nout - number of incoming and outgoing particles, ev - event number, weight - total weight of the collision (wgt), partial_weight - partial weight of the collision (par_wgt), (t,x,y,z), (p0,px,py,pz) - arrays of dimension nin+nout that contain coordinates and momenta.

Definition at line 97 of file rootoutput.h.

Inheritance diagram for smash::RootOutput:
[legend]
Collaboration diagram for smash::RootOutput:
[legend]

Public Member Functions

 RootOutput (const bf::path &path, const std::string &name, const OutputParameters &out_par)
 Construct ROOT output. More...
 
 ~RootOutput ()
 Destructor. More...
 
void at_eventstart (const Particles &particles, const int event_number) override
 update event number and writes intermediate particles to a tree. More...
 
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. More...
 
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 No). More...
 
void at_interaction (const Action &action, const double density) override
 Writes collisions to a tree defined by treename. More...
 
- Public Member Functions inherited from smash::OutputInterface
 OutputInterface (std::string name)
 Construct output interface. More...
 
virtual ~OutputInterface ()=default
 
virtual void thermodynamics_output (const ThermodynamicQuantity tq, const DensityType dt, RectangularLattice< DensityOnLattice > &lattice)
 Output to write thermodynamics from the lattice. More...
 
virtual void thermodynamics_output (const ThermodynamicQuantity tq, const DensityType dt, RectangularLattice< EnergyMomentumTensor > &lattice)
 Output to write energy-momentum tensor and related quantities from the lattice. More...
 
virtual void thermodynamics_output (const GrandCanThermalizer &gct)
 Output to write energy-momentum tensor and related quantities from the thermalizer class. More...
 
bool is_dilepton_output () const
 Get, whether this is the dilepton output? More...
 
bool is_photon_output () const
 Get, whether this is the photon output? More...
 
bool is_IC_output () const
 Get, whether this is the IC output? More...
 
const char * to_string (const ThermodynamicQuantity tq)
 Convert thermodynamic quantities to strings. More...
 
const char * to_string (const DensityType dens_type)
 Convert density types to strings. More...
 

Private Member Functions

template<typename T >
void particles_to_tree (T &particles)
 Writes particles to a tree defined by treename. More...
 
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. More...
 

Private Attributes

const bf::path filename_
 Filename of output. More...
 
bf::path filename_unfinished_
 Filename of output as long as simulation is still running. More...
 
std::unique_ptr< TFile > root_out_file_
 Pointer to root output file. More...
 
TTree * particles_tree_
 TTree for particles output. More...
 
TTree * collisions_tree_
 TTree for collision output. More...
 
int output_counter_ = 0
 Number of output in a given event. More...
 
int current_event_ = 0
 Number of current event. More...
 

Static Private Attributes

static const int max_buffer_size_ = 10000
 Maximal buffer size. More...
 

Buffer for filling TTree

See class documentation for definitions.

std::array< double, max_buffer_size_p0
 Property that is written to ROOT output. More...
 
std::array< double, max_buffer_size_px
 Property that is written to ROOT output. More...
 
std::array< double, max_buffer_size_py
 Property that is written to ROOT output. More...
 
std::array< double, max_buffer_size_pz
 Property that is written to ROOT output. More...
 
std::array< double, max_buffer_size_t
 Property that is written to ROOT output. More...
 
std::array< double, max_buffer_size_x
 Property that is written to ROOT output. More...
 
std::array< double, max_buffer_size_y
 Property that is written to ROOT output. More...
 
std::array< double, max_buffer_size_z
 Property that is written to ROOT output. More...
 
std::array< double, max_buffer_size_formation_time_
 Property that is written to ROOT output. More...
 
std::array< double, max_buffer_size_xsec_factor_
 Property that is written to ROOT output. More...
 
std::array< double, max_buffer_size_time_last_coll_
 Property that is written to ROOT output. More...
 
std::array< int, max_buffer_size_pdgcode
 Property that is written to ROOT output. More...
 
std::array< int, max_buffer_size_charge
 Property that is written to ROOT output. More...
 
std::array< int, max_buffer_size_coll_per_part_
 Property that is written to ROOT output. More...
 
std::array< int, max_buffer_size_proc_id_origin_
 Property that is written to ROOT output. More...
 
std::array< int, max_buffer_size_proc_type_origin_
 Property that is written to ROOT output. More...
 
std::array< int, max_buffer_size_pdg_mother1_
 Property that is written to ROOT output. More...
 
std::array< int, max_buffer_size_pdg_mother2_
 Property that is written to ROOT output. More...
 
int npart
 Property that is written to ROOT output. More...
 
int tcounter
 Property that is written to ROOT output. More...
 
int ev
 Property that is written to ROOT output. More...
 
int nin
 Property that is written to ROOT output. More...
 
int nout
 Property that is written to ROOT output. More...
 
double wgt
 Property that is written to ROOT output. More...
 
double par_wgt
 Property that is written to ROOT output. More...
 
double impact_b
 Property that is written to ROOT output. More...
 
bool empty_event_
 Property that is written to ROOT output. More...
 
bool write_collisions_
 Option to write collisions tree. More...
 
bool write_particles_
 Option to write particles tree. More...
 
bool write_initial_conditions_
 Option to write particles tree for initial conditions. More...
 
OutputOnlyFinal particles_only_final_
 Print only final particles in the event, no intermediate output. More...
 
int autosave_frequency_
 Root file cannot be read if it was not properly closed and finalized. More...
 
const bool part_extended_
 Whether extended particle output is on. More...
 
const bool coll_extended_
 Whether extended collisions output is on. More...
 
const bool ic_extended_
 Whether extended ic output is on. More...
 
void init_trees ()
 Basic initialization routine, creating the TTree objects for particles and collisions. More...
 

Additional Inherited Members

- Protected Attributes inherited from smash::OutputInterface
const bool is_dilepton_output_
 Is this the dilepton output? More...
 
const bool is_photon_output_
 Is this the photon output? More...
 
const bool is_IC_output_
 Is this the IC output? More...
 

Constructor & Destructor Documentation

◆ RootOutput()

smash::RootOutput::RootOutput ( const bf::path &  path,
const std::string &  name,
const OutputParameters out_par 
)

Construct ROOT output.

Parameters
[in]pathOutput path.
[in]nameName of the ouput.
[in]out_parA structure containing parameters of the output.

Definition at line 87 of file rootoutput.cc.

89  : OutputInterface(name),
90  filename_(path / (name + ".root")),
91  write_collisions_(name == "Collisions" || name == "Dileptons" ||
92  name == "Photons"),
93  write_particles_(name == "Particles"),
94  write_initial_conditions_(name == "SMASH_IC"),
95  particles_only_final_(out_par.part_only_final),
96  autosave_frequency_(1000),
97  part_extended_(out_par.part_extended),
98  coll_extended_(out_par.coll_extended),
99  ic_extended_(out_par.ic_extended) {
101  filename_unfinished_ += ".unfinished";
103  make_unique<TFile>(filename_unfinished_.native().c_str(), "NEW");
104  init_trees();
105 }
Here is the call graph for this function:

◆ ~RootOutput()

smash::RootOutput::~RootOutput ( )

Destructor.

RootOutput destructor.

Writes root objects (here TTrees) to file and closes it.

Definition at line 194 of file rootoutput.cc.

194  {
195  // kOverwrite option prevents from writing extra TKey objects into root file
196  root_out_file_->Write("", TObject::kOverwrite);
197  root_out_file_->Close();
198  bf::rename(filename_unfinished_, filename_);
199 }

Member Function Documentation

◆ at_eventstart()

void smash::RootOutput::at_eventstart ( const Particles particles,
const int  event_number 
)
overridevirtual

update event number and writes intermediate particles to a tree.

Parameters
[in]particlesParticles to be written to output.
[in]event_numberevent number to be used in ROOT output.

Implements smash::OutputInterface.

Definition at line 201 of file rootoutput.cc.

202  {
203  // save event number
204  current_event_ = event_number;
205 
207  output_counter_ = 0;
208  // This is to have only one output of positive impact parameter per event
209  impact_b = -1.0;
210  empty_event_ = false;
211  particles_to_tree(particles);
212  output_counter_++;
213  }
214 }
Here is the call graph for this function:

◆ at_eventend()

void smash::RootOutput::at_eventend ( const Particles particles,
const int  event_number,
double  impact_parameter,
bool  empty_event 
)
overridevirtual

update event number and impact parameter, and writes intermediate particles to a tree.

Parameters
[in]particlesParticles to be written to output.
[in]event_numberevent number to be used in ROOT output.
[in]impact_parameterevent number to be used in ROOT output. [fm]
[in]empty_eventWhether there was no interaction between the target and the projectile.

Implements smash::OutputInterface.

Definition at line 225 of file rootoutput.cc.

227  {
228  impact_b = impact_parameter;
229  empty_event_ = empty_event;
230  if (write_particles_ &&
231  !(empty_event && particles_only_final_ == OutputOnlyFinal::IfNotEmpty)) {
232  particles_to_tree(particles);
233  }
234  /* Forced regular dump from operational memory to disk. Very demanding!
235  * If program crashes written data will NOT be lost. */
238  particles_tree_->AutoSave("SaveSelf");
239  }
240  if (write_collisions_) {
241  collisions_tree_->AutoSave("SaveSelf");
242  }
243  }
244 
246  // If the runtime is too short some particles might not yet have
247  // reached the hypersurface. Warning is printed.
248  if (particles.size() != 0) {
250  "End time might be too small for initial conditions output. "
251  "Hypersurface has not yet been crossed by ",
252  particles.size(), " particle(s).");
253  }
254  }
255 }
Here is the call graph for this function:

◆ at_intermediate_time()

void smash::RootOutput::at_intermediate_time ( const Particles particles,
const std::unique_ptr< Clock > &  clock,
const DensityParameters dens_param 
)
overridevirtual

Writes intermediate particles to a tree defined by treename, if it is allowed (i.e., particles_only_final_ is No).

Parameters
[in]particlesParticles to be written to output.
[in]clockUnused, needed since inherited.
[in]dens_paramUnused, needed since inherited.

Reimplemented from smash::OutputInterface.

Definition at line 216 of file rootoutput.cc.

218  {
220  particles_to_tree(particles);
221  output_counter_++;
222  }
223 }
Here is the call graph for this function:

◆ at_interaction()

void smash::RootOutput::at_interaction ( const Action action,
const double  density 
)
overridevirtual

Writes collisions to a tree defined by treename.

Parameters
[in]actionan Action object containing incoming, outgoing particles and type of interactions.
[in]densityUnused, needed since inherited.

Reimplemented from smash::OutputInterface.

Definition at line 257 of file rootoutput.cc.

258  {
259  if (write_collisions_) {
260  collisions_to_tree(action.incoming_particles(), action.outgoing_particles(),
261  action.get_total_weight(), action.get_partial_weight());
262  }
263 
265  action.get_type() == ProcessType::HyperSurfaceCrossing) {
266  particles_to_tree(action.incoming_particles());
267  }
268 }
Here is the call graph for this function:

◆ particles_to_tree()

template<typename T >
void smash::RootOutput::particles_to_tree ( T &  particles)
private

Writes particles to a tree defined by treename.

Parameters
[in]particlesParticles or ParticleList to be written to output.

Definition at line 271 of file rootoutput.cc.

271  {
272  int i = 0;
273 
275  ev = current_event_;
276 
277  for (const auto &p : particles) {
278  // Buffer full - flush to tree, else fill with particles
279  if (i >= max_buffer_size_) {
281  i = 0;
282  particles_tree_->Fill();
283  } else {
284  t[i] = p.position().x0();
285  x[i] = p.position().x1();
286  y[i] = p.position().x2();
287  z[i] = p.position().x3();
288 
289  p0[i] = p.momentum().x0();
290  px[i] = p.momentum().x1();
291  py[i] = p.momentum().x2();
292  pz[i] = p.momentum().x3();
293 
294  pdgcode[i] = p.pdgcode().get_decimal();
295  charge[i] = p.type().charge();
296 
297  if (part_extended_ || ic_extended_) {
298  const auto h = p.get_history();
299  formation_time_[i] = p.formation_time();
300  xsec_factor_[i] = p.xsec_scaling_factor();
301  time_last_coll_[i] = h.time_last_collision;
302  coll_per_part_[i] = h.collisions_per_particle;
303  proc_id_origin_[i] = h.id_process;
304  proc_type_origin_[i] = static_cast<int>(h.process_type);
305  pdg_mother1_[i] = h.p1.get_decimal();
306  pdg_mother2_[i] = h.p2.get_decimal();
307  }
308 
309  i++;
310  }
311  }
312  // Flush rest to tree
313  if (i > 0) {
314  npart = i;
315  particles_tree_->Fill();
316  }
317 }
Here is the caller graph for this function:

◆ collisions_to_tree()

void smash::RootOutput::collisions_to_tree ( const ParticleList &  incoming,
const ParticleList &  outgoing,
const double  weight,
const double  partial_weight 
)
private

Writes collisions to a tree defined by treename.

Parameters
[in]incomingIncoming particles to be written to output.
[in]outgoingOutgoing particles to be written to output.
[in]weightTotal weight of the collision.
[in]partial_weightPartial weight of the collision

Definition at line 319 of file rootoutput.cc.

322  {
323  ev = current_event_;
324  nin = incoming.size();
325  nout = outgoing.size();
326  npart = nin + nout;
327  wgt = weight;
328  par_wgt = partial_weight;
329 
330  int i = 0;
331 
332  /* It is assumed that nin + nout < max_buffer_size_
333  * This is true for any possible reaction for current buffer size: 10000
334  * But if one wants initial/final particles written to collisions
335  * then implementation should be updated. */
336 
337  for (const ParticleList &plist : {incoming, outgoing}) {
338  for (const auto &p : plist) {
339  t[i] = p.position().x0();
340  x[i] = p.position().x1();
341  y[i] = p.position().x2();
342  z[i] = p.position().x3();
343 
344  p0[i] = p.momentum().x0();
345  px[i] = p.momentum().x1();
346  py[i] = p.momentum().x2();
347  pz[i] = p.momentum().x3();
348 
349  pdgcode[i] = p.pdgcode().get_decimal();
350  charge[i] = p.type().charge();
351 
352  if (coll_extended_) {
353  const auto h = p.get_history();
354  formation_time_[i] = p.formation_time();
355  xsec_factor_[i] = p.xsec_scaling_factor();
356  time_last_coll_[i] = h.time_last_collision;
357  coll_per_part_[i] = h.collisions_per_particle;
358  proc_id_origin_[i] = h.id_process;
359  proc_type_origin_[i] = static_cast<int>(h.process_type);
360  pdg_mother1_[i] = h.p1.get_decimal();
361  pdg_mother2_[i] = h.p2.get_decimal();
362  }
363 
364  i++;
365  }
366  }
367 
368  collisions_tree_->Fill();
369 }
Here is the caller graph for this function:

◆ init_trees()

void smash::RootOutput::init_trees ( )
private

Basic initialization routine, creating the TTree objects for particles and collisions.

Definition at line 107 of file rootoutput.cc.

107  {
109  particles_tree_ = new TTree("particles", "particles");
110 
111  particles_tree_->Branch("npart", &npart, "npart/I");
112  particles_tree_->Branch("impact_b", &impact_b, "impact_b/D");
113  particles_tree_->Branch("empty_event", &empty_event_, "empty_event/O");
114  particles_tree_->Branch("ev", &ev, "ev/I");
115  particles_tree_->Branch("tcounter", &tcounter, "tcounter/I");
116 
117  particles_tree_->Branch("pdgcode", &pdgcode[0], "pdgcode[npart]/I");
118  particles_tree_->Branch("charge", &charge[0], "charge[npart]/I");
119 
120  particles_tree_->Branch("p0", &p0[0], "p0[npart]/D");
121  particles_tree_->Branch("px", &px[0], "px[npart]/D");
122  particles_tree_->Branch("py", &py[0], "py[npart]/D");
123  particles_tree_->Branch("pz", &pz[0], "pz[npart]/D");
124 
125  particles_tree_->Branch("t", &t[0], "t[npart]/D");
126  particles_tree_->Branch("x", &x[0], "x[npart]/D");
127  particles_tree_->Branch("y", &y[0], "y[npart]/D");
128  particles_tree_->Branch("z", &z[0], "z[npart]/D");
129 
130  if (part_extended_ || ic_extended_) {
131  particles_tree_->Branch("ncoll", &coll_per_part_[0], "ncoll[npart]/I");
132  particles_tree_->Branch("form_time", &formation_time_[0],
133  "form_time[npart]/D");
134  particles_tree_->Branch("xsecfac", &xsec_factor_[0], "xsecfac[npart]/D");
135  particles_tree_->Branch("proc_id_origin", &proc_id_origin_[0],
136  "proc_id_origin[npart]/I");
137  particles_tree_->Branch("proc_type_origin", &proc_type_origin_[0],
138  "proc_type_origin[npart]/I");
139  particles_tree_->Branch("time_last_coll", &time_last_coll_[0],
140  "time_last_coll[npart]/D");
141  particles_tree_->Branch("pdg_mother1", &pdg_mother1_[0],
142  "pdg_mother1[npart]/I");
143  particles_tree_->Branch("pdg_mother2", &pdg_mother2_[0],
144  "pdg_mother2[npart]/I");
145  }
146  }
147 
148  if (write_collisions_) {
149  collisions_tree_ = new TTree("collisions", "collisions");
150 
151  collisions_tree_->Branch("nin", &nin, "nin/I");
152  collisions_tree_->Branch("nout", &nout, "nout/I");
153  collisions_tree_->Branch("npart", &npart, "npart/I");
154  collisions_tree_->Branch("ev", &ev, "ev/I");
155  collisions_tree_->Branch("weight", &wgt, "weight/D");
156  collisions_tree_->Branch("partial_weight", &par_wgt, "partial_weight/D");
157 
158  collisions_tree_->Branch("pdgcode", &pdgcode[0], "pdgcode[npart]/I");
159  collisions_tree_->Branch("charge", &charge[0], "charge[npart]/I");
160 
161  collisions_tree_->Branch("p0", &p0[0], "p0[npart]/D");
162  collisions_tree_->Branch("px", &px[0], "px[npart]/D");
163  collisions_tree_->Branch("py", &py[0], "py[npart]/D");
164  collisions_tree_->Branch("pz", &pz[0], "pz[npart]/D");
165 
166  collisions_tree_->Branch("t", &t[0], "t[npart]/D");
167  collisions_tree_->Branch("x", &x[0], "x[npart]/D");
168  collisions_tree_->Branch("y", &y[0], "y[npart]/D");
169  collisions_tree_->Branch("z", &z[0], "z[npart]/D");
170 
171  if (coll_extended_) {
172  collisions_tree_->Branch("ncoll", &coll_per_part_[0], "ncoll[npart]/I");
173  collisions_tree_->Branch("form_time", &formation_time_[0],
174  "form_time[npart]/D");
175  collisions_tree_->Branch("xsecfac", &xsec_factor_[0], "xsecfac[npart]/D");
176  collisions_tree_->Branch("proc_id_origin", &proc_id_origin_[0],
177  "proc_id_origin[npart]/I");
178  collisions_tree_->Branch("proc_type_origin", &proc_type_origin_[0],
179  "proc_type_origin[npart]/I");
180  collisions_tree_->Branch("time_last_coll", &time_last_coll_[0],
181  "time_last_coll[npart]/D");
182  collisions_tree_->Branch("pdg_mother1", &pdg_mother1_[0],
183  "pdg_mother1[npart]/I");
184  collisions_tree_->Branch("pdg_mother2", &pdg_mother2_[0],
185  "pdg_mother2[npart]/I");
186  }
187  }
188 }
Here is the caller graph for this function:

Member Data Documentation

◆ filename_

const bf::path smash::RootOutput::filename_
private

Filename of output.

Definition at line 150 of file rootoutput.h.

◆ filename_unfinished_

bf::path smash::RootOutput::filename_unfinished_
private

Filename of output as long as simulation is still running.

Definition at line 152 of file rootoutput.h.

◆ root_out_file_

std::unique_ptr<TFile> smash::RootOutput::root_out_file_
private

Pointer to root output file.

Definition at line 154 of file rootoutput.h.

◆ particles_tree_

TTree* smash::RootOutput::particles_tree_
private

TTree for particles output.

TFile takes ownership of all TTrees. That's why TTree is not a unique pointer.

Definition at line 161 of file rootoutput.h.

◆ collisions_tree_

TTree* smash::RootOutput::collisions_tree_
private

TTree for collision output.

TFile takes ownership of all TTrees. That's why TTree is not a unique pointer.

Definition at line 168 of file rootoutput.h.

◆ output_counter_

int smash::RootOutput::output_counter_ = 0
private

Number of output in a given event.

Definition at line 186 of file rootoutput.h.

◆ current_event_

int smash::RootOutput::current_event_ = 0
private

Number of current event.

Definition at line 188 of file rootoutput.h.

◆ max_buffer_size_

const int smash::RootOutput::max_buffer_size_ = 10000
staticprivate

Maximal buffer size.

Definition at line 191 of file rootoutput.h.

◆ p0

std::array<double, max_buffer_size_> smash::RootOutput::p0
private

Property that is written to ROOT output.

Definition at line 198 of file rootoutput.h.

◆ px

std::array<double, max_buffer_size_> smash::RootOutput::px
private

Property that is written to ROOT output.

Definition at line 198 of file rootoutput.h.

◆ py

std::array<double, max_buffer_size_> smash::RootOutput::py
private

Property that is written to ROOT output.

Definition at line 198 of file rootoutput.h.

◆ pz

std::array<double, max_buffer_size_> smash::RootOutput::pz
private

Property that is written to ROOT output.

Definition at line 198 of file rootoutput.h.

◆ t

std::array<double, max_buffer_size_> smash::RootOutput::t
private

Property that is written to ROOT output.

Definition at line 198 of file rootoutput.h.

◆ x

std::array<double, max_buffer_size_> smash::RootOutput::x
private

Property that is written to ROOT output.

Definition at line 198 of file rootoutput.h.

◆ y

std::array<double, max_buffer_size_> smash::RootOutput::y
private

Property that is written to ROOT output.

Definition at line 198 of file rootoutput.h.

◆ z

std::array<double, max_buffer_size_> smash::RootOutput::z
private

Property that is written to ROOT output.

Definition at line 198 of file rootoutput.h.

◆ formation_time_

std::array<double, max_buffer_size_> smash::RootOutput::formation_time_
private

Property that is written to ROOT output.

Definition at line 198 of file rootoutput.h.

◆ xsec_factor_

std::array<double, max_buffer_size_> smash::RootOutput::xsec_factor_
private

Property that is written to ROOT output.

Definition at line 198 of file rootoutput.h.

◆ time_last_coll_

std::array<double, max_buffer_size_> smash::RootOutput::time_last_coll_
private

Property that is written to ROOT output.

Definition at line 198 of file rootoutput.h.

◆ pdgcode

std::array<int, max_buffer_size_> smash::RootOutput::pdgcode
private

Property that is written to ROOT output.

Definition at line 200 of file rootoutput.h.

◆ charge

std::array<int, max_buffer_size_> smash::RootOutput::charge
private

Property that is written to ROOT output.

Definition at line 200 of file rootoutput.h.

◆ coll_per_part_

std::array<int, max_buffer_size_> smash::RootOutput::coll_per_part_
private

Property that is written to ROOT output.

Definition at line 200 of file rootoutput.h.

◆ proc_id_origin_

std::array<int, max_buffer_size_> smash::RootOutput::proc_id_origin_
private

Property that is written to ROOT output.

Definition at line 200 of file rootoutput.h.

◆ proc_type_origin_

std::array<int, max_buffer_size_> smash::RootOutput::proc_type_origin_
private

Property that is written to ROOT output.

Definition at line 200 of file rootoutput.h.

◆ pdg_mother1_

std::array<int, max_buffer_size_> smash::RootOutput::pdg_mother1_
private

Property that is written to ROOT output.

Definition at line 200 of file rootoutput.h.

◆ pdg_mother2_

std::array<int, max_buffer_size_> smash::RootOutput::pdg_mother2_
private

Property that is written to ROOT output.

Definition at line 200 of file rootoutput.h.

◆ npart

int smash::RootOutput::npart
private

Property that is written to ROOT output.

Definition at line 202 of file rootoutput.h.

◆ tcounter

int smash::RootOutput::tcounter
private

Property that is written to ROOT output.

Definition at line 202 of file rootoutput.h.

◆ ev

int smash::RootOutput::ev
private

Property that is written to ROOT output.

Definition at line 202 of file rootoutput.h.

◆ nin

int smash::RootOutput::nin
private

Property that is written to ROOT output.

Definition at line 202 of file rootoutput.h.

◆ nout

int smash::RootOutput::nout
private

Property that is written to ROOT output.

Definition at line 202 of file rootoutput.h.

◆ wgt

double smash::RootOutput::wgt
private

Property that is written to ROOT output.

Definition at line 203 of file rootoutput.h.

◆ par_wgt

double smash::RootOutput::par_wgt
private

Property that is written to ROOT output.

Definition at line 203 of file rootoutput.h.

◆ impact_b

double smash::RootOutput::impact_b
private

Property that is written to ROOT output.

Definition at line 203 of file rootoutput.h.

◆ empty_event_

bool smash::RootOutput::empty_event_
private

Property that is written to ROOT output.

Definition at line 204 of file rootoutput.h.

◆ write_collisions_

bool smash::RootOutput::write_collisions_
private

Option to write collisions tree.

Definition at line 208 of file rootoutput.h.

◆ write_particles_

bool smash::RootOutput::write_particles_
private

Option to write particles tree.

Definition at line 211 of file rootoutput.h.

◆ write_initial_conditions_

bool smash::RootOutput::write_initial_conditions_
private

Option to write particles tree for initial conditions.

Definition at line 214 of file rootoutput.h.

◆ particles_only_final_

OutputOnlyFinal smash::RootOutput::particles_only_final_
private

Print only final particles in the event, no intermediate output.

Definition at line 217 of file rootoutput.h.

◆ autosave_frequency_

int smash::RootOutput::autosave_frequency_
private

Root file cannot be read if it was not properly closed and finalized.

It can happen that SMASH simulation crashed and root file was not closed. To save results of simulation in such case, "AutoSave" is applied every N events. The autosave_frequency_ sets this N (default N = 1000). Note that "AutoSave" operation is very time-consuming, so the Autosave_Frequency is always a compromise between safety and speed.

Definition at line 228 of file rootoutput.h.

◆ part_extended_

const bool smash::RootOutput::part_extended_
private

Whether extended particle output is on.

Definition at line 231 of file rootoutput.h.

◆ coll_extended_

const bool smash::RootOutput::coll_extended_
private

Whether extended collisions output is on.

Definition at line 233 of file rootoutput.h.

◆ ic_extended_

const bool smash::RootOutput::ic_extended_
private

Whether extended ic output is on.

Definition at line 235 of file rootoutput.h.


The documentation for this class was generated from the following files:
smash::RootOutput::npart
int npart
Property that is written to ROOT output.
Definition: rootoutput.h:202
smash::OutputInterface::OutputInterface
OutputInterface(std::string name)
Construct output interface.
Definition: outputinterface.h:41
smash::RootOutput::filename_unfinished_
bf::path filename_unfinished_
Filename of output as long as simulation is still running.
Definition: rootoutput.h:152
smash::RootOutput::pdgcode
std::array< int, max_buffer_size_ > pdgcode
Property that is written to ROOT output.
Definition: rootoutput.h:200
smash::RootOutput::coll_extended_
const bool coll_extended_
Whether extended collisions output is on.
Definition: rootoutput.h:233
smash::RootOutput::impact_b
double impact_b
Property that is written to ROOT output.
Definition: rootoutput.h:203
smash::RootOutput::ev
int ev
Property that is written to ROOT output.
Definition: rootoutput.h:202
smash::RootOutput::nout
int nout
Property that is written to ROOT output.
Definition: rootoutput.h:202
smash::RootOutput::z
std::array< double, max_buffer_size_ > z
Property that is written to ROOT output.
Definition: rootoutput.h:198
smash::RootOutput::y
std::array< double, max_buffer_size_ > y
Property that is written to ROOT output.
Definition: rootoutput.h:198
smash::RootOutput::formation_time_
std::array< double, max_buffer_size_ > formation_time_
Property that is written to ROOT output.
Definition: rootoutput.h:198
smash::RootOutput::filename_
const bf::path filename_
Filename of output.
Definition: rootoutput.h:150
smash::RootOutput::write_initial_conditions_
bool write_initial_conditions_
Option to write particles tree for initial conditions.
Definition: rootoutput.h:214
smash::logg
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:39
smash::RootOutput::init_trees
void init_trees()
Basic initialization routine, creating the TTree objects for particles and collisions.
Definition: rootoutput.cc:107
smash::RootOutput::output_counter_
int output_counter_
Number of output in a given event.
Definition: rootoutput.h:186
smash::RootOutput::wgt
double wgt
Property that is written to ROOT output.
Definition: rootoutput.h:203
smash::RootOutput::autosave_frequency_
int autosave_frequency_
Root file cannot be read if it was not properly closed and finalized.
Definition: rootoutput.h:228
smash::RootOutput::empty_event_
bool empty_event_
Property that is written to ROOT output.
Definition: rootoutput.h:204
OutputOnlyFinal::IfNotEmpty
Print only final-state particles, and those only if the event is not empty.
smash::RootOutput::coll_per_part_
std::array< int, max_buffer_size_ > coll_per_part_
Property that is written to ROOT output.
Definition: rootoutput.h:200
smash::RootOutput::write_particles_
bool write_particles_
Option to write particles tree.
Definition: rootoutput.h:211
smash::RootOutput::charge
std::array< int, max_buffer_size_ > charge
Property that is written to ROOT output.
Definition: rootoutput.h:200
smash::LHyperSurfaceCrossing
static constexpr int LHyperSurfaceCrossing
Definition: hypersurfacecrossingaction.cc:18
smash::RootOutput::x
std::array< double, max_buffer_size_ > x
Property that is written to ROOT output.
Definition: rootoutput.h:198
smash::RootOutput::collisions_tree_
TTree * collisions_tree_
TTree for collision output.
Definition: rootoutput.h:168
smash::RootOutput::px
std::array< double, max_buffer_size_ > px
Property that is written to ROOT output.
Definition: rootoutput.h:198
smash::RootOutput::nin
int nin
Property that is written to ROOT output.
Definition: rootoutput.h:202
smash::RootOutput::py
std::array< double, max_buffer_size_ > py
Property that is written to ROOT output.
Definition: rootoutput.h:198
smash::RootOutput::write_collisions_
bool write_collisions_
Option to write collisions tree.
Definition: rootoutput.h:208
smash::RootOutput::current_event_
int current_event_
Number of current event.
Definition: rootoutput.h:188
smash::RootOutput::xsec_factor_
std::array< double, max_buffer_size_ > xsec_factor_
Property that is written to ROOT output.
Definition: rootoutput.h:198
smash::RootOutput::par_wgt
double par_wgt
Property that is written to ROOT output.
Definition: rootoutput.h:203
smash::RootOutput::pdg_mother1_
std::array< int, max_buffer_size_ > pdg_mother1_
Property that is written to ROOT output.
Definition: rootoutput.h:200
smash::RootOutput::root_out_file_
std::unique_ptr< TFile > root_out_file_
Pointer to root output file.
Definition: rootoutput.h:154
smash::RootOutput::particles_tree_
TTree * particles_tree_
TTree for particles output.
Definition: rootoutput.h:161
smash::RootOutput::collisions_to_tree
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.
Definition: rootoutput.cc:319
smash::RootOutput::p0
std::array< double, max_buffer_size_ > p0
Property that is written to ROOT output.
Definition: rootoutput.h:198
smash::RootOutput::part_extended_
const bool part_extended_
Whether extended particle output is on.
Definition: rootoutput.h:231
smash::RootOutput::max_buffer_size_
static const int max_buffer_size_
Maximal buffer size.
Definition: rootoutput.h:191
smash::ProcessType::HyperSurfaceCrossing
Hypersurface crossing Particles are removed from the evolution and printed to a separate output to se...
smash::RootOutput::time_last_coll_
std::array< double, max_buffer_size_ > time_last_coll_
Property that is written to ROOT output.
Definition: rootoutput.h:198
smash::RootOutput::particles_to_tree
void particles_to_tree(T &particles)
Writes particles to a tree defined by treename.
Definition: rootoutput.cc:271
smash::RootOutput::tcounter
int tcounter
Property that is written to ROOT output.
Definition: rootoutput.h:202
smash::pdg::p
constexpr int p
Proton.
Definition: pdgcode_constants.h:28
smash::RootOutput::particles_only_final_
OutputOnlyFinal particles_only_final_
Print only final particles in the event, no intermediate output.
Definition: rootoutput.h:217
smash::RootOutput::proc_id_origin_
std::array< int, max_buffer_size_ > proc_id_origin_
Property that is written to ROOT output.
Definition: rootoutput.h:200
smash::RootOutput::pz
std::array< double, max_buffer_size_ > pz
Property that is written to ROOT output.
Definition: rootoutput.h:198
smash::NeedsToWrap::No
smash::RootOutput::ic_extended_
const bool ic_extended_
Whether extended ic output is on.
Definition: rootoutput.h:235
smash::RootOutput::t
std::array< double, max_buffer_size_ > t
Property that is written to ROOT output.
Definition: rootoutput.h:198
smash::RootOutput::proc_type_origin_
std::array< int, max_buffer_size_ > proc_type_origin_
Property that is written to ROOT output.
Definition: rootoutput.h:200
smash::RootOutput::pdg_mother2_
std::array< int, max_buffer_size_ > pdg_mother2_
Property that is written to ROOT output.
Definition: rootoutput.h:200