4 auto key = std::make_pair(id1, id2);
5 return parameter_correlations->at(key);
12 auto key = std::make_pair(id1, id2);
13 return observable_correlations->at(key);
17 const std::string& experiment,
28 const std::string& experiment,
39 const std::string& experiment,
48 const std::string& exp1,
50 const std::string& exp2,
59 parameter_correlations = correlation_matrices;
64 observable_correlations = correlation_matrices;
70 for (
const auto &corr : correlation_matrices->stat) {
71 parameter_correlations->stat.insert_or_assign(corr.first, corr.second);
74 for (
const auto &corr : correlation_matrices->syst) {
75 parameter_correlations->syst.insert_or_assign(corr.first, corr.second);
82 for (
const auto &corr : correlation_matrices->stat) {
83 observable_correlations->stat.insert_or_assign(corr.first, corr.second);
86 for (
const auto &corr : correlation_matrices->syst) {
87 observable_correlations->syst.insert_or_assign(corr.first, corr.second);
92 LOG_INFO(
"------- Parameter correlations (off-diagonal) -------");
94 LOG_INFO(
"------- Observable correlations by experiment (off-diagonal) -------");
100 for (
const std::pair<std::pair<U, U>,
double>& corr : cmp.
stat) {
101 auto corr_vals = cmp.
at(corr.first);
102 os <<
"\t(" << corr.first.first <<
", " << corr.first.second <<
"): "
103 << corr_vals.first <<
" (stat) + "
104 << corr_vals.second <<
" (syst)\n";
std::ostream & operator<<(std::ostream &os, const CorrelationMatrixPair< U > &cmp)
#define LOG_INFO(...)
Macro for logging informational messages.
void set_correlation_matrix(std::shared_ptr< CorrelationMatrixPair< ParamId > > correlation_matrices)
Sets (replaces) the correlation matrix for parameters.
void print_content() const
Prints the current content of parameter and observable correlations.
void merge_correlation_matrix(std::shared_ptr< CorrelationMatrixPair< ParamId > > correlation_matrix)
Merges a new correlation matrix into the existing parameter correlations.
std::pair< double, double > get_correlation(ParamId p1, ParamId p2) const
Retrieves the correlation between two parameters.
static IdOf< ObservableTag > to_id(Observables e)
Converts an enum value to an IdOf<Tag>.
Identifies an observable together with a numerical bin.
Stores a pair of correlation matrices (statistical and systematic) for a given key type.
std::pair< double, double > at(const std::pair< T, T > &key) const
Retrieves the correlation values for a given pair.
SparseMatrix< T > stat
Statistical correlation matrix.
Composite identifier for a single parameter.