Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
decay_graph.h
Go to the documentation of this file.
1#ifndef DECAY_GRAPH_H
2#define DECAY_GRAPH_H
3
4#include <mutex>
5#include <optional>
6#include <string>
7#include <unordered_map>
8#include <vector>
9
10#include "dynamic_registry.h"
11
31struct DecayTag;
32struct ObservableTag;
33
36
39
54public:
60 static DecayGraph& instance();
61
74 void link(const DecayId& decay, const ObservableId& obs);
75
85 std::vector<ObservableId> observables_of(const DecayId& decay) const;
86
96 std::optional<DecayId> parent_of(const ObservableId& obs) const;
97
104 bool has_observables(const DecayId& decay) const;
105
106private:
107 mutable std::mutex m_;
108
110 std::unordered_map<std::string, std::vector<ObservableId>> graph_;
111
113 std::unordered_map<std::string, DecayId> parent_;
114};
115
116#endif // DECAY_GRAPH_H
Thread-safe singleton storing dynamic decay-observable links.
Definition decay_graph.h:53
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 DecayGraph & instance()
Return the unique global graph instance.
std::vector< ObservableId > observables_of(const DecayId &decay) const
Return all dynamically linked observables for a decay.
void link(const DecayId &decay, const ObservableId &obs)
Link an observable to a parent decay.
Tag type for decay identifiers.
Definition decay_ids.hpp:36