Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
ObsParameterProxy.cpp
Go to the documentation of this file.
1#include "ObsParameterProxy.h"
2
4 if (!ObsParameterProxy::ALLOWED.contains(type)) {
5 LOG_ERROR("ValueError", "BusinessLogic cannot access parameter type", ParameterTypeMapper::str(type));
6 }
7 this->pp_with_type = ParameterProvider(type);
8 this->pp = ParameterProvider();
9}
10
11scalar_t ObsParameterProxy::operator()(const std::string& block, const LhaID& id, DataType d_type) const {
12 if (pp_with_type.get_type() == ParameterType::WILSON) {
13 return pp_with_type.exists(block, id) ? pp_with_type(block, id, d_type) : scalar_t();
14 }
15 scalar_t value = pp_with_type(block, id, d_type);
16 return value;
17};
18
20 if (!pid.type.has_value()) {
21 LOG_WARN("LogicError", "Use of untyped ParamId in ParameterProvider.");
22 }
23
24 if (!ObsParameterProxy::ALLOWED.contains(pid.type.value())) {
25 LOG_ERROR("ValueError", "BusinessLogic cannot access parameter type", ParameterTypeMapper::str(pid.type.value()));
26 }
27 if (pid.type == ParameterType::WILSON) {
28 // std::cout << pid << std::endl;
29 // std::cout << pp.exists(pid) << std::endl;
30 return pp.exists(pid) ? pp(pid, d_type) : scalar_t();
31 }
32 return pp(pid, d_type);
33};
34
35std::shared_ptr<Parameter> ObsParameterProxy::get_parameter(const ParamId& pid) const{
36 return pp.get_parameter(pid);
37}
ParameterType
DataType
#define LOG_ERROR(type,...)
Macro for logging error messages and terminating the application.
Definition Logger.h:41
#define LOG_WARN(...)
Macro for logging warning messages.
Definition Logger.h:40
Read-only proxy to access parameters needed by observable computations.
static std::string str(const IdOf< ParamTypeTag > &id)
Returns the string representation associated with an identifier.
scalar_t operator()(const ParamId &pid, DataType d_type=DataType::VALUE) override
Access a parameter by fully-typed ParamId.
std::shared_ptr< Parameter > get_parameter(const ParamId &pid) const override
Returns the underlying Parameter object (shared_ptr) for a given id.
ObsParameterProxy(ParameterType type=ParameterType::SM)
Construct a proxy limited to a given parameter type.
Provides access to parameter values, errors, and existence checks.
std::shared_ptr< Parameter > get_parameter(const ParamId &pid) const
Retrieves the actual Parameter object corresponding to the given ParamId.
ParameterType get_type() const
Retrieves the renormalization scale associated with a given block.
bool exists(const ParamId &pid) const
Checks if a parameter identified by ParamId exists.
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
std::optional< ParameterType > type
Optional high-level parameter category.
Definition ParamID.h:65