ATLAS Offline Software
Loading...
Searching...
No Matches
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
17namespace CP
18{
19
22
24 {
25 // Greet the user:
26 ATH_MSG_INFO("Initializing MuonCalibIntSagittaTool");
27
28 // Get the m_eventinfo container
29 ATH_CHECK(m_eventInfo.initialize());
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
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;
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 {
187 int scale = (m_currentParameters->SagittaBias == MCP::SystVariation::Up) ? 1: -1;
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 }
221 else if(m_currentParameters->SagittaGlobal != MCP::SystVariation::Default)
222 {
223 int scale = (m_currentParameters->SagittaGlobal == MCP::SystVariation::Up) ? 1: -1;
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 }
238 else if(m_currentParameters->SagittaPtExtra != MCP::SystVariation::Default)
239 {
240 int scale = (m_currentParameters->SagittaPtExtra == MCP::SystVariation::Up) ? 1: -1;
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
250 if (corrMap->at(MCP::SagittaCorrection::PtExtra__1up)->mapExist()) {
251 deltas = corrMap->at(MCP::SagittaCorrection::PtExtra__1up)->getCalibConstant(trk);
252 if (pT > 450.0)
253 corr += std::abs(450.0 - 45) * deltas; // Above 450 GeV flat
254 else
255 corr += std::abs(pT - 45) * deltas;
256 } else {
257 // old style uncertainty for Run2 and early Run3 recommendations
258 if (eta > 2 || (eta > -2 && eta < -1.05)) {
259 if (pT > 450.0)
260 corr += std::abs(450.0 - 45) / 100 * deltas; // Above 450 GeV flat
261 else
262 corr += std::abs(pT - 45) / 100 * deltas;
263 }
264 if (eta < -2 || (eta < 2 && eta> 1.5)) {
265 if (pT > 450.0)
266 corr += std::abs(450.0 - 45) / 200 * deltas; // Above 450 GeV flat
267 else
268 corr += std::abs(pT - 45) / 200 * deltas;
269 }
270 // additional uncertainties for 2022 data
271 if (m_release.value().find("Recs2023") != std::string::npos) {
272 if ( (trk.year==MCP::DataYear::Data22) && pT > 100.0) {
273 if (eta < 0 && eta> -0.5) corr += 2.1*deltas;
274 else if (eta < -1.05) corr += 1.1*deltas;
275 else if (eta > 0.5 ) corr += 0.8*deltas;
276 }
277 } else {
278 if ( trk.year==MCP::DataYear::Data22 ) {
279 if (eta > -2 && eta < -1.05) corr = corr*2.5;
280 if (eta < -2) corr = corr*6;
281 if (eta > 1.5 && eta < 2) {
282 if (pT > 450.0)
283 corr += std::abs(450.0 - 45) / 80 * deltas; // Above 450 GeV flat
284 else
285 corr += std::abs(pT - 45) / 80 * deltas;
286 }
287 if (eta > 1.05 && eta < 1.5) {
288 if (pT > 450.0)
289 corr += std::abs(450.0 - 45) / 40 * deltas; // Above 450 GeV flat
290 else
291 corr += std::abs(pT - 45) / 40 * deltas;
292 }
293 }
294 }
295 // done for old style uncertainty for Run2 and early Run3 recommendations
296 }
297
298 corrections.push_back(corr*scale);
299 ATH_MSG_VERBOSE("High pT variation for pT "<<pT<<" deltas "<<deltas<<" final corr: "<<corr);
300
301 }
302 else if(m_currentParameters->SagittaDataStat != MCP::SystVariation::Default)
303 {
304 int scale = (m_currentParameters->SagittaDataStat == MCP::SystVariation::Up) ? 1: -1;
305 // Apply 50% of the datastat map, up and down as stat error
306 // TODO change to 100%
307 // -1 is to match the convention
308 double corr = corrMap->at(MCP::SagittaCorrection::Datastat__1up)->getCalibConstant(trk);
309 corr *= (0.5 * scale);
310 ATH_MSG_VERBOSE("data stat final corr: "<<corr);
311 corrections.push_back(corr);
312 }
314 {
315 // For rho systematic, nothing happens right now
316 }
317 else
318 {
319 // if it is MC, then for nominal corrections - we don't apply anything
320 }
321 }
322
323 return corrections;
324 }
325
326
327 double MuonCalibIntSagittaTool::statCombCorrection(const MCP::MuonObj& mu, double corrIDpT, double corrMEpT, double CBpT) const
328 {
329 ATH_MSG_VERBOSE("Sag mu.ID.calib_pt: "<<mu.ID.calib_pt);
330 ATH_MSG_VERBOSE("Sag mu.ME.calib_pt: "<<mu.ME.calib_pt);
331 ATH_MSG_VERBOSE("Sag mu.CB.calib_pt: "<<mu.CB.calib_pt);
332
333 // Corner cases to prevent a NaN in the combination
334 if(mu.ID.calib_pt == 0) return CBpT;
335 if(mu.ME.calib_pt == 0) return CBpT;
336 if(corrIDpT == 0) return CBpT;
337 if(corrMEpT == 0) return CBpT;
338
339 double chi2Nom = -999;
340 AmgVector(5) parsCBNom = mu.CB.pars;
341 AmgVector(5) parsID = mu.ID.pars;
342 AmgVector(5) parsMS = mu.ME.pars;
343 AmgSymMatrix(5) covCBNom = mu.CB.covariance;
344 AmgSymMatrix(5) covID = mu.ID.covariance;
345 AmgSymMatrix(5) covMS = mu.ME.covariance;
346
347 AmgVector(5) parsCBCorr;
348 AmgSymMatrix(5) covCBCorr;
349
350 // Do the statistical combination, with the original pTs
351 // create the TLV with original ID pT
352 using TLV = ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double>>;
353 TLV tlv{mu.ID.calib_pt, mu.ID.eta, mu.ID.phi, mu.ID.mass};
354 // Now modify the ID covariance matrix, and convert it to MeV
355 if(tlv.P() == 0) parsID[4] = 1e12;
356 else parsID[4] = 1.0 / (tlv.P() * 1e3);
357
358 tlv.SetCoordinates(mu.ME.calib_pt, mu.ME.eta, mu.ME.phi, mu.ME.mass);
359 // Now modify the ME covariance matrix
360 if(tlv.P() == 0) parsMS[4] = 1e12;
361 else parsMS[4] = 1.0 / (tlv.P() * 1e3);
362
363 CorrectionCode SysCorrCode = applyStatCombination(parsID, covID, parsMS, covMS, mu.CB.calib_charge, parsCBNom, covCBNom, chi2Nom);
364 if (SysCorrCode != CorrectionCode::Ok) return CBpT;
365
366
367 // Do the statistical combination, with the original pTs
368 // create the TLV with original ID pT
369 tlv.SetCoordinates(corrIDpT, mu.ID.eta, mu.ID.phi, mu.ID.mass);
370 // Now modify the ID covariance matrix, and convert it to MeV
371 if(tlv.P() == 0) parsID[4] = 1e12;
372 else parsID[4] = 1.0 / (tlv.P() * 1e3);
373
374 tlv.SetCoordinates(corrMEpT, mu.ME.eta, mu.ME.phi, mu.ME.mass);
375 // Now modify the ME covariance matrix
376 if(tlv.P() == 0) parsMS[4] = 1e12;
377 else parsMS[4] = 1.0 / (tlv.P() * 1e3);
378
379 SysCorrCode = applyStatCombination(parsID, covID, parsMS, covMS, mu.CB.calib_charge, parsCBCorr, covCBCorr, chi2Nom);
380 if (SysCorrCode != CorrectionCode::Ok) return CBpT;
381
382
383 double statCombPtNom = std::sin(parsCBNom[3]) / std::abs(parsCBNom[4]);
384 double statCombPtCorr = std::sin(parsCBCorr[3]) / std::abs(parsCBCorr[4]);
385 double corrCBpT = CBpT * (statCombPtCorr / statCombPtNom);
386
387 return corrCBpT;
388
389 }
391 const AmgSymMatrix(5)& covMS, int charge, AmgVector(5) & parsCB,
392 AmgSymMatrix(5) & covCB, double& chi2) const {
393 chi2 = 1e20;
394 parsID[4] = std::abs(parsID[4]);
395 parsMS[4] = std::abs(parsMS[4]);
396
397
398 Eigen::FullPivLU<AmgSymMatrix(5)> matID(covID);
399 if (!matID.isInvertible()) {
400 ATH_MSG_DEBUG(" ID weight matrix computation failed ");
402 }
403 const AmgSymMatrix(5) weightID = matID.inverse();
404
405
406 Eigen::FullPivLU<AmgSymMatrix(5)> matMS(covMS);
407 if (!matMS.isInvertible()) {
408 ATH_MSG_DEBUG(" MS weight matrix computation failed ");
410 }
411 const AmgSymMatrix(5) weightMS = matMS.inverse();
412
413
414 Eigen::FullPivLU<AmgSymMatrix(5)> matCB(weightID + weightMS);
415 if (!matCB.isInvertible()) {
416 ATH_MSG_DEBUG(" Inversion of weightCB failed ");
418 }
419 covCB = matCB.inverse();
420
421
422 Eigen::FullPivLU<AmgSymMatrix(5)> matSum(covID + covMS);
423 if (!matSum.isInvertible()) {
424 ATH_MSG_DEBUG(" Inversion of weightCB failed ");
426 }
427 AmgSymMatrix(5) invCovSum = matSum.inverse();
428
429
430 AmgVector(5) diffPars = parsID - parsMS;
431 chi2 = diffPars.transpose() * invCovSum * diffPars;
432 chi2 = chi2 / 5.;
433
434 parsCB = covCB * (weightID * parsID + weightMS * parsMS);
435 parsCB[4] *= charge;
436
437 if (parsCB[2] > M_PI)
438 parsCB[2] -= 2. * M_PI;
439 else if (parsCB[2] < -M_PI)
440 parsCB[2] += 2. * M_PI;
441 return CorrectionCode::Ok;
442 }
443
444
445
447 {
449 return sys.find(systematic) != sys.end();
450 }
451
453 {
458 if (!m_useFixedRho || m_sysScheme == "AllSys") {
459 result.insert(SystematicVariation("MUON_SAGITTA_RHO", 1));
460 result.insert(SystematicVariation("MUON_SAGITTA_RHO", -1));
461 }
462
463 if (m_doEtaSagittaSys) {
464 // Sagitta correction residual bias
465 result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS_NEGETA", 1));
466 result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS_NEGETA", -1));
467
468 result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS_POSETA", 1));
469 result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS_POSETA", -1));
470
471 }
472 else {
473 // Sagitta correction residual bias
474 result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS", 1));
475 result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS", -1));
476 }
477
478 result.insert(SystematicVariation("MUON_SAGITTA_DATASTAT", 1));
479 result.insert(SystematicVariation("MUON_SAGITTA_DATASTAT", -1));
480
481 result.insert(SystematicVariation("MUON_SAGITTA_GLOBAL", 1));
482 result.insert(SystematicVariation("MUON_SAGITTA_GLOBAL", -1));
483
484 result.insert(SystematicVariation("MUON_SAGITTA_PTEXTRA", 1));
485 result.insert(SystematicVariation("MUON_SAGITTA_PTEXTRA", -1));
486
487 return result;
488 }
489
491
493 {
500
501 // Sagitta Rho systematics
502 SystematicVariation syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_RHO");
503
504 if (syst == SystematicVariation("MUON_SAGITTA_RHO", 1)) param.SagittaRho = MCP::SystVariation::Down;
505 else if (syst == SystematicVariation("MUON_SAGITTA_RHO", -1)) param.SagittaRho = MCP::SystVariation::Up;
506 else if (!syst.empty()) return StatusCode::FAILURE;
507
508 // Sagitta Residual Bias systematics
509 syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_RESBIAS");
510
511 if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS", 1)) param.SagittaBias = MCP::SystVariation::Down;
512 else if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS", -1)) param.SagittaBias = MCP::SystVariation::Up;
513 else if (!syst.empty()) return StatusCode::FAILURE;
514
515 // Sagitta Residual Global Bias systematics
516 syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_GLOBAL");
517
518 if (syst == SystematicVariation("MUON_SAGITTA_GLOBAL", 1)) param.SagittaGlobal = MCP::SystVariation::Down;
519 else if (syst == SystematicVariation("MUON_SAGITTA_GLOBAL", -1)) param.SagittaGlobal = MCP::SystVariation::Up;
520 else if (!syst.empty()) return StatusCode::FAILURE;
521
522 // Sagitta Residual Bias systematics pt extrapolation
523 syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_PTEXTRA");
524
525 if (syst == SystematicVariation("MUON_SAGITTA_PTEXTRA", 1)) param.SagittaPtExtra = MCP::SystVariation::Down;
526 else if (syst == SystematicVariation("MUON_SAGITTA_PTEXTRA", -1)) param.SagittaPtExtra = MCP::SystVariation::Up;
527 else if (!syst.empty()) return StatusCode::FAILURE;
528
529 // Sagitta Residual Bias systematics
530 syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_RESBIAS_POSETA");
531
532 if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS_POSETA", 1))
533 {
536 }
537 else if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS_POSETA", -1))
538 {
541 }
542 else if (!syst.empty()) return StatusCode::FAILURE;
543
544 // Sagitta Residual Bias systematics
545 syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_RESBIAS_NEGETA");
546
547 if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS_NEGETA", 1))
548 {
551 }
552 else if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS_NEGETA", -1))
553 {
556 }
557 else if (!syst.empty()) return StatusCode::FAILURE;
558
559 // Sagitta Residual Bias systematics
560 syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_DATASTAT");
561
562 if (syst == SystematicVariation("MUON_SAGITTA_DATASTAT", 1)) param.SagittaDataStat = MCP::SystVariation::Up;
563 else if (syst == SystematicVariation("MUON_SAGITTA_DATASTAT", -1)) param.SagittaDataStat = MCP::SystVariation::Down;
564 else if (!syst.empty()) return StatusCode::FAILURE;
565
566 //
567 ATH_MSG_DEBUG("Systematic variation's parameters, SagittaRho: " << param.SagittaRho);
568 ATH_MSG_DEBUG("Systematic variation's parameters, SagittaBias: " << param.SagittaBias);
569 ATH_MSG_DEBUG("Systematic variation's parameters, SagittaGlobal: " << param.SagittaGlobal);
570 ATH_MSG_DEBUG("Systematic variation's parameters, SagittaPtExtra: " << param.SagittaPtExtra);
571 ATH_MSG_DEBUG("Systematic variation's parameters, SagittaDataStat: " << param.SagittaDataStat);
572 ATH_MSG_DEBUG("Systematic variation's parameters, SagittaEtaSlice: " << param.SagittaEtaSlice);
573
574 return StatusCode::SUCCESS;
575 }
576
578 {
579 return m_Parameters.get(systConfig, m_currentParameters);
580 }
581
582
583
584} // namespace CP
#define M_PI
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
Handle class for reading from StoreGate.
#define AmgSymMatrix(dim)
#define AmgVector(rows)
std::pair< std::vector< unsigned int >, bool > res
const double width
Return value from object correction CP tools.
@ Error
Some error happened during the object correction.
@ Ok
The correction was done successfully.
virtual CorrectionCode applyCorrection(MCP::MuonObj &mu) const =0
Declare the interface that the class provides.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
MuonCalibIntSagittaTool(const std::string &name)
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_ME
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig) override
effects: configure this tool for the given list of systematic variations.
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_mcME
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.
std::map< MCP::SagittaCorrection, std::shared_ptr< MCP::CalibContainer > > SagittaCorrConstMap
Gaudi::Property< bool > m_useFixedRho
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_CB
SystematicsCache< ParameterSetSagitta > m_Parameters
Gaudi::Property< float > m_fixedRhoValue
Gaudi::Property< bool > m_applyCorrectionOnData
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_ID
Gaudi::Property< float > m_extraRebiasSys
double statCombCorrection(const MCP::MuonObj &mu, double corrIDpT, double corrMEpT, double CBpT) const
Gaudi::Property< bool > m_doDirectCBCalib
virtual SystematicSet affectingSystematics() const override
the list of all systematics this tool can be affected by
Gaudi::Property< bool > m_doEtaSagittaSys
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_mcID
StatusCode calcSystematicVariation(const SystematicSet &systConfig, ParameterSetSagitta &param) const
virtual SystematicSet recommendedSystematics() const override
the list of all systematics this tool recommends to use
Gaudi::Property< std::string > m_release
Gaudi::Property< std::string > m_sysScheme
std::vector< double > getCorrections(const MCP::TrackCalibObj &mu) const
std::map< MCP::DataYear, SagittaCorrConstMap > m_sagittaCorrConst_mcCB
const ParameterSetSagitta * m_currentParameters
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
void applySagittaCorrection(double &pt, const std::vector< double > &correction, const int &charge, const bool &isData) const
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.
StatusCode registerSystematics(const IReentrantSystematicsTool &tool)
effects: register all the systematics from the tool
Class to wrap a set of SystematicVariations.
SystematicVariation getSystematicByBaseName(const std::string &basename) const
description: get the first systematic matching basename
bool empty() const
returns: whether this is an empty systematic, i.e.
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
double chi2(TH1 *h0, TH1 *h1)
Select isolated Photons, Electrons and Muons.
std::map< SagittaCorrection, std::shared_ptr< CalibContainer > > createSagittaCorrMap(DataYear dataYear, TrackType type, const std::string &recommendationPath, const std::string &correctionType)
static constexpr std::array< MCP::DataYear, 7 > dataYearList
Definition EnumDef.h:34
setRcore setEtHad setFside pt
Basic object to cache all relevant information from the track.
Definition MuonObj.h:74
const double eta
Value of the track-eta.
Definition MuonObj.h:157
const DataYear year
Definition MuonObj.h:167
const bool isData
Definition MuonObj.h:169
double calib_pt
Smeared track pt.
Definition MuonObj.h:155
const TrackType type
Flag telling the code whether this is CB/ME/ID.
Definition MuonObj.h:149