Version: SMASH-1.5
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_OUTPUTPARAMETERS_H_
8 #define SRC_INCLUDE_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 
29  td_rho_eckart(false),
30  td_tmn(false),
31  td_tmn_landau(false),
32  td_v_landau(false),
33  td_smearing(true),
34  part_extended(false),
35  part_only_final(true),
36  coll_extended(false),
37  coll_printstartend(false),
38  dil_extended(false),
39  photons_extended(false) {}
40 
43  const auto& log = logger<LogArea::Experiment>();
44  log.trace(source_location);
45 
46  if (conf.has_value({"Thermodynamics"})) {
47  auto subcon = conf["Thermodynamics"];
48  if (subcon.has_value({"Position"})) {
49  const std::array<double, 3> a = subcon.take({"Position"});
50  td_position = ThreeVector(a[0], a[1], a[2]);
51  }
52  std::set<ThermodynamicQuantity> quan = subcon.take({"Quantities"});
54  td_tmn = (quan.count(ThermodynamicQuantity::Tmn) > 0);
57  td_dens_type = subcon.take({"Type"}, DensityType::Baryon);
60  log.warn("Requested Thermodynamics output with Density type None. ",
61  "Change the density type to avoid output being dropped.");
62  }
63  td_smearing = subcon.take({"Smearing"}, true);
64  }
65 
66  if (conf.has_value({"Particles"})) {
67  part_extended = conf.take({"Particles", "Extended"}, false);
68  part_only_final = conf.take({"Particles", "Only_Final"}, true);
69  }
70 
71  if (conf.has_value({"Collisions"})) {
72  coll_extended = conf.take({"Collisions", "Extended"}, false);
73  coll_printstartend = conf.take({"Collisions", "Print_Start_End"}, false);
74  }
75 
76  if (conf.has_value({"Dileptons"})) {
77  dil_extended = conf.take({"Dileptons", "Extended"}, false);
78  }
79 
80  if (conf.has_value({"Photons"})) {
81  photons_extended = conf.take({"Photons", "Extended"}, false);
82  }
83  }
84 
90  bool get_coll_extended(std::string name) const {
91  if (name == "Collisions") {
92  return coll_extended;
93  } else if (name == "Dileptons") {
94  return dil_extended;
95  } else if (name == "Photons") {
96  return photons_extended;
97  } else {
98  return false; // error
99  }
100  }
101 
104 
107 
110 
112  bool td_tmn;
113 
119 
122 
128 
131 
134 
137 
140 
143 
146 };
147 
148 } // namespace smash
149 
150 #endif // SRC_INCLUDE_OUTPUTPARAMETERS_H_
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:30
DensityType td_dens_type
Type (e.g., baryon/pion/hadron) of thermodynamic quantity.
ThreeVector td_position
Point, where thermodynamic quantities are calculated.
bool part_extended
Extended format for particles output.
OutputParameters()
Default constructor, useful for tests.
Interface to the SMASH configuration files.
bool td_tmn_landau
Print out energy-momentum tensor in Landau rest frame (of type td_dens_type) or not?
OutputParameters(Configuration &&conf)
Constructor from configuration.
bool td_smearing
Whether smearing is on or off; WARNING : if smearing is off, then final result is in GeV instead of G...
bool coll_printstartend
Print initial and final particles in event into collision output.
#define source_location
Hackery that is required to output the location in the source code where the log statement occurs...
Definition: logging.h:246
bool photons_extended
Extended format for photon output.
bool part_only_final
Print only final particles in event.
bool coll_extended
Extended format for collisions output.
bool td_rho_eckart
Print out Eckart rest frame density of type td_dens_type or not?
Helper structure for Experiment to hold output options and parameters.
bool dil_extended
Extended format for dilepton output.
bool td_tmn
Print out energy-momentum tensor of type td_dens_type or not?
bool td_v_landau
Print out Landau velocity of type td_dens_type or not?
DensityType
Allows to choose which kind of density to calculate.
Definition: density.h:34
bool get_coll_extended(std::string name) const
Pass correct extended flag to binary collision output constructor.
Definition: action.h:24