Version: SMASH-3.3
smash::OutputParameters Struct Reference

#include <outputparameters.h>

Helper structure for Experiment to hold output options and parameters.

Experiment has one member of this struct.

Definition at line 62 of file outputparameters.h.

Public Member Functions

 OutputParameters ()
 Default constructor, useful for tests. More...
 
 OutputParameters (Configuration conf)
 Constructor from configuration. More...
 

Public Attributes

ThreeVector td_position
 Point, where thermodynamic quantities are calculated. More...
 
DensityType td_dens_type
 Type (e.g., baryon/pion/hadron) of thermodynamic quantity. More...
 
bool td_rho_eckart
 Print out Eckart rest frame density of type td_dens_type or not? More...
 
bool td_tmn
 Print out energy-momentum tensor of type td_dens_type or not? More...
 
bool td_tmn_landau
 Print out energy-momentum tensor in Landau rest frame (of type td_dens_type) or not? More...
 
bool td_v_landau
 Print out Landau velocity of type td_dens_type or not? More...
 
bool td_jQBS
 Print out QBS 4-currents or not? More...
 
bool td_smearing
 Whether smearing is on or off; WARNING : if smearing is off, then final result is in GeV instead of GeV/fm3. More...
 
bool td_only_participants
 Flag reporting whether only participants are considered (true) or also spectators (false) More...
 
bool part_extended
 Extended format for particles output. More...
 
OutputOnlyFinal part_only_final
 Print only final particles in event. More...
 
bool coll_extended
 Extended format for collisions output. More...
 
bool coll_printstartend
 Print initial and final particles in event into collision output. More...
 
bool dil_extended
 Extended format for dilepton output. More...
 
bool photons_extended
 Extended format for photon output. More...
 
bool ic_extended
 Extended initial conditions output. More...
 
RivetOutputParameters rivet_parameters
 Rivet specfic parameters. More...
 
std::map< std::string, std::vector< std::string > > quantities
 Map of quantities to be printed in the output. More...
 

Constructor & Destructor Documentation

◆ OutputParameters() [1/2]

smash::OutputParameters::OutputParameters ( )
inline

Default constructor, useful for tests.

Definition at line 64 of file outputparameters.h.

65  : td_position(ThreeVector()),
67  td_rho_eckart(false),
68  td_tmn(false),
69  td_tmn_landau(false),
70  td_v_landau(false),
71  td_jQBS(false),
72  td_smearing(true),
73  td_only_participants(false),
74  part_extended(false),
76  coll_extended(false),
77  coll_printstartend(false),
78  dil_extended(false),
79  photons_extended(false),
80  ic_extended(false),
82  quantities{} {}
@ Yes
Print only final-state particles.
bool dil_extended
Extended format for dilepton output.
bool coll_extended
Extended format for collisions output.
bool part_extended
Extended format for particles output.
bool photons_extended
Extended format for photon output.
bool td_v_landau
Print out Landau velocity of type td_dens_type or not?
bool td_tmn_landau
Print out energy-momentum tensor in Landau rest frame (of type td_dens_type) or not?
RivetOutputParameters rivet_parameters
Rivet specfic parameters.
std::map< std::string, std::vector< std::string > > quantities
Map of quantities to be printed in the output.
bool td_jQBS
Print out QBS 4-currents or not?
OutputOnlyFinal part_only_final
Print only final particles in event.
DensityType td_dens_type
Type (e.g., baryon/pion/hadron) of thermodynamic quantity.
bool td_tmn
Print out energy-momentum tensor of type td_dens_type or not?
bool td_smearing
Whether smearing is on or off; WARNING : if smearing is off, then final result is in GeV instead of G...
bool td_rho_eckart
Print out Eckart rest frame density of type td_dens_type or not?
bool td_only_participants
Flag reporting whether only participants are considered (true) or also spectators (false)
bool ic_extended
Extended initial conditions output.
ThreeVector td_position
Point, where thermodynamic quantities are calculated.
bool coll_printstartend
Print initial and final particles in event into collision output.

◆ OutputParameters() [2/2]

smash::OutputParameters::OutputParameters ( Configuration  conf)
inlineexplicit

Constructor from configuration.

Definition at line 85 of file outputparameters.h.

85  : OutputParameters() {
87 
88  if (conf.has_section(InputSections::o_thermodynamics)) {
89  auto thermo_conf = conf.extract_complete_sub_configuration(
91  if (thermo_conf.has_value(InputKeys::output_thermodynamics_position)) {
92  const std::array<double, 3> a =
94  td_position = ThreeVector(a[0], a[1], a[2]);
95  }
96  std::set<ThermodynamicQuantity> quan =
99  td_tmn = (quan.count(ThermodynamicQuantity::Tmn) > 0);
102  td_jQBS = (quan.count(ThermodynamicQuantity::j_QBS) > 0);
106  logg[LExperiment].warn(
107  "Requested Thermodynamics output with Density type None. ",
108  "Change the density type to avoid output being dropped.");
109  }
113  }
114 
115  /* Unconditionally take quantities from the configuration file. This is
116  * needed because the 'Format' key in the output content sub-section is
117  * taken before this object is instantiated and that might be the only
118  * present key making the sub-section disappear before the configuration is
119  * handed over to this constructor. As a positive consequence, the
120  * quantities map has always the entry set, at least to an empty list. This
121  * is assumed elsewhere in the code and it ensured here. */
122  const auto part_quantities =
124  quantities.insert({"Particles", part_quantities});
125  const auto coll_quantities =
127  quantities.insert({"Collisions", coll_quantities});
128  const auto dil_quantities =
130  quantities.insert({"Dileptons", dil_quantities});
131  const auto photons_quantities =
133  quantities.insert({"Photons", photons_quantities});
134  const auto IC_quantities =
136  quantities.insert({"Initial_Conditions", IC_quantities});
137  /* In the same spirit, always take also other particles and collisions keys.
138  * This makes the class behaviour bounded to the key default value and not
139  * to the class member initial value. */
144 
145  if (conf.has_section(InputSections::o_dileptons)) {
147  }
148 
149  if (conf.has_section(InputSections::o_photons)) {
151  }
152 
153  if (conf.has_section(InputSections::o_initialConditions)) {
155  }
156 
157  if (conf.has_section(InputSections::o_rivet)) {
158  auto rivet_conf =
159  conf.extract_complete_sub_configuration(InputSections::o_rivet);
160  /*
161  * std::optional<T> can be assigned from a value using the
162  * template<class U = T> optional& operator=( U&& value );
163  * which is a perfect-forwarded assignment. However, in more complex cases
164  * like here where we use a Configuration::Value object returned by
165  * Configuration::take as value, it might be sometimes needed to
166  * explicitly specify the type U. It is then advantageous to use
167  * std::make_optional. When T is a built-in type, an assignment would work
168  * (although not that mentioned above), but std::make_optional also works.
169  * Note that GNU compiler has a buggy implementation of std::make_optional
170  * in versions from 8.1 till 8.3 and hence we use here make_optional and
171  * not std::make_optional. For faulty GNU versions the implementation
172  * shipped within smash namespace is then used, while in all other cases
173  * std::make_optional is used.
174  */
175  if (rivet_conf.has_value(InputKeys::output_rivet_logging)) {
177  make_optional<std::map<std::string, std::string>>(
178  rivet_conf.take(InputKeys::output_rivet_logging));
179  }
180  if (rivet_conf.has_value(InputKeys::output_rivet_paths)) {
181  rivet_parameters.paths = make_optional<std::vector<std::string>>(
182  rivet_conf.take(InputKeys::output_rivet_paths));
183  }
184  if (rivet_conf.has_value(InputKeys::output_rivet_preloads)) {
185  rivet_parameters.preloads = make_optional<std::vector<std::string>>(
186  rivet_conf.take(InputKeys::output_rivet_preloads));
187  }
188  if (rivet_conf.has_value(InputKeys::output_rivet_analyses)) {
189  rivet_parameters.analyses = make_optional<std::vector<std::string>>(
190  rivet_conf.take(InputKeys::output_rivet_analyses));
191  }
192  if (rivet_conf.has_value(InputKeys::output_rivet_crossSection)) {
193  rivet_parameters.cross_sections = make_optional<std::array<double, 2>>(
194  rivet_conf.take(InputKeys::output_rivet_crossSection));
195  }
197  rivet_conf.take(InputKeys::output_rivet_ignoreBeams);
198  if (rivet_conf.has_section(InputSections::o_r_weights)) {
200  if (rivet_conf.has_value(InputKeys::output_rivet_weights_select)) {
202  make_optional<std::vector<std::string>>(
203  rivet_conf.take(InputKeys::output_rivet_weights_select));
204  }
205  if (rivet_conf.has_value(InputKeys::output_rivet_weights_deselect)) {
207  make_optional<std::vector<std::string>>(
209  }
210  if (rivet_conf.has_value(InputKeys::output_rivet_weights_nominal)) {
211  rivet_parameters.nominal_weight_name = make_optional<std::string>(
212  rivet_conf.take(InputKeys::output_rivet_weights_nominal));
213  }
214  if (rivet_conf.has_value(InputKeys::output_rivet_weights_cap)) {
215  rivet_parameters.cap_on_weights = make_optional<double>(
216  rivet_conf.take(InputKeys::output_rivet_weights_cap));
217  }
218  if (rivet_conf.has_value(InputKeys::output_rivet_weights_nloSmearing)) {
219  rivet_parameters.nlo_smearing = make_optional<double>(
221  }
222  if (rivet_conf.has_value(InputKeys::output_rivet_weights_noMulti)) {
223  rivet_parameters.no_multi_weight = make_optional<bool>(
224  rivet_conf.take(InputKeys::output_rivet_weights_noMulti));
225  }
226  }
227  }
228  }
@ EckartDensity
Density in the Eckart frame.
@ Tmn
Energy-momentum tensor in lab frame.
@ LandauVelocity
Velocity of the Landau rest frame.
@ j_QBS
Electric (Q), baryonic (B) and strange (S) currents.
@ TmnLandau
Energy-momentum tensor in Landau rest frame.
#define SMASH_SOURCE_LOCATION
Hackery that is required to output the location in the source code where the log statement occurs.
Definition: logging.h:153
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:40
static constexpr int LExperiment
static const Key< bool > output_initialConditions_extended
See user guide description for more information.
Definition: input_keys.h:5230
static const Key< std::vector< std::string > > output_rivet_weights_select
See user guide description for more information.
Definition: input_keys.h:5497
static const Key< bool > output_rivet_weights_noMulti
See user guide description for more information.
Definition: input_keys.h:5467
static const Key< std::string > output_rivet_weights_nominal
See user guide description for more information.
Definition: input_keys.h:5482
static const Key< std::set< ThermodynamicQuantity > > output_thermodynamics_quantites
See user guide description for more information.
Definition: input_keys.h:5586
static const Key< DensityType > output_thermodynamics_type
See user guide description for more information.
Definition: input_keys.h:5643
static const Key< bool > output_rivet_ignoreBeams
See user guide description for more information.
Definition: input_keys.h:5361
static const Key< std::vector< std::string > > output_initialConditions_quantities
See user guide description for more information.
Definition: input_keys.h:5248
static const Key< std::vector< std::string > > output_rivet_preloads
See user guide description for more information.
Definition: input_keys.h:5405
static const Key< double > output_rivet_weights_cap
See user guide description for more information.
Definition: input_keys.h:5423
static const Key< std::vector< std::string > > output_photons_quantities
See user guide description for more information.
Definition: input_keys.h:5210
static const Key< bool > output_particles_extended
See user guide description for more information.
Definition: input_keys.h:5049
static const Key< std::array< double, 3 > > output_thermodynamics_position
See user guide description for more information.
Definition: input_keys.h:5556
static const Key< std::vector< std::string > > output_rivet_paths
See user guide description for more information.
Definition: input_keys.h:5391
static const Key< bool > output_collisions_extended
See user guide description for more information.
Definition: input_keys.h:5105
static const Key< OutputOnlyFinal > output_particles_onlyFinal
See user guide description for more information.
Definition: input_keys.h:5084
static const Key< std::vector< std::string > > output_particles_quantities
See user guide description for more information.
Definition: input_keys.h:5065
static const Key< std::vector< std::string > > output_rivet_analyses
See user guide description for more information.
Definition: input_keys.h:5332
static const Key< bool > output_dileptons_extended
See user guide description for more information.
Definition: input_keys.h:5156
static const Key< bool > output_thermodynamics_onlyParticipants
See user guide description for more information.
Definition: input_keys.h:5543
static const Key< std::array< double, 2 > > output_rivet_crossSection
See user guide description for more information.
Definition: input_keys.h:5345
static const Key< std::vector< std::string > > output_rivet_weights_deselect
See user guide description for more information.
Definition: input_keys.h:5437
static const Key< bool > output_collisions_printStartEnd
See user guide description for more information.
Definition: input_keys.h:5138
static const Key< bool > output_thermodynamics_smearing
See user guide description for more information.
Definition: input_keys.h:5625
static const Key< std::map< std::string, std::string > > output_rivet_logging
See user guide description for more information.
Definition: input_keys.h:5377
static const Key< double > output_rivet_weights_nloSmearing
See user guide description for more information.
Definition: input_keys.h:5452
static const Key< std::vector< std::string > > output_dileptons_quantities
See user guide description for more information.
Definition: input_keys.h:5173
static const Key< bool > output_photons_extended
See user guide description for more information.
Definition: input_keys.h:5193
static const Key< std::vector< std::string > > output_collisions_quantities
See user guide description for more information.
Definition: input_keys.h:5123
static const Section o_rivet
Subsection for the output Rivet content.
Definition: input_keys.h:156
static const Section o_r_weights
Subsection for the output Rivet weights information.
Definition: input_keys.h:158
static const Section o_thermodynamics
Subsection for the output thermodynamics content.
Definition: input_keys.h:160
static const Section o_dileptons
Subsection for the output dileptons content.
Definition: input_keys.h:147
static const Section o_photons
Subsection for the output photons content.
Definition: input_keys.h:154
static const Section o_initialConditions
Subsection for the output initial conditions content.
Definition: input_keys.h:149
OutputParameters()
Default constructor, useful for tests.
std::optional< std::vector< std::string > > to_be_enabled_weights
Weights to be enabled for processing.
std::optional< std::string > nominal_weight_name
Nominal weight name.
std::optional< std::map< std::string, std::string > > logs
Logging in Rivet.
std::optional< std::vector< std::string > > preloads
Data files to pre-load e.g., for centrality configurations.
std::optional< std::vector< std::string > > paths
Paths to analyses libraries and data.
std::optional< double > nlo_smearing
How to smear for NLO calculations.
std::optional< std::vector< std::string > > analyses
Analyses (including options) to add to run.
bool ignore_beams
Whether Rivet should ignore beams.
std::optional< double > cap_on_weights
Cap (maximum) on weights.
std::optional< bool > no_multi_weight
Whether Rivet should not care about multi weights.
std::optional< std::vector< std::string > > to_be_disabled_weights
Weights to be disabled for processing.
bool any_weight_parameter_was_given
Whether any weight parameter was specified.
std::optional< std::array< double, 2 > > cross_sections
Cross sections.

Member Data Documentation

◆ td_position

ThreeVector smash::OutputParameters::td_position

Point, where thermodynamic quantities are calculated.

Definition at line 231 of file outputparameters.h.

◆ td_dens_type

DensityType smash::OutputParameters::td_dens_type

Type (e.g., baryon/pion/hadron) of thermodynamic quantity.

Definition at line 234 of file outputparameters.h.

◆ td_rho_eckart

bool smash::OutputParameters::td_rho_eckart

Print out Eckart rest frame density of type td_dens_type or not?

Definition at line 237 of file outputparameters.h.

◆ td_tmn

bool smash::OutputParameters::td_tmn

Print out energy-momentum tensor of type td_dens_type or not?

Definition at line 240 of file outputparameters.h.

◆ td_tmn_landau

bool smash::OutputParameters::td_tmn_landau

Print out energy-momentum tensor in Landau rest frame (of type td_dens_type) or not?

Definition at line 246 of file outputparameters.h.

◆ td_v_landau

bool smash::OutputParameters::td_v_landau

Print out Landau velocity of type td_dens_type or not?

Definition at line 249 of file outputparameters.h.

◆ td_jQBS

bool smash::OutputParameters::td_jQBS

Print out QBS 4-currents or not?

Definition at line 252 of file outputparameters.h.

◆ td_smearing

bool smash::OutputParameters::td_smearing

Whether smearing is on or off; WARNING : if smearing is off, then final result is in GeV instead of GeV/fm3.

Definition at line 258 of file outputparameters.h.

◆ td_only_participants

bool smash::OutputParameters::td_only_participants

Flag reporting whether only participants are considered (true) or also spectators (false)

Definition at line 264 of file outputparameters.h.

◆ part_extended

bool smash::OutputParameters::part_extended

Extended format for particles output.

Definition at line 267 of file outputparameters.h.

◆ part_only_final

OutputOnlyFinal smash::OutputParameters::part_only_final

Print only final particles in event.

Definition at line 270 of file outputparameters.h.

◆ coll_extended

bool smash::OutputParameters::coll_extended

Extended format for collisions output.

Definition at line 273 of file outputparameters.h.

◆ coll_printstartend

bool smash::OutputParameters::coll_printstartend

Print initial and final particles in event into collision output.

Definition at line 276 of file outputparameters.h.

◆ dil_extended

bool smash::OutputParameters::dil_extended

Extended format for dilepton output.

Definition at line 279 of file outputparameters.h.

◆ photons_extended

bool smash::OutputParameters::photons_extended

Extended format for photon output.

Definition at line 282 of file outputparameters.h.

◆ ic_extended

bool smash::OutputParameters::ic_extended

Extended initial conditions output.

Definition at line 285 of file outputparameters.h.

◆ rivet_parameters

RivetOutputParameters smash::OutputParameters::rivet_parameters

Rivet specfic parameters.

Definition at line 288 of file outputparameters.h.

◆ quantities

std::map<std::string, std::vector<std::string> > smash::OutputParameters::quantities

Map of quantities to be printed in the output.

Keys are the different output contents. It is initialised in a way such that it is guaranteed that an entry for every content requested by the user exists. When the user requests the output content without specifying a list of quantities, the corresponding entry in the map will be an empty vector.

Definition at line 297 of file outputparameters.h.


The documentation for this struct was generated from the following file: