33 for(
const auto &
year: MCP::dataYearList)
54 return StatusCode::FAILURE;
57 if (
registry.registerSystematics(*
this) != StatusCode::SUCCESS)
60 return StatusCode::FAILURE;
63 return StatusCode::SUCCESS;
91 mu.ID.calib_pt = corrIDpT * ((corrIDpT < -0.1) ? -1 : 1);
92 mu.ME.calib_pt = corrMEpT * ((corrMEpT < -0.1) ? -1 : 1);
93 mu.CB.calib_pt = corrCBpT * ((corrCBpT < -0.1) ? -1 : 1);
95 mu.ID.calib_charge =
mu.ID.uncalib_charge * ((corrIDpT < -0.1) ? -1 : 1);
96 mu.ME.calib_charge =
mu.ME.uncalib_charge * ((corrMEpT < -0.1) ? -1 : 1);
97 mu.CB.calib_charge =
mu.CB.uncalib_charge * ((corrCBpT < -0.1) ? -1 : 1);
100 mu.CB.calib_pt = corrCBpTWithIDME * ((corrCBpTWithIDME < -0.1) ? -1 : 1);
101 mu.CB.calib_charge =
mu.CB.uncalib_charge * ((corrCBpTWithIDME < -0.1) ? -1 : 1);
111 std::map<MCP::ScaleSmearParam, double> calibConstants;
116 const auto & contantList =
constants.at(param);
134 calibConstants[param] =
val;
137 return calibConstants;
169 double additional_weight = 1.;
170 if (std::abs(trk.
eta) > 2) additional_weight = sinh(trk.
eta);
172 return r1 *
mu.rnd_g3 + r2 *
mu.rnd_g4 *
pT * additional_weight;
174 return r0 *
mu.rnd_g0 /
pT + r1 *
mu.rnd_g1 + r2 *
mu.rnd_g2 *
pT;
181 double weightID = 0.5;
182 double weightME = 0.5;
184 double deltaCBME =
mu.CB.calib_pt -
mu.ME.calib_pt;
185 double deltaCBID =
mu.CB.calib_pt -
mu.ID.calib_pt;
187 if (
mu.ME.calib_pt == 0)
192 else if (
mu.ID.calib_pt == 0)
197 else if (
mu.CB.calib_pt != 0)
199 if (std::abs(deltaCBME) > 0 || std::abs(deltaCBID) > 0)
201 double R = 1, Rplus = 1;
202 if (std::abs(deltaCBME) == std::abs(deltaCBID))
206 else if (std::abs(deltaCBME) != 0 &&
207 std::abs(deltaCBME) > std::abs(deltaCBID)) {
208 R = (-deltaCBID) / deltaCBME;
210 if (Rplus != 0 && R > 0) {
211 weightID = 1 / Rplus;
212 weightME = R / Rplus;
215 else if (std::abs(deltaCBID) != 0 &&
216 std::abs(deltaCBME) < std::abs(deltaCBID)) {
217 R = (-deltaCBME) / (deltaCBID);
219 if (Rplus != 0 && R > 0) {
220 weightID = R / Rplus;
221 weightME = 1 / Rplus;
227 if(weightID == 0.5 && weightME == 0.5)
229 double wME =
mu.ME.calib_pt /
mu.CB.calib_pt /
std::pow(
mu.expectedPercentResME, 2);
230 double wID =
mu.ID.calib_pt /
mu.CB.calib_pt /
std::pow(
mu.expectedPercentResID, 2);
231 weightID = wID / (wME + wID);
232 weightME = wME / (wME + wID);
239 double smearCorr = weightID * smearIDCorr + weightME * smearMECorr;
260 double pT =
mu.CB.calib_pt;
261 double corrpT = (
pT +
pT * scaleCB)/(1 + smearCorr);
270 return sys.find(systematic) !=
sys.end();
364 }
else if (!syst.
empty())
return StatusCode::FAILURE;
377 }
else if (!syst.
empty())
return StatusCode::FAILURE;
390 }
else if (!syst.
empty())
return StatusCode::FAILURE;
414 }
else if (!syst.
empty())
return StatusCode::FAILURE;
425 }
else if (!syst.
empty())
return StatusCode::FAILURE;
433 }
else if (!syst.
empty())
return StatusCode::FAILURE;
441 }
else if (!syst.
empty())
return StatusCode::FAILURE;
449 }
else if (!syst.
empty())
return StatusCode::FAILURE;
457 }
else if (!syst.
empty())
return StatusCode::FAILURE;
459 return StatusCode::SUCCESS;
485 if (
pT == 0)
return 1e12;
491 if(!addMCCorrectionSmearing)
517 if (
pT == 0)
return 1e12;
522 if(!addMCCorrectionSmearing)
527 if(p2Tan)
p2 = p2Tan;
534 if(p2Tan) expectedP2 = p2Tan;
542 if(p2Tan)
p2 =
p2 * std::sinh(
eta) * std::sinh(
eta);