18 m_systNominal(
CP::SystematicSet()),
19 m_systUP(
CP::SystematicSet()),
20 m_systDOWN(
CP::SystematicSet()),
21 m_jvt_tool(
"JetJvtEfficiencyTool"),
22 m_fjvt_tool(
"JetForwardJvtEfficiencyTool") {
27 ATH_MSG_INFO(
"top::JetScaleFactorCalculator initialize");
35 if (
m_config->getfJVTWP() !=
"None") {
42 return StatusCode::SUCCESS;
48 for (
auto currentSystematic : *
m_config->systSgKeyMapJets(
false)) {
51 top::check(this->
decorateJets(jets,currentSystematic.first ==
m_config->nominalHashValue()),
"failed to decorate jets in JetScaleFactorCalculator::execute()");
56 for (
auto currentSystematic : *
m_config->systSgKeyMapJets(
true)) {
59 top::check(this->
decorateJets(jets,currentSystematic.first ==
m_config->nominalHashValue()),
"failed to decorate loose jets in JetScaleFactorCalculator::execute()");
63 return StatusCode::SUCCESS;
72 bool passSelection(
false);
73 if (jetPtr->isAvailable<
char>(
"passPreORSelection")) {
74 if (jetPtr->auxdataConst<
char>(
"passPreORSelection") == 1) {
78 if (jetPtr->isAvailable<
char>(
"passPreORSelectionLoose")) {
79 if (jetPtr->auxdataConst<
char>(
"passPreORSelectionLoose") == 1) {
88 "Failed to set JVT nominal SF");
92 if (!jetPtr->isAvailable<
char>(
"passJVT")) {
93 ATH_MSG_ERROR(
" Can't find jet decoration \"passJVT\" - we need it to calculate the jet scale-factors!");
94 return StatusCode::FAILURE;
97 int passes_jvt = jetPtr->auxdataConst<
char >(
"passJVT");
98 if (passes_jvt < 0)
continue;
101 "Failed to getEfficiencyScaleFactor for JVT");
104 "Failed to getInefficiencyScaleFactor for JVT");
107 jetPtr->auxdecor<
float>(
"JET_SF_jvt") = jvtSF;
111 float jvtSF_up(1.), jvtSF_down(1.);
115 "Failed to applySystematicVariation up for JVT");
117 "Failed to get JVT SF (systematic up)");
119 "Failed to applySystematicVariation down for JVT");
121 "Failed to get JVT SF (systematic down)");
124 "Failed to applySystematicVariation up for JVT");
126 "Failed to get JVT SF (systematic up)");
128 "Failed to applySystematicVariation down for JVT");
130 "Failed to get JVT SF (systematic down)");
134 jetPtr->auxdecor<
float>(
"JET_SF_jvt_UP") = jvtSF_up;
135 jetPtr->auxdecor<
float>(
"JET_SF_jvt_DOWN") = jvtSF_down;
140 if (
m_config->getfJVTWP() !=
"None") {
142 "Failed to set fJVT nominal SF");
145 if (!jetPtr->isAvailable<
char>(
"AnalysisTop_fJVTdecision")) {
146 ATH_MSG_ERROR(
" Can't find jet decoration \"AnalysisTop_fJVTdecision\" - we need it to calculate the jet fJVT scale-factors!");
147 return StatusCode::FAILURE;
149 int passes_fjvt = jetPtr->auxdataConst<
char >(
"AnalysisTop_fJVTdecision");
150 if (passes_fjvt < 0)
continue;
152 "Failed to getEfficiencyScaleFactor for fJVT");
155 "Failed to getInefficiencyScaleFactor for fJVT");
157 jetPtr->auxdecor<
float>(
"JET_SF_fjvt") = fjvtSF;
160 float fjvtSF_up(1.), fjvtSF_down(1.);
163 "Failed to applySystematicVariation up for fJVT");
165 "Failed to get fJVT SF (systematic up)");
167 "Failed to applySystematicVariation down for fJVT");
169 "Failed to get fJVT SF (systematic down)");
172 "Failed to applySystematicVariation up for fJVT");
174 "Failed to get fJVT SF (systematic up)");
176 "Failed to applySystematicVariation down for fJVT");
178 "Failed to get fJVT SF (systematic down)");
181 jetPtr->auxdecor<
float>(
"JET_SF_fjvt_UP") = fjvtSF_up;
182 jetPtr->auxdecor<
float>(
"JET_SF_fjvt_DOWN") = fjvtSF_down;
188 return StatusCode::SUCCESS;