ATLAS Offline Software
MuonCalibIntScaleSmearTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Framework include(s):
8 
9 // Local include(s):
10 #include <cmath>
11 #include "TRandom3.h"
12 
16 
17 namespace CP
18 {
19 
21  {}
22 
24  {
25  // Greet the user:
26  ATH_MSG_INFO("Initializing MuonCalibIntScaleSmearTool");
27 
28  // Get the m_eventinfo container
30 
31 
32  // Load the constants
33  for(const auto & year: MCP::dataYearList)
34  {
35  for(const auto & param: m_paramList)
36  {
40  }
41 
44  }
45 
46 
47  m_currentParameters = nullptr;
48  // Init the systematics
49  m_Parameters.initialize(affectingSystematics(), [this](const SystematicSet &systConfig, ParameterSetScaleSmear &param)
50  { return calcSystematicVariation(systConfig, param); });
52  {
53  ATH_MSG_ERROR("Unable to run with no systematic");
54  return StatusCode::FAILURE;
55  }
57  if (registry.registerSystematics(*this) != StatusCode::SUCCESS)
58  {
59  ATH_MSG_ERROR("Unkown systematic list");
60  return StatusCode::FAILURE;
61  }
62  // Return gracefully:
63  return StatusCode::SUCCESS;
64  }
65 
67  {
68  // Do nothing, if it is data
69  if(mu.CB.isData) return CorrectionCode::Ok;
70 
71  // Get the correction constants for each year
72  auto IDcorrConstants = getConstants(mu.ID, m_IDparams.at(mu.ID.year), m_currentParameters->m_IDparams);
73  auto MEcorrConstants = getConstants(mu.ME, m_MEparams.at(mu.ME.year), m_currentParameters->m_MEparams);
74  auto CBcorrConstants = getConstants(mu.CB, m_CBparams.at(mu.CB.year), m_currentParameters->m_CBparams);
75 
76  double corrIDpT = getCorrectedPt(mu, mu.ID, IDcorrConstants);
77  double corrMEpT = getCorrectedPt(mu, mu.ME, MEcorrConstants);
78  double corrCBpT = getCorrectedPt(mu, mu.CB, CBcorrConstants);
79 
80  //Smearing can be positive and negative since it depends on Gaussians centered in 0 with sigma 1.
81  //However, the resolution correction factor depends on 1/(1+smearing)
82  //and therefore if the smearing is less than -1 the pT turns out to have a negative value.
83  //Physically it means that the resolution has caused the pT to be reconstructed with a flip of the charge.
84  //Therefore in addition to correcting the pT, a flip of the charge is also done through the calib_charge variable.
85 
86  // First compute the calibrated CB pT under the recombination scheme with uncalibrated ID & ME pT
87  double corrCBpTWithIDME = getCorrectedCBPtWithIDMSComb(mu, IDcorrConstants, MEcorrConstants);
88 
89  // Write the pT into the object (if negative pT, multiply it by -1)
90  //< 0.1 because sometimes the pT is -0.
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);
94  //charge calibration (flip of the charge if needed)
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);
98 
99  if(!m_doDirectCBCalib) {
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);
102  }
103 
104  // Return gracefully:
105  return CorrectionCode::Ok;
106  }
107 
108  std::map<MCP::ScaleSmearParam, double> MuonCalibIntScaleSmearTool::getConstants(const MCP::TrackCalibObj& trk, const std::map<MCP::ScaleSmearParam, ScaleSmearCorrConstMap>& constants, const std::map<MCP::ScaleSmearParam, double>& direction) const
109  {
110 
111  std::map<MCP::ScaleSmearParam, double> calibConstants;
112 
113  // Extra the constants from container into a simple map
114  for(const auto& param: m_paramList)
115  {
116  const auto & contantList = constants.at(param);
117 
118  double val = contantList.at(MCP::ScaleResCorrection::Nominal)->getCalibConstant(trk);
119  if(direction.at(param) == MCP::SystVariation::Up)
120  {
121  val += contantList.at(MCP::ScaleResCorrection::SystErr__1up)->getCalibConstant(trk);
122  }
123  else if (direction.at(param) == MCP::SystVariation::Down)
124  {
125  val -= contantList.at(MCP::ScaleResCorrection::SystErr__1down)->getCalibConstant(trk);
126  }
127 
128  // Remove unphysical smearing
130  {
131  val = std::max(0.0, val);
132  }
133 
134  calibConstants[param] = val;
135  }
136 
137  return calibConstants;
138  }
139 
140 
141  double MuonCalibIntScaleSmearTool::getCorrectedPt(const MCP::MuonObj& mu, const MCP::TrackCalibObj& trk, const std::map<MCP::ScaleSmearParam, double>& calibConstant) const
142  {
143  if(trk.calib_pt == 0) return 0;
144 
145  // For debugging:: Todo add checking if in verbose mode
146  ATH_MSG_VERBOSE("MuonType: "<<MCP::toString(trk.type));
147  for(const auto& var: calibConstant) ATH_MSG_VERBOSE("var: "<<MCP::toString(var.first)<<" = "<<var.second);
148 
149  double pT = trk.calib_pt;
150 
151  // Calculate the denominator for the scale correction
152  double smearCorr = getSmearCorr(mu, trk, calibConstant.at(MCP::ScaleSmearParam::r0), calibConstant.at(MCP::ScaleSmearParam::r1), calibConstant.at(MCP::ScaleSmearParam::r2));
153  ATH_MSG_VERBOSE("smearCorr: "<<smearCorr);
154 
155  // apply the full correction
156  double corrpT = (pT + pT * calibConstant.at(MCP::ScaleSmearParam::s1) + calibConstant.at(MCP::ScaleSmearParam::s0))/(1 + smearCorr);
157 
158  return corrpT;
159  }
160 
161  double MuonCalibIntScaleSmearTool::getSmearCorr(const MCP::MuonObj& mu, const MCP::TrackCalibObj& trk, double r0, double r1, double r2) const
162  {
163  if(trk.calib_pt == 0) return 1;
164 
165  double pT = trk.calib_pt;
166  if(trk.type == MCP::TrackType::ID)
167  {
168  // ID applies a tan(theta) correction for r2 for high eta muons
169  double additional_weight = 1.;
170  if (std::abs(trk.eta) > 2) additional_weight = sinh(trk.eta);
171 
172  return r1 * mu.rnd_g3 + r2 * mu.rnd_g4 * pT * additional_weight;
173  }
174  return r0 * mu.rnd_g0 / pT + r1 * mu.rnd_g1 + r2 * mu.rnd_g2 * pT;
175  }
176 
177 
178  double MuonCalibIntScaleSmearTool::getCorrectedCBPtWithIDMSComb(const MCP::MuonObj& mu, const std::map<MCP::ScaleSmearParam, double>& calibIDConstant, const std::map<MCP::ScaleSmearParam, double>& calibMEConstant) const
179  {
180  // calculate the relative of ID and ME for the corrections
181  double weightID = 0.5;
182  double weightME = 0.5;
183 
184  double deltaCBME = mu.CB.calib_pt - mu.ME.calib_pt;
185  double deltaCBID = mu.CB.calib_pt - mu.ID.calib_pt;
186 
187  if (mu.ME.calib_pt == 0)
188  {
189  weightID = 1.0;
190  weightME = 0.0;
191  }
192  else if (mu.ID.calib_pt == 0)
193  {
194  weightID = 0.0;
195  weightME = 1.0;
196  }
197  else if (mu.CB.calib_pt != 0)
198  {
199  if (std::abs(deltaCBME) > 0 || std::abs(deltaCBID) > 0)
200  {
201  double R = 1, Rplus = 1;
202  if (std::abs(deltaCBME) == std::abs(deltaCBID))
203  {
204  // do nothing
205  }
206  else if (std::abs(deltaCBME) != 0 &&
207  std::abs(deltaCBME) > std::abs(deltaCBID)) {
208  R = (-deltaCBID) / deltaCBME; /* R~wMS/wID */
209  Rplus = 1 + R;
210  if (Rplus != 0 && R > 0) {
211  weightID = 1 / Rplus;
212  weightME = R / Rplus;
213  }
214  }
215  else if (std::abs(deltaCBID) != 0 &&
216  std::abs(deltaCBME) < std::abs(deltaCBID)) {
217  R = (-deltaCBME) / (deltaCBID); /* R~wID/wMS */
218  Rplus = 1 + R;
219  if (Rplus != 0 && R > 0) {
220  weightID = R / Rplus;
221  weightME = 1 / Rplus;
222  }
223  }
224  }
225  }
226  // If no correction was found
227  if(weightID == 0.5 && weightME == 0.5)
228  {
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);
233  }
234 
235 
236  // Calculate the denominator for the scale correction
237  double smearIDCorr = getSmearCorr(mu, mu.ID, calibIDConstant.at(MCP::ScaleSmearParam::r0), calibIDConstant.at(MCP::ScaleSmearParam::r1), calibIDConstant.at(MCP::ScaleSmearParam::r2));
238  double smearMECorr = getSmearCorr(mu, mu.ME, calibMEConstant.at(MCP::ScaleSmearParam::r0), calibMEConstant.at(MCP::ScaleSmearParam::r1), calibMEConstant.at(MCP::ScaleSmearParam::r2));
239  double smearCorr = weightID * smearIDCorr + weightME * smearMECorr;
240  double scaleCB = 0;
241 
242  // apply the full correction
243  if(weightID == 0) scaleCB = (calibMEConstant.at(MCP::ScaleSmearParam::s1) + calibMEConstant.at(MCP::ScaleSmearParam::s0) / mu.ME.calib_pt) * weightME;
244  else if(weightME == 0) scaleCB = calibIDConstant.at(MCP::ScaleSmearParam::s1) * weightID ;
245  else scaleCB = (calibIDConstant.at(MCP::ScaleSmearParam::s1) * weightID + (calibMEConstant.at(MCP::ScaleSmearParam::s1) + calibMEConstant.at(MCP::ScaleSmearParam::s0) / mu.ME.calib_pt) * weightME);
246 
247  ATH_MSG_VERBOSE("mu.ID.calib_pt: "<<mu.ID.calib_pt);
248  ATH_MSG_VERBOSE("mu.ME.calib_pt: "<<mu.ME.calib_pt);
249  ATH_MSG_VERBOSE("mu.CB.calib_pt: "<<mu.CB.calib_pt);
250  ATH_MSG_VERBOSE("mu.expectedPercentResME: "<<mu.expectedPercentResME);
251  ATH_MSG_VERBOSE("mu.expectedPercentResID: "<<mu.expectedPercentResID);
252 
253  ATH_MSG_VERBOSE("weightID: "<<weightID);
254  ATH_MSG_VERBOSE("weightME: "<<weightME);
255  ATH_MSG_VERBOSE("smearIDCorr: "<<smearIDCorr);
256  ATH_MSG_VERBOSE("smearMECorr: "<<smearMECorr);
257  ATH_MSG_VERBOSE("smearCorr: "<<smearCorr);
258  ATH_MSG_VERBOSE("scaleCB: "<<scaleCB);
259 
260  double pT = mu.CB.calib_pt;
261  double corrpT = (pT + pT * scaleCB)/(1 + smearCorr);
262 
263  return corrpT;
264  }
265 
266 
268  {
270  return sys.find(systematic) != sys.end();
271  }
272 
274  {
277  // Resolution systematics
279  if (m_doDirectCBCalib || m_sysScheme == "AllSys") {
280  // CB systematics
281  result.insert(SystematicVariation("MUON_CB", 1));
282  result.insert(SystematicVariation("MUON_CB", -1));
283  }
284  if (!m_doDirectCBCalib || m_sysScheme == "AllSys") {
285  // ID systematics
286  result.insert(SystematicVariation("MUON_ID", 1));
287  result.insert(SystematicVariation("MUON_ID", -1));
288 
289  // MS systematics
290  result.insert(SystematicVariation("MUON_MS", 1));
291  result.insert(SystematicVariation("MUON_MS", -1));
292  }
293 
297  if (m_sysScheme == "Corr_Scale") {
298  result.insert(SystematicVariation("MUON_SCALE", 1));
299  result.insert(SystematicVariation("MUON_SCALE", -1));
300  }
301  else if (m_sysScheme == "Decorr_Scale" || m_sysScheme == "AllSys") {
302  // Either doing direct calib of CB or asking for all the sys
303  if (m_doDirectCBCalib || m_sysScheme == "AllSys") {
304  result.insert(SystematicVariation("MUON_SCALE_CB", 1));
305  result.insert(SystematicVariation("MUON_SCALE_CB", -1));
306 
307  result.insert(SystematicVariation("MUON_SCALE_CB_ELOSS", 1));
308  result.insert(SystematicVariation("MUON_SCALE_CB_ELOSS", -1));
309  }
310 
311  // Either not doing direct calib of CB or asking for all the sys
312  if (!m_doDirectCBCalib || m_sysScheme == "AllSys") {
313  result.insert(SystematicVariation("MUON_SCALE_ID", 1));
314  result.insert(SystematicVariation("MUON_SCALE_ID", -1));
315 
316  result.insert(SystematicVariation("MUON_SCALE_MS", 1));
317  result.insert(SystematicVariation("MUON_SCALE_MS", -1));
318 
319  result.insert(SystematicVariation("MUON_SCALE_MS_ELOSS", 1));
320  result.insert(SystematicVariation("MUON_SCALE_MS_ELOSS", -1));
321  }
322  }
323 
324 
325 
326 
327  return result;
328  }
329 
331 
333  {
339 
345 
351 
352 
353  // ID systematics
354  SystematicVariation syst = systConfig.getSystematicByBaseName("MUON_ID");
355 
356  if (syst == SystematicVariation("MUON_ID", 1)) {
360  } else if (syst == SystematicVariation("MUON_ID", -1)) {
364  } else if (!syst.empty()) return StatusCode::FAILURE;
365 
366  // MS systematics
367  syst = systConfig.getSystematicByBaseName("MUON_MS");
368 
369  if (syst == SystematicVariation("MUON_MS", 1)) {
373  } else if (syst == SystematicVariation("MUON_MS", -1)) {
377  } else if (!syst.empty()) return StatusCode::FAILURE;
378 
379  // CB systematics
380  syst = systConfig.getSystematicByBaseName("MUON_CB");
381 
382  if (syst == SystematicVariation("MUON_CB", 1)) {
386  } else if (syst == SystematicVariation("MUON_CB", -1)) {
390  } else if (!syst.empty()) return StatusCode::FAILURE;
391 
392  // Scale systematics
393  syst = systConfig.getSystematicByBaseName("MUON_SCALE");
394 
395  if (syst == SystematicVariation("MUON_SCALE", 1)) {
398 
401 
404 
405  } else if (syst == SystematicVariation("MUON_SCALE", -1)) {
408 
411 
414  } else if (!syst.empty()) return StatusCode::FAILURE;
415 
416  // Split scale ID/MS/EGloss
417  syst = systConfig.getSystematicByBaseName("MUON_SCALE_ID");
418 
419  if (syst == SystematicVariation("MUON_SCALE_ID", 1)) {
422  } else if (syst == SystematicVariation("MUON_SCALE_ID", -1)) {
425  } else if (!syst.empty()) return StatusCode::FAILURE;
426 
427  syst = systConfig.getSystematicByBaseName("MUON_SCALE_MS");
428 
429  if (syst == SystematicVariation("MUON_SCALE_MS", 1)) {
431  } else if (syst == SystematicVariation("MUON_SCALE_MS", -1)) {
433  } else if (!syst.empty()) return StatusCode::FAILURE;
434 
435  syst = systConfig.getSystematicByBaseName("MUON_SCALE_MS_ELOSS");
436 
437  if (syst == SystematicVariation("MUON_SCALE_MS_ELOSS", 1)) {
439  } else if (syst == SystematicVariation("MUON_SCALE_MS_ELOSS", -1)) {
441  } else if (!syst.empty()) return StatusCode::FAILURE;
442 
443  syst = systConfig.getSystematicByBaseName("MUON_SCALE_CB");
444 
445  if (syst == SystematicVariation("MUON_SCALE_CB", 1)) {
447  } else if (syst == SystematicVariation("MUON_SCALE_CB", -1)) {
449  } else if (!syst.empty()) return StatusCode::FAILURE;
450 
451  syst = systConfig.getSystematicByBaseName("MUON_SCALE_CB_ELOSS");
452 
453  if (syst == SystematicVariation("MUON_SCALE_CB_ELOSS", 1)) {
455  } else if (syst == SystematicVariation("MUON_SCALE_CB_ELOSS", -1)) {
457  } else if (!syst.empty()) return StatusCode::FAILURE;
458 
459  return StatusCode::SUCCESS;
460  }
461 
463  {
464  return m_Parameters.get(systConfig, m_currentParameters);
465  }
466 
467 
468  double MuonCalibIntScaleSmearTool::getExpectedResolution(const int &DetType, double pT, double eta, double phi, MCP::DataYear year, bool addMCCorrectionSmearing) const
469  {
470 
471  const auto & IDcorrConstants = m_IDparams.at(year);
472  const auto & MEcorrConstants = m_MEparams.at(year);
473  const auto & IDExpectedResConstants = m_IDExpectedResparams.at(year);
474  const auto & MEExpectedResConstants = m_MEExpectedResparams.at(year);
475 
478 
479  auto trk = MCP::TrackCalibObj(type, pT * GeVtoMeV, eta, phi, year, false);
480 
481 
482  double expRes = 0.;
484  {
485  if (pT == 0) return 1e12;
486 
487  double p0 = 0;
488  double p1 = 0;
489  double p2 = 0;
490 
491  if(!addMCCorrectionSmearing)
492  {
493  p0 = MEExpectedResConstants.at(MCP::ExpectedResParam::r0)->getCalibConstant(trk);
494  p1 = MEExpectedResConstants.at(MCP::ExpectedResParam::r1)->getCalibConstant(trk);
495  p2 = MEExpectedResConstants.at(MCP::ExpectedResParam::r2)->getCalibConstant(trk);
496  }
497  else
498  {
499  double expectedP0 = MEExpectedResConstants.at(MCP::ExpectedResParam::r0)->getCalibConstant(trk);
500  double expectedP1 = MEExpectedResConstants.at(MCP::ExpectedResParam::r1)->getCalibConstant(trk);
501  double expectedP2 = MEExpectedResConstants.at(MCP::ExpectedResParam::r2)->getCalibConstant(trk);
502 
503  double r0 = MEcorrConstants.at(MCP::ScaleSmearParam::r0).at(MCP::ScaleResCorrection::Nominal)->getCalibConstant(trk);
504  double r1 = MEcorrConstants.at(MCP::ScaleSmearParam::r1).at(MCP::ScaleResCorrection::Nominal)->getCalibConstant(trk);
505  double r2 = MEcorrConstants.at(MCP::ScaleSmearParam::r2).at(MCP::ScaleResCorrection::Nominal)->getCalibConstant(trk);
506 
507  p0 = std::sqrt(std::pow(expectedP0, 2) + std::pow(r0, 2));
508  p1 = std::sqrt(std::pow(expectedP1, 2) + std::pow(r1, 2));
509  p2 = std::sqrt(std::pow(expectedP2, 2) + std::pow(r2, 2));
510  }
511 
512  expRes = std::sqrt(std::pow(p0 / pT, 2) + std::pow(p1, 2) + std::pow(p2 * pT, 2));
513 
514  }
515  else if (DetType == MCP::DetectorType::ID)
516  {
517  if (pT == 0) return 1e12;
518 
519  double p1 = 0;
520  double p2 = 0;
521 
522  if(!addMCCorrectionSmearing)
523  {
524  p1 = IDExpectedResConstants.at(MCP::ExpectedResParam::r1)->getCalibConstant(trk);
525  p2 = IDExpectedResConstants.at(MCP::ExpectedResParam::r2)->getCalibConstant(trk);
526  double p2Tan = IDExpectedResConstants.at(MCP::ExpectedResParam::r2tan2)->getCalibConstant(trk);
527  if(p2Tan) p2 = p2Tan;
528  }
529  else
530  {
531  double expectedP1 = IDExpectedResConstants.at(MCP::ExpectedResParam::r1)->getCalibConstant(trk);
532  double expectedP2 = IDExpectedResConstants.at(MCP::ExpectedResParam::r2)->getCalibConstant(trk);
533  double p2Tan = IDExpectedResConstants.at(MCP::ExpectedResParam::r2tan2)->getCalibConstant(trk);
534  if(p2Tan) expectedP2 = p2Tan;
535 
536  double r1 = IDcorrConstants.at(MCP::ScaleSmearParam::r1).at(MCP::ScaleResCorrection::Nominal)->getCalibConstant(trk);
537  double r2 = IDcorrConstants.at(MCP::ScaleSmearParam::r2).at(MCP::ScaleResCorrection::Nominal)->getCalibConstant(trk);
538 
539  p1 = std::sqrt(std::pow(expectedP1, 2) + std::pow(r1, 2));
540  p2 = std::sqrt(std::pow(expectedP2, 2) + std::pow(r2, 2));
541 
542  if(p2Tan) p2 = p2 * std::sinh(eta) * std::sinh(eta);
543  }
544 
545  expRes = std::sqrt(std::pow(p1, 2) + std::pow(p2 * pT, 2));
546  return expRes;
547  }
548  else
549  {
550  ATH_MSG_ERROR("wrong DetType in input " << DetType);
551  return 0.;
552  }
553 
554  return expRes;
555  }
556 
557 
558 } // namespace CP
python.Dso.registry
registry
Definition: Control/AthenaServices/python/Dso.py:158
MCP::DetectorType::ID
@ ID
Definition: EnumDef.h:37
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
beamspotnt.var
var
Definition: bin/beamspotnt.py:1393
CP::MuonCalibIntScaleSmearTool::ParameterSetScaleSmear
Definition: MuonCalibIntScaleSmearTool.h:75
CP::MuonCalibIntScaleSmearTool::applySystematicVariation
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig) override
effects: configure this tool for the given list of systematic variations.
Definition: MuonCalibIntScaleSmearTool.cxx:462
MCP::ScaleResCorrection::Nominal
@ Nominal
MCP::CalibInitializer::createExpectedResMap
std::map< ExpectedResParam, std::shared_ptr< CalibContainer > > createExpectedResMap(DataYear dataYear, TrackType type, const std::string &recommendationPath)
Definition: CalibInitializer.cxx:74
CP::MuonCalibIntScaleSmearTool::ParameterSetScaleSmear::m_IDparams
std::map< MCP::ScaleSmearParam, double > m_IDparams
Definition: MuonCalibIntScaleSmearTool.h:76
get_generator_info.result
result
Definition: get_generator_info.py:21
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CP::MuonCalibIntScaleSmearTool::m_doDirectCBCalib
Gaudi::Property< bool > m_doDirectCBCalib
Definition: MuonCalibIntScaleSmearTool.h:69
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
CP::MuonCalibIntScaleSmearTool::affectingSystematics
virtual SystematicSet affectingSystematics() const override
the list of all systematics this tool can be affected by
Definition: MuonCalibIntScaleSmearTool.cxx:273
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
asg
Definition: DataHandleTestTool.h:28
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
MCP::ScaleSmearParam::s0
@ s0
CP::IMuonCalibIntTool::applyCorrection
virtual CorrectionCode applyCorrection(MCP::MuonObj &mu) const =0
Declare the interface that the class provides.
CalibInitializer.h
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
CP::SystematicVariation
Definition: SystematicVariation.h:47
MCP::ScaleSmearParam::r2
@ r2
python.AtlRunQueryAMI.year
year
Definition: AtlRunQueryAMI.py:225
CP::MuonCalibIntScaleSmearTool::getConstants
std::map< MCP::ScaleSmearParam, double > getConstants(const MCP::TrackCalibObj &trk, const std::map< MCP::ScaleSmearParam, ScaleSmearCorrConstMap > &constants, const std::map< MCP::ScaleSmearParam, double > &direction) const
Definition: MuonCalibIntScaleSmearTool.cxx:108
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:49
MCP::SystVariation::Default
@ Default
Definition: EnumDef.h:73
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
CP::MuonCalibIntScaleSmearTool::m_currentParameters
const ParameterSetScaleSmear * m_currentParameters
Definition: MuonCalibIntScaleSmearTool.h:85
MCP::ExpectedResParam::r1
@ r1
CP::MuonCalibIntScaleSmearTool::ParameterSetScaleSmear::m_MEparams
std::map< MCP::ScaleSmearParam, double > m_MEparams
Definition: MuonCalibIntScaleSmearTool.h:77
CP::MuonCalibIntScaleSmearTool::m_MEparams
std::map< MCP::DataYear, std::map< MCP::ScaleSmearParam, ScaleSmearCorrConstMap > > m_MEparams
Definition: MuonCalibIntScaleSmearTool.h:89
MCP::SystVariation::Down
@ Down
Definition: EnumDef.h:73
MCP::ExpectedResParam::r0
@ r0
MCP::ExpectedResParam::r2
@ r2
CP::SystematicSet::getSystematicByBaseName
SystematicVariation getSystematicByBaseName(const std::string &basename) const
description: get the first systematic matching basename
Definition: SystematicSet.cxx:170
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
MCP::toString
std::string toString(TrackType trkType)
Definition: EnumDef.h:39
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MCP::SystVariation::Up
@ Up
Definition: EnumDef.h:73
MCP::ScaleSmearParam::s1
@ s1
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MCP::ScaleResCorrection::SystErr__1down
@ SystErr__1down
CP::MuonCalibIntScaleSmearTool::recommendedSystematics
virtual SystematicSet recommendedSystematics() const override
the list of all systematics this tool recommends to use
Definition: MuonCalibIntScaleSmearTool.cxx:330
CP::MuonCalibIntScaleSmearTool::m_IDparams
std::map< MCP::DataYear, std::map< MCP::ScaleSmearParam, ScaleSmearCorrConstMap > > m_IDparams
Definition: MuonCalibIntScaleSmearTool.h:88
CP::MuonCalibIntScaleSmearTool::m_release
Gaudi::Property< std::string > m_release
Definition: MuonCalibIntScaleSmearTool.h:63
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
MCP::TrackCalibObj::eta
const double eta
Value of the track-eta.
Definition: MuonObj.h:104
CP::MuonCalibIntScaleSmearTool::m_IDExpectedResparams
std::map< MCP::DataYear, std::map< MCP::ExpectedResParam, std::shared_ptr< MCP::CalibContainer > > > m_IDExpectedResparams
Definition: MuonCalibIntScaleSmearTool.h:94
MCP::ScaleResCorrection::SystErr__1up
@ SystErr__1up
CP::MuonCalibIntScaleSmearTool::getExpectedResolution
virtual ASG_TOOL_CLASS3(MuonCalibIntScaleSmearTool, CP::IMuonCalibIntScaleSmearTool, CP::ISystematicsTool, CP::IReentrantSystematicsTool) public double getExpectedResolution(const int &DetType, double pT, double eta, double phi, MCP::DataYear year, bool isData) const override
Declare the interface that the class provides.
Definition: MuonCalibIntScaleSmearTool.cxx:468
CP::MuonCalibIntScaleSmearTool::getCorrectedCBPtWithIDMSComb
double getCorrectedCBPtWithIDMSComb(const MCP::MuonObj &mu, const std::map< MCP::ScaleSmearParam, double > &calibIDConstant, const std::map< MCP::ScaleSmearParam, double > &calibMEConstant) const
Definition: MuonCalibIntScaleSmearTool.cxx:178
CP::MuonCalibIntScaleSmearTool::isAffectedBySystematic
virtual bool isAffectedBySystematic(const SystematicVariation &systematic) const override
Declare the interface that this class provides.
Definition: MuonCalibIntScaleSmearTool.cxx:267
MCP::CalibInitializer::createScaleResCorrMap
std::map< ScaleResCorrection, std::shared_ptr< CalibContainer > > createScaleResCorrMap(DataYear dataYear, TrackType type, const std::string &recommendationPath, ScaleSmearParam param)
Definition: CalibInitializer.cxx:41
MCP::DetectorType::MS
@ MS
Definition: EnumDef.h:37
CP::MuonCalibIntScaleSmearTool::m_eventInfo
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Definition: MuonCalibIntScaleSmearTool.h:60
PathResolver.h
MCP::TrackCalibObj::type
const TrackType type
Flag telling the code whether this is CB/ME/ID.
Definition: MuonObj.h:96
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ReadHandle.h
Handle class for reading from StoreGate.
CP::MuonCalibIntScaleSmearTool::getSmearCorr
double getSmearCorr(const MCP::MuonObj &mu, const MCP::TrackCalibObj &trk, double r0, double r1, double r2) const
Definition: MuonCalibIntScaleSmearTool.cxx:161
MuonCalibIntScaleSmearTool.h
MCP::ExpectedResParam::r2tan2
@ r2tan2
CP::MuonCalibIntScaleSmearTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: MuonCalibIntScaleSmearTool.cxx:23
MCP::TrackCalibObj::calib_pt
double calib_pt
Smeared track pt.
Definition: MuonObj.h:102
EnumDef.h
CP::MuonCalibIntScaleSmearTool::m_sysScheme
Gaudi::Property< std::string > m_sysScheme
Definition: MuonCalibIntScaleSmearTool.h:66
MCP::TrackType::CB
@ CB
CP::MuonCalibIntScaleSmearTool::m_CBparams
std::map< MCP::DataYear, std::map< MCP::ScaleSmearParam, ScaleSmearCorrConstMap > > m_CBparams
Definition: MuonCalibIntScaleSmearTool.h:90
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
CP::MuonCalibIntScaleSmearTool::m_paramList
static constexpr std::array< MCP::ScaleSmearParam, 5 > m_paramList
Definition: MuonCalibIntScaleSmearTool.h:97
MCP::ScaleSmearParam::r0
@ r0
CP::MuonCalibIntScaleSmearTool::m_Parameters
SystematicsCache< ParameterSetScaleSmear > m_Parameters
Definition: MuonCalibIntScaleSmearTool.h:84
constants
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:1
CP::SystematicVariation::empty
bool empty() const
returns: whether this is an empty systematic, i.e.
Definition: SystematicVariation.cxx:294
CP::SystematicRegistry
This module implements the central registry for handling systematic uncertainties with CP tools.
Definition: SystematicRegistry.h:25
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
CP::MuonCalibIntScaleSmearTool::m_MEExpectedResparams
std::map< MCP::DataYear, std::map< MCP::ExpectedResParam, std::shared_ptr< MCP::CalibContainer > > > m_MEExpectedResparams
Definition: MuonCalibIntScaleSmearTool.h:95
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
CP::MuonCalibIntScaleSmearTool::calcSystematicVariation
StatusCode calcSystematicVariation(const SystematicSet &systConfig, ParameterSetScaleSmear &param) const
Definition: MuonCalibIntScaleSmearTool.cxx:332
MCP::DataYear
DataYear
Definition: EnumDef.h:28
MCP::MuonObj
Definition: MuonObj.h:126
CP::MuonCalibIntScaleSmearTool::MuonCalibIntScaleSmearTool
MuonCalibIntScaleSmearTool(const std::string &name)
Definition: MuonCalibIntScaleSmearTool.cxx:20
DetType
Definition: DetType.h:10
MCP::ScaleSmearParam::r1
@ r1
CP::MuonCalibIntScaleSmearTool::ParameterSetScaleSmear::m_CBparams
std::map< MCP::ScaleSmearParam, double > m_CBparams
Definition: MuonCalibIntScaleSmearTool.h:78
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:51
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
MCP::TrackCalibObj
Basic object to cache all relevant information from the track.
Definition: MuonObj.h:21
MCP::TrackType
TrackType
Definition: EnumDef.h:13
MCP::TrackType::ME
@ ME
CP::MuonCalibIntScaleSmearTool::getCorrectedPt
double getCorrectedPt(const MCP::MuonObj &mu, const MCP::TrackCalibObj &trk, const std::map< MCP::ScaleSmearParam, double > &calibConstant) const
Definition: MuonCalibIntScaleSmearTool.cxx:141
TRTCalib_cfilter.p0
p0
Definition: TRTCalib_cfilter.py:129
CP::SystematicRegistry::getInstance
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Definition: SystematicRegistry.cxx:25
MCP::TrackType::ID
@ ID