Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
CinematicExtractor.h
Go to the documentation of this file.
1#ifndef CINEMATIC_EXTRACTOR_H
2#define CINEMATIC_EXTRACTOR_H
3
4#include <string>
5#include <utility>
6#include <regex>
7#include <fstream>
8#include <vector>
9#include <unordered_map>
10#include <optional>
11
15int countMatchInRegex(std::string s, std::string re);
16
26 std::vector<std::string> incoming;
27 std::vector<std::string> outgoing;
28
29 bool empty() const { return incoming.empty() && outgoing.empty(); }
30 std::size_t incoming_count() const { return incoming.size(); }
31 std::size_t outgoing_count() const { return outgoing.size(); }
32
33 std::vector<std::string> ordered_particles() const {
34 std::vector<std::string> out;
35 out.reserve(incoming.size() + outgoing.size());
36 out.insert(out.end(), incoming.begin(), incoming.end());
37 out.insert(out.end(), outgoing.begin(), outgoing.end());
38 return out;
39 }
40};
41
51public:
55 std::pair<int, int> extract(const std::string& filename);
56
60 CinematicProcess extract_process(const std::string& filename) const;
61
65 static std::string normalize_particle_name(std::string particle_name);
66
72 static std::optional<std::string> mass_symbol_for_particle(const std::string& particle_name);
73
77 static const std::unordered_map<std::string, std::string>& default_mass_symbols();
78};
79
80#endif // CINEMATIC_EXTRACTOR_H
int countMatchInRegex(std::string s, std::string re)
Counts the number of occurrences of a regex pattern in a given string.
Extracts process kinematics from MARTY templates.
static std::optional< std::string > mass_symbol_for_particle(const std::string &particle_name)
Returns the MARTY mass symbol associated with a particle name.
std::pair< int, int > extract(const std::string &filename)
Legacy API: returns {number_of_incoming, number_of_outgoing}.
static std::string normalize_particle_name(std::string particle_name)
Normalizes common MARTY particle names for dictionary lookup.
static const std::unordered_map< std::string, std::string > & default_mass_symbols()
Default particle -> MARTY mass-symbol dictionary.
CinematicProcess extract_process(const std::string &filename) const
Extracts the first MARTY process from a template file.
Incoming/outgoing particles extracted from a MARTY computeWilsonCoefficients call.
std::size_t outgoing_count() const
std::vector< std::string > ordered_particles() const
std::vector< std::string > outgoing
std::size_t incoming_count() const
std::vector< std::string > incoming