19namespace ADD_CMODE(CP)
22 MuonCalibIntHighpTSmearTool::MuonCalibIntHighpTSmearTool(
const std::string &name) :
asg::AsgTool(name)
26 StatusCode MuonCalibIntHighpTSmearTool::initialize()
29 ATH_MSG_INFO(
"Initializing MuonCalibIntHighpTSmearTool");
49 return StatusCode::FAILURE;
52 if (registry.registerSystematics(*
this) != StatusCode::SUCCESS)
55 return StatusCode::FAILURE;
58 return StatusCode::SUCCESS;
66 auto cat = ConvertToMacroCategory(mu.raw_mst_category.value());
68 ATH_MSG_VERBOSE(
"Doing high pT smearing: "<<
int(cat)<<
" for year: "<<
int(mu.CB.year)<<
" raw: "<<mu.raw_mst_category.value());
77 double MS_Misaligned_p1 = m_MS_Misaligned_p1.at(mu.CB.year).at(cat)->getCalibConstant(mu.CB);
78 double MS_Misaligned_p2 = m_MS_Misaligned_p2.at(mu.CB.year).at(cat)->getCalibConstant(mu.CB);
79 double reso_Misaligned = std::hypot(MS_Misaligned_p1, MS_Misaligned_p2 * mu.CB.calib_pt);
81 double MS_AlignedAndCorrected_p1 = m_MS_AlignedAndCorrected_p1.at(mu.CB.year).at(cat)->getCalibConstant(mu.CB);
82 double MS_AlignedAndCorrected_p2 = m_MS_AlignedAndCorrected_p2.at(mu.CB.year).at(cat)->getCalibConstant(mu.CB);
84 double reso_AlignedAndCorrected = std::sqrt(std::pow(MS_AlignedAndCorrected_p1, 2) + std::pow(MS_AlignedAndCorrected_p2 * mu.CB.calib_pt, 2));
86 double smearDeltaCBOnly = 0;
87 if (reso_Misaligned > reso_AlignedAndCorrected) smearDeltaCBOnly = std::sqrt(std::pow(reso_Misaligned, 2) - std::pow(reso_AlignedAndCorrected, 2));
90 double smeared_combined_pt = mu.CB.calib_pt * (1. + mu.rnd_g_highPt * smearDeltaCBOnly);
92 mu.CB.calib_pt = smeared_combined_pt;
101 return sys.find(systematic) != sys.end();
111 CP::SystematicSet MuonCalibIntHighpTSmearTool::recommendedSystematics()
const {
return affectingSystematics(); }
113 StatusCode MuonCalibIntHighpTSmearTool::applySystematicVariation(
const CP::SystematicSet&)
116 return StatusCode::SUCCESS;
119 MCP::MST_Categories MuonCalibIntHighpTSmearTool::ConvertToMacroCategory(
const int raw_mst_category)
const {
120 if (raw_mst_category < 0) {