Version: SMASH-3.1
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 61 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...
 
bool get_coll_extended (std::string name) const
 Pass correct extended flag to binary collision output constructor. 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...
 

Constructor & Destructor Documentation

◆ OutputParameters() [1/2]

smash::OutputParameters::OutputParameters ( )
inline

Default constructor, useful for tests.

Definition at line 63 of file outputparameters.h.

64  : td_position(ThreeVector()),
66  td_rho_eckart(false),
67  td_tmn(false),
68  td_tmn_landau(false),
69  td_v_landau(false),
70  td_jQBS(false),
71  td_smearing(true),
72  td_only_participants(false),
73  part_extended(false),
75  coll_extended(false),
76  coll_printstartend(false),
77  dil_extended(false),
78  photons_extended(false),
79  ic_extended(false),
80  rivet_parameters{} {}
@ 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.
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 83 of file outputparameters.h.

83  : OutputParameters() {
85 
86  if (conf.has_value({"Thermodynamics"})) {
87  auto thermo_conf = conf.extract_sub_configuration({"Thermodynamics"});
88  if (thermo_conf.has_value({"Position"})) {
89  const std::array<double, 3> a = thermo_conf.take({"Position"});
90  td_position = ThreeVector(a[0], a[1], a[2]);
91  }
92  std::set<ThermodynamicQuantity> quan = thermo_conf.take({"Quantities"});
94  td_tmn = (quan.count(ThermodynamicQuantity::Tmn) > 0);
97  td_jQBS = (quan.count(ThermodynamicQuantity::j_QBS) > 0);
98  td_dens_type = thermo_conf.take({"Type"}, DensityType::Baryon);
101  logg[LExperiment].warn(
102  "Requested Thermodynamics output with Density type None. ",
103  "Change the density type to avoid output being dropped.");
104  }
105  td_smearing = thermo_conf.take({"Smearing"}, true);
106  td_only_participants = thermo_conf.take({"Only_Participants"}, false);
107  }
108 
109  if (conf.has_value({"Particles"})) {
110  part_extended = conf.take({"Particles", "Extended"}, false);
112  conf.take({"Particles", "Only_Final"}, OutputOnlyFinal::Yes);
113  }
114 
115  if (conf.has_value({"Collisions"})) {
116  coll_extended = conf.take({"Collisions", "Extended"}, false);
117  coll_printstartend = conf.take({"Collisions", "Print_Start_End"}, false);
118  }
119 
120  if (conf.has_value({"Dileptons"})) {
121  dil_extended = conf.take({"Dileptons", "Extended"}, false);
122  }
123 
124  if (conf.has_value({"Photons"})) {
125  photons_extended = conf.take({"Photons", "Extended"}, false);
126  }
127 
128  if (conf.has_value({"Initial_Conditions"})) {
129  ic_extended = conf.take({"Initial_Conditions", "Extended"}, false);
130  }
131 
132  if (conf.has_value({"Rivet"})) {
133  auto rivet_conf = conf.extract_sub_configuration({"Rivet"});
134  logg[LOutput].debug() << "Reading Rivet section from configuration:\n"
135  << rivet_conf.to_string() << "\n";
136 
137  /*
138  * std::optional<T> can be assigned from a value using the
139  * template<class U = T> optional& operator=( U&& value );
140  * which is a perfect-forwarded assignment. However, in more complex cases
141  * like here where we use a Configuration::Value object returned by
142  * Configuration::take as value, it might be sometimes needed to
143  * explicitly specify the type U. It is then advantageous to use
144  * std::make_optional. When T is a built-in type, an assignment would work
145  * (although not that mentioned above), but std::make_optional also works.
146  * Note that GNU compiler has a buggy implementation of std::make_optional
147  * in versions from 8.1 till 8.3 and hence we use here make_optional and
148  * not std::make_optional. For faulty GNU versions the implementation
149  * shipped within smash namespace is then used, while in all other cases
150  * std::make_optional is used.
151  */
152  if (rivet_conf.has_value({"Logging"})) {
154  make_optional<std::map<std::string, std::string>>(
155  rivet_conf.take({"Logging"}));
156  }
157  if (rivet_conf.has_value({"Paths"})) {
159  make_optional<std::vector<std::string>>(rivet_conf.take({"Paths"}));
160  }
161  if (rivet_conf.has_value({"Preloads"})) {
162  rivet_parameters.preloads = make_optional<std::vector<std::string>>(
163  rivet_conf.take({"Preloads"}));
164  }
165  if (rivet_conf.has_value({"Analyses"})) {
166  rivet_parameters.analyses = make_optional<std::vector<std::string>>(
167  rivet_conf.take({"Analyses"}));
168  }
169  if (rivet_conf.has_value({"Cross_Section"})) {
170  rivet_parameters.cross_sections = make_optional<std::array<double, 2>>(
171  rivet_conf.take({"Cross_Section"}));
172  }
173  rivet_parameters.ignore_beams = rivet_conf.take({"Ignore_Beams"}, true);
174  if (rivet_conf.has_value({"Weights"})) {
176  if (rivet_conf.has_value({"Weights", "Select"})) {
178  make_optional<std::vector<std::string>>(
179  rivet_conf.take({"Weights", "Select"}));
180  }
181  if (rivet_conf.has_value({"Weights", "Deselect"})) {
183  make_optional<std::vector<std::string>>(
184  rivet_conf.take({"Weights", "Deselect"}));
185  }
186  if (rivet_conf.has_value({"Weights", "Nominal"})) {
187  rivet_parameters.nominal_weight_name = make_optional<std::string>(
188  rivet_conf.take({"Weights", "Nominal"}));
189  }
190  if (rivet_conf.has_value({"Weights", "Cap"})) {
192  make_optional<double>(rivet_conf.take({"Weights", "Cap"}));
193  }
194  if (rivet_conf.has_value({"Weights", "NLO_Smearing"})) {
195  rivet_parameters.nlo_smearing = make_optional<double>(
196  rivet_conf.take({"Weights", "NLO_Smearing"}));
197  }
198  if (rivet_conf.has_value({"Weights", "No_Multi"})) {
200  make_optional<bool>(rivet_conf.take({"Weights", "No_Multi"}));
201  }
202  }
203  logg[LOutput].debug() << "After processing configuration:\n"
204  << rivet_conf.to_string() << "\n";
205  }
206  }
@ 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:39
static constexpr int LExperiment
static constexpr int LOutput
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 Function Documentation

◆ get_coll_extended()

bool smash::OutputParameters::get_coll_extended ( std::string  name) const
inline

Pass correct extended flag to binary collision output constructor.

Parameters
[in]name(File)name of the output.
Returns
Extended flag for binary output.

Definition at line 213 of file outputparameters.h.

213  {
214  if (name == "Collisions") {
215  return coll_extended;
216  } else if (name == "Dileptons") {
217  return dil_extended;
218  } else if (name == "Photons") {
219  return photons_extended;
220  } else {
221  return false; // error
222  }
223  }

Member Data Documentation

◆ td_position

ThreeVector smash::OutputParameters::td_position

Point, where thermodynamic quantities are calculated.

Definition at line 226 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 229 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 232 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 235 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 241 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 244 of file outputparameters.h.

◆ td_jQBS

bool smash::OutputParameters::td_jQBS

Print out QBS 4-currents or not?

Definition at line 247 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 253 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 259 of file outputparameters.h.

◆ part_extended

bool smash::OutputParameters::part_extended

Extended format for particles output.

Definition at line 262 of file outputparameters.h.

◆ part_only_final

OutputOnlyFinal smash::OutputParameters::part_only_final

Print only final particles in event.

Definition at line 265 of file outputparameters.h.

◆ coll_extended

bool smash::OutputParameters::coll_extended

Extended format for collisions output.

Definition at line 268 of file outputparameters.h.

◆ coll_printstartend

bool smash::OutputParameters::coll_printstartend

Print initial and final particles in event into collision output.

Definition at line 271 of file outputparameters.h.

◆ dil_extended

bool smash::OutputParameters::dil_extended

Extended format for dilepton output.

Definition at line 274 of file outputparameters.h.

◆ photons_extended

bool smash::OutputParameters::photons_extended

Extended format for photon output.

Definition at line 277 of file outputparameters.h.

◆ ic_extended

bool smash::OutputParameters::ic_extended

Extended initial conditions output.

Definition at line 280 of file outputparameters.h.

◆ rivet_parameters

RivetOutputParameters smash::OutputParameters::rivet_parameters

Rivet specfic parameters.

Definition at line 283 of file outputparameters.h.


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