20{
21
22 MuonCalibIntHighpTSmearTool::MuonCalibIntHighpTSmearTool(
const std::string &name) :
asg::AsgTool(
name)
23 {
24 }
25
26 StatusCode MuonCalibIntHighpTSmearTool::initialize()
27 {
28
29 ATH_MSG_INFO(
"Initializing MuonCalibIntHighpTSmearTool");
30
31
33
34
35
37 {
42
43 }
44
45
47 {
49 return StatusCode::FAILURE;
50 }
52 if (
registry.registerSystematics(*
this) != StatusCode::SUCCESS)
53 {
55 return StatusCode::FAILURE;
56 }
57
58 return StatusCode::SUCCESS;
59 }
60
62 {
63
65
66 auto cat = ConvertToMacroCategory(
mu.raw_mst_category.value());
67
68 ATH_MSG_VERBOSE(
"Doing high pT smearing: "<<
int(cat)<<
" for year: "<<
int(
mu.CB.year)<<
" raw: "<<
mu.raw_mst_category.value());
69
70
72 {
74 }
75
76
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);
80
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);
83
84 double reso_AlignedAndCorrected = std::sqrt(std::pow(MS_AlignedAndCorrected_p1, 2) + std::pow(MS_AlignedAndCorrected_p2 *
mu.CB.calib_pt, 2));
85
86 double smearDeltaCBOnly = 0;
87 if (reso_Misaligned > reso_AlignedAndCorrected) smearDeltaCBOnly = std::sqrt(std::pow(reso_Misaligned, 2) - std::pow(reso_AlignedAndCorrected, 2));
88
89
90 double smeared_combined_pt =
mu.CB.calib_pt * (1. +
mu.rnd_g_highPt * smearDeltaCBOnly);
91
92 mu.CB.calib_pt = smeared_combined_pt;
93
94
96 }
97
99 {
101 return sys.find(systematic) !=
sys.end();
102 }
103
105 {
107
109 }
110
111 CP::SystematicSet MuonCalibIntHighpTSmearTool::recommendedSystematics()
const {
return affectingSystematics(); }
112
114 {
115
116 return StatusCode::SUCCESS;
117 }
118
119 MCP::MST_Categories MuonCalibIntHighpTSmearTool::ConvertToMacroCategory(
const int raw_mst_category)
const {
120 if (raw_mst_category < 0) {
132 else
134 }
135
136
137
138}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_VERBOSE(x,...)
#define ATH_MSG_INFO(x,...)
Return value from object correction CP tools.
@ Ok
The correction was done successfully.
This module implements the central registry for handling systematic uncertainties with CP tools.
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Class to wrap a set of SystematicVariations.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::map< MST_Categories, std::shared_ptr< CalibContainer > > createHighpTCorrMap(DataYear dataYear, const std::string &type, const std::string &recommendationPath, const std::string ¶m)
static constexpr std::array< MCP::DataYear, 8 > dataYearList