10 #ifndef SRC_TESTS_SETUP_H_ 11 #define SRC_TESTS_SETUP_H_ 13 #include "../include/smash/cxx14compat.h" 14 #include "../include/smash/decaymodes.h" 15 #include "../include/smash/experiment.h" 16 #include "../include/smash/particledata.h" 17 #include "../include/smash/particles.h" 18 #include "../include/smash/particletype.h" 19 #include "../include/smash/random.h" 21 #include <boost/filesystem.hpp> 37 #include <particles.txt.h> 49 #include <decaymodes.txt.h> 67 "# NAME MASS[GEV] WIDTH[GEV] PARITY PDG\n" 69 std::to_string(smashon_mass) +
" " + std::to_string(smashon_width) +
96 p.set_4position(position);
105 p.set_4momentum(momentum);
115 p.set_4position(position);
116 p.set_4momentum(momentum);
129 p.set_4position(position);
130 p.set_4momentum(momentum);
141 {random_value(), random_value(), random_value(), random_value()});
142 p.set_4momentum(smashon_mass,
143 {random_value(), random_value(), random_value()});
163 if (!overrides.empty()) {
184 inline std::unique_ptr<ExperimentBase>
experiment(
const char *configOverrides) {
191 template <
typename G>
195 for (
auto i = n; i; --i) {
196 list.emplace_back(generator());
208 template <
typename G>
211 for (
auto i = n; i; --i) {
212 p->insert(generator());
222 const std::initializer_list<ParticleData> &init) {
224 for (
const auto &data : init) {
266 #endif // SRC_TESTS_SETUP_H_ ReactionsBitSet all_reactions_included()
returns BitSet of 2->2 reactions, where everything is on
Configuration configuration(std::string overrides={})
Return a configuration object filled with data from src/config.yaml.
A FourVector that is marked as a position vector.
ParticleList create_particle_list(std::size_t n, G &&generator)
Generate a list of particles from the given generator function.
A FourVector that is marked as a momentum vector.
static std::unique_ptr< ExperimentBase > create(Configuration config, const bf::path &output_path)
Factory method that creates and initializes a new Experiment<Modus>.
static void load_decaymodes(const std::string &input)
Loads the DecayModes map as described in the input string.
std::unique_ptr< Particles > ParticlesPtr
A type alias for a unique_ptr of Particles.
Interface to the SMASH configuration files.
ParticleData smashon(int id=-1)
Create a particle with 0 position and momentum vectors and optionally a given id. ...
static const ParticleType & find(PdgCode pdgcode)
Returns the ParticleType object for the given pdgcode.
static constexpr double smashon_width
The decay width of the smashon particle.
void merge_yaml(const std::string &yaml)
Merge the configuration in yaml into the existing tree.
ExperimentParameters default_parameters(int testparticles=1, double dt=0.1)
Creates a standard ExperimentParameters object which works for almost all testing purposes...
static constexpr const char smashon_pdg_string[]
The PDG code of the smashon particle.
static constexpr double smashon_mass
The mass of the smashon particle.
uniform_dist< T > make_uniform_distribution(T min, T max)
std::bitset< 6 > ReactionsBitSet
Container for the 2 to 2 reactions in the code.
static void create_type_list(const std::string &particles)
Initialize the global ParticleType list (list_all) from the given input data.
void create_actual_particletypes()
Creates the ParticleType list containing the actual particles that SMASH uses.
ParticlesPtr create_particles(int n, G &&generator)
Creates a Particles object and fills it with n particles generated by the generator function...
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
FourVector()
default constructor nulls the fourvector components
std::unique_ptr< ExperimentBase > experiment(const Configuration &c=configuration())
Create an experiment.
Helper structure for Experiment.
ParticleData contains the dynamic information of a certain particle.
ParticleData smashon_random(int id=-1)
Create a particle with random position and momentum vectors and optionally a given id...
void create_smashon_particletypes()
Creates a ParticleType list containing only the smashon test particle.
void create_actual_decaymodes()
Creates the DecayModes list containing the actual decay modes that SMASH uses.