|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Thread-safe singleton storing dynamic decay-observable links. More...
#include <decay_graph.h>
Public Member Functions | |
| void | link (const DecayId &decay, const ObservableId &obs) |
| Link an observable to a parent decay. | |
| std::vector< ObservableId > | observables_of (const DecayId &decay) const |
| Return all dynamically linked observables for a decay. | |
| std::optional< DecayId > | parent_of (const ObservableId &obs) const |
| Return the dynamic parent decay of an observable, if known. | |
| bool | has_observables (const DecayId &decay) const |
| Check whether a decay has at least one dynamic observable. | |
Static Public Member Functions | |
| static DecayGraph & | instance () |
| Return the unique global graph instance. | |
Thread-safe singleton storing dynamic decay-observable links.
DecayGraph is used when custom symbols are registered. Builtin relations still live in decay_observable_mapping(), while this graph stores relations that cannot be represented by the static enum maps.
Invariants enforced by this class:
Definition at line 53 of file decay_graph.h.
| bool DecayGraph::has_observables | ( | const DecayId & | decay | ) | const |
Check whether a decay has at least one dynamic observable.
| decay | Decay identifier. |
decay has at least one runtime-linked observable. Definition at line 70 of file decay_graph.cpp.
|
static |
Return the unique global graph instance.
Definition at line 24 of file decay_graph.cpp.
| void DecayGraph::link | ( | const DecayId & | decay, |
| const ObservableId & | obs | ||
| ) |
Link an observable to a parent decay.
If the link already exists, this function is a no-op. If the observable is already linked to a different decay, an exception is thrown because an observable must not belong to several decay channels.
| decay | Parent decay identifier. |
| obs | Observable identifier to attach to decay. |
| std::runtime_error | if obs is already linked to another decay. |
Definition at line 29 of file decay_graph.cpp.
| std::vector< ObservableId > DecayGraph::observables_of | ( | const DecayId & | decay | ) | const |
Return all dynamically linked observables for a decay.
This only returns runtime links stored in the graph. Builtin static observables are merged at DecayMapper level.
| decay | Decay identifier. |
decay, in insertion order. Definition at line 50 of file decay_graph.cpp.
| std::optional< DecayId > DecayGraph::parent_of | ( | const ObservableId & | obs | ) | const |
Return the dynamic parent decay of an observable, if known.
This only checks runtime links. Builtin static fallback is handled by DecayMapper::get_decay_id().
| obs | Observable identifier. |
obs is known by the dynamic graph. Definition at line 60 of file decay_graph.cpp.