Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
ParamID.h
Go to the documentation of this file.
1#ifndef PARAM_ID_H
2#define PARAM_ID_H
3
4#include <string>
5#include <stdexcept>
6#include <algorithm>
7#include <iostream>
8#include <unordered_set>
9#include <initializer_list>
10#include <map>
11#include <vector>
12#include <set>
13#include <ranges>
14#include <concepts>
15#include <variant>
16#include "Logger.h"
17#include "Utils.h"
18#include "GeneralEnum.h"
19#include "LhaID.h"
20#include "BlockName.h"
21
22namespace fs = std::filesystem;
23
57struct ParamId {
65 std::optional<ParameterType> type;
66
74
83
94 ParamId();
95
105 ParamId(const BlockName& block, const LhaID& code);
106
118
128
141 bool friend operator==(const ParamId& lhs, const ParamId& rhs);
142
159 bool operator<(const ParamId& other) const;
160};
161
173namespace std {
174 template <>
175 struct hash<ParamId> {
186 std::size_t operator()(const ParamId& p) const noexcept {
187 std::size_t h1 = std::hash<BlockName>{}(p.block);
188 std::size_t h2 = std::hash<LhaID>{}(p.code);
189 std::size_t h3 = p.type ? std::hash<int>{}(static_cast<int>(*p.type)) : 0;
190 return h1 ^ (h2 << 1) ^ (h3 << 2);
191 }
192 };
193}
194
214inline std::ostream& operator<<(std::ostream& os, const ParamId& pid) {
215 os << pid.block << ":" << pid.code;
216 return os;
217};
218
219#endif
Representation of SLHA / LHA block names with support for aliases.
ParameterType
Lightweight representation of LHAPDF / SLHA-style identifiers.
std::ostream & operator<<(std::ostream &os, const ParamId &pid)
Stream output operator for ParamId.
Definition ParamID.h:214
Block identifier with alias support.
Definition BlockName.h:59
Hash specialization for SymbolId<Tag>.
Definition BlockName.h:353
double h1(double x)
Wilson special function h1 depending on x.
double h3(double x)
Wilson special function h3 depending on x.
Represents an identifier of a LHA element, possibly containing several sub-ids.
Definition LhaID.h:56
Composite identifier for a single parameter.
Definition ParamID.h:57
bool friend operator==(const ParamId &lhs, const ParamId &rhs)
Equality comparison between two ParamId objects.
std::optional< ParameterType > type
Optional high-level parameter category.
Definition ParamID.h:65
void set_parameter_type(ParameterType type)
Sets or overwrites the parameter type.
Definition ParamID.cpp:8
BlockName block
Name of the block where the parameter is stored.
Definition ParamID.h:73
ParamId()
Default constructor.
Definition ParamID.cpp:4
bool operator<(const ParamId &other) const
Strict ordering operator for ParamId.
Definition ParamID.cpp:14
LhaID code
Index or multi-index of the parameter inside the block.
Definition ParamID.h:82
std::size_t operator()(const ParamId &p) const noexcept
Computes a hash value for a ParamId.
Definition ParamID.h:186