12 bool getBin(
const TAxis &axis,
float value,
int &
bin) {
16 bool getBinContentAndError(
const TH2 &
h,
float x,
float y,
float &content,
float &
error) {
24 content =
h.GetBinContent(xBin, yBin);
25 error =
h.GetBinError(xBin, yBin);
34 ATH_MSG_WARNING(
"No truth requirement will be performed, which is not recommended.");
44 return StatusCode::SUCCESS;
89 return StatusCode::SUCCESS;
92 if (resolved.empty()) {
94 return StatusCode::FAILURE;
96 std::unique_ptr<TFile> fIn(TFile::Open(resolved.c_str(),
"READ"));
99 return StatusCode::FAILURE;
102 std::string jvtName =
"Jvt" + wp;
103 m_jvtHist.reset(fIn->Get<TH2>(jvtName.c_str()));
106 "Could not open SF histogram "
107 << jvtName <<
". Please check the supported working points.");
108 return StatusCode::FAILURE;
111 std::string effName =
"Eff" + wp;
112 m_effHist.reset(fIn->Get<TH2>(effName.c_str()));
115 "Could not open efficiency histogram "
116 << jvtName <<
". Please check the supported working points.");
117 return StatusCode::FAILURE;
121 return StatusCode::SUCCESS;
125 float baseFactor = 1;
128 if (!getBinContentAndError(*
m_jvtHist,
x,
y, baseFactor, errorTerm)) {
142 float baseFactor, errorTerm, effFactor, errorEffTerm;
143 if (!getBinContentAndError(*
m_jvtHist,
x,
y, baseFactor, errorTerm) ||
144 !getBinContentAndError(*
m_effHist,
x,
y, effFactor, errorEffTerm)) {
151 sf = (1 - baseFactor * effFactor) / (1 - effFactor);
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
int getBin(double x, double min, double step, int clamp_max)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Header file for AthHistogramAlgorithm.
Return value from object correction CP tools.
@ Error
Some error happened during the object correction.
@ OutOfValidityRange
Input object is out of validity range.
@ Ok
The correction was done successfully.
Helper class to provide constant type-safe access to aux data.
Select isolated Photons, Electrons and Muons.
Jet_v1 Jet
Definition of the current "jet version".