|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Abstract base class for a decay/observable module. More...
#include <DecayParent.h>


Public Member Functions | |
| virtual | ~DecayParent ()=default |
| DecayParent (DecayId custom_id, double matching_scale, double hadronic_scale, QCDOrder order, ObservablePortsConfig &ports) | |
| Construct a decay module and bind it to the observable ports. | |
| void | bind_wilson_builder (std::shared_ptr< IObsWilsonBuilder > &wilson_builder) |
| Bind a Wilson builder to this decay. | |
| void | enable () |
| Enable the decay module (build Wilson groups and load parameters). | |
| void | disable () |
| Disable the decay module. | |
| void | set_order (QCDOrder new_order) |
| Set the QCD order for this decay (one-shot policy). | |
| virtual void | load_params ()=0 |
| Load and cache parameters needed by this decay. | |
| virtual std::vector< ObservableValue > | compute_observable (Observables obs)=0 |
| Compute an observable given a public observable enum. | |
| virtual std::vector< ObservableValue > | compute_observable (ObservableId obs)=0 |
| Compute an observable given an internal observable identifier. | |
| virtual void | set_config (std::any cfg)=0 |
| Set a configuration blob for this decay. | |
| virtual std::any | get_config () const |
| Return the current decay configuration when the decay has one. | |
| virtual void | set_n_threads (size_t n_threads) |
| Set the number of worker threads used by decays that support parallel cache filling. | |
| virtual size_t | get_n_threads () const |
| Return the currently configured worker-thread count. | |
| virtual bool | supports_thread_config () const |
| Whether this decay supports runtime thread configuration. | |
| void | set_bins (std::vector< std::pair< double, double > > new_bins) |
| Set the binning for the observables related to this decay. | |
| void | add_bin (std::pair< double, double > new_bin) |
| Adds a bin to the observables related to this decay. | |
| std::optional< std::vector< std::pair< double, double > > > | get_bins () |
| Returns the current binning of the decay. | |
| DecayId | get_id () |
| Return the decay identifier. | |
| QCDOrder | get_order () const |
| Return the currently configured QCD order for this decay. | |
| bool | is_enabled () const |
| Return whether the decay has already been enabled. | |
| bool | is_binned () const |
| Return whether this decay has at least one observable requiring q² bins. | |
| virtual bool | is_observable_binned (ObservableId) const |
| Return whether one observable of this decay requires q² bins. | |
| virtual bool | is_observable_binned (Observables obs) const |
| Convenience overload for public observable enum ids. | |
Protected Member Functions | |
| QCDOrder | check_max_order (QCDOrder order) const |
| Clamp a requested QCD order to this decay's supported maximum. | |
Protected Attributes | |
| QCDOrder | max_order = QCDOrder::LO |
| Maximum QCD order supported by this decay module (default: LO). | |
| ObservablePortsConfig & | ports |
| Reference to the ports/configuration wiring this decay to the framework. | |
| std::shared_ptr< IObsWilsonBuilder > | w_builder |
| Wilson builder used to build/add Wilson groups for this decay. | |
| std::shared_ptr< IObsWilsonProxy > | w_proxy |
| Wilson proxy used at compute-time to query coefficients (matching/run). | |
| std::shared_ptr< IObsCoreAPI< bool > > | use_marty |
| Port exposing whether the MARTY backend is active. | |
| std::shared_ptr< IObsParameterProxy< ParamId, DataType, std::string, LhaID > > | p |
| Parameter proxy for SM-like quantities used by the decay (may be SM/BSM depending on wiring). | |
| std::shared_ptr< IObsQCDProxy > | iobs_qcdp |
| QCD proxy (alpha_s, running masses, constants...). | |
| std::shared_ptr< IWilsonFreezer< WGroupId > > | iobs_wfreezer |
| Freezer to freeze/unfreeze Wilson blocks when they are not needed by active decays. | |
| std::shared_ptr< ObsWilsonHelper > | w_helper |
| Per-manager Wilson lifecycle helper. | |
| WilsonBuildConfig | w_config {} |
| Wilson build configuration used when enabling this decay (scales, order, groups). | |
| bool | enabled {false} |
| Whether the decay is enabled (i.e. Wilson groups built and parameters loaded). | |
| bool | binned {false} |
| Whether this decay requires q² bins before its observables can be computed. | |
| DecayId | id |
| Unique decay identifier. | |
| std::optional< std::vector< std::pair< double, double > > > | bins |
| Optional q^2 bins. | |
Abstract base class for a decay/observable module.
Typical usage is:
Calling enable twice is safe (it becomes a no-op after first enable).
Definition at line 87 of file DecayParent.h.
|
virtualdefault |
| DecayParent::DecayParent | ( | DecayId | custom_id, |
| double | matching_scale, | ||
| double | hadronic_scale, | ||
| QCDOrder | order, | ||
| ObservablePortsConfig & | ports | ||
| ) |
Construct a decay module and bind it to the observable ports.
The constructor does NOT build Wilson groups. That happens in enable. It stores the scales and the requested QCD order (clamped to max_order).
| custom_id | Identifier of the decay module. |
| matching_scale | Matching scale mu_W used for Wilson matching. |
| hadronic_scale | Hadronic scale mu_h used for running/evolution. |
| order | Requested QCD order (will be clamped to max_order). |
| ports | Ports configuration providing dependencies. |
Definition at line 13 of file DecayParent.cpp.
| void DecayParent::add_bin | ( | std::pair< double, double > | new_bin | ) |
Adds a bin to the observables related to this decay.
| new_bins | Desired bin in the form of {q²_min, q²_max} |
Definition at line 98 of file DecayParent.cpp.
| void DecayParent::bind_wilson_builder | ( | std::shared_ptr< IObsWilsonBuilder > & | wilson_builder | ) |
Bind a Wilson builder to this decay.
This is typically used internally by the constructor (binding ports.iobswb), but can be called explicitly if the builder is swapped/replaced.
| wilson_builder | Builder used to build Wilson groups needed by this decay. |
Definition at line 22 of file DecayParent.cpp.
Clamp a requested QCD order to this decay's supported maximum.
If order is higher than max_order, a warning is emitted and max_order is returned.
| order | Requested order. |
Definition at line 5 of file DecayParent.cpp.
|
pure virtual |
Compute an observable given an internal observable identifier.
| obs | Internal observable id. |
Implemented in BDlnuDecay, BDstarlnuDecay, BKllDecay, BKstarllDecay, BKstarGammaDecay, BllDecay, BlnuDecay, BsPhiDecay, BXsDecay, BXsllDecay, DlnuDecay, DslnuDecay, KllDecay, KlnuDecay, KPinunuDecay, LbLllDecay, M0Mixing, LambdaDecay, and WilsonDecay.
|
pure virtual |
Compute an observable given a public observable enum.
| obs | Observable enum id. |
Implemented in BDlnuDecay, BDstarlnuDecay, BKllDecay, BKstarllDecay, BKstarGammaDecay, BllDecay, BlnuDecay, BsPhiDecay, BXsDecay, BXsllDecay, DlnuDecay, DslnuDecay, KllDecay, KlnuDecay, KPinunuDecay, LbLllDecay, M0Mixing, LambdaDecay, and WilsonDecay.
| void DecayParent::disable | ( | ) |
Disable the decay module.
This only flips the enabled flag. It does not automatically unbuild or unfreeze Wilson groups; the global policy is handled by ObsWilsonHelper and the freezer port.
Definition at line 41 of file DecayParent.cpp.
| void DecayParent::enable | ( | ) |
Enable the decay module (build Wilson groups and load parameters).
Steps: 1) Build/update Wilson groups using ObsWilsonHelper::build with w_config 2) Acquire a Wilson proxy from the builder 3) Set a default basis (currently WilsonBasis::B_STANDARD) 4) Call load_params (implemented by derived class) 5) Mark the decay as enabled
Calling enable() multiple times is safe: if already enabled, Wilson groups are not rebuilt, but load_params() is called again to refresh cached inputs.
Definition at line 26 of file DecayParent.cpp.
| std::optional< std::vector< std::pair< double, double > > > DecayParent::get_bins | ( | ) |
Returns the current binning of the decay.
Definition at line 112 of file DecayParent.cpp.
|
inlinevirtual |
Return the current decay configuration when the decay has one.
The base implementation returns an empty std::any. Configurable decays that keep runtime options, such as form-factor source or internal thread count, override this so ObservableInterface worker clones can reproduce the same physics setup as the parent interface.
Reimplemented in BKllDecay, BKstarllDecay, BKstarGammaDecay, BsPhiDecay, and LbLllDecay.
Definition at line 253 of file DecayParent.h.
|
inline |
Return the decay identifier.
Definition at line 300 of file DecayParent.h.
|
virtual |
Return the currently configured worker-thread count.
Decays that do not implement internal parallelism return 1.
Reimplemented in BKllDecay, BKstarllDecay, BsPhiDecay, and LbLllDecay.
Definition at line 82 of file DecayParent.cpp.
|
inline |
Return the currently configured QCD order for this decay.
Definition at line 305 of file DecayParent.h.
|
inline |
Return whether this decay has at least one observable requiring q² bins.
Bins are stored at decay level, but mixed decays may expose both binned and non-binned observables. Use is_observable_binned(...) for single-observable routing.
Definition at line 324 of file DecayParent.h.
|
inline |
Return whether the decay has already been enabled.
A decay is considered enabled after enable has built/acquired its Wilson proxy and loaded its parameters at least once. This is useful for manager-level refresh operations: disabled decays may not have a valid Wilson proxy yet and must not be asked to reload their parameters.
Definition at line 315 of file DecayParent.h.
|
inlinevirtual |
Return whether one observable of this decay requires q² bins.
Most decays are either fully binned or fully unbinned, but some mixed decays such as B -> K*ll also expose global observables like q0(A_FB).
Reimplemented in BKstarllDecay.
Definition at line 332 of file DecayParent.h.
|
inlinevirtual |
Convenience overload for public observable enum ids.
Definition at line 335 of file DecayParent.h.
|
pure virtual |
Load and cache parameters needed by this decay.
Derived classes should read all relevant inputs through the proxies (e.g. p, w_proxy, iobs_qcdp) and store them internally.
This is called by enable after Wilson has been built and the proxy is ready.
Implemented in BDlnuDecay, BDstarlnuDecay, BKllDecay, BKstarllDecay, BKstarGammaDecay, BllDecay, BlnuDecay, BsPhiDecay, BXsDecay, BXsllDecay, DlnuDecay, DslnuDecay, KllDecay, KlnuDecay, KPinunuDecay, LbLllDecay, M0Mixing, LambdaDecay, and WilsonDecay.
| void DecayParent::set_bins | ( | std::vector< std::pair< double, double > > | new_bins | ) |
Set the binning for the observables related to this decay.
| new_bins | Desired binning in the form of {{q²_min, q²_max}, ...} |
Definition at line 90 of file DecayParent.cpp.
|
pure virtual |
Set a configuration blob for this decay.
This generic entry point allows the framework to pass a type-erased config. Most users should prefer inheriting from DecayParentConfigurable<T> to get a typed config setter.
| cfg | Type-erased configuration object. |
| std::bad_any_cast | if the derived class expects a different type. |
Implemented in DecayParentConfigurable< T >, DecayParentConfigurable< BDlnuConfig >, DecayParentConfigurable< BDstarlnuConfig >, DecayParentConfigurable< BKllConfig >, DecayParentConfigurable< BKstarGammaConfig >, DecayParentConfigurable< BKstarllConfig >, DecayParentConfigurable< BsPhiConfig >, DecayParentConfigurable< BXsllConfig >, DecayParentConfigurable< KllDecayConfig >, DecayParentConfigurable< LbLllConfig >, LambdaDecay, and DecayParentConfigurable< DecayConfig >.
|
virtual |
Set the number of worker threads used by decays that support parallel cache filling.
The default implementation warns and leaves the decay unchanged. Derived decays with long QCDf/integration caches can override this method. Passing 0 means "use hardware_concurrency" for decays that support it.
| n_threads | Requested number of threads. |
Reimplemented in BKllDecay, BKstarllDecay, BsPhiDecay, and LbLllDecay.
Definition at line 72 of file DecayParent.cpp.
| void DecayParent::set_order | ( | QCDOrder | new_order | ) |
Set the QCD order for this decay (one-shot policy).
new_order > LO, it is downgraded to LO.| new_order | Requested order. |
Definition at line 45 of file DecayParent.cpp.
|
virtual |
Whether this decay supports runtime thread configuration.
Reimplemented in BKllDecay, BKstarllDecay, BsPhiDecay, and LbLllDecay.
Definition at line 86 of file DecayParent.cpp.
|
protected |
Whether this decay requires q² bins before its observables can be computed.
Definition at line 123 of file DecayParent.h.
|
protected |
Optional q^2 bins.
Definition at line 129 of file DecayParent.h.
|
protected |
Whether the decay is enabled (i.e. Wilson groups built and parameters loaded).
Definition at line 120 of file DecayParent.h.
|
protected |
Unique decay identifier.
Definition at line 126 of file DecayParent.h.
|
protected |
QCD proxy (alpha_s, running masses, constants...).
Definition at line 108 of file DecayParent.h.
|
protected |
Freezer to freeze/unfreeze Wilson blocks when they are not needed by active decays.
Definition at line 111 of file DecayParent.h.
|
protected |
Maximum QCD order supported by this decay module (default: LO).
Definition at line 90 of file DecayParent.h.
|
protected |
Parameter proxy for SM-like quantities used by the decay (may be SM/BSM depending on wiring).
Definition at line 105 of file DecayParent.h.
|
protected |
Reference to the ports/configuration wiring this decay to the framework.
Definition at line 93 of file DecayParent.h.
|
protected |
Port exposing whether the MARTY backend is active.
Definition at line 102 of file DecayParent.h.
|
protected |
Wilson builder used to build/add Wilson groups for this decay.
Definition at line 96 of file DecayParent.h.
|
protected |
Wilson build configuration used when enabling this decay (scales, order, groups).
Definition at line 117 of file DecayParent.h.
|
protected |
Per-manager Wilson lifecycle helper.
Definition at line 114 of file DecayParent.h.
|
protected |
Wilson proxy used at compute-time to query coefficients (matching/run).
Definition at line 99 of file DecayParent.h.