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;
88 mu.ID.calib_pt = corrIDpT * ((corrIDpT < -0.1) ? -1 : 1);
89 mu.ME.calib_pt = corrMEpT * ((corrMEpT < -0.1) ? -1 : 1);
90 mu.CB.calib_pt = corrCBpT * ((corrCBpT < -0.1) ? -1 : 1);
92 mu.ID.calib_charge =
mu.ID.uncalib_charge * ((corrIDpT < -0.1) ? -1 : 1);
93 mu.ME.calib_charge =
mu.ME.uncalib_charge * ((corrMEpT < -0.1) ? -1 : 1);
94 mu.CB.calib_charge =
mu.CB.uncalib_charge * ((corrCBpT < -0.1) ? -1 : 1);
98 mu.CB.calib_pt = corrCBpTWithIDME * ((corrCBpTWithIDME < -0.1) ? -1 : 1);
99 mu.CB.calib_charge =
mu.CB.uncalib_charge * ((corrCBpTWithIDME < -0.1) ? -1 : 1);
109 std::map<MCP::ScaleSmearParam, double> calibConstants;
132 calibConstants[param] =
val;
135 return calibConstants;
167 double additional_weight = 1.;
168 if (std::abs(trk.
eta) > 2) additional_weight = sinh(trk.
eta);
170 return r1 *
mu.rnd_g3 + r2 *
mu.rnd_g4 *
pT * additional_weight;
172 return r0 *
mu.rnd_g0 /
pT + r1 *
mu.rnd_g1 + r2 *
mu.rnd_g2 *
pT;
179 double weightID = 0.5;
180 double weightME = 0.5;
182 double deltaCBME =
mu.CB.calib_pt -
mu.ME.calib_pt;
183 double deltaCBID =
mu.CB.calib_pt -
mu.ID.calib_pt;
185 if (
mu.ME.calib_pt == 0)
190 else if (
mu.ID.calib_pt == 0)
195 else if (
mu.CB.calib_pt != 0)
197 if (std::abs(deltaCBME) > 0 || std::abs(deltaCBID) > 0)
199 double R = 1, Rplus = 1;
200 if (std::abs(deltaCBME) == std::abs(deltaCBID))
204 else if (std::abs(deltaCBME) != 0 &&
205 std::abs(deltaCBME) > std::abs(deltaCBID)) {
206 R = (-deltaCBID) / deltaCBME;
208 if (Rplus != 0 && R > 0) {
209 weightID = 1 / Rplus;
210 weightME = R / Rplus;
213 else if (std::abs(deltaCBID) != 0 &&
214 std::abs(deltaCBME) < std::abs(deltaCBID)) {
215 R = (-deltaCBME) / (deltaCBID);
217 if (Rplus != 0 && R > 0) {
218 weightID = R / Rplus;
219 weightME = 1 / Rplus;
225 if(weightID == 0.5 && weightME == 0.5)
227 double wME =
mu.ME.calib_pt /
mu.CB.calib_pt /
std::pow(
mu.expectedPercentResME, 2);
228 double wID =
mu.ID.calib_pt /
mu.CB.calib_pt /
std::pow(
mu.expectedPercentResID, 2);
229 weightID = wID / (wME + wID);
230 weightME = wME / (wME + wID);
237 double smearCorr = weightID * smearIDCorr + weightME * smearMECorr;
258 double pT =
mu.CB.calib_pt;
259 double corrpT = (
pT +
pT * scaleCB)/(1 + smearCorr);
268 return sys.find(systematic) !=
sys.end();
362 }
else if (!syst.
empty())
return StatusCode::FAILURE;
375 }
else if (!syst.
empty())
return StatusCode::FAILURE;
388 }
else if (!syst.
empty())
return StatusCode::FAILURE;
412 }
else if (!syst.
empty())
return StatusCode::FAILURE;
423 }
else if (!syst.
empty())
return StatusCode::FAILURE;
431 }
else if (!syst.
empty())
return StatusCode::FAILURE;
439 }
else if (!syst.
empty())
return StatusCode::FAILURE;
447 }
else if (!syst.
empty())
return StatusCode::FAILURE;
455 }
else if (!syst.
empty())
return StatusCode::FAILURE;
457 return StatusCode::SUCCESS;
483 if (
pT == 0)
return 1e12;
489 if(!addMCCorrectionSmearing)
515 if (
pT == 0)
return 1e12;
520 if(!addMCCorrectionSmearing)
525 if(p2Tan) p2 = p2Tan;
532 if(p2Tan) expectedP2 = p2Tan;
540 if(p2Tan) p2 = p2 * std::sinh(
eta) * std::sinh(
eta);