#include "ReweightUtils/APEvtWeight.h"
#include "ReweightUtils/APWeightEntry.h"
#include <cmath>
#include <iostream>
Go to the source code of this file.
◆ APEvtWeight_cxx
◆ operator!()
◆ operator&&()
Definition at line 42 of file APEvtWeight.cxx.
49 if ( ((a_type >=
APEvtWeight::kMuon && a_type <=
APEvtWeight::kJet) || (b_type >=
APEvtWeight::kMuon && b_type <=
APEvtWeight::kJet)) && (a_type != b_type) ) cout <<
"WARNING in APEvtWeight::operator&&: Trying to logically AND weights for single component triggers in multiobject configuration. You shouldn't do this, but use kXxxMO types instead. Uncertainties will be incorrect." << endl;
51 if ( a_type != b_type ) {
78 if (!
b.m_isComputed)
b.Compute();
79 if (!
a.m_isComputed)
a.Compute();
80 ret.m_n_entries =
a.m_n_entries +
b.m_n_entries;
81 ret.m_k_evt_weight =
a.m_k_evt_weight *
b.m_k_evt_weight;
82 ret.m_variance =
a.m_variance *
b.m_k_evt_weight *
b.m_k_evt_weight +
b.m_variance *
a.m_k_evt_weight *
a.m_k_evt_weight;
83 ret.m_variance_sys =
a.m_variance_sys *
b.m_k_evt_weight *
b.m_k_evt_weight +
b.m_variance_sys *
a.m_k_evt_weight *
a.m_k_evt_weight;
91 cout <<
"WARNING in APEvtWeight::operator&&: Trying to combine already combined event weights with overlapping objects. Uncertainties will be incorrect." << endl;
118 if (!
b.m_isComputed)
b.Compute();
119 if (!
a.m_isComputed)
a.Compute();
120 ret.m_n_entries =
a.m_n_entries +
b.m_n_entries;
121 ret.m_k_evt_weight =
a.m_k_evt_weight *
b.m_k_evt_weight;
122 ret.m_variance =
a.m_variance *
b.m_k_evt_weight *
b.m_k_evt_weight +
b.m_variance *
a.m_k_evt_weight *
a.m_k_evt_weight;
123 ret.m_variance_sys =
a.m_variance_sys *
b.m_k_evt_weight *
b.m_k_evt_weight +
b.m_variance_sys *
a.m_k_evt_weight *
a.m_k_evt_weight;
◆ operator||()
Definition at line 128 of file APEvtWeight.cxx.
161 if (!
b.m_isComputed)
b.Compute();
162 if (!
a.m_isComputed)
a.Compute();
164 ret.m_n_entries =
a.m_n_entries +
b.m_n_entries;
165 ret.m_k_evt_weight =
a.m_k_evt_weight +
b.m_k_evt_weight * ( 1.0 -
a.m_k_evt_weight );
166 ret.m_variance =
a.m_variance * ( 1.0 -
b.m_k_evt_weight ) * ( 1.0 -
b.m_k_evt_weight ) +
b.m_variance * ( 1.0 -
a.m_k_evt_weight ) * ( 1.0 -
a.m_k_evt_weight );
167 ret.m_variance_sys =
a.m_variance_sys * ( 1.0 -
b.m_k_evt_weight ) * ( 1.0 -
b.m_k_evt_weight ) +
b.m_variance_sys * ( 1.0 -
a.m_k_evt_weight ) * ( 1.0 -
a.m_k_evt_weight );
172 cout <<
"WARNING in APEvtWeight::operator||: Trying to combine already combined event weights with overlapping objects. Uncertainties will be incorrect." << endl;
202 if (!
b.m_isComputed)
b.Compute();
203 if (!
a.m_isComputed)
a.Compute();
205 ret.m_n_entries =
a.m_n_entries +
b.m_n_entries;
206 ret.m_k_evt_weight = 1.0 - (1.0 -
a.m_k_evt_weight) * (1.0 -
b.m_k_evt_weight);
207 ret.m_variance =
a.m_variance * (1.0 -
b.m_k_evt_weight) * (1.0 -
b.m_k_evt_weight) +
b.m_variance * (1.0 -
a.m_k_evt_weight) * (1.0 -
a.m_k_evt_weight);
208 ret.m_variance_sys =
a.m_variance_sys * (1.0 -
b.m_k_evt_weight) * (1.0 -
b.m_k_evt_weight) +
b.m_variance_sys * (1.0 -
a.m_k_evt_weight) * (1.0 -
a.m_k_evt_weight);