Version: SMASH-2.0
outputparameters.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-
3  * SMASH Team
4  *
5  * GNU General Public License (GPLv3 or later)
6  */
7 #ifndef SRC_INCLUDE_SMASH_OUTPUTPARAMETERS_H_
8 #define SRC_INCLUDE_SMASH_OUTPUTPARAMETERS_H_
9 
10 #include <set>
11 #include <string>
12 
13 #include "configuration.h"
14 #include "density.h"
15 #include "forwarddeclarations.h"
16 #include "logging.h"
17 
18 namespace smash {
19 static constexpr int LExperiment = LogArea::Experiment::id;
20 
30  td_rho_eckart(false),
31  td_tmn(false),
32  td_tmn_landau(false),
33  td_v_landau(false),
34  td_jQBS(false),
35  td_smearing(true),
36  part_extended(false),
38  coll_extended(false),
39  coll_printstartend(false),
40  dil_extended(false),
41  photons_extended(false),
42  ic_extended(false) {}
43 
47 
48  if (conf.has_value({"Thermodynamics"})) {
49  auto subcon = conf["Thermodynamics"];
50  if (subcon.has_value({"Position"})) {
51  const std::array<double, 3> a = subcon.take({"Position"});
52  td_position = ThreeVector(a[0], a[1], a[2]);
53  }
54  std::set<ThermodynamicQuantity> quan = subcon.take({"Quantities"});
56  td_tmn = (quan.count(ThermodynamicQuantity::Tmn) > 0);
59  td_jQBS = (quan.count(ThermodynamicQuantity::j_QBS) > 0);
60  td_dens_type = subcon.take({"Type"}, DensityType::Baryon);
63  logg[LExperiment].warn(
64  "Requested Thermodynamics output with Density type None. ",
65  "Change the density type to avoid output being dropped.");
66  }
67  td_smearing = subcon.take({"Smearing"}, true);
68  }
69 
70  if (conf.has_value({"Particles"})) {
71  part_extended = conf.take({"Particles", "Extended"}, false);
73  conf.take({"Particles", "Only_Final"}, OutputOnlyFinal::Yes);
74  }
75 
76  if (conf.has_value({"Collisions"})) {
77  coll_extended = conf.take({"Collisions", "Extended"}, false);
78  coll_printstartend = conf.take({"Collisions", "Print_Start_End"}, false);
79  }
80 
81  if (conf.has_value({"Dileptons"})) {
82  dil_extended = conf.take({"Dileptons", "Extended"}, false);
83  }
84 
85  if (conf.has_value({"Photons"})) {
86  photons_extended = conf.take({"Photons", "Extended"}, false);
87  }
88 
89  if (conf.has_value({"Initial_Conditions"})) {
90  ic_extended = conf.take({"Initial_Conditions", "Extended"}, false);
91  }
92  }
93 
99  bool get_coll_extended(std::string name) const {
100  if (name == "Collisions") {
101  return coll_extended;
102  } else if (name == "Dileptons") {
103  return dil_extended;
104  } else if (name == "Photons") {
105  return photons_extended;
106  } else {
107  return false; // error
108  }
109  }
110 
113 
116 
119 
121  bool td_tmn;
122 
128 
131 
133  bool td_jQBS;
134 
140 
143 
146 
149 
152 
155 
158 
161 };
162 
163 } // namespace smash
164 
165 #endif // SRC_INCLUDE_SMASH_OUTPUTPARAMETERS_H_
smash
Definition: action.h:24
ThermodynamicQuantity::TmnLandau
smash::OutputParameters::ic_extended
bool ic_extended
Extended initial conditions output.
Definition: outputparameters.h:160
ThermodynamicQuantity::LandauVelocity
OutputOnlyFinal
OutputOnlyFinal
Whether and when only final state particles should be printed.
Definition: forwarddeclarations.h:205
smash::LExperiment
static constexpr int LExperiment
Definition: outputparameters.h:19
smash::OutputParameters::td_jQBS
bool td_jQBS
Print out QBS 4-currents or not?
Definition: outputparameters.h:133
smash::OutputParameters::OutputParameters
OutputParameters(Configuration &&conf)
Constructor from configuration.
Definition: outputparameters.h:45
smash::OutputParameters::td_v_landau
bool td_v_landau
Print out Landau velocity of type td_dens_type or not?
Definition: outputparameters.h:130
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::Configuration
Interface to the SMASH configuration files.
Definition: configuration.h:464
forwarddeclarations.h
smash::ThreeVector
Definition: threevector.h:31
source_location
#define source_location
Hackery that is required to output the location in the source code where the log statement occurs.
Definition: logging.h:243
smash::OutputParameters::td_position
ThreeVector td_position
Point, where thermodynamic quantities are calculated.
Definition: outputparameters.h:112
smash::OutputParameters::part_extended
bool part_extended
Extended format for particles output.
Definition: outputparameters.h:142
smash::OutputParameters
Helper structure for Experiment to hold output options and parameters.
Definition: outputparameters.h:25
smash::OutputParameters::photons_extended
bool photons_extended
Extended format for photon output.
Definition: outputparameters.h:157
ThermodynamicQuantity::Tmn
smash::OutputParameters::td_rho_eckart
bool td_rho_eckart
Print out Eckart rest frame density of type td_dens_type or not?
Definition: outputparameters.h:118
smash::OutputParameters::coll_extended
bool coll_extended
Extended format for collisions output.
Definition: outputparameters.h:148
smash::OutputParameters::coll_printstartend
bool coll_printstartend
Print initial and final particles in event into collision output.
Definition: outputparameters.h:151
density.h
smash::OutputParameters::td_tmn
bool td_tmn
Print out energy-momentum tensor of type td_dens_type or not?
Definition: outputparameters.h:121
OutputOnlyFinal::Yes
Print only final-state particles.
ThermodynamicQuantity::EckartDensity
smash::OutputParameters::get_coll_extended
bool get_coll_extended(std::string name) const
Pass correct extended flag to binary collision output constructor.
Definition: outputparameters.h:99
smash::DensityType
DensityType
Allows to choose which kind of density to calculate.
Definition: density.h:36
logging.h
smash::OutputParameters::OutputParameters
OutputParameters()
Default constructor, useful for tests.
Definition: outputparameters.h:27
configuration.h
smash::OutputParameters::part_only_final
OutputOnlyFinal part_only_final
Print only final particles in event.
Definition: outputparameters.h:145
smash::OutputParameters::td_dens_type
DensityType td_dens_type
Type (e.g., baryon/pion/hadron) of thermodynamic quantity.
Definition: outputparameters.h:115
smash::DensityType::None
ThermodynamicQuantity::j_QBS
smash::DensityType::Baryon
smash::OutputParameters::td_smearing
bool td_smearing
Whether smearing is on or off; WARNING : if smearing is off, then final result is in GeV instead of G...
Definition: outputparameters.h:139
smash::OutputParameters::dil_extended
bool dil_extended
Extended format for dilepton output.
Definition: outputparameters.h:154
smash::OutputParameters::td_tmn_landau
bool td_tmn_landau
Print out energy-momentum tensor in Landau rest frame (of type td_dens_type) or not?
Definition: outputparameters.h:127