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(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  // Write the pT into the object (if negative pT, multiply it by -1)
87  //< 0.1 because sometimes the pT is -0.
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);
91  //charge calibration (flip of the charge if needed)
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);
95 
96  double corrCBpTWithIDME = getCorrectedCBPtWithIDMSComb(mu, IDcorrConstants, MEcorrConstants);
97  if(!m_doDirectCBCalib) {
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);
100  }
101 
102  // Return gracefully:
103  return CorrectionCode::Ok;
104  }
105 
106  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
107  {
108 
109  std::map<MCP::ScaleSmearParam, double> calibConstants;
110 
111  // Extra the constants from container into a simple map
112  for(const auto& param: m_paramList)
113  {
114  auto contantList = constants.at(param);
115 
116  double val = contantList.at(MCP::ScaleResCorrection::Nominal)->getCalibConstant(trk);
117  if(direction.at(param) == MCP::SystVariation::Up)
118  {
119  val += contantList.at(MCP::ScaleResCorrection::SystErr__1up)->getCalibConstant(trk);
120  }
121  else if (direction.at(param) == MCP::SystVariation::Down)
122  {
123  val -= contantList.at(MCP::ScaleResCorrection::SystErr__1down)->getCalibConstant(trk);
124  }
125 
126  // Remove unphysical smearing
128  {
129  val = std::max(0.0, val);
130  }
131 
132  calibConstants[param] = val;
133  }
134 
135  return calibConstants;
136  }
137 
138 
139  double MuonCalibIntScaleSmearTool::getCorrectedPt(const MCP::MuonObj& mu, const MCP::TrackCalibObj& trk, const std::map<MCP::ScaleSmearParam, double>& calibConstant) const
140  {
141  if(trk.calib_pt == 0) return 0;
142 
143  // For debugging:: Todo add checking if in verbose mode
144  ATH_MSG_VERBOSE("MuonType: "<<MCP::toString(trk.type));
145  for(const auto& var: calibConstant) ATH_MSG_VERBOSE("var: "<<MCP::toString(var.first)<<" = "<<var.second);
146 
147  double pT = trk.calib_pt;
148 
149  // Calculate the denominator for the scale correction
150  double smearCorr = getSmearCorr(mu, trk, calibConstant.at(MCP::ScaleSmearParam::r0), calibConstant.at(MCP::ScaleSmearParam::r1), calibConstant.at(MCP::ScaleSmearParam::r2));
151  ATH_MSG_VERBOSE("smearCorr: "<<smearCorr);
152 
153  // apply the full correction
154  double corrpT = (pT + pT * calibConstant.at(MCP::ScaleSmearParam::s1) + calibConstant.at(MCP::ScaleSmearParam::s0))/(1 + smearCorr);
155 
156  return corrpT;
157  }
158 
159  double MuonCalibIntScaleSmearTool::getSmearCorr(const MCP::MuonObj& mu, const MCP::TrackCalibObj& trk, double r0, double r1, double r2) const
160  {
161  if(trk.calib_pt == 0) return 1;
162 
163  double pT = trk.calib_pt;
164  if(trk.type == MCP::TrackType::ID)
165  {
166  // ID applies a tan(theta) correction for r2 for high eta muons
167  double additional_weight = 1.;
168  if (std::abs(trk.eta) > 2) additional_weight = sinh(trk.eta);
169 
170  return r1 * mu.rnd_g3 + r2 * mu.rnd_g4 * pT * additional_weight;
171  }
172  return r0 * mu.rnd_g0 / pT + r1 * mu.rnd_g1 + r2 * mu.rnd_g2 * pT;
173  }
174 
175 
176  double MuonCalibIntScaleSmearTool::getCorrectedCBPtWithIDMSComb(const MCP::MuonObj& mu, const std::map<MCP::ScaleSmearParam, double>& calibIDConstant, const std::map<MCP::ScaleSmearParam, double>& calibMEConstant) const
177  {
178  // calculate the relative of ID and ME for the corrections
179  double weightID = 0.5;
180  double weightME = 0.5;
181 
182  double deltaCBME = mu.CB.calib_pt - mu.ME.calib_pt;
183  double deltaCBID = mu.CB.calib_pt - mu.ID.calib_pt;
184 
185  if (mu.ME.calib_pt == 0)
186  {
187  weightID = 1.0;
188  weightME = 0.0;
189  }
190  else if (mu.ID.calib_pt == 0)
191  {
192  weightID = 0.0;
193  weightME = 1.0;
194  }
195  else if (mu.CB.calib_pt != 0)
196  {
197  if (std::abs(deltaCBME) > 0 || std::abs(deltaCBID) > 0)
198  {
199  double R = 1, Rplus = 1;
200  if (std::abs(deltaCBME) == std::abs(deltaCBID))
201  {
202  // do nothing
203  }
204  else if (std::abs(deltaCBME) != 0 &&
205  std::abs(deltaCBME) > std::abs(deltaCBID)) {
206  R = (-deltaCBID) / deltaCBME; /* R~wMS/wID */
207  Rplus = 1 + R;
208  if (Rplus != 0 && R > 0) {
209  weightID = 1 / Rplus;
210  weightME = R / Rplus;
211  }
212  }
213  else if (std::abs(deltaCBID) != 0 &&
214  std::abs(deltaCBME) < std::abs(deltaCBID)) {
215  R = (-deltaCBME) / (deltaCBID); /* R~wID/wMS */
216  Rplus = 1 + R;
217  if (Rplus != 0 && R > 0) {
218  weightID = R / Rplus;
219  weightME = 1 / Rplus;
220  }
221  }
222  }
223  }
224  // If no correction was found
225  if(weightID == 0.5 && weightME == 0.5)
226  {
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);
231  }
232 
233 
234  // Calculate the denominator for the scale correction
235  double smearIDCorr = getSmearCorr(mu, mu.ID, calibIDConstant.at(MCP::ScaleSmearParam::r0), calibIDConstant.at(MCP::ScaleSmearParam::r1), calibIDConstant.at(MCP::ScaleSmearParam::r2));
236  double smearMECorr = getSmearCorr(mu, mu.ME, calibMEConstant.at(MCP::ScaleSmearParam::r0), calibMEConstant.at(MCP::ScaleSmearParam::r1), calibMEConstant.at(MCP::ScaleSmearParam::r2));
237  double smearCorr = weightID * smearIDCorr + weightME * smearMECorr;
238  double scaleCB = 0;
239 
240  // apply the full correction
241  if(weightID == 0) scaleCB = (calibMEConstant.at(MCP::ScaleSmearParam::s1) + calibMEConstant.at(MCP::ScaleSmearParam::s0) / mu.ME.calib_pt) * weightME;
242  else if(weightME == 0) scaleCB = calibIDConstant.at(MCP::ScaleSmearParam::s1) * weightID ;
243  else scaleCB = (calibIDConstant.at(MCP::ScaleSmearParam::s1) * weightID + (calibMEConstant.at(MCP::ScaleSmearParam::s1) + calibMEConstant.at(MCP::ScaleSmearParam::s0) / mu.ME.calib_pt) * weightME);
244 
245  ATH_MSG_VERBOSE("mu.ID.calib_pt: "<<mu.ID.calib_pt);
246  ATH_MSG_VERBOSE("mu.ME.calib_pt: "<<mu.ME.calib_pt);
247  ATH_MSG_VERBOSE("mu.CB.calib_pt: "<<mu.CB.calib_pt);
248  ATH_MSG_VERBOSE("mu.expectedPercentResME: "<<mu.expectedPercentResME);
249  ATH_MSG_VERBOSE("mu.expectedPercentResID: "<<mu.expectedPercentResID);
250 
251  ATH_MSG_VERBOSE("weightID: "<<weightID);
252  ATH_MSG_VERBOSE("weightME: "<<weightME);
253  ATH_MSG_VERBOSE("smearIDCorr: "<<smearIDCorr);
254  ATH_MSG_VERBOSE("smearMECorr: "<<smearMECorr);
255  ATH_MSG_VERBOSE("smearCorr: "<<smearCorr);
256  ATH_MSG_VERBOSE("scaleCB: "<<scaleCB);
257 
258  double pT = mu.CB.calib_pt;
259  double corrpT = (pT + pT * scaleCB)/(1 + smearCorr);
260 
261  return corrpT;
262  }
263 
264 
266  {
268  return sys.find(systematic) != sys.end();
269  }
270 
272  {
275  // Resolution systematics
277  if (m_doDirectCBCalib || m_sysScheme == "AllSys") {
278  // CB systematics
279  result.insert(SystematicVariation("MUON_CB", 1));
280  result.insert(SystematicVariation("MUON_CB", -1));
281  }
282  if (!m_doDirectCBCalib || m_sysScheme == "AllSys") {
283  // ID systematics
284  result.insert(SystematicVariation("MUON_ID", 1));
285  result.insert(SystematicVariation("MUON_ID", -1));
286 
287  // MS systematics
288  result.insert(SystematicVariation("MUON_MS", 1));
289  result.insert(SystematicVariation("MUON_MS", -1));
290  }
291 
295  if (m_sysScheme == "Corr_Scale") {
296  result.insert(SystematicVariation("MUON_SCALE", 1));
297  result.insert(SystematicVariation("MUON_SCALE", -1));
298  }
299  else if (m_sysScheme == "Decorr_Scale" || m_sysScheme == "AllSys") {
300  // Either doing direct calib of CB or asking for all the sys
301  if (m_doDirectCBCalib || m_sysScheme == "AllSys") {
302  result.insert(SystematicVariation("MUON_SCALE_CB", 1));
303  result.insert(SystematicVariation("MUON_SCALE_CB", -1));
304 
305  result.insert(SystematicVariation("MUON_SCALE_CB_ELOSS", 1));
306  result.insert(SystematicVariation("MUON_SCALE_CB_ELOSS", -1));
307  }
308 
309  // Either not doing direct calib of CB or asking for all the sys
310  if (!m_doDirectCBCalib || m_sysScheme == "AllSys") {
311  result.insert(SystematicVariation("MUON_SCALE_ID", 1));
312  result.insert(SystematicVariation("MUON_SCALE_ID", -1));
313 
314  result.insert(SystematicVariation("MUON_SCALE_MS", 1));
315  result.insert(SystematicVariation("MUON_SCALE_MS", -1));
316 
317  result.insert(SystematicVariation("MUON_SCALE_MS_ELOSS", 1));
318  result.insert(SystematicVariation("MUON_SCALE_MS_ELOSS", -1));
319  }
320  }
321 
322 
323 
324 
325  return result;
326  }
327 
329 
331  {
337 
343 
349 
350 
351  // ID systematics
352  SystematicVariation syst = systConfig.getSystematicByBaseName("MUON_ID");
353 
354  if (syst == SystematicVariation("MUON_ID", 1)) {
358  } else if (syst == SystematicVariation("MUON_ID", -1)) {
362  } else if (!syst.empty()) return StatusCode::FAILURE;
363 
364  // MS systematics
365  syst = systConfig.getSystematicByBaseName("MUON_MS");
366 
367  if (syst == SystematicVariation("MUON_MS", 1)) {
371  } else if (syst == SystematicVariation("MUON_MS", -1)) {
375  } else if (!syst.empty()) return StatusCode::FAILURE;
376 
377  // CB systematics
378  syst = systConfig.getSystematicByBaseName("MUON_CB");
379 
380  if (syst == SystematicVariation("MUON_CB", 1)) {
384  } else if (syst == SystematicVariation("MUON_CB", -1)) {
388  } else if (!syst.empty()) return StatusCode::FAILURE;
389 
390  // Scale systematics
391  syst = systConfig.getSystematicByBaseName("MUON_SCALE");
392 
393  if (syst == SystematicVariation("MUON_SCALE", 1)) {
396 
399 
402 
403  } else if (syst == SystematicVariation("MUON_SCALE", -1)) {
406 
409 
412  } else if (!syst.empty()) return StatusCode::FAILURE;
413 
414  // Split scale ID/MS/EGloss
415  syst = systConfig.getSystematicByBaseName("MUON_SCALE_ID");
416 
417  if (syst == SystematicVariation("MUON_SCALE_ID", 1)) {
420  } else if (syst == SystematicVariation("MUON_SCALE_ID", -1)) {
423  } else if (!syst.empty()) return StatusCode::FAILURE;
424 
425  syst = systConfig.getSystematicByBaseName("MUON_SCALE_MS");
426 
427  if (syst == SystematicVariation("MUON_SCALE_MS", 1)) {
429  } else if (syst == SystematicVariation("MUON_SCALE_MS", -1)) {
431  } else if (!syst.empty()) return StatusCode::FAILURE;
432 
433  syst = systConfig.getSystematicByBaseName("MUON_SCALE_MS_ELOSS");
434 
435  if (syst == SystematicVariation("MUON_SCALE_MS_ELOSS", 1)) {
437  } else if (syst == SystematicVariation("MUON_SCALE_MS_ELOSS", -1)) {
439  } else if (!syst.empty()) return StatusCode::FAILURE;
440 
441  syst = systConfig.getSystematicByBaseName("MUON_SCALE_CB");
442 
443  if (syst == SystematicVariation("MUON_SCALE_CB", 1)) {
445  } else if (syst == SystematicVariation("MUON_SCALE_CB", -1)) {
447  } else if (!syst.empty()) return StatusCode::FAILURE;
448 
449  syst = systConfig.getSystematicByBaseName("MUON_SCALE_CB_ELOSS");
450 
451  if (syst == SystematicVariation("MUON_SCALE_CB_ELOSS", 1)) {
453  } else if (syst == SystematicVariation("MUON_SCALE_CB_ELOSS", -1)) {
455  } else if (!syst.empty()) return StatusCode::FAILURE;
456 
457  return StatusCode::SUCCESS;
458  }
459 
461  {
462  return m_Parameters.get(systConfig, m_currentParameters);
463  }
464 
465 
466  double MuonCalibIntScaleSmearTool::getExpectedResolution(const int &DetType, double pT, double eta, double phi, MCP::DataYear year, bool addMCCorrectionSmearing) const
467  {
468 
469  auto IDcorrConstants = m_IDparams.at(year);
470  auto MEcorrConstants = m_MEparams.at(year);
471  auto IDExpectedResConstants = m_IDExpectedResparams.at(year);
472  auto MEExpectedResConstants = m_MEExpectedResparams.at(year);
473 
476 
477  auto trk = MCP::TrackCalibObj(type, pT * GeVtoMeV, eta, phi, year, false);
478 
479 
480  double expRes = 0.;
482  {
483  if (pT == 0) return 1e12;
484 
485  double p0 = 0;
486  double p1 = 0;
487  double p2 = 0;
488 
489  if(!addMCCorrectionSmearing)
490  {
491  p0 = MEExpectedResConstants.at(MCP::ExpectedResParam::r0)->getCalibConstant(trk);
492  p1 = MEExpectedResConstants.at(MCP::ExpectedResParam::r1)->getCalibConstant(trk);
493  p2 = MEExpectedResConstants.at(MCP::ExpectedResParam::r2)->getCalibConstant(trk);
494  }
495  else
496  {
497  double expectedP0 = MEExpectedResConstants.at(MCP::ExpectedResParam::r0)->getCalibConstant(trk);
498  double expectedP1 = MEExpectedResConstants.at(MCP::ExpectedResParam::r1)->getCalibConstant(trk);
499  double expectedP2 = MEExpectedResConstants.at(MCP::ExpectedResParam::r2)->getCalibConstant(trk);
500 
501  double r0 = MEcorrConstants.at(MCP::ScaleSmearParam::r0).at(MCP::ScaleResCorrection::Nominal)->getCalibConstant(trk);
502  double r1 = MEcorrConstants.at(MCP::ScaleSmearParam::r1).at(MCP::ScaleResCorrection::Nominal)->getCalibConstant(trk);
503  double r2 = MEcorrConstants.at(MCP::ScaleSmearParam::r2).at(MCP::ScaleResCorrection::Nominal)->getCalibConstant(trk);
504 
505  p0 = std::sqrt(std::pow(expectedP0, 2) + std::pow(r0, 2));
506  p1 = std::sqrt(std::pow(expectedP1, 2) + std::pow(r1, 2));
507  p2 = std::sqrt(std::pow(expectedP2, 2) + std::pow(r2, 2));
508  }
509 
510  expRes = std::sqrt(std::pow(p0 / pT, 2) + std::pow(p1, 2) + std::pow(p2 * pT, 2));
511 
512  }
513  else if (DetType == MCP::DetectorType::ID)
514  {
515  if (pT == 0) return 1e12;
516 
517  double p1 = 0;
518  double p2 = 0;
519 
520  if(!addMCCorrectionSmearing)
521  {
522  p1 = IDExpectedResConstants.at(MCP::ExpectedResParam::r1)->getCalibConstant(trk);
523  p2 = IDExpectedResConstants.at(MCP::ExpectedResParam::r2)->getCalibConstant(trk);
524  double p2Tan = IDExpectedResConstants.at(MCP::ExpectedResParam::r2tan2)->getCalibConstant(trk);
525  if(p2Tan) p2 = p2Tan;
526  }
527  else
528  {
529  double expectedP1 = IDExpectedResConstants.at(MCP::ExpectedResParam::r1)->getCalibConstant(trk);
530  double expectedP2 = IDExpectedResConstants.at(MCP::ExpectedResParam::r2)->getCalibConstant(trk);
531  double p2Tan = IDExpectedResConstants.at(MCP::ExpectedResParam::r2tan2)->getCalibConstant(trk);
532  if(p2Tan) expectedP2 = p2Tan;
533 
534  double r1 = IDcorrConstants.at(MCP::ScaleSmearParam::r1).at(MCP::ScaleResCorrection::Nominal)->getCalibConstant(trk);
535  double r2 = IDcorrConstants.at(MCP::ScaleSmearParam::r2).at(MCP::ScaleResCorrection::Nominal)->getCalibConstant(trk);
536 
537  p1 = std::sqrt(std::pow(expectedP1, 2) + std::pow(r1, 2));
538  p2 = std::sqrt(std::pow(expectedP2, 2) + std::pow(r2, 2));
539 
540  if(p2Tan) p2 = p2 * std::sinh(eta) * std::sinh(eta);
541  }
542 
543  expRes = std::sqrt(std::pow(p1, 2) + std::pow(p2 * pT, 2));
544  return expRes;
545  }
546  else
547  {
548  ATH_MSG_ERROR("wrong DetType in input " << DetType);
549  return 0.;
550  }
551 
552  return expRes;
553  }
554 
555 
556 } // namespace CP
python.Dso.registry
registry
Definition: Control/AthenaServices/python/Dso.py:159
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
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:460
MCP::SystVariation::Default
@ Default
Definition: EnumDef.h:72
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:73
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
max
#define max(a, b)
Definition: cfImp.cxx:41
MCP::DetectorType::ID
@ ID
Definition: EnumDef.h:37
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
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:79
CP::MuonCalibIntScaleSmearTool::affectingSystematics
virtual SystematicSet affectingSystematics() const override
the list of all systematics this tool can be affected by
Definition: MuonCalibIntScaleSmearTool.cxx:271
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
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:226
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:106
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
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::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:171
MCP::toString
std::string toString(TrackType trkType)
Definition: EnumDef.h:39
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MCP::ScaleSmearParam::s1
@ s1
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MCP::SystVariation::Down
@ Down
Definition: EnumDef.h:72
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:328
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:466
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:176
CP::MuonCalibIntScaleSmearTool::isAffectedBySystematic
virtual bool isAffectedBySystematic(const SystematicVariation &systematic) const override
Declare the interface that this class provides.
Definition: MuonCalibIntScaleSmearTool.cxx:265
MCP::CalibInitializer::createScaleResCorrMap
std::map< ScaleResCorrection, std::shared_ptr< CalibContainer > > createScaleResCorrMap(DataYear dataYear, TrackType type, const std::string &recommendationPath, ScaleSmearParam param)
Definition: CalibInitializer.cxx:40
CP::MuonCalibIntScaleSmearTool::m_eventInfo
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Definition: MuonCalibIntScaleSmearTool.h:60
PathResolver.h
GeVtoMeV
#define GeVtoMeV
Purpose: label jets with b or c quarks.
Definition: JetQuarkLabel.cxx:23
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:195
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:159
MuonCalibIntScaleSmearTool.h
MCP::ExpectedResParam::r2tan2
@ r2tan2
CP::MuonCalibIntScaleSmearTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: MuonCalibIntScaleSmearTool.cxx:23
MCP::DetectorType::MS
@ MS
Definition: EnumDef.h:37
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
MCP::SystVariation::Up
@ Up
Definition: EnumDef.h:72
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
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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:330
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:53
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:139
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