Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
DecayGraph Class Reference

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< ObservableIdobservables_of (const DecayId &decay) const
 Return all dynamically linked observables for a decay.
 
std::optional< DecayIdparent_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 DecayGraphinstance ()
 Return the unique global graph instance.
 

Detailed Description

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:

  • an observable can only have one parent decay,
  • duplicate links are ignored,
  • lookup keys are case-insensitive.

Definition at line 53 of file decay_graph.h.

Member Function Documentation

◆ has_observables()

bool DecayGraph::has_observables ( const DecayId decay) const

Check whether a decay has at least one dynamic observable.

Parameters
decayDecay identifier.
Returns
true if decay has at least one runtime-linked observable.

Definition at line 70 of file decay_graph.cpp.

◆ instance()

DecayGraph & DecayGraph::instance ( )
static

Return the unique global graph instance.

Returns
Mutable singleton instance.

Definition at line 24 of file decay_graph.cpp.

◆ link()

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.

Parameters
decayParent decay identifier.
obsObservable identifier to attach to decay.
Exceptions
std::runtime_errorif obs is already linked to another decay.

Definition at line 29 of file decay_graph.cpp.

◆ observables_of()

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.

Parameters
decayDecay identifier.
Returns
Observables dynamically linked to decay, in insertion order.

Definition at line 50 of file decay_graph.cpp.

◆ parent_of()

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().

Parameters
obsObservable identifier.
Returns
Parent decay if obs is known by the dynamic graph.

Definition at line 60 of file decay_graph.cpp.


The documentation for this class was generated from the following files: