Version: SMASH-3.4
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 853 of file configuration.h.

Collaboration diagram for smash::Configuration::Value:
[legend]

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 DileptonBremsPionFormFactor () const
 Set form factor 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 CharmRescattering () const
 Set charm rescattering method from configuration values. More...
 
 operator SpinInteractionType () const
 Set spin interaction type from configuration values. More...
 
 operator HardStringTransitionMode () const
 Set hard string transition mode 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 867 of file configuration.h.

867  : node_(n), key_(key) {
868  if (!(n.IsScalar() || n.IsSequence() || n.IsMap())) {
869  std::stringstream err;
870  err << "Configuration value for \"" << key
871  << "\" is missing or invalid";
872  throw std::runtime_error(err.str());
873  }
874  }
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 891 of file configuration.h.

891  {
892  try {
893  return node_.as<T>();
894  } catch (YAML::TypedBadConversion<T> &e) {
895  throw IncorrectTypeInAssignment(
896  "The value for key \"" + std::string(key_) +
897  "\" cannot be converted to the requested type.");
898  }
899  }

◆ 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 907 of file configuration.h.

907  {
908  try {
909  return node_.as<std::vector<T>>();
910  } catch (YAML::TypedBadConversion<T> &e) {
911  throw IncorrectTypeInAssignment(
912  "One of the values in the sequence for key \"" + std::string(key_) +
913  "\" failed to convert to the requested type. E.g. [1 2] is a "
914  "sequence of one string \"1 2\" and [1, 2] is a sequence of two "
915  "integers. Often there is just a comma missing in the config "
916  "file.");
917  } catch (YAML::TypedBadConversion<std::vector<T>> &e) {
918  throw IncorrectTypeInAssignment(
919  "The value for key \"" + std::string(key_) +
920  "\" cannot be converted to the requested type. A sequence was "
921  "expected but apparently not found.");
922  }
923  }

◆ 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 933 of file configuration.h.

933  {
934  const std::vector<T> vec = operator std::vector<T>();
935  const size_t n_read = vec.size();
936  // Alert if size does not match
937  if (n_read != N) {
938  throw IncorrectTypeInAssignment("Wrong number of values in array \"" +
939  std::string(key_) + "\". Expected " +
940  std::to_string(N) +
941  " values,"
942  " found " +
943  std::to_string(n_read) + ".");
944  }
945  std::array<T, N> arr;
946  std::copy_n(vec.begin(), N, arr.begin());
947  return arr;
948  }
std::string to_string(ThermodynamicQuantity quantity)
Convert a ThermodynamicQuantity enum value to its corresponding string.
Definition: stringify.cc:26
Here is the call graph for this function:

◆ 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 957 of file configuration.h.

957  {
958  const std::vector<std::string> v = operator std::vector<std::string>();
959  ReactionsBitSet s;
960  for (const auto &x : v) {
961  if (x == "All") {
962  s.set();
963  break;
964  } else if (x == "Elastic") {
966  } else if (x == "NN_to_NR") {
968  } else if (x == "NN_to_DR") {
970  } else if (x == "KN_to_KN") {
972  } else if (x == "KN_to_KDelta") {
974  } else if (x == "Strangeness_exchange") {
976  } else if (x == "NNbar") {
978  } else if (x == "PiDeuteron_to_NN") {
980  } else if (x == "PiDeuteron_to_pidprime") {
982  } else if (x == "NDeuteron_to_Ndprime") {
984  } else if (x == "Charm_T-matrix") {
986  } else {
987  throw IncorrectTypeInAssignment(
988  "The value for key \"" + std::string(key_) +
989  "\" should be \"All\", \"Elastic\", \"NN_to_NR\", \"NN_to_DR\","
990  "\"KN_to_KN\", \"KN_to_KDelta\", \"PiDeuteron_to_NN\", "
991  "\"PiDeuteron_to_pidprime\", \"NDeuteron_to_Ndprime\", "
992  "\"Strangeness_exchange\", \"NNbar\", or \"Charm_T-matrix\" "
993  "or any combination of these.");
994  }
995  }
996  return s;
997  }
@ KN_to_KDelta
@ KN_to_KN
@ NN_to_NR
@ PiDeuteron_to_pidprime
@ NDeuteron_to_Ndprime
@ Strangeness_exchange
@ Charm_T_matrix
@ PiDeuteron_to_NN
@ NN_to_DR
std::bitset< 11 > ReactionsBitSet
Container for the 2 to 2 reactions in the code.

◆ 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 1006 of file configuration.h.

1006  {
1007  const std::vector<std::string> v = operator std::vector<std::string>();
1009  for (const auto &x : v) {
1010  if (x == "All") {
1011  s.set();
1012  break;
1013  } else if (x == "Meson_3to1") {
1015  } else if (x == "Deuteron_3to2") {
1017  } else if (x == "NNbar_5to2") {
1019  } else if (x == "A3_Nuclei_4to2") {
1021  } else {
1022  throw IncorrectTypeInAssignment(
1023  "The value for key \"" + std::string(key_) +
1024  "\" should be \"All\", \"Meson_3to1\", "
1025  "\"Deuteron_3to2\" or \"NNbar_5to2\", "
1026  "\"A3_Nuclei_4to2\", or any combination of "
1027  "these.");
1028  }
1029  }
1030  return s;
1031  }
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 1040 of file configuration.h.

1040  {
1041  const std::vector<std::string> v = operator std::vector<std::string>();
1042  std::set<ThermodynamicQuantity> s;
1043  for (const auto &x : v) {
1044  if (x == "rho_eckart") {
1046  } else if (x == "tmn") {
1047  s.insert(ThermodynamicQuantity::Tmn);
1048  } else if (x == "tmn_landau") {
1050  } else if (x == "landau_velocity") {
1052  } else if (x == "j_QBS") {
1053  s.insert(ThermodynamicQuantity::j_QBS);
1054  } else {
1055  throw IncorrectTypeInAssignment(
1056  "The value for key \"" + std::string(key_) +
1057  "\" should be \"rho_eckart\", \"tmn\""
1058  ", \"tmn_landau\", \"landau_velocity\" or \"j_QBS\".");
1059  }
1060  }
1061  return s;
1062  }
@ 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 1071 of file configuration.h.

1071  {
1072  const std::string s = operator std::string();
1073  if (s == "center of velocity") {
1075  }
1076  if (s == "center of mass") {
1078  }
1079  if (s == "fixed target") {
1081  }
1082  throw IncorrectTypeInAssignment(
1083  "The value for key \"" + std::string(key_) +
1084  "\" should be \"center of velocity\" or \"center of mass\" "
1085  "or \"fixed target\".");
1086  }

◆ operator DileptonBremsPionFormFactor()

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

Set form factor from configuration values.

Returns
Dilepton pion form factor type.
Exceptions
IncorrectTypeInAssignmentin case a form factor value that is not available is provided as a configuration value.

Definition at line 1095 of file configuration.h.

1095  {
1096  const std::string s = operator std::string();
1097  if (s == "FF1") {
1099  }
1100  if (s == "FF2") {
1102  }
1103  if (s == "Off") {
1105  }
1106  throw IncorrectTypeInAssignment(
1107  "The value for key \"" + std::string(key_) +
1108  "\" should be \"FF1\" or \"FF2\" or \"Off\".");
1109  }
@ FF2
Photon couples 40% directly to intrinsice quark structure of pion and 60% indirectly via meson.
@ FF1
Photon couples to pion only via meson.
@ Off
Don't use form factors, i.e. multiply by 1.

◆ 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 1118 of file configuration.h.

1118  {
1119  const std::string s = operator std::string();
1120  if (s == "off") {
1121  return FermiMotion::Off;
1122  }
1123  if (s == "on") {
1124  return FermiMotion::On;
1125  }
1126  if (s == "frozen") {
1127  return FermiMotion::Frozen;
1128  }
1129  throw IncorrectTypeInAssignment(
1130  "The value for key \"" + std::string(key_) +
1131  "\" should be \"off\" or \"on\" or \"frozen\".");
1132  }
@ 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 1141 of file configuration.h.

1141  {
1142  const std::string s = operator std::string();
1143  if (s == "hadron") {
1144  return DensityType::Hadron;
1145  }
1146  if (s == "baryon") {
1147  return DensityType::Baryon;
1148  }
1149  if (s == "baryonic isospin") {
1151  }
1152  if (s == "pion") {
1153  return DensityType::Pion;
1154  }
1155  if (s == "total isospin") {
1157  }
1158  if (s == "none") {
1159  return DensityType::None;
1160  }
1161  throw IncorrectTypeInAssignment("The value for key \"" +
1162  std::string(key_) +
1163  "\" should be \"hadron\" or \"baryon\" "
1164  "or \"baryonic isospin\" or \"pion\" "
1165  "or \"none\".");
1166  }

◆ 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 1175 of file configuration.h.

1175  {
1176  const std::string s = operator std::string();
1177  if (s == "NoExpansion") {
1179  }
1180  if (s == "MasslessFRW") {
1182  }
1183  if (s == "MassiveFRW") {
1185  }
1186  if (s == "Exponential") {
1188  }
1189  throw IncorrectTypeInAssignment(
1190  "The value for key \"" + std::string(key_) +
1191  "\" should be \"NoExpansion\", \"MasslessFRW\"," +
1192  "\"MassiveFRW\" or \"Exponential\".");
1193  }

◆ operator DerivativesMode()

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

Set DerivativesMode.

Definition at line 1198 of file configuration.h.

1198  {
1199  const std::string s = operator std::string();
1200  if (s == "Covariant Gaussian") {
1202  }
1203  if (s == "Finite difference") {
1205  }
1206  if (s == "Off") {
1207  return DerivativesMode::Off;
1208  }
1209  throw IncorrectTypeInAssignment(
1210  "The value for key \"" + std::string(key_) +
1211  "\" should be \"Covariant Gaussian\", \"Finite difference\"," +
1212  " or \"Off\".");
1213  }

◆ operator FieldDerivativesMode()

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

Set FieldDerivatives mode.

Definition at line 1218 of file configuration.h.

1218  {
1219  const std::string s = operator std::string();
1220  if (s == "Chain Rule") {
1222  }
1223  if (s == "Direct") {
1225  }
1226  throw IncorrectTypeInAssignment(
1227  "The value for key \"" + std::string(key_) +
1228  "\" should be \"Chain Rule\" or \"Direct\".");
1229  }

◆ operator SmearingMode()

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

Set SmearingMode.

Definition at line 1234 of file configuration.h.

1234  {
1235  const std::string s = operator std::string();
1236  if (s == "Covariant Gaussian") {
1238  }
1239  if (s == "Discrete") {
1240  return SmearingMode::Discrete;
1241  }
1242  if (s == "Triangular") {
1243  return SmearingMode::Triangular;
1244  }
1245  throw IncorrectTypeInAssignment(
1246  "The value for key \"" + std::string(key_) +
1247  "\" should be \"Covariant Gaussian\", \"Discrete\"," +
1248  " or \"Triangular\".");
1249  }

◆ 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 1258 of file configuration.h.

1258  {
1259  const std::string s = operator std::string();
1260  if (s == "None") {
1261  return TimeStepMode::None;
1262  }
1263  if (s == "Fixed") {
1264  return TimeStepMode::Fixed;
1265  }
1266  throw IncorrectTypeInAssignment("The value for key \"" +
1267  std::string(key_) +
1268  "\" should be \"None\" or \"Fixed\".");
1269  }
@ 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 1278 of file configuration.h.

1278  {
1279  const std::string s = operator std::string();
1280  if (s == "thermal momenta") {
1282  }
1283  if (s == "thermal momenta quantum") {
1285  }
1286  if (s == "peaked momenta") {
1288  }
1289  throw IncorrectTypeInAssignment(
1290  "The value for key \"" + std::string(key_) +
1291  "\" should be \"thermal momenta\", \"thermal momenta quantum\", " +
1292  "or \"peaked momenta\".");
1293  }
@ 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 1302 of file configuration.h.

1302  {
1303  const std::string s = operator std::string();
1304  if (s == "thermal momenta") {
1306  }
1307  if (s == "thermal momenta quantum") {
1309  }
1310  if (s == "IC_ES") {
1312  }
1313  if (s == "IC_1M") {
1315  }
1316  if (s == "IC_2M") {
1318  }
1319  if (s == "IC_Massive") {
1321  }
1322  throw IncorrectTypeInAssignment(
1323  "The value for key \"" + std::string(key_) +
1324  "\" should be \"thermal momenta\", \"thermal momenta quantum\", " +
1325  "\"IC_ES\", \"IC_1M\", \"IC_2M\" or" + "\"IC_Massive\".");
1326  }
@ 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 1335 of file configuration.h.

1335  {
1336  const std::string s = operator std::string();
1337  if (s == "no annihilation") {
1339  }
1340  if (s == "resonances") {
1342  }
1343  if (s == "two to five") {
1345  }
1346  if (s == "strings") {
1347  return NNbarTreatment::Strings;
1348  }
1349  throw IncorrectTypeInAssignment(
1350  "The value for key \"" + std::string(key_) + "\" should be " +
1351  "\"no annihilation\", \"resonances\", \"two to five\" or " +
1352  " \"strings\".");
1353  }
@ 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 1362 of file configuration.h.

1362  {
1363  const std::string s = operator std::string();
1364  if (s == "quadratic") {
1365  return Sampling::Quadratic;
1366  }
1367  if (s == "custom") {
1368  return Sampling::Custom;
1369  }
1370  if (s == "uniform") {
1371  return Sampling::Uniform;
1372  }
1373  throw IncorrectTypeInAssignment(
1374  "The value for key \"" + std::string(key_) +
1375  "\" should be \"quadratic\", \"uniform\" or \"custom\".");
1376  }
@ 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 1385 of file configuration.h.

1385  {
1386  const std::string s = operator std::string();
1387  if (s == "mode sampling") {
1389  }
1390  if (s == "biased BF") {
1392  }
1393  if (s == "unbiased BF") {
1395  }
1396  throw IncorrectTypeInAssignment(
1397  "The value for key \"" + std::string(key_) +
1398  "\" should be \"mode sampling\", \"biased BF\" or \"unbiased BF\".");
1399  }

◆ operator CollisionCriterion()

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

Set collision criterion from configuration values.

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

Definition at line 1408 of file configuration.h.

1408  {
1409  const std::string s = operator std::string();
1410  if (s == "Geometric") {
1412  }
1413  if (s == "Stochastic") {
1415  }
1416  if (s == "Covariant") {
1418  }
1419  throw IncorrectTypeInAssignment(
1420  "The value for key \"" + std::string(key_) + "\" should be " +
1421  "\"Geometric\", \"Stochastic\" " + "or \"Covariant\".");
1422  }
@ Stochastic
Stochastic Criteiron.
@ Geometric
Geometric criterion.
@ Covariant
Covariant Criterion.

◆ operator CharmRescattering()

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

Set charm rescattering method from configuration values.

Returns
CharmRescattering.
Exceptions
IncorrectTypeInAssignmentin case a charm rescattering method that is not available is provided as a configuration value.

Definition at line 1431 of file configuration.h.

1431  {
1432  const std::string c = operator std::string();
1433  if (c == "T-matrix") {
1435  }
1436  if (c == "resonances") {
1438  }
1439  if (c == "none") {
1440  return CharmRescattering::None;
1441  }
1442  throw IncorrectTypeInAssignment(
1443  "The value for key \"" + std::string(key_) + "\" should be " +
1444  "\"T-matrix\", \"resonances\", " + "or \"none\".");
1445  }
@ T_Matrix
Charm interactions via T-matrix approach.
@ Resonances
Charm interactions via resonances.
@ None
Disable charm interactions.

◆ 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 1454 of file configuration.h.

1454  {
1455  const std::string s = operator std::string();
1456  if (s == "On")
1457  return SpinInteractionType::On;
1458  if (s == "Off")
1459  return SpinInteractionType::Off;
1460  throw IncorrectTypeInAssignment("The value for key \"" +
1461  std::string(key_) + "\" should be " +
1462  "\"On\" or \"Off\".");
1463  }
@ On
All spin interactions.
@ Off
No spin interactions.

◆ operator HardStringTransitionMode()

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

Set hard string transition mode from configuration values.

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

Definition at line 1472 of file configuration.h.

1472  {
1473  const std::string s = operator std::string();
1474 
1475  if (s == "Exponential") {
1477  }
1478  if (s == "Custom_Range") {
1480  }
1481 
1482  throw IncorrectTypeInAssignment("The value for key \"" +
1483  std::string(key_) +
1484  "\" should be "
1485  "\"Exponential\" or \"Custom_Range\".");
1486  }
@ Custom_Range
Smooth transition within a user-defined invariant energy range.
@ Exponential
Legacy exponential splitting based on the hard string cross section.

◆ 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 1494 of file configuration.h.

1494  {
1495  const std::string s = operator std::string();
1496  if (s == "BottomUp") {
1498  }
1499  if (s == "TopDown") {
1501  }
1502  if (s == "TopDownMeasured") {
1504  }
1505  throw IncorrectTypeInAssignment(
1506  "The value for key \"" + std::string(key_) + "\" should be " +
1507  "\"BottomUp\", \"TopDown\" " + "or \"TopDownMeasured\".");
1508  }
@ 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 1517 of file configuration.h.

1517  {
1518  const std::string s = operator std::string();
1519  if (s == "None") {
1520  return PseudoResonance::None;
1521  }
1522  if (s == "Largest") {
1523  return PseudoResonance::Largest;
1524  }
1525  if (s == "Closest") {
1526  return PseudoResonance::Closest;
1527  }
1528  if (s == "LargestFromUnstable") {
1530  }
1531  if (s == "ClosestFromUnstable") {
1533  }
1534  throw IncorrectTypeInAssignment(
1535  "The value for key \"" + std::string(key_) + "\" should be " +
1536  "\"None\", \"Largest\", \"Closest\", \"LargestFromUnstable\", or "
1537  "\"ClosestFromUnstable\".");
1538  }
@ 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 1548 of file configuration.h.

1548  {
1549  const std::string s = operator std::string();
1550  if (s == "Constant_Tau") {
1552  } else if (s == "Dynamic") {
1554  }
1555  throw IncorrectTypeInAssignment("The value for key \"" +
1556  std::string(key_) + "\" should be " +
1557  "\"Constant_Tau\" or \"Dynamic\".");
1558  }
@ 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 1567 of file configuration.h.

1567  {
1568  const std::string s = operator std::string();
1569  if (s == "Yes") {
1570  return OutputOnlyFinal::Yes;
1571  }
1572  if (s == "No") {
1573  return OutputOnlyFinal::No;
1574  }
1575  if (s == "IfNotEmpty") {
1577  }
1578  throw IncorrectTypeInAssignment("The value for key \"" +
1579  std::string(key_) + "\" should be " +
1580  "\"Yes\", \"No\" or \"IfNotEmpty\".");
1581  }
@ 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 1590 of file configuration.h.

1590  {
1591  const std::vector<std::string> v = operator std::vector<std::string>();
1593  for (const auto &x : v) {
1594  if (x == "All") {
1595  s.set();
1596  break;
1597  } else if (x == "Elastic") {
1599  } else if (x == "Decay") {
1601  } else if (x == "Inelastic") {
1603  } else if (x == "SoftString") {
1605  } else if (x == "HardString") {
1607  } else {
1608  throw IncorrectTypeInAssignment(
1609  "The value for key \"" + std::string(key_) +
1610  "\" should be \"All\", \"Elastic\", \"Decay\", "
1611  "\"Inelastic\", \"SoftString\", \"HardString\", "
1612  "or any combination of these.");
1613  }
1614  }
1615  return s;
1616  }
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 854 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 857 of file configuration.h.

◆ key_

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

The key to be interpreted.

Definition at line 859 of file configuration.h.


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