Version: SMASH-3.4
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.

Collaboration diagram for smash::OutputParameters:
[legend]

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 td_ignore_unformed
 Flag reporting whether unformed particles are ignored (true) or not (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  td_ignore_unformed(false),
75  part_extended(false),
77  coll_extended(false),
78  coll_printstartend(false),
79  dil_extended(false),
80  photons_extended(false),
81  ic_extended(false),
83  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_ignore_unformed
Flag reporting whether unformed particles are ignored (true) or not (false)
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 86 of file outputparameters.h.

86  : OutputParameters() {
88 
89  if (conf.has_section(InputSections::o_thermodynamics)) {
90  auto thermo_conf = conf.extract_complete_sub_configuration(
92  if (thermo_conf.has_value(InputKeys::output_thermodynamics_position)) {
93  const std::array<double, 3> a =
95  td_position = ThreeVector(a[0], a[1], a[2]);
96  }
97  std::set<ThermodynamicQuantity> quan =
100  td_tmn = (quan.count(ThermodynamicQuantity::Tmn) > 0);
103  td_jQBS = (quan.count(ThermodynamicQuantity::j_QBS) > 0);
107  logg[LExperiment].warn(
108  "Requested Thermodynamics output with Density type None. ",
109  "Change the density type to avoid output being dropped.");
110  }
116  }
117 
118  /* Unconditionally take quantities from the configuration file. This is
119  * needed because the 'Format' key in the output content sub-section is
120  * taken before this object is instantiated and that might be the only
121  * present key making the sub-section disappear before the configuration is
122  * handed over to this constructor. As a positive consequence, the
123  * quantities map has always the entry set, at least to an empty list. This
124  * is assumed elsewhere in the code and it ensured here. */
125  const auto part_quantities =
127  quantities.insert({"Particles", part_quantities});
128  const auto coll_quantities =
130  quantities.insert({"Collisions", coll_quantities});
131  const auto dil_quantities =
133  quantities.insert({"Dileptons", dil_quantities});
134  const auto photons_quantities =
136  quantities.insert({"Photons", photons_quantities});
137  const auto IC_quantities =
139  quantities.insert({"Initial_Conditions", IC_quantities});
140  /* In the same spirit, always take also other particles and collisions keys.
141  * This makes the class behaviour bounded to the key default value and not
142  * to the class member initial value. */
147 
148  if (conf.has_section(InputSections::o_dileptons)) {
150  }
151 
152  if (conf.has_section(InputSections::o_photons)) {
154  }
155 
156  if (conf.has_section(InputSections::o_initialConditions)) {
158  }
159 
160  if (conf.has_section(InputSections::o_rivet)) {
161  auto rivet_conf =
162  conf.extract_complete_sub_configuration(InputSections::o_rivet);
163  /*
164  * std::optional<T> can be assigned from a value using the
165  * template<class U = T> optional& operator=( U&& value );
166  * which is a perfect-forwarded assignment. However, in more complex cases
167  * like here where we use a Configuration::Value object returned by
168  * Configuration::take as value, it might be sometimes needed to
169  * explicitly specify the type U. It is then advantageous to use
170  * std::make_optional. When T is a built-in type, an assignment would work
171  * (although not that mentioned above), but std::make_optional also works.
172  * Note that GNU compiler has a buggy implementation of std::make_optional
173  * in versions from 8.1 till 8.3 and hence we use here make_optional and
174  * not std::make_optional. For faulty GNU versions the implementation
175  * shipped within smash namespace is then used, while in all other cases
176  * std::make_optional is used.
177  */
178  if (rivet_conf.has_value(InputKeys::output_rivet_logging)) {
180  make_optional<std::map<std::string, std::string>>(
181  rivet_conf.take(InputKeys::output_rivet_logging));
182  }
183  if (rivet_conf.has_value(InputKeys::output_rivet_paths)) {
184  rivet_parameters.paths = make_optional<std::vector<std::string>>(
185  rivet_conf.take(InputKeys::output_rivet_paths));
186  }
187  if (rivet_conf.has_value(InputKeys::output_rivet_preloads)) {
188  rivet_parameters.preloads = make_optional<std::vector<std::string>>(
189  rivet_conf.take(InputKeys::output_rivet_preloads));
190  }
191  if (rivet_conf.has_value(InputKeys::output_rivet_analyses)) {
192  rivet_parameters.analyses = make_optional<std::vector<std::string>>(
193  rivet_conf.take(InputKeys::output_rivet_analyses));
194  }
195  if (rivet_conf.has_value(InputKeys::output_rivet_crossSection)) {
196  rivet_parameters.cross_sections = make_optional<std::array<double, 2>>(
197  rivet_conf.take(InputKeys::output_rivet_crossSection));
198  }
200  rivet_conf.take(InputKeys::output_rivet_ignoreBeams);
201  if (rivet_conf.has_section(InputSections::o_r_weights)) {
203  if (rivet_conf.has_value(InputKeys::output_rivet_weights_select)) {
205  make_optional<std::vector<std::string>>(
206  rivet_conf.take(InputKeys::output_rivet_weights_select));
207  }
208  if (rivet_conf.has_value(InputKeys::output_rivet_weights_deselect)) {
210  make_optional<std::vector<std::string>>(
212  }
213  if (rivet_conf.has_value(InputKeys::output_rivet_weights_nominal)) {
214  rivet_parameters.nominal_weight_name = make_optional<std::string>(
215  rivet_conf.take(InputKeys::output_rivet_weights_nominal));
216  }
217  if (rivet_conf.has_value(InputKeys::output_rivet_weights_cap)) {
218  rivet_parameters.cap_on_weights = make_optional<double>(
219  rivet_conf.take(InputKeys::output_rivet_weights_cap));
220  }
221  if (rivet_conf.has_value(InputKeys::output_rivet_weights_nloSmearing)) {
222  rivet_parameters.nlo_smearing = make_optional<double>(
224  }
225  if (rivet_conf.has_value(InputKeys::output_rivet_weights_noMulti)) {
226  rivet_parameters.no_multi_weight = make_optional<bool>(
227  rivet_conf.take(InputKeys::output_rivet_weights_noMulti));
228  }
229  }
230  }
231  }
@ 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.h:245
constexpr Section o_rivet
Subsection for the output Rivet content.
Definition: input_keys.h:220
constexpr Section o_initialConditions
Subsection for the output initial conditions content.
Definition: input_keys.h:213
constexpr Section o_thermodynamics
Subsection for the output thermodynamics content.
Definition: input_keys.h:224
constexpr Section o_r_weights
Subsection for the output Rivet weights information.
Definition: input_keys.h:222
constexpr Section o_photons
Subsection for the output photons content.
Definition: input_keys.h:218
constexpr Section o_dileptons
Subsection for the output dileptons content.
Definition: input_keys.h:211
static constexpr int LExperiment
static const Key< bool > output_initialConditions_extended
See user guide description for more information.
Definition: input_keys.h:6670
static const Key< std::vector< std::string > > output_rivet_weights_select
See user guide description for more information.
Definition: input_keys.h:6980
static const Key< bool > output_rivet_weights_noMulti
See user guide description for more information.
Definition: input_keys.h:6948
static const Key< std::string > output_rivet_weights_nominal
See user guide description for more information.
Definition: input_keys.h:6964
static const Key< std::set< ThermodynamicQuantity > > output_thermodynamics_quantites
See user guide description for more information.
Definition: input_keys.h:7105
static const Key< DensityType > output_thermodynamics_type
See user guide description for more information.
Definition: input_keys.h:7167
static const Key< bool > output_rivet_ignoreBeams
See user guide description for more information.
Definition: input_keys.h:6823
static const Key< bool > output_thermodynamics_ignoreUnformed
See user guide description for more information.
Definition: input_keys.h:7058
static const Key< std::vector< std::string > > output_initialConditions_quantities
See user guide description for more information.
Definition: input_keys.h:6690
static const Key< std::vector< std::string > > output_rivet_preloads
See user guide description for more information.
Definition: input_keys.h:6877
static const Key< double > output_rivet_weights_cap
See user guide description for more information.
Definition: input_keys.h:6898
static const Key< std::vector< std::string > > output_photons_quantities
See user guide description for more information.
Definition: input_keys.h:6640
static const Key< bool > output_particles_extended
See user guide description for more information.
Definition: input_keys.h:6430
static const Key< std::array< double, 3 > > output_thermodynamics_position
See user guide description for more information.
Definition: input_keys.h:7074
static const Key< std::vector< std::string > > output_rivet_paths
See user guide description for more information.
Definition: input_keys.h:6859
static const Key< bool > output_collisions_extended
See user guide description for more information.
Definition: input_keys.h:6502
static const Key< OutputOnlyFinal > output_particles_onlyFinal
See user guide description for more information.
Definition: input_keys.h:6479
static const Key< std::vector< std::string > > output_particles_quantities
See user guide description for more information.
Definition: input_keys.h:6449
static const Key< std::vector< std::string > > output_rivet_analyses
See user guide description for more information.
Definition: input_keys.h:6789
static const Key< bool > output_dileptons_extended
See user guide description for more information.
Definition: input_keys.h:6571
static const Key< bool > output_thermodynamics_onlyParticipants
See user guide description for more information.
Definition: input_keys.h:7034
static const Key< std::array< double, 2 > > output_rivet_crossSection
See user guide description for more information.
Definition: input_keys.h:6805
static const Key< std::vector< std::string > > output_rivet_weights_deselect
See user guide description for more information.
Definition: input_keys.h:6915
static const Key< bool > output_collisions_printStartEnd
See user guide description for more information.
Definition: input_keys.h:6549
static const Key< bool > output_thermodynamics_smearing
See user guide description for more information.
Definition: input_keys.h:7145
static const Key< std::map< std::string, std::string > > output_rivet_logging
See user guide description for more information.
Definition: input_keys.h:6842
static const Key< double > output_rivet_weights_nloSmearing
See user guide description for more information.
Definition: input_keys.h:6932
static const Key< std::vector< std::string > > output_dileptons_quantities
See user guide description for more information.
Definition: input_keys.h:6590
static const Key< bool > output_photons_extended
See user guide description for more information.
Definition: input_keys.h:6621
static const Key< std::vector< std::string > > output_collisions_quantities
See user guide description for more information.
Definition: input_keys.h:6522
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.
Here is the call graph for this function:

Member Data Documentation

◆ td_position

ThreeVector smash::OutputParameters::td_position

Point, where thermodynamic quantities are calculated.

Definition at line 234 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 237 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 240 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 243 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 249 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 252 of file outputparameters.h.

◆ td_jQBS

bool smash::OutputParameters::td_jQBS

Print out QBS 4-currents or not?

Definition at line 255 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 261 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 267 of file outputparameters.h.

◆ td_ignore_unformed

bool smash::OutputParameters::td_ignore_unformed

Flag reporting whether unformed particles are ignored (true) or not (false)

Definition at line 273 of file outputparameters.h.

◆ part_extended

bool smash::OutputParameters::part_extended

Extended format for particles output.

Definition at line 276 of file outputparameters.h.

◆ part_only_final

OutputOnlyFinal smash::OutputParameters::part_only_final

Print only final particles in event.

Definition at line 279 of file outputparameters.h.

◆ coll_extended

bool smash::OutputParameters::coll_extended

Extended format for collisions output.

Definition at line 282 of file outputparameters.h.

◆ coll_printstartend

bool smash::OutputParameters::coll_printstartend

Print initial and final particles in event into collision output.

Definition at line 285 of file outputparameters.h.

◆ dil_extended

bool smash::OutputParameters::dil_extended

Extended format for dilepton output.

Definition at line 288 of file outputparameters.h.

◆ photons_extended

bool smash::OutputParameters::photons_extended

Extended format for photon output.

Definition at line 291 of file outputparameters.h.

◆ ic_extended

bool smash::OutputParameters::ic_extended

Extended initial conditions output.

Definition at line 294 of file outputparameters.h.

◆ rivet_parameters

RivetOutputParameters smash::OutputParameters::rivet_parameters

Rivet specfic parameters.

Definition at line 297 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 306 of file outputparameters.h.


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