Version: SMASH-3.3
smash::Configuration::Value Class Reference

Proxy object to be used when taking or reading keys in the configuration.

This type automatically converts to the target type e.g. on assignment. An object of this type is returned by the private take and read methods and it is constructed from the YAML::Node to be taken or read.

This class is an implementation detail of Configuration and can be ignored by users of Configuration.

Definition at line 839 of file configuration.h.

Public Member Functions

 Value (const Value &)=delete
 If you want to copy this you're doing it wrong. More...
 
Valueoperator= (const Value &)=delete
 If you want to copy this you're doing it wrong. More...
 
template<typename T >
 operator T () const
 This function determines the type it is assigned to and calls YAML::Node::as<T>() with this type. More...
 
template<typename T >
 operator std::vector< T > () const
 Check conversion exceptions. More...
 
template<typename T , size_t N>
 operator std::array< T, N > () const
 Cast array of keys to a std::array of length N. More...
 
 operator ReactionsBitSet () const
 Set ReactionBitSet from configuration values. More...
 
 operator MultiParticleReactionsBitSet () const
 Set MultiParticleReactionsBitSet from configuration values. More...
 
 operator std::set< ThermodynamicQuantity > () const
 Set thermodynamic quantity from configuration values. More...
 
 operator CalculationFrame () const
 Set calculation frame from configuration values. More...
 
 operator FermiMotion () const
 (De-)Activate Fermi motion from configuration values. More...
 
 operator DensityType () const
 Set density type from configuration values. More...
 
 operator ExpansionMode () const
 Set expansion mode from configuration values. More...
 
 operator DerivativesMode () const
 Set DerivativesMode. More...
 
 operator FieldDerivativesMode () const
 Set FieldDerivatives mode. More...
 
 operator SmearingMode () const
 Set SmearingMode. More...
 
 operator TimeStepMode () const
 Set time step mode from configuration values. More...
 
 operator BoxInitialCondition () const
 Set initial condition for box setup from configuration values. More...
 
 operator SphereInitialCondition () const
 Set initial condition for sphere setup from configuration values. More...
 
 operator NNbarTreatment () const
 Set treatment of N-Nbar reactions from configuration values. More...
 
 operator Sampling () const
 Set cross-section sampling method from configuration values. More...
 
 operator ThermalizationAlgorithm () const
 Set algorithm for forced thermalization from configuration values. More...
 
 operator CollisionCriterion () const
 Set collision criterion from configuration values. More...
 
 operator SpinInteractionType () const
 Set spin interaction type from configuration values. More...
 
 operator TotalCrossSectionStrategy () const
 Set total cross section strategy from configuration values. More...
 
 operator PseudoResonance () const
 Set how pseudo-resonances are used from configuration values. More...
 
 operator FluidizationType () const
 Set condition of fluidization for hydrodynamic initial conditions. More...
 
 operator OutputOnlyFinal () const
 Set OutputOnlyFinal for particles output from configuration values. More...
 
 operator FluidizableProcessesBitSet () const
 Set FluidizableProcessesBitSet from configuration values. More...
 

Private Member Functions

 Value (const YAML::Node &n, const char *key)
 Construct the Value wrapper from a YAML::Node. More...
 

Private Attributes

const YAML::Node node_
 a YAML leaf node More...
 
const char *const key_
 The key to be interpreted. More...
 

Friends

class Configuration
 

Constructor & Destructor Documentation

◆ Value() [1/2]

smash::Configuration::Value::Value ( const YAML::Node &  n,
const char *  key 
)
inlineprivate

Construct the Value wrapper from a YAML::Node.

Note
This constructor must be implicit, otherwise it's impossible to return an rvalue Value object - because the copy constructor is deleted.

Definition at line 853 of file configuration.h.

853  : node_(n), key_(key) {
854  if (!(n.IsScalar() || n.IsSequence() || n.IsMap())) {
855  std::stringstream err;
856  err << "Configuration value for \"" << key
857  << "\" is missing or invalid";
858  throw std::runtime_error(err.str());
859  }
860  }
const char *const key_
The key to be interpreted.
const YAML::Node node_
a YAML leaf node
constexpr int n
Neutron.

◆ Value() [2/2]

smash::Configuration::Value::Value ( const Value )
delete

If you want to copy this you're doing it wrong.

Member Function Documentation

◆ operator=()

Value& smash::Configuration::Value::operator= ( const Value )
delete

If you want to copy this you're doing it wrong.

◆ operator T()

template<typename T >
smash::Configuration::Value::operator T ( ) const
inline

This function determines the type it is assigned to and calls YAML::Node::as<T>() with this type.

This makes reading values more convenient than calling as<type>() explicitly.

Exceptions
IncorrectTypeInAssignment

Definition at line 877 of file configuration.h.

877  {
878  try {
879  return node_.as<T>();
880  } catch (YAML::TypedBadConversion<T> &e) {
881  throw IncorrectTypeInAssignment(
882  "The value for key \"" + std::string(key_) +
883  "\" cannot be converted to the requested type.");
884  }
885  }

◆ operator std::vector< T >()

template<typename T >
smash::Configuration::Value::operator std::vector< T > ( ) const
inline

Check conversion exceptions.

Exceptions
IncorrectTypeInAssignmentin case type conversion failed.

Definition at line 893 of file configuration.h.

893  {
894  try {
895  return node_.as<std::vector<T>>();
896  } catch (YAML::TypedBadConversion<T> &e) {
897  throw IncorrectTypeInAssignment(
898  "One of the values in the sequence for key \"" + std::string(key_) +
899  "\" failed to convert to the requested type. E.g. [1 2] is a "
900  "sequence of one string \"1 2\" and [1, 2] is a sequence of two "
901  "integers. Often there is just a comma missing in the config "
902  "file.");
903  } catch (YAML::TypedBadConversion<std::vector<T>> &e) {
904  throw IncorrectTypeInAssignment(
905  "The value for key \"" + std::string(key_) +
906  "\" cannot be converted to the requested type. A sequence was "
907  "expected but apparently not found.");
908  }
909  }

◆ operator std::array< T, N >()

template<typename T , size_t N>
smash::Configuration::Value::operator std::array< T, N > ( ) const
inline

Cast array of keys to a std::array of length N.

Returns
Array of std::array type.
Exceptions
IncorrectTypeInAssignmentin case the number of keys does not match the length of the newly generated array.

Definition at line 919 of file configuration.h.

919  {
920  const std::vector<T> vec = operator std::vector<T>();
921  const size_t n_read = vec.size();
922  // Alert if size does not match
923  if (n_read != N) {
924  throw IncorrectTypeInAssignment("Wrong number of values in array \"" +
925  std::string(key_) + "\". Expected " +
926  std::to_string(N) +
927  " values,"
928  " found " +
929  std::to_string(n_read) + ".");
930  }
931  std::array<T, N> arr;
932  std::copy_n(vec.begin(), N, arr.begin());
933  return arr;
934  }
std::string to_string(ThermodynamicQuantity quantity)
Convert a ThermodynamicQuantity enum value to its corresponding string.
Definition: stringify.cc:26

◆ operator ReactionsBitSet()

smash::Configuration::Value::operator ReactionsBitSet ( ) const
inline

Set ReactionBitSet from configuration values.

Returns
ReactionBitSet with all included reaction types.
Exceptions
IncorrectTypeInAssignmentin case a reaction type that is not available is provided as a configuration value.

Definition at line 943 of file configuration.h.

943  {
944  const std::vector<std::string> v = operator std::vector<std::string>();
945  ReactionsBitSet s;
946  for (const auto &x : v) {
947  if (x == "All") {
948  s.set();
949  break;
950  } else if (x == "Elastic") {
952  } else if (x == "NN_to_NR") {
954  } else if (x == "NN_to_DR") {
956  } else if (x == "KN_to_KN") {
958  } else if (x == "KN_to_KDelta") {
960  } else if (x == "Strangeness_exchange") {
962  } else if (x == "NNbar") {
964  } else if (x == "PiDeuteron_to_NN") {
966  } else if (x == "PiDeuteron_to_pidprime") {
968  } else if (x == "NDeuteron_to_Ndprime") {
970  } else {
971  throw IncorrectTypeInAssignment(
972  "The value for key \"" + std::string(key_) +
973  "\" should be \"All\", \"Elastic\", \"NN_to_NR\", \"NN_to_DR\","
974  "\"KN_to_KN\", \"KN_to_KDelta\", \"PiDeuteron_to_NN\", "
975  "\"PiDeuteron_to_pidprime\", \"NDeuteron_to_Ndprime\", "
976  "\"Strangeness_exchange\" or "
977  "\"NNbar\", or any combination of these.");
978  }
979  }
980  return s;
981  }
std::bitset< 10 > ReactionsBitSet
Container for the 2 to 2 reactions in the code.
@ KN_to_KDelta
@ KN_to_KN
@ NN_to_NR
@ PiDeuteron_to_pidprime
@ NDeuteron_to_Ndprime
@ Strangeness_exchange
@ PiDeuteron_to_NN
@ NN_to_DR

◆ operator MultiParticleReactionsBitSet()

smash::Configuration::Value::operator MultiParticleReactionsBitSet ( ) const
inline

Set MultiParticleReactionsBitSet from configuration values.

Returns
MultiParticleReactionsBitSet with all included reaction types.
Exceptions
IncorrectTypeInAssignmentin case a reaction type that is not available is provided as a configuration value.

Definition at line 990 of file configuration.h.

990  {
991  const std::vector<std::string> v = operator std::vector<std::string>();
993  for (const auto &x : v) {
994  if (x == "All") {
995  s.set();
996  break;
997  } else if (x == "Meson_3to1") {
999  } else if (x == "Deuteron_3to2") {
1001  } else if (x == "NNbar_5to2") {
1003  } else if (x == "A3_Nuclei_4to2") {
1005  } else {
1006  throw IncorrectTypeInAssignment(
1007  "The value for key \"" + std::string(key_) +
1008  "\" should be \"All\", \"Meson_3to1\", "
1009  "\"Deuteron_3to2\" or \"NNbar_5to2\", "
1010  "\"A3_Nuclei_4to2\", or any combination of "
1011  "these.");
1012  }
1013  }
1014  return s;
1015  }
std::bitset< 4 > MultiParticleReactionsBitSet
Container for the n to m reactions in the code.
@ NNbar_5to2
@ A3_Nuclei_4to2
@ Deuteron_3to2
@ Meson_3to1

◆ operator std::set< ThermodynamicQuantity >()

smash::Configuration::Value::operator std::set< ThermodynamicQuantity > ( ) const
inline

Set thermodynamic quantity from configuration values.

Returns
Set of thermodynamic quantity.
Exceptions
IncorrectTypeInAssignmentin case a thermodynamic quantity that is not available is provided as a configuration value.

Definition at line 1024 of file configuration.h.

1024  {
1025  const std::vector<std::string> v = operator std::vector<std::string>();
1026  std::set<ThermodynamicQuantity> s;
1027  for (const auto &x : v) {
1028  if (x == "rho_eckart") {
1030  } else if (x == "tmn") {
1031  s.insert(ThermodynamicQuantity::Tmn);
1032  } else if (x == "tmn_landau") {
1034  } else if (x == "landau_velocity") {
1036  } else if (x == "j_QBS") {
1037  s.insert(ThermodynamicQuantity::j_QBS);
1038  } else {
1039  throw IncorrectTypeInAssignment(
1040  "The value for key \"" + std::string(key_) +
1041  "\" should be \"rho_eckart\", \"tmn\""
1042  ", \"tmn_landau\", \"landau_velocity\" or \"j_QBS\".");
1043  }
1044  }
1045  return s;
1046  }
@ 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.

◆ operator CalculationFrame()

smash::Configuration::Value::operator CalculationFrame ( ) const
inline

Set calculation frame from configuration values.

Returns
string of calculation frame.
Exceptions
IncorrectTypeInAssignmentin case a calculation frame that is not available is provided as a configuration value.

Definition at line 1055 of file configuration.h.

1055  {
1056  const std::string s = operator std::string();
1057  if (s == "center of velocity") {
1059  }
1060  if (s == "center of mass") {
1062  }
1063  if (s == "fixed target") {
1065  }
1066  throw IncorrectTypeInAssignment(
1067  "The value for key \"" + std::string(key_) +
1068  "\" should be \"center of velocity\" or \"center of mass\" "
1069  "or \"fixed target\".");
1070  }

◆ operator FermiMotion()

smash::Configuration::Value::operator FermiMotion ( ) const
inline

(De-)Activate Fermi motion from configuration values.

Returns
Fermi motion setup.
Exceptions
IncorrectTypeInAssignmentin case a Fermi motion value that is not available is provided as a configuration value.

Definition at line 1079 of file configuration.h.

1079  {
1080  const std::string s = operator std::string();
1081  if (s == "off") {
1082  return FermiMotion::Off;
1083  }
1084  if (s == "on") {
1085  return FermiMotion::On;
1086  }
1087  if (s == "frozen") {
1088  return FermiMotion::Frozen;
1089  }
1090  throw IncorrectTypeInAssignment(
1091  "The value for key \"" + std::string(key_) +
1092  "\" should be \"off\" or \"on\" or \"frozen\".");
1093  }
@ On
Use fermi motion in combination with potentials.
@ Frozen
Use fermi motion without potentials.
@ Off
Don't use fermi motion.

◆ operator DensityType()

smash::Configuration::Value::operator DensityType ( ) const
inline

Set density type from configuration values.

Returns
Density type.
Exceptions
IncorrectTypeInAssignmentin case a density type that is not available is provided as a configuration value.

Definition at line 1102 of file configuration.h.

1102  {
1103  const std::string s = operator std::string();
1104  if (s == "hadron") {
1105  return DensityType::Hadron;
1106  }
1107  if (s == "baryon") {
1108  return DensityType::Baryon;
1109  }
1110  if (s == "baryonic isospin") {
1112  }
1113  if (s == "pion") {
1114  return DensityType::Pion;
1115  }
1116  if (s == "total isospin") {
1118  }
1119  if (s == "none") {
1120  return DensityType::None;
1121  }
1122  throw IncorrectTypeInAssignment("The value for key \"" +
1123  std::string(key_) +
1124  "\" should be \"hadron\" or \"baryon\" "
1125  "or \"baryonic isospin\" or \"pion\" "
1126  "or \"none\".");
1127  }

◆ operator ExpansionMode()

smash::Configuration::Value::operator ExpansionMode ( ) const
inline

Set expansion mode from configuration values.

Returns
Expansion mode.
Exceptions
IncorrectTypeInAssignmentin case an expansion mode that is not available is provided as a configuration value.

Definition at line 1136 of file configuration.h.

1136  {
1137  const std::string s = operator std::string();
1138  if (s == "NoExpansion") {
1140  }
1141  if (s == "MasslessFRW") {
1143  }
1144  if (s == "MassiveFRW") {
1146  }
1147  if (s == "Exponential") {
1149  }
1150  throw IncorrectTypeInAssignment(
1151  "The value for key \"" + std::string(key_) +
1152  "\" should be \"NoExpansion\", \"MasslessFRW\"," +
1153  "\"MassiveFRW\" or \"Exponential\".");
1154  }

◆ operator DerivativesMode()

smash::Configuration::Value::operator DerivativesMode ( ) const
inline

Set DerivativesMode.

Definition at line 1159 of file configuration.h.

1159  {
1160  const std::string s = operator std::string();
1161  if (s == "Covariant Gaussian") {
1163  }
1164  if (s == "Finite difference") {
1166  }
1167  if (s == "Off") {
1168  return DerivativesMode::Off;
1169  }
1170  throw IncorrectTypeInAssignment(
1171  "The value for key \"" + std::string(key_) +
1172  "\" should be \"Covariant Gaussian\", \"Finite difference\"," +
1173  " or \"Off\".");
1174  }

◆ operator FieldDerivativesMode()

smash::Configuration::Value::operator FieldDerivativesMode ( ) const
inline

Set FieldDerivatives mode.

Definition at line 1179 of file configuration.h.

1179  {
1180  const std::string s = operator std::string();
1181  if (s == "Chain Rule") {
1183  }
1184  if (s == "Direct") {
1186  }
1187  throw IncorrectTypeInAssignment(
1188  "The value for key \"" + std::string(key_) +
1189  "\" should be \"Chain Rule\" or \"Direct\".");
1190  }

◆ operator SmearingMode()

smash::Configuration::Value::operator SmearingMode ( ) const
inline

Set SmearingMode.

Definition at line 1195 of file configuration.h.

1195  {
1196  const std::string s = operator std::string();
1197  if (s == "Covariant Gaussian") {
1199  }
1200  if (s == "Discrete") {
1201  return SmearingMode::Discrete;
1202  }
1203  if (s == "Triangular") {
1204  return SmearingMode::Triangular;
1205  }
1206  throw IncorrectTypeInAssignment(
1207  "The value for key \"" + std::string(key_) +
1208  "\" should be \"Covariant Gaussian\", \"Discrete\"," +
1209  " or \"Triangular\".");
1210  }

◆ operator TimeStepMode()

smash::Configuration::Value::operator TimeStepMode ( ) const
inline

Set time step mode from configuration values.

Returns
time step mode.
Exceptions
IncorrectTypeInAssignmentin case a time step mode that is not available is provided as a configuration value.

Definition at line 1219 of file configuration.h.

1219  {
1220  const std::string s = operator std::string();
1221  if (s == "None") {
1222  return TimeStepMode::None;
1223  }
1224  if (s == "Fixed") {
1225  return TimeStepMode::Fixed;
1226  }
1227  throw IncorrectTypeInAssignment("The value for key \"" +
1228  std::string(key_) +
1229  "\" should be \"None\" or \"Fixed\".");
1230  }
@ Fixed
Use fixed time step.
@ None
Don't use time steps; propagate from action to action.

◆ operator BoxInitialCondition()

smash::Configuration::Value::operator BoxInitialCondition ( ) const
inline

Set initial condition for box setup from configuration values.

Returns
Initial condition for box setup.
Exceptions
IncorrectTypeInAssignmentin case an initial conditions that is not available is provided as a configuration value.

Definition at line 1239 of file configuration.h.

1239  {
1240  const std::string s = operator std::string();
1241  if (s == "thermal momenta") {
1243  }
1244  if (s == "thermal momenta quantum") {
1246  }
1247  if (s == "peaked momenta") {
1249  }
1250  throw IncorrectTypeInAssignment(
1251  "The value for key \"" + std::string(key_) +
1252  "\" should be \"thermal momenta\", \"thermal momenta quantum\", " +
1253  "or \"peaked momenta\".");
1254  }
@ ThermalMomentaBoltzmann
A thermalized ensemble is generated, with momenta sampled from a Maxwell-Boltzmann distribution.
@ ThermalMomentaQuantum
A thermalized ensemble is generated, with momenta of baryons(mesons) sampled from a Fermi(Bose) distr...
@ PeakedMomenta
All particles have the same momentum with T being the temperature.

◆ operator SphereInitialCondition()

smash::Configuration::Value::operator SphereInitialCondition ( ) const
inline

Set initial condition for sphere setup from configuration values.

Returns
Initial condition for sphere setup.
Exceptions
IncorrectTypeInAssignmentin case an initial conditions that is not available is provided as a configuration value.

Definition at line 1263 of file configuration.h.

1263  {
1264  const std::string s = operator std::string();
1265  if (s == "thermal momenta") {
1267  }
1268  if (s == "thermal momenta quantum") {
1270  }
1271  if (s == "IC_ES") {
1273  }
1274  if (s == "IC_1M") {
1276  }
1277  if (s == "IC_2M") {
1279  }
1280  if (s == "IC_Massive") {
1282  }
1283  throw IncorrectTypeInAssignment(
1284  "The value for key \"" + std::string(key_) +
1285  "\" should be \"thermal momenta\", \"thermal momenta quantum\", " +
1286  "\"IC_ES\", \"IC_1M\", \"IC_2M\" or" + "\"IC_Massive\".");
1287  }
@ ThermalMomentaBoltzmann
A thermalized ensemble is generated, with momenta sampled from a Maxwell-Boltzmann distribution.
@ IC_ES
Off-equilibrium distribution used in massless comparisons of SMASH to the extended universe metric.
@ ThermalMomentaQuantum
A thermalized ensemble is generated, with momenta of baryons(mesons) sampled from a Fermi(Bose) distr...
@ IC_Massive
A generalization of IC_ES for the non-zero mass case; note that there is currently no analytical comp...
@ IC_2M
Off-equilibrium distribution used in massless comparisons of SMASH to the extended universe metric.
@ IC_1M
Off-equilibrium distribution used in massless comparisons of SMASH to the extended universe metric.

◆ operator NNbarTreatment()

smash::Configuration::Value::operator NNbarTreatment ( ) const
inline

Set treatment of N-Nbar reactions from configuration values.

Returns
N-Nbar treatment.
Exceptions
IncorrectTypeInAssignmentin case an N-Nbar treatment that is not available is provided as a configuration value.

Definition at line 1296 of file configuration.h.

1296  {
1297  const std::string s = operator std::string();
1298  if (s == "no annihilation") {
1300  }
1301  if (s == "resonances") {
1303  }
1304  if (s == "two to five") {
1306  }
1307  if (s == "strings") {
1308  return NNbarTreatment::Strings;
1309  }
1310  throw IncorrectTypeInAssignment(
1311  "The value for key \"" + std::string(key_) + "\" should be " +
1312  "\"no annihilation\", \"resonances\", \"two to five\" or " +
1313  " \"strings\".");
1314  }
@ NoAnnihilation
No Annihilation.
@ TwoToFive
Directly create 5 pions, use with multi-particle reactions.
@ Resonances
Use intermediate Resonances.
@ Strings
Use string fragmentation.

◆ operator Sampling()

smash::Configuration::Value::operator Sampling ( ) const
inline

Set cross-section sampling method from configuration values.

Returns
Sampling method of cross-section.
Exceptions
IncorrectTypeInAssignmentin case a sampling method that is not available is provided as a configuration value.

Definition at line 1323 of file configuration.h.

1323  {
1324  const std::string s = operator std::string();
1325  if (s == "quadratic") {
1326  return Sampling::Quadratic;
1327  }
1328  if (s == "custom") {
1329  return Sampling::Custom;
1330  }
1331  if (s == "uniform") {
1332  return Sampling::Uniform;
1333  }
1334  throw IncorrectTypeInAssignment(
1335  "The value for key \"" + std::string(key_) +
1336  "\" should be \"quadratic\", \"uniform\" or \"custom\".");
1337  }
@ Quadratic
Sample from areal / quadratic distribution.
@ Custom
Sample from custom, user-defined distribution.
@ Uniform
Sample from uniform distribution.

◆ operator ThermalizationAlgorithm()

smash::Configuration::Value::operator ThermalizationAlgorithm ( ) const
inline

Set algorithm for forced thermalization from configuration values.

Returns
Algorithm for forced thermalization.
Exceptions
IncorrectTypeInAssignmentin case a thermalization algorithm that is not available is provided as a configuration value.

Definition at line 1346 of file configuration.h.

1346  {
1347  const std::string s = operator std::string();
1348  if (s == "mode sampling") {
1350  }
1351  if (s == "biased BF") {
1353  }
1354  if (s == "unbiased BF") {
1356  }
1357  throw IncorrectTypeInAssignment(
1358  "The value for key \"" + std::string(key_) +
1359  "\" should be \"mode sampling\", \"biased BF\" or \"unbiased BF\".");
1360  }

◆ operator CollisionCriterion()

smash::Configuration::Value::operator CollisionCriterion ( ) const
inline

Set collision criterion from configuration values.

Returns
CollisionCriterion.
Exceptions
IncorrectTypeInAssignmentin case an collision criterion that is not available is provided as a configuration value.

Definition at line 1369 of file configuration.h.

1369  {
1370  const std::string s = operator std::string();
1371  if (s == "Geometric") {
1373  }
1374  if (s == "Stochastic") {
1376  }
1377  if (s == "Covariant") {
1379  }
1380  throw IncorrectTypeInAssignment(
1381  "The value for key \"" + std::string(key_) + "\" should be " +
1382  "\"Geometric\", \"Stochastic\" " + "or \"Covariant\".");
1383  }
@ Stochastic
Stochastic Criteiron.
@ Geometric
Geometric criterion.
@ Covariant
Covariant Criterion.

◆ operator SpinInteractionType()

smash::Configuration::Value::operator SpinInteractionType ( ) const
inline

Set spin interaction type from configuration values.

Returns
SpinInteractionType.
Exceptions
IncorrectTypeInAssignmentin case a spin interaction type that is not available is provided as a configuration value.

Definition at line 1392 of file configuration.h.

1392  {
1393  const std::string s = operator std::string();
1394  if (s == "On")
1395  return SpinInteractionType::On;
1396  if (s == "Off")
1397  return SpinInteractionType::Off;
1398  throw IncorrectTypeInAssignment("The value for key \"" +
1399  std::string(key_) + "\" should be " +
1400  "\"On\", \"Off\" " + "or \"Elastic\".");
1401  }
@ On
All spin interactions.
@ Off
No spin interactions.

◆ operator TotalCrossSectionStrategy()

smash::Configuration::Value::operator TotalCrossSectionStrategy ( ) const
inline

Set total cross section strategy from configuration values.

Returns
TotalCrossSectionStrategy.
Exceptions
IncorrectTypeInAssignmentin case a strategy that is not available is provided as a configuration value.

Definition at line 1410 of file configuration.h.

1410  {
1411  const std::string s = operator std::string();
1412  if (s == "BottomUp") {
1414  }
1415  if (s == "TopDown") {
1417  }
1418  if (s == "TopDownMeasured") {
1420  }
1421  throw IncorrectTypeInAssignment(
1422  "The value for key \"" + std::string(key_) + "\" should be " +
1423  "\"BottomUp\", \"TopDown\" " + "or \"TopDownMeasured\".");
1424  }
@ TopDownMeasured
Mix the two above, using the parametrizations only for measured processes, and summing up partials fo...
@ TopDown
Use parametrizations based on existing data, rescaling with AQM for unmeasured processes.
@ BottomUp
Sum the existing partial contributions.

◆ operator PseudoResonance()

smash::Configuration::Value::operator PseudoResonance ( ) const
inline

Set how pseudo-resonances are used from configuration values.

Returns
PseudoResonance.
Exceptions
IncorrectTypeInAssignmentin case a key that is not available is provided as a configuration value.

Definition at line 1433 of file configuration.h.

1433  {
1434  const std::string s = operator std::string();
1435  if (s == "None") {
1436  return PseudoResonance::None;
1437  }
1438  if (s == "Largest") {
1439  return PseudoResonance::Largest;
1440  }
1441  if (s == "Closest") {
1442  return PseudoResonance::Closest;
1443  }
1444  if (s == "LargestFromUnstable") {
1446  }
1447  if (s == "ClosestFromUnstable") {
1449  }
1450  throw IncorrectTypeInAssignment(
1451  "The value for key \"" + std::string(key_) + "\" should be " +
1452  "\"None\", \"Largest\", \"Closest\", \"LargestFromUnstable\", or "
1453  "\"ClosestFromUnstable\".");
1454  }
@ Closest
Resonance with the pole mass closest from the invariant mass of incoming particles for all processes.
@ ClosestFromUnstable
Closest resonance for a given mass from processes with at least one resonance in the incoming particl...
@ None
No pseudo-resonance is created.
@ LargestFromUnstable
Heaviest possible resonance from processes with at least one resonance in the incoming particles.
@ Largest
Resonance of largest mass for all processes.

◆ operator FluidizationType()

smash::Configuration::Value::operator FluidizationType ( ) const
inline

Set condition of fluidization for hydrodynamic initial conditions.

Returns
FluidizationType.
Exceptions
IncorrectTypeInAssignmentin case a key that is not available is provided as a configuration value.

Definition at line 1464 of file configuration.h.

1464  {
1465  const std::string s = operator std::string();
1466  if (s == "Constant_Tau") {
1468  } else if (s == "Dynamic") {
1470  }
1471  throw IncorrectTypeInAssignment("The value for key \"" +
1472  std::string(key_) + "\" should be " +
1473  "\"Constant_Tau\" or \"Dynamic\".");
1474  }
@ ConstantTau
Hypersurface crossed at a fixed proper time.
@ Dynamic
Dynamic fluidization based on local densities.

◆ operator OutputOnlyFinal()

smash::Configuration::Value::operator OutputOnlyFinal ( ) const
inline

Set OutputOnlyFinal for particles output from configuration values.

Returns
OutputOnlyFinal.
Exceptions
IncorrectTypeInAssignmentin case only_final value that is not available is provided as a configuration value.

Definition at line 1483 of file configuration.h.

1483  {
1484  const std::string s = operator std::string();
1485  if (s == "Yes") {
1486  return OutputOnlyFinal::Yes;
1487  }
1488  if (s == "No") {
1489  return OutputOnlyFinal::No;
1490  }
1491  if (s == "IfNotEmpty") {
1493  }
1494  throw IncorrectTypeInAssignment("The value for key \"" +
1495  std::string(key_) + "\" should be " +
1496  "\"Yes\", \"No\" or \"IfNotEmpty\".");
1497  }
@ IfNotEmpty
Print only final-state particles, and those only if the event is not empty.
@ Yes
Print only final-state particles.
@ No
Print initial, intermediate and final-state particles.

◆ operator FluidizableProcessesBitSet()

smash::Configuration::Value::operator FluidizableProcessesBitSet ( ) const
inline

Set FluidizableProcessesBitSet from configuration values.

Returns
FluidizableProcessesBitSet with all included reaction types.
Exceptions
IncorrectTypeInAssignmentin case a reaction type that is not available is provided as a configuration value.

Definition at line 1506 of file configuration.h.

1506  {
1507  const std::vector<std::string> v = operator std::vector<std::string>();
1509  for (const auto &x : v) {
1510  if (x == "All") {
1511  s.set();
1512  break;
1513  } else if (x == "Elastic") {
1515  } else if (x == "Decay") {
1517  } else if (x == "Inelastic") {
1519  } else if (x == "SoftString") {
1521  } else if (x == "HardString") {
1523  } else {
1524  throw IncorrectTypeInAssignment(
1525  "The value for key \"" + std::string(key_) +
1526  "\" should be \"All\", \"Elastic\", \"Decay\", "
1527  "\"Inelastic\", \"SoftString\", \"HardString\", "
1528  "or any combination of these.");
1529  }
1530  }
1531  return s;
1532  }
std::bitset< 5 > FluidizableProcessesBitSet
@ From_HardString
@ From_Inelastic
@ From_Elastic
@ From_SoftString
@ From_Decay

Friends And Related Function Documentation

◆ Configuration

friend class Configuration
friend

Definition at line 840 of file configuration.h.

Member Data Documentation

◆ node_

const YAML::Node smash::Configuration::Value::node_
private

a YAML leaf node

Todo:
(steinberg) What is that?

Definition at line 843 of file configuration.h.

◆ key_

const char* const smash::Configuration::Value::key_
private

The key to be interpreted.

Definition at line 845 of file configuration.h.


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