Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
Wilson.h
Go to the documentation of this file.
1#ifndef WILSON_H
2#define WILSON_H
3
4#include "Include.h"
5#include "Math.h"
6#include "Utils.h"
7#include "Parameter.h"
8#include "IParameterProxy.h"
9#include "SourcesView.h"
10
64 std::unordered_set<ParamId> sources = {};
65
73 std::function<scalar_t(const ParamSrc&)> compute =
74 [](const auto&) { return 0.0; };
75
78
81 : compute([](const auto&) { return 0.0; }) {}
82
87 MatchingInfo(const LhaID& id) : lhaid(id) {}
88
95 MatchingInfo(std::unordered_set<ParamId> src,
96 std::function<scalar_t(const ParamSrc&)> comp,
97 LhaID id)
98 : sources(std::move(src)), compute(std::move(comp)), lhaid(std::move(id)) {}
99
100 MatchingInfo(MatchingInfo&& mi) = default;
101 MatchingInfo(const MatchingInfo& mi) = default;
102
109 this->sources = mi.sources;
110 this->compute = mi.compute;
111 this->lhaid = mi.lhaid;
112 return *this;
113 }
114};
115
154public:
155 WilsonCoefficient() = default;
156
167 WilsonCoefficient(const std::string& name, const std::string& storage_block);
168
181 WilsonCoefficient(const LhaID &name, const std::string& storage_block, ContributionType ct);
182
183
190 std::function<scalar_t(const ParamSrc&)> get_func(QCDOrder order);
191
198 std::unordered_set<ParamId> get_sources(QCDOrder order);
199
206 LhaID get_lhaid(QCDOrder order);
207
218
226 std::string get_base_name() const;
227
229 void set_name(std::string name) {this->coeffName = name;}
230
238 void set_owned(bool owned);
239
241 void set_storage_block(std::string block_name);
242
245
253 void add_matching_patch(QCDOrder order,
254 std::unordered_set<ParamId> extra_sources,
255 std::function<scalar_t(const ParamSrc&)> patch);
256
269 complex_t get_matching_value(std::string order, ContributionType cont_type, std::shared_ptr<IParameterProxy<std::string, LhaID>> wilson_p) const;
270
272 std::string get_name() const {return this->coeffName;}
273
275 std::string get_storage_block() const {return this->storage_block;}
276
279
289 LhaID id(QCDOrder order, ContributionType typ) const;
290
292 bool operator==(const WilsonCoefficient& other) const;
293
295 bool operator!=(const WilsonCoefficient& other) const { return !(*this == other); }
296
297 virtual ~WilsonCoefficient() = default;
298
307 virtual std::shared_ptr<WilsonCoefficient> clone() const = 0;
308
309protected:
311 std::string coeffName{};
312
315
317 bool is_owned {false};
318
320 std::string storage_block;
321
330 std::map<QCDOrder, MatchingInfo> matching_info;
331};
332
333#endif // WILSON_H
QCDOrder
ContributionType
Defines the Parameter class used to store individual physical/model parameters.
std::complex< double > complex_t
Convenience alias for std::complex<double>.
Definition Utils.h:35
Abstract interface for reading parameters and basic metadata.
Lightweight view over a set of source parameters keyed by ParamId.
Abstract base class representing a Wilson coefficient and its matching information.
Definition Wilson.h:153
std::string get_name() const
Returns the current full name (may include suffixes).
Definition Wilson.h:272
std::string get_base_name() const
Returns the base name of the coefficient without BSM suffixes.
Definition Wilson.cpp:68
std::unordered_set< ParamId > get_sources(QCDOrder order)
Returns the source ParamIds required at a given QCD order.
Definition Wilson.cpp:32
virtual std::shared_ptr< WilsonCoefficient > clone() const =0
Virtual clone for polymorphic copy.
void add_matching_patch(QCDOrder order, std::unordered_set< ParamId > extra_sources, std::function< scalar_t(const ParamSrc &)> patch)
Add an extra additive term to the matching function of one QCD order.
Definition Wilson.cpp:37
void set_contribution_type(ContributionType type)
Sets the contribution type (SM/BSM/…).
Definition Wilson.cpp:93
ContributionType get_type()
Returns the current contribution type.
Definition Wilson.h:278
bool is_owned
Ownership flag (used by higher-level logic to track "produced" coefficients).
Definition Wilson.h:317
bool operator!=(const WilsonCoefficient &other) const
Inequality convenience.
Definition Wilson.h:295
LhaID get_lhaid_from_name(QCDOrder order)
Computes the LhaID directly from the coefficient base name and mapping conventions.
Definition Wilson.cpp:61
void set_name(std::string name)
Sets the domain name of the coefficient.
Definition Wilson.h:229
std::function< scalar_t(const ParamSrc &)> get_func(QCDOrder order)
Returns the compute function for a given QCD order.
Definition Wilson.cpp:27
void set_storage_block(std::string block_name)
Sets the storage block where the coefficient value is stored.
Definition Wilson.cpp:89
LhaID id(QCDOrder order, ContributionType typ) const
Returns the LHA id for a given order and contribution type.
Definition Wilson.cpp:97
std::string get_storage_block() const
Returns the storage block name.
Definition Wilson.h:275
WilsonCoefficient()=default
bool operator==(const WilsonCoefficient &other) const
Equality compares name, contribution type, and ownership flag.
Definition Wilson.cpp:101
std::string coeffName
Domain name of the coefficient (may include suffixes like _THDM/_SUSY).
Definition Wilson.h:311
virtual ~WilsonCoefficient()=default
complex_t get_matching_value(std::string order, ContributionType cont_type, std::shared_ptr< IParameterProxy< std::string, LhaID > > wilson_p) const
Reads the coefficient value from the storage backend for a given order/type.
Definition Wilson.cpp:107
std::map< QCDOrder, MatchingInfo > matching_info
Matching metadata indexed by QCD order.
Definition Wilson.h:330
void set_owned(bool owned)
Sets the ownership flag.
Definition Wilson.cpp:80
ContributionType type
Contribution type for this coefficient (SM by default, inferred in constructors).
Definition Wilson.h:314
std::string storage_block
Block name where this coefficient is stored in the Parameters system.
Definition Wilson.h:320
LhaID get_lhaid(QCDOrder order)
Returns the storage LhaID associated with a given QCD order.
Definition Wilson.cpp:57
Hash specialization for SymbolId<Tag>.
Definition BlockName.h:353
Represents an identifier of a LHA element, possibly containing several sub-ids.
Definition LhaID.h:56
Matching metadata for a Wilson coefficient at a specific QCD order.
Definition Wilson.h:62
MatchingInfo operator=(const MatchingInfo &mi)
Copy assignment operator.
Definition Wilson.h:108
MatchingInfo(std::unordered_set< ParamId > src, std::function< scalar_t(const ParamSrc &)> comp, LhaID id)
Full constructor.
Definition Wilson.h:95
MatchingInfo(MatchingInfo &&mi)=default
std::function< scalar_t(const ParamSrc &)> compute
Computation function for this coefficient/order.
Definition Wilson.h:73
std::unordered_set< ParamId > sources
Set of source parameter identifiers used by compute().
Definition Wilson.h:64
MatchingInfo()
Default ctor: sets compute to a safe no-op (returns 0.0).
Definition Wilson.h:80
LhaID lhaid
LHA identifier used to store the coefficient value in its storage block.
Definition Wilson.h:77
MatchingInfo(const MatchingInfo &mi)=default
MatchingInfo(const LhaID &id)
Constructs a MatchingInfo with only an LHA id.
Definition Wilson.h:87