ATLAS Offline Software
MuonCalibIntSagittaTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Framework include(s):
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 MuonCalibIntSagittaTool");
27 
28  // Get the m_eventinfo container
30 
31  // Read the recommendations
32  for(const auto& year: MCP::dataYearList)
33  {
37 
38  // Corrections from the MC - what is typically referred to as the kinematic term
42  ATH_MSG_VERBOSE("Sagitta initilised: Year " <<m_release);
43  }
44 
45  m_currentParameters = nullptr;
46  // Init the systematics
47  m_Parameters.initialize(affectingSystematics(), [this](const SystematicSet &systConfig, ParameterSetSagitta &param)
48  { return calcSystematicVariation(systConfig, param); });
50  {
51  ATH_MSG_ERROR("Unable to run with no systematic");
52  return StatusCode::FAILURE;
53  }
55  if (registry.registerSystematics(*this) != StatusCode::SUCCESS)
56  {
57  ATH_MSG_ERROR("Unkown systematic list");
58  return StatusCode::FAILURE;
59  }
60  // Return gracefully:
61  return StatusCode::SUCCESS;
62  }
63 
65  {
66  auto IDCorrections = getCorrections(mu.ID);
67  auto MECorrections = getCorrections(mu.ME);
68  auto CBCorrections = getCorrections(mu.CB);
69 
70  // Directly correct all three tracks
71  double corrIDpT = mu.ID.calib_pt;
72  applySagittaCorrection(corrIDpT, IDCorrections, mu.ID.calib_charge, mu.ID.isData);
73 
74  double corrMEpT = mu.ME.calib_pt;
75  applySagittaCorrection(corrMEpT, MECorrections, mu.ME.calib_charge, mu.ME.isData);
76 
77  double corrDirectCBpT = mu.CB.calib_pt;
78  applySagittaCorrection(corrDirectCBpT, CBCorrections, mu.CB.calib_charge, mu.CB.isData);
79 
80 
81  // Perform the statistical combination of ID + ME, before and after correction. Apply that ratio as a correction to create the weighted rho
82  double corrStatCombCBpT = statCombCorrection(mu, corrIDpT, corrMEpT, mu.CB.calib_pt);
83 
84  // Calculation of rho
85  // The central value is average value and width of muons coming Z
86  // The idea of this rho calculationsi that we want the muons at 45 GeV to get the CB correction
87  // And for it to slowly taper to ID+MS at the low and high pT specturm
88  // All this if rho is dynamically set and not fixed
89  double central(45.2), width(15.5);
90  double rho = 0;
91 
92  // If we are doing the systematic, shift the central values by the expected resolution of the muon
94  {
95  double sigmaID = mu.expectedResID;
96  double sigmaME = mu.expectedResME;
97  double denominator = mu.CB.calib_pt * std::sqrt(sigmaID * sigmaID + sigmaME * sigmaME);
98  double res = denominator ? M_SQRT2 * sigmaID * sigmaME / denominator : 0.;
99 
101  {
102  central += std::abs(0.5 * res * central);
104  {
105  central -= std::abs(0.5 * res * central);
106  }
107  }
108 
109  // Calculate the rho
110  if (!m_useFixedRho)
111  {
112  double sigmas = std::max(1.,(std::abs(mu.CB.calib_pt - central) / width));
113  rho = 1. / sigmas;
114 
115  }
116  else rho = m_fixedRhoValue;
117 
118  // Caculated the corrected pT
119  double corrCBpT = rho * corrDirectCBpT + (1 - rho) * corrStatCombCBpT;
120 
121  ATH_MSG_DEBUG("Saggita correction - corrDirectCBpT: " << corrDirectCBpT << " corrStatCombCBpT: " << corrStatCombCBpT << " rho " << rho<<" corrCBPt: "<<corrCBpT);
122 
123  // Write the pT into the object
124  mu.ID.calib_pt = corrIDpT;
125  mu.ME.calib_pt = corrMEpT;
126  if(m_doDirectCBCalib) mu.CB.calib_pt = corrCBpT;
127  else mu.CB.calib_pt = corrStatCombCBpT;
128 
129  // Return gracefully:
130  return CorrectionCode::Ok;
131  }
132 
133  // This function applies the vector of corrections iteratively to the pT
134  void MuonCalibIntSagittaTool::applySagittaCorrection(double& pt, const std::vector<double>& correction, const int& charge, const bool& isData) const
135  {
136  for(const auto& corr: correction)
137  {
138  double originalPt = pt;
139  if(isData) pt = pt / (1 + charge * corr * pt);
140  else pt = pt / (1 - charge * corr * pt);
141  ATH_MSG_DEBUG("CorrectForCharge - in pT: " << originalPt << " corrPt: " << pt << " applied saggita: " << corr);
142 
143  }
144  }
145 
146 
147  // Get the set of correction, based on data + systematic setting
148  std::vector<double> MuonCalibIntSagittaTool::getCorrections(const MCP::TrackCalibObj& trk) const
149  {
150  double eta = trk.eta;
151  double pT = trk.calib_pt;
152  SagittaCorrConstMap const *corrMap{nullptr};
153  SagittaCorrConstMap const *kinematicTermMap{nullptr};
154  if(trk.type == MCP::TrackType::CB)
155  {
156  corrMap = &m_sagittaCorrConst_CB.at(trk.year);
157  kinematicTermMap = &m_sagittaCorrConst_mcCB.at(trk.year);
158  }
159  else if(trk.type == MCP::TrackType::ID)
160  {
161  corrMap = &m_sagittaCorrConst_ID.at(trk.year);
162  kinematicTermMap = &m_sagittaCorrConst_mcID.at(trk.year);
163  }
164  else if(trk.type == MCP::TrackType::ME)
165  {
166  corrMap = &m_sagittaCorrConst_ME.at(trk.year);
167  kinematicTermMap = &m_sagittaCorrConst_mcME.at(trk.year);
168  }
169 
170  std::vector<double> corrections;
171  if(trk.isData)
172  {
173  if(!m_applyCorrectionOnData) return corrections;
174  else if (m_applyCorrectionOnData)
175  {
176  // Apply data - kinematic term for the nominal
177  double corr = corrMap->at(MCP::SagittaCorrection::Nominal)->getCalibConstant(trk);
178  corr -= kinematicTermMap->at(MCP::SagittaCorrection::Nominal)->getCalibConstant(trk);
179  corrections.push_back(corr);
180  }
181  }
182  else // if it is MC
183  {
184  // Otherwise do as needed
186  {
188  // Sanity check
190  {
191  ATH_MSG_ERROR("Sagitta correction is not applied to data, yet Eta dependant systematics are requested. This configuration is not supported");
192  return corrections;
193  }
194 
195  // if no apply correction on data, apply 100% of (Data - kinematic term)
196  // TODO: Check if it 50% or 100%?
198  {
199  // Apply data - kinematic term for the nominal
200  double corr = corrMap->at(MCP::SagittaCorrection::Nominal)->getCalibConstant(trk);
201  ATH_MSG_VERBOSE("Raw corr: "<<corr);
202  // corr -= kinematicTermMap->at(MCP::SagittaCorrection::Nominal)->getCalibConstant(eta, phi);
203  // ATH_MSG_VERBOSE("Raw - Kinematic corr: "<<corr);
204  corr *= (scale);
205  ATH_MSG_VERBOSE("corr: "<<corr);
206  corrections.push_back(corr);
207  }
208 
209  // 100% of resbiasMap added as res bias
210  double corr = corrMap->at(MCP::SagittaCorrection::Residual__1up)->getCalibConstant(trk);
211  corr *= scale;
212  ATH_MSG_VERBOSE("Residual corr: "<<corr);
213 
214  // If eta dependant, set the p2 to 0, if it not in the given eta slices
215  if ((m_currentParameters->SagittaEtaSlice == MCP::SystVariation::Up) && eta < 0) corr = 0;
216  if ((m_currentParameters->SagittaEtaSlice == MCP::SystVariation::Down) && eta > 0) corr = 0;
217 
218  corrections.push_back(corr);
219  ATH_MSG_VERBOSE("final corr: "<<corr);
220  }
222  {
224 
225  double deltas = m_extraRebiasSys;
226  // systematic for Run3 data 2022
227  if (trk.year==MCP::DataYear::Data22) {
228  if(m_release.value().find("Recs2023") != std::string::npos) deltas = 1.2 * deltas;
229  else if(std::abs(eta)>1.05) deltas = 1.5 * deltas;
230  }
231  double corr = deltas * scale;
232  ATH_MSG_VERBOSE("Deltas corr: "<<deltas);
233 
234  corrections.push_back(corr);
235  ATH_MSG_VERBOSE("final corr: "<<corr);
236 
237  }
239  {
241 
242  // Extra scaling to cover for non-closure in the forward and transition region
243  // As seen in the Rel 21 validation of the sagitta correction
244  // It is only concetrateed in a few high eta bin. Idea is to apply a linearly increasing sys
245  // Till it reach 450 GeV and then to flatten it.
246  // The value is chosen in an arbitrary fashion. To be replaced and fixed, once we have a better idea of
247  double corr = 0;
248  double deltas = 0.00002;
249  if (eta > 2 || (eta > -2 && eta < -1.05)) {
250  if (pT > 450.0)
251  corr += std::abs(450.0 - 45) / 100 * deltas; // Above 450 GeV flat
252  else
253  corr += std::abs(pT - 45) / 100 * deltas;
254  }
255  if (eta < -2 || (eta < 2 && eta> 1.5)) {
256  if (pT > 450.0)
257  corr += std::abs(450.0 - 45) / 200 * deltas; // Above 450 GeV flat
258  else
259  corr += std::abs(pT - 45) / 200 * deltas;
260  }
261  // additional uncertainties for 2022 data
262  if (m_release.value().find("Recs2023") != std::string::npos) {
263  if ( (trk.year==MCP::DataYear::Data22) && pT > 100.0) {
264  if (eta < 0 && eta> -0.5) corr += 2.1*deltas;
265  else if (eta < -1.05) corr += 1.1*deltas;
266  else if (eta > 0.5 ) corr += 0.8*deltas;
267  }
268  } else {
269  if ( trk.year==MCP::DataYear::Data22 ) {
270  if (eta > -2 && eta < -1.05) corr = corr*2.5;
271  if (eta < -2) corr = corr*6;
272  if (eta > 1.5 && eta < 2) {
273  if (pT > 450.0)
274  corr += std::abs(450.0 - 45) / 80 * deltas; // Above 450 GeV flat
275  else
276  corr += std::abs(pT - 45) / 80 * deltas;
277  }
278  if (eta > 1.05 && eta < 1.5) {
279  if (pT > 450.0)
280  corr += std::abs(450.0 - 45) / 40 * deltas; // Above 450 GeV flat
281  else
282  corr += std::abs(pT - 45) / 40 * deltas;
283  }
284  }
285  }
286  ATH_MSG_VERBOSE("Deltas corr: "<<deltas);
287 
288 
289  corrections.push_back(corr*scale);
290  ATH_MSG_VERBOSE("final corr: "<<corr);
291 
292  }
294  {
296  // Apply 50% of the datastat map, up and down as stat error
297  // TODO change to 100%
298  // -1 is to match the convention
299  double corr = corrMap->at(MCP::SagittaCorrection::Datastat__1up)->getCalibConstant(trk);
300  corr *= (0.5 * scale);
301  ATH_MSG_VERBOSE("data stat final corr: "<<corr);
302  corrections.push_back(corr);
303  }
305  {
306  // For rho systematic, nothing happens right now
307  }
308  else
309  {
310  // if it is MC, then for nominal corrections - we don't apply anything
311  }
312  }
313 
314  return corrections;
315  }
316 
317 
318  double MuonCalibIntSagittaTool::statCombCorrection(const MCP::MuonObj& mu, double corrIDpT, double corrMEpT, double CBpT) const
319  {
320  ATH_MSG_VERBOSE("Sag mu.ID.calib_pt: "<<mu.ID.calib_pt);
321  ATH_MSG_VERBOSE("Sag mu.ME.calib_pt: "<<mu.ME.calib_pt);
322  ATH_MSG_VERBOSE("Sag mu.CB.calib_pt: "<<mu.CB.calib_pt);
323 
324  // Corner cases to prevent a NaN in the combination
325  if(mu.ID.calib_pt == 0) return CBpT;
326  if(mu.ME.calib_pt == 0) return CBpT;
327  if(corrIDpT == 0) return CBpT;
328  if(corrMEpT == 0) return CBpT;
329 
330  double chi2Nom = -999;
331  AmgVector(5) parsCBNom = mu.CB.pars;
332  AmgVector(5) parsID = mu.ID.pars;
333  AmgVector(5) parsMS = mu.ME.pars;
334  AmgSymMatrix(5) covCBNom = mu.CB.covariance;
335  AmgSymMatrix(5) covID = mu.ID.covariance;
336  AmgSymMatrix(5) covMS = mu.ME.covariance;
337 
338  AmgVector(5) parsCBCorr;
339  AmgSymMatrix(5) covCBCorr;
340 
341  // Do the statistical combination, with the original pTs
342  // create the TLV with original ID pT
343  using TLV = ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double>>;
344  TLV tlv{mu.ID.calib_pt, mu.ID.eta, mu.ID.phi, mu.ID.mass};
345  // Now modify the ID covariance matrix, and convert it to MeV
346  if(tlv.P() == 0) parsID[4] = 1e12;
347  else parsID[4] = 1.0 / (tlv.P() * 1e3);
348 
349  tlv.SetCoordinates(mu.ME.calib_pt, mu.ME.eta, mu.ME.phi, mu.ME.mass);
350  // Now modify the ME covariance matrix
351  if(tlv.P() == 0) parsMS[4] = 1e12;
352  else parsMS[4] = 1.0 / (tlv.P() * 1e3);
353 
354  CorrectionCode SysCorrCode = applyStatCombination(parsID, covID, parsMS, covMS, mu.CB.calib_charge, parsCBNom, covCBNom, chi2Nom);
355  if (SysCorrCode != CorrectionCode::Ok) return CBpT;
356 
357 
358  // Do the statistical combination, with the original pTs
359  // create the TLV with original ID pT
360  tlv.SetCoordinates(corrIDpT, mu.ID.eta, mu.ID.phi, mu.ID.mass);
361  // Now modify the ID covariance matrix, and convert it to MeV
362  if(tlv.P() == 0) parsID[4] = 1e12;
363  else parsID[4] = 1.0 / (tlv.P() * 1e3);
364 
365  tlv.SetCoordinates(corrMEpT, mu.ME.eta, mu.ME.phi, mu.ME.mass);
366  // Now modify the ME covariance matrix
367  if(tlv.P() == 0) parsMS[4] = 1e12;
368  else parsMS[4] = 1.0 / (tlv.P() * 1e3);
369 
370  SysCorrCode = applyStatCombination(parsID, covID, parsMS, covMS, mu.CB.calib_charge, parsCBCorr, covCBCorr, chi2Nom);
371  if (SysCorrCode != CorrectionCode::Ok) return CBpT;
372 
373 
374  double statCombPtNom = std::sin(parsCBNom[3]) / std::abs(parsCBNom[4]);
375  double statCombPtCorr = std::sin(parsCBCorr[3]) / std::abs(parsCBCorr[4]);
376  double corrCBpT = CBpT * (statCombPtCorr / statCombPtNom);
377 
378  return corrCBpT;
379 
380  }
382  const AmgSymMatrix(5)& covMS, int charge, AmgVector(5) & parsCB,
383  AmgSymMatrix(5) & covCB, double& chi2) const {
384  chi2 = 1e20;
385  parsID[4] = std::abs(parsID[4]);
386  parsMS[4] = std::abs(parsMS[4]);
387 
388 
389  Eigen::FullPivLU<AmgSymMatrix(5)> matID(covID);
390  if (!matID.isInvertible()) {
391  ATH_MSG_DEBUG(" ID weight matrix computation failed ");
392  return CorrectionCode::Error;
393  }
394  const AmgSymMatrix(5) weightID = matID.inverse();
395 
396 
397  Eigen::FullPivLU<AmgSymMatrix(5)> matMS(covMS);
398  if (!matMS.isInvertible()) {
399  ATH_MSG_DEBUG(" MS weight matrix computation failed ");
400  return CorrectionCode::Error;
401  }
402  const AmgSymMatrix(5) weightMS = matMS.inverse();
403 
404 
405  Eigen::FullPivLU<AmgSymMatrix(5)> matCB(weightID + weightMS);
406  if (!matCB.isInvertible()) {
407  ATH_MSG_DEBUG(" Inversion of weightCB failed ");
408  return CorrectionCode::Error;
409  }
410  covCB = matCB.inverse();
411 
412 
413  Eigen::FullPivLU<AmgSymMatrix(5)> matSum(covID + covMS);
414  if (!matSum.isInvertible()) {
415  ATH_MSG_DEBUG(" Inversion of weightCB failed ");
416  return CorrectionCode::Error;
417  }
418  AmgSymMatrix(5) invCovSum = matSum.inverse();
419 
420 
421  AmgVector(5) diffPars = parsID - parsMS;
422  chi2 = diffPars.transpose() * invCovSum * diffPars;
423  chi2 = chi2 / 5.;
424 
425  parsCB = covCB * (weightID * parsID + weightMS * parsMS);
426  parsCB[4] *= charge;
427 
428  if (parsCB[2] > M_PI)
429  parsCB[2] -= 2. * M_PI;
430  else if (parsCB[2] < -M_PI)
431  parsCB[2] += 2. * M_PI;
432  return CorrectionCode::Ok;
433  }
434 
435 
436 
438  {
440  return sys.find(systematic) != sys.end();
441  }
442 
444  {
449  if (!m_useFixedRho || m_sysScheme == "AllSys") {
450  result.insert(SystematicVariation("MUON_SAGITTA_RHO", 1));
451  result.insert(SystematicVariation("MUON_SAGITTA_RHO", -1));
452  }
453 
454  if (m_doEtaSagittaSys) {
455  // Sagitta correction residual bias
456  result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS_NEGETA", 1));
457  result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS_NEGETA", -1));
458 
459  result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS_POSETA", 1));
460  result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS_POSETA", -1));
461 
462  }
463  else {
464  // Sagitta correction residual bias
465  result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS", 1));
466  result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS", -1));
467  }
468 
469  result.insert(SystematicVariation("MUON_SAGITTA_DATASTAT", 1));
470  result.insert(SystematicVariation("MUON_SAGITTA_DATASTAT", -1));
471 
472  result.insert(SystematicVariation("MUON_SAGITTA_GLOBAL", 1));
473  result.insert(SystematicVariation("MUON_SAGITTA_GLOBAL", -1));
474 
475  result.insert(SystematicVariation("MUON_SAGITTA_PTEXTRA", 1));
476  result.insert(SystematicVariation("MUON_SAGITTA_PTEXTRA", -1));
477 
478  return result;
479  }
480 
482 
484  {
491 
492  // Sagitta Rho systematics
493  SystematicVariation syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_RHO");
494 
495  if (syst == SystematicVariation("MUON_SAGITTA_RHO", 1)) param.SagittaRho = MCP::SystVariation::Down;
496  else if (syst == SystematicVariation("MUON_SAGITTA_RHO", -1)) param.SagittaRho = MCP::SystVariation::Up;
497  else if (!syst.empty()) return StatusCode::FAILURE;
498 
499  // Sagitta Residual Bias systematics
500  syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_RESBIAS");
501 
502  if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS", 1)) param.SagittaBias = MCP::SystVariation::Down;
503  else if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS", -1)) param.SagittaBias = MCP::SystVariation::Up;
504  else if (!syst.empty()) return StatusCode::FAILURE;
505 
506  // Sagitta Residual Global Bias systematics
507  syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_GLOBAL");
508 
509  if (syst == SystematicVariation("MUON_SAGITTA_GLOBAL", 1)) param.SagittaGlobal = MCP::SystVariation::Down;
510  else if (syst == SystematicVariation("MUON_SAGITTA_GLOBAL", -1)) param.SagittaGlobal = MCP::SystVariation::Up;
511  else if (!syst.empty()) return StatusCode::FAILURE;
512 
513  // Sagitta Residual Bias systematics pt extrapolation
514  syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_PTEXTRA");
515 
516  if (syst == SystematicVariation("MUON_SAGITTA_PTEXTRA", 1)) param.SagittaPtExtra = MCP::SystVariation::Down;
517  else if (syst == SystematicVariation("MUON_SAGITTA_PTEXTRA", -1)) param.SagittaPtExtra = MCP::SystVariation::Up;
518  else if (!syst.empty()) return StatusCode::FAILURE;
519 
520  // Sagitta Residual Bias systematics
521  syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_RESBIAS_POSETA");
522 
523  if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS_POSETA", 1))
524  {
527  }
528  else if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS_POSETA", -1))
529  {
532  }
533  else if (!syst.empty()) return StatusCode::FAILURE;
534 
535  // Sagitta Residual Bias systematics
536  syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_RESBIAS_NEGETA");
537 
538  if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS_NEGETA", 1))
539  {
542  }
543  else if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS_NEGETA", -1))
544  {
547  }
548  else if (!syst.empty()) return StatusCode::FAILURE;
549 
550  // Sagitta Residual Bias systematics
551  syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_DATASTAT");
552 
553  if (syst == SystematicVariation("MUON_SAGITTA_DATASTAT", 1)) param.SagittaDataStat = MCP::SystVariation::Up;
554  else if (syst == SystematicVariation("MUON_SAGITTA_DATASTAT", -1)) param.SagittaDataStat = MCP::SystVariation::Down;
555  else if (!syst.empty()) return StatusCode::FAILURE;
556 
557  //
558  ATH_MSG_DEBUG("Systematic variation's parameters, SagittaRho: " << param.SagittaRho);
559  ATH_MSG_DEBUG("Systematic variation's parameters, SagittaBias: " << param.SagittaBias);
560  ATH_MSG_DEBUG("Systematic variation's parameters, SagittaGlobal: " << param.SagittaGlobal);
561  ATH_MSG_DEBUG("Systematic variation's parameters, SagittaPtExtra: " << param.SagittaPtExtra);
562  ATH_MSG_DEBUG("Systematic variation's parameters, SagittaDataStat: " << param.SagittaDataStat);
563  ATH_MSG_DEBUG("Systematic variation's parameters, SagittaEtaSlice: " << param.SagittaEtaSlice);
564 
565  return StatusCode::SUCCESS;
566  }
567 
569  {
570  return m_Parameters.get(systConfig, m_currentParameters);
571  }
572 
573 
574 
575 } // namespace CP
python.Dso.registry
registry
Definition: Control/AthenaServices/python/Dso.py:159
CP::MuonCalibIntSagittaTool::m_sagittaCorrConst_mcCB
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_mcCB
Definition: MuonCalibIntSagittaTool.h:105
CP::MuonCalibIntSagittaTool::statCombCorrection
double statCombCorrection(const MCP::MuonObj &mu, double corrIDpT, double corrMEpT, double CBpT) const
Definition: MuonCalibIntSagittaTool.cxx:318
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
MCP::SagittaCorrection::Residual__1up
@ Residual__1up
CP::MuonCalibIntSagittaTool::ParameterSetSagitta::SagittaBias
double SagittaBias
Definition: MuonCalibIntSagittaTool.h:82
get_generator_info.result
result
Definition: get_generator_info.py:21
CP::MuonCalibIntSagittaTool::applySagittaCorrection
void applySagittaCorrection(double &pt, const std::vector< double > &correction, const int &charge, const bool &isData) const
Definition: MuonCalibIntSagittaTool.cxx:134
max
#define max(a, b)
Definition: cfImp.cxx:41
CP::MuonCalibIntSagittaTool::m_useFixedRho
Gaudi::Property< bool > m_useFixedRho
Definition: MuonCalibIntSagittaTool.h:72
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CP::MuonCalibIntSagittaTool::MuonCalibIntSagittaTool
MuonCalibIntSagittaTool(const std::string &name)
Definition: MuonCalibIntSagittaTool.cxx:20
CP::MuonCalibIntSagittaTool::ParameterSetSagitta::SagittaDataStat
double SagittaDataStat
Definition: MuonCalibIntSagittaTool.h:85
CP::MuonCalibIntSagittaTool::calcSystematicVariation
StatusCode calcSystematicVariation(const SystematicSet &systConfig, ParameterSetSagitta &param) const
Definition: MuonCalibIntSagittaTool.cxx:483
xAODP4Helpers.h
CP::MuonCalibIntSagittaTool::m_sagittaCorrConst_CB
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_CB
Definition: MuonCalibIntSagittaTool.h:100
CP::MuonCalibIntSagittaTool::m_sagittaCorrConst_ID
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_ID
Definition: MuonCalibIntSagittaTool.h:98
CP::MuonCalibIntSagittaTool::ParameterSetSagitta::SagittaPtExtra
double SagittaPtExtra
Definition: MuonCalibIntSagittaTool.h:84
CP::MuonCalibIntSagittaTool::m_eventInfo
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Definition: MuonCalibIntSagittaTool.h:59
asg
Definition: DataHandleTestTool.h:28
test_pyathena.pt
pt
Definition: test_pyathena.py:11
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
M_PI
#define M_PI
Definition: ActiveFraction.h:11
CP::MuonCalibIntSagittaTool::m_sysScheme
Gaudi::Property< std::string > m_sysScheme
Definition: MuonCalibIntSagittaTool.h:76
CP::MuonCalibIntSagittaTool::m_extraRebiasSys
Gaudi::Property< float > m_extraRebiasSys
Definition: MuonCalibIntSagittaTool.h:77
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::MuonCalibIntSagittaTool::m_doEtaSagittaSys
Gaudi::Property< bool > m_doEtaSagittaSys
Definition: MuonCalibIntSagittaTool.h:65
CP::SystematicVariation
Definition: SystematicVariation.h:47
python.AtlRunQueryAMI.year
year
Definition: AtlRunQueryAMI.py:226
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
CP::MuonCalibIntSagittaTool::affectingSystematics
virtual SystematicSet affectingSystematics() const override
the list of all systematics this tool can be affected by
Definition: MuonCalibIntSagittaTool.cxx:443
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
CP::MuonCalibIntSagittaTool::ParameterSetSagitta::SagittaRho
double SagittaRho
Definition: MuonCalibIntSagittaTool.h:81
MCP::TrackCalibObj::year
const DataYear year
Definition: MuonObj.h:114
CP::MuonCalibIntSagittaTool::m_release
Gaudi::Property< std::string > m_release
Definition: MuonCalibIntSagittaTool.h:62
CP::MuonCalibIntSagittaTool::applyStatCombination
CorrectionCode applyStatCombination(AmgVector(5) parsID, const AmgSymMatrix(5)&covID, AmgVector(5) parsMS, const AmgSymMatrix(5)&covMS, int charge, AmgVector(5) &parsCB, AmgSymMatrix(5) &covCB, double &chi2) const
Definition: MuonCalibIntSagittaTool.cxx:381
MCP::SagittaCorrection::Datastat__1up
@ Datastat__1up
tools.zlumi_mc_cf.correction
def correction(mu, runmode, campaign, run=None)
Definition: zlumi_mc_cf.py:4
CP::SystematicSet::getSystematicByBaseName
SystematicVariation getSystematicByBaseName(const std::string &basename) const
description: get the first systematic matching basename
Definition: SystematicSet.cxx:171
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
CP::MuonCalibIntSagittaTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: MuonCalibIntSagittaTool.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
CP::MuonCalibIntSagittaTool::m_Parameters
SystematicsCache< ParameterSetSagitta > m_Parameters
Definition: MuonCalibIntSagittaTool.h:92
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
CP::MuonCalibIntSagittaTool::m_sagittaCorrConst_mcME
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_mcME
Definition: MuonCalibIntSagittaTool.h:104
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
CP::MuonCalibIntSagittaTool::ParameterSetSagitta::SagittaEtaSlice
double SagittaEtaSlice
Definition: MuonCalibIntSagittaTool.h:86
CP::MuonCalibIntSagittaTool::recommendedSystematics
virtual SystematicSet recommendedSystematics() const override
the list of all systematics this tool recommends to use
Definition: MuonCalibIntSagittaTool.cxx:481
MCP::SystVariation::Up
@ Up
Definition: EnumDef.h:73
ReadTripsProbsFromCool.denominator
denominator
Definition: ReadTripsProbsFromCool.py:96
CP::MuonCalibIntSagittaTool::applySystematicVariation
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig) override
effects: configure this tool for the given list of systematic variations.
Definition: MuonCalibIntSagittaTool.cxx:568
MCP::TrackCalibObj::eta
const double eta
Value of the track-eta.
Definition: MuonObj.h:104
CP::MuonCalibIntSagittaTool::SagittaCorrConstMap
std::map< MCP::SagittaCorrection, std::shared_ptr< MCP::CalibContainer > > SagittaCorrConstMap
Definition: MuonCalibIntSagittaTool.h:95
CP::MuonCalibIntSagittaTool::m_sagittaCorrConst_mcID
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_mcID
Definition: MuonCalibIntSagittaTool.h:103
PathResolver.h
MCP::TrackCalibObj::type
const TrackType type
Flag telling the code whether this is CB/ME/ID.
Definition: MuonObj.h:96
CP::MuonCalibIntSagittaTool::ParameterSetSagitta::SagittaGlobal
double SagittaGlobal
Definition: MuonCalibIntSagittaTool.h:83
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonCalibIntSagittaTool.h
ReadHandle.h
Handle class for reading from StoreGate.
MCP::SystVariation::Default
@ Default
Definition: EnumDef.h:73
charge
double charge(const T &p)
Definition: AtlasPID.h:538
MCP::TrackCalibObj::calib_pt
double calib_pt
Smeared track pt.
Definition: MuonObj.h:102
CP::MuonCalibIntSagittaTool::m_sagittaCorrConst_ME
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_ME
Definition: MuonCalibIntSagittaTool.h:99
EnumDef.h
MCP::TrackType::CB
@ CB
CP::MuonCalibIntSagittaTool::isAffectedBySystematic
virtual ASG_TOOL_CLASS3(MuonCalibIntSagittaTool, CP::IMuonCalibIntTool, CP::ISystematicsTool, CP::IReentrantSystematicsTool) public bool isAffectedBySystematic(const SystematicVariation &systematic) const override
Declare the interface that this class provides.
Definition: MuonCalibIntSagittaTool.cxx:437
CP::MuonCalibIntSagittaTool::m_applyCorrectionOnData
Gaudi::Property< bool > m_applyCorrectionOnData
Definition: MuonCalibIntSagittaTool.h:66
MCP::SagittaCorrection::Nominal
@ Nominal
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
CP::MuonCalibIntSagittaTool::ParameterSetSagitta
Definition: MuonCalibIntSagittaTool.h:80
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
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
MCP::TrackCalibObj::isData
const bool isData
Definition: MuonObj.h:116
MCP::MuonObj
Definition: MuonObj.h:126
MCP::CalibInitializer::createSagittaCorrMap
std::map< SagittaCorrection, std::shared_ptr< CalibContainer > > createSagittaCorrMap(DataYear dataYear, TrackType type, const std::string &recommendationPath, const std::string &correctionType)
Definition: CalibInitializer.cxx:13
MCP::SystVariation::Down
@ Down
Definition: EnumDef.h:73
CP::MuonCalibIntSagittaTool::m_doDirectCBCalib
Gaudi::Property< bool > m_doDirectCBCalib
Definition: MuonCalibIntSagittaTool.h:69
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
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
CP::MuonCalibIntSagittaTool::m_fixedRhoValue
Gaudi::Property< float > m_fixedRhoValue
Definition: MuonCalibIntSagittaTool.h:73
MCP::DataYear::Data22
@ Data22
MCP::TrackType::ME
@ ME
fitman.rho
rho
Definition: fitman.py:532
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
CP::MuonCalibIntSagittaTool::getCorrections
std::vector< double > getCorrections(const MCP::TrackCalibObj &mu) const
Definition: MuonCalibIntSagittaTool.cxx:148
CP::MuonCalibIntSagittaTool::m_currentParameters
const ParameterSetSagitta * m_currentParameters
Definition: MuonCalibIntSagittaTool.h:93