ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCalibIntSagittaTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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
17
18namespace CP
19{
20
23
25 {
26 // Greet the user:
27 ATH_MSG_INFO("Initializing MuonCalibIntSagittaTool");
28
29 // Get the m_eventinfo container
30 ATH_CHECK(m_eventInfo.initialize());
31
32 // Read the recommendations
33 for(const auto& year: MCP::dataYearList)
34 {
38
39 // Corrections from the MC - what is typically referred to as the kinematic term
43 ATH_MSG_VERBOSE("Sagitta initilised: Year " <<m_release);
44 }
45
46 m_currentParameters = nullptr;
47 // Init the systematics
48 m_Parameters.initialize(affectingSystematics(), [this](const SystematicSet &systConfig, ParameterSetSagitta &param)
49 { return calcSystematicVariation(systConfig, param); });
51 {
52 ATH_MSG_ERROR("Unable to run with no systematic");
53 return StatusCode::FAILURE;
54 }
56 if (registry.registerSystematics(*this) != StatusCode::SUCCESS)
57 {
58 ATH_MSG_ERROR("Unkown systematic list");
59 return StatusCode::FAILURE;
60 }
61 // Return gracefully:
62 return StatusCode::SUCCESS;
63 }
64
66 {
67 auto IDCorrections = getCorrections(mu.ID);
68 auto MECorrections = getCorrections(mu.ME);
69 auto CBCorrections = getCorrections(mu.CB);
70
71 // Directly correct all three tracks
72 double corrIDpT = mu.ID.calib_pt;
73 applySagittaCorrection(corrIDpT, IDCorrections, mu.ID.calib_charge, mu.ID.isData);
74
75 double corrMEpT = mu.ME.calib_pt;
76 applySagittaCorrection(corrMEpT, MECorrections, mu.ME.calib_charge, mu.ME.isData);
77
78 double corrDirectCBpT = mu.CB.calib_pt;
79 applySagittaCorrection(corrDirectCBpT, CBCorrections, mu.CB.calib_charge, mu.CB.isData);
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
127 if(m_calibMode == MuonCalibTool::correctData_CB) mu.CB.calib_pt = corrCBpT;
128 else if(m_calibMode == MuonCalibTool::correctData_IDMS) mu.CB.calib_pt = corrStatCombCBpT;
129 else if(m_calibMode == MuonCalibTool::correctData_IDonly) mu.CB.calib_pt = corrIDpT;
130 else if(m_calibMode == MuonCalibTool::correctData_MSonly) mu.CB.calib_pt = corrMEpT;
131
132 // Return gracefully:
133 return CorrectionCode::Ok;
134 }
135
136 // This function applies the vector of corrections iteratively to the pT
137 void MuonCalibIntSagittaTool::applySagittaCorrection(double& pt, const std::vector<double>& correction, const int& charge, const bool& isData) const
138 {
139 for(const auto& corr: correction)
140 {
141 double originalPt = pt;
142 if(isData) pt = pt / (1 + charge * corr * pt);
143 else pt = pt / (1 - charge * corr * pt);
144 ATH_MSG_DEBUG("CorrectForCharge - in pT: " << originalPt << " corrPt: " << pt << " applied saggita: " << corr);
145
146 }
147 }
148
149
150 // Get the set of correction, based on data + systematic setting
152 {
153 double eta = trk.eta;
154 double pT = trk.calib_pt;
155 SagittaCorrConstMap const *corrMap{nullptr};
156 SagittaCorrConstMap const *kinematicTermMap{nullptr};
157 if(trk.type == MCP::TrackType::CB)
158 {
159 corrMap = &m_sagittaCorrConst_CB.at(trk.year);
160 kinematicTermMap = &m_sagittaCorrConst_mcCB.at(trk.year);
161 }
162 else if(trk.type == MCP::TrackType::ID)
163 {
164 corrMap = &m_sagittaCorrConst_ID.at(trk.year);
165 kinematicTermMap = &m_sagittaCorrConst_mcID.at(trk.year);
166 }
167 else if(trk.type == MCP::TrackType::ME)
168 {
169 corrMap = &m_sagittaCorrConst_ME.at(trk.year);
170 kinematicTermMap = &m_sagittaCorrConst_mcME.at(trk.year);
171 }
172
173 std::vector<double> corrections;
174 if(trk.isData)
175 {
176 if(!m_applyCorrectionOnData) return corrections;
178 {
179 // Apply data - kinematic term for the nominal
180 double corr = corrMap->at(MCP::SagittaCorrection::Nominal)->getCalibConstant(trk);
181 corr -= kinematicTermMap->at(MCP::SagittaCorrection::Nominal)->getCalibConstant(trk);
182 corrections.push_back(corr);
183 }
184 }
185 else // if it is MC
186 {
187 // Otherwise do as needed
189 {
190 int scale = (m_currentParameters->SagittaBias == MCP::SystVariation::Up) ? 1: -1;
191 // Sanity check
193 {
194 ATH_MSG_ERROR("Sagitta correction is not applied to data, yet Eta dependant systematics are requested. This configuration is not supported");
195 return corrections;
196 }
197
198 // if no apply correction on data, apply 100% of (Data - kinematic term)
199 // TODO: Check if it 50% or 100%?
201 {
202 // Apply data - kinematic term for the nominal
203 double corr = corrMap->at(MCP::SagittaCorrection::Nominal)->getCalibConstant(trk);
204 ATH_MSG_VERBOSE("Raw corr: "<<corr);
205 // corr -= kinematicTermMap->at(MCP::SagittaCorrection::Nominal)->getCalibConstant(eta, phi);
206 // ATH_MSG_VERBOSE("Raw - Kinematic corr: "<<corr);
207 corr *= (scale);
208 ATH_MSG_VERBOSE("corr: "<<corr);
209 corrections.push_back(corr);
210 }
211
212 // 100% of resbiasMap added as res bias
213 double corr = corrMap->at(MCP::SagittaCorrection::Residual__1up)->getCalibConstant(trk);
214 corr *= scale;
215 ATH_MSG_VERBOSE("Residual corr: "<<corr);
216
217 // If eta dependant, set the p2 to 0, if it not in the given eta slices
218 if ((m_currentParameters->SagittaEtaSlice == MCP::SystVariation::Up) && eta < 0) corr = 0;
219 if ((m_currentParameters->SagittaEtaSlice == MCP::SystVariation::Down) && eta > 0) corr = 0;
220
221 corrections.push_back(corr);
222 ATH_MSG_VERBOSE("final corr: "<<corr);
223 }
224 else if(m_currentParameters->SagittaGlobal != MCP::SystVariation::Default)
225 {
226 int scale = (m_currentParameters->SagittaGlobal == MCP::SystVariation::Up) ? 1: -1;
227
228 double deltas = m_extraRebiasSys;
229 // systematic for Run3 data 2022
230 if (trk.year==MCP::DataYear::Data22) {
231 if(m_release.value().find("Recs2023") != std::string::npos) deltas = 1.2 * deltas;
232 else if(std::abs(eta)>1.05) deltas = 1.5 * deltas;
233 }
234 double corr = deltas * scale;
235 ATH_MSG_VERBOSE("Deltas corr: "<<deltas);
236
237 corrections.push_back(corr);
238 ATH_MSG_VERBOSE("final corr: "<<corr);
239
240 }
241 else if(m_currentParameters->SagittaPtExtra != MCP::SystVariation::Default)
242 {
243 int scale = (m_currentParameters->SagittaPtExtra == MCP::SystVariation::Up) ? 1: -1;
244
245 // Extra scaling to cover for non-closure in the forward and transition region
246 // As seen in the Rel 21 validation of the sagitta correction
247 // It is only concetrateed in a few high eta bin. Idea is to apply a linearly increasing sys
248 // Till it reach 450 GeV and then to flatten it.
249 // The value is chosen in an arbitrary fashion. To be replaced and fixed, once we have a better idea of
250 double corr = 0;
251 double deltas = 0.00002;
252
253 if (corrMap->at(MCP::SagittaCorrection::PtExtra__1up)->mapExist()) {
254 deltas = corrMap->at(MCP::SagittaCorrection::PtExtra__1up)->getCalibConstant(trk);
255 if (pT > 450.0)
256 corr += std::abs(450.0 - 45) * deltas; // Above 450 GeV flat
257 else
258 corr += std::abs(pT - 45) * deltas;
259 } else {
260 // old style uncertainty for Run2 and early Run3 recommendations
261 if (eta > 2 || (eta > -2 && eta < -1.05)) {
262 if (pT > 450.0)
263 corr += std::abs(450.0 - 45) / 100 * deltas; // Above 450 GeV flat
264 else
265 corr += std::abs(pT - 45) / 100 * deltas;
266 }
267 if (eta < -2 || (eta < 2 && eta> 1.5)) {
268 if (pT > 450.0)
269 corr += std::abs(450.0 - 45) / 200 * deltas; // Above 450 GeV flat
270 else
271 corr += std::abs(pT - 45) / 200 * deltas;
272 }
273 // additional uncertainties for 2022 data
274 if (m_release.value().find("Recs2023") != std::string::npos) {
275 if ( (trk.year==MCP::DataYear::Data22) && pT > 100.0) {
276 if (eta < 0 && eta> -0.5) corr += 2.1*deltas;
277 else if (eta < -1.05) corr += 1.1*deltas;
278 else if (eta > 0.5 ) corr += 0.8*deltas;
279 }
280 } else {
281 if ( trk.year==MCP::DataYear::Data22 ) {
282 if (eta > -2 && eta < -1.05) corr = corr*2.5;
283 if (eta < -2) corr = corr*6;
284 if (eta > 1.5 && eta < 2) {
285 if (pT > 450.0)
286 corr += std::abs(450.0 - 45) / 80 * deltas; // Above 450 GeV flat
287 else
288 corr += std::abs(pT - 45) / 80 * deltas;
289 }
290 if (eta > 1.05 && eta < 1.5) {
291 if (pT > 450.0)
292 corr += std::abs(450.0 - 45) / 40 * deltas; // Above 450 GeV flat
293 else
294 corr += std::abs(pT - 45) / 40 * deltas;
295 }
296 }
297 }
298 // done for old style uncertainty for Run2 and early Run3 recommendations
299 }
300
301 corrections.push_back(corr*scale);
302 ATH_MSG_VERBOSE("High pT variation for pT "<<pT<<" deltas "<<deltas<<" final corr: "<<corr);
303
304 }
305 else if(m_currentParameters->SagittaDataStat != MCP::SystVariation::Default)
306 {
307 int scale = (m_currentParameters->SagittaDataStat == MCP::SystVariation::Up) ? 1: -1;
308 // Apply 50% of the datastat map, up and down as stat error
309 // TODO change to 100%
310 // -1 is to match the convention
311 double corr = corrMap->at(MCP::SagittaCorrection::Datastat__1up)->getCalibConstant(trk);
312 corr *= (0.5 * scale);
313 ATH_MSG_VERBOSE("data stat final corr: "<<corr);
314 corrections.push_back(corr);
315 }
317 {
318 // For rho systematic, nothing happens right now
319 }
320 else
321 {
322 // if it is MC, then for nominal corrections - we don't apply anything
323 }
324 }
325
326 return corrections;
327 }
328
329
330 double MuonCalibIntSagittaTool::statCombCorrection(const MCP::MuonObj& mu, double corrIDpT, double corrMEpT, double CBpT) const
331 {
332 ATH_MSG_VERBOSE("Sag mu.ID.calib_pt: "<<mu.ID.calib_pt);
333 ATH_MSG_VERBOSE("Sag mu.ME.calib_pt: "<<mu.ME.calib_pt);
334 ATH_MSG_VERBOSE("Sag mu.CB.calib_pt: "<<mu.CB.calib_pt);
335
336 // Corner cases to prevent a NaN in the combination
337 if(mu.ID.calib_pt == 0) return CBpT;
338 if(mu.ME.calib_pt == 0) return CBpT;
339 if(corrIDpT == 0) return CBpT;
340 if(corrMEpT == 0) return CBpT;
341
342 double chi2Nom = -999;
343 AmgVector(5) parsCBNom = mu.CB.pars;
344 AmgVector(5) parsID = mu.ID.pars;
345 AmgVector(5) parsMS = mu.ME.pars;
346 AmgSymMatrix(5) covCBNom = mu.CB.covariance;
347 AmgSymMatrix(5) covID = mu.ID.covariance;
348 AmgSymMatrix(5) covMS = mu.ME.covariance;
349
350 AmgVector(5) parsCBCorr;
351 AmgSymMatrix(5) covCBCorr;
352
353 // Do the statistical combination, with the original pTs
354 // create the TLV with original ID pT
355 using TLV = ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double>>;
356 TLV tlv{mu.ID.calib_pt, mu.ID.eta, mu.ID.phi, mu.ID.mass};
357 // Now modify the ID covariance matrix, and convert it to MeV
358 if(tlv.P() == 0) parsID[4] = 1e12;
359 else parsID[4] = 1.0 / (tlv.P() * 1e3);
360
361 tlv.SetCoordinates(mu.ME.calib_pt, mu.ME.eta, mu.ME.phi, mu.ME.mass);
362 // Now modify the ME covariance matrix
363 if(tlv.P() == 0) parsMS[4] = 1e12;
364 else parsMS[4] = 1.0 / (tlv.P() * 1e3);
365
366 CorrectionCode SysCorrCode = applyStatCombination(parsID, covID, parsMS, covMS, mu.CB.calib_charge, parsCBNom, covCBNom, chi2Nom);
367 if (SysCorrCode != CorrectionCode::Ok) return CBpT;
368
369
370 // Do the statistical combination, with the original pTs
371 // create the TLV with original ID pT
372 tlv.SetCoordinates(corrIDpT, mu.ID.eta, mu.ID.phi, mu.ID.mass);
373 // Now modify the ID covariance matrix, and convert it to MeV
374 if(tlv.P() == 0) parsID[4] = 1e12;
375 else parsID[4] = 1.0 / (tlv.P() * 1e3);
376
377 tlv.SetCoordinates(corrMEpT, mu.ME.eta, mu.ME.phi, mu.ME.mass);
378 // Now modify the ME covariance matrix
379 if(tlv.P() == 0) parsMS[4] = 1e12;
380 else parsMS[4] = 1.0 / (tlv.P() * 1e3);
381
382 SysCorrCode = applyStatCombination(parsID, covID, parsMS, covMS, mu.CB.calib_charge, parsCBCorr, covCBCorr, chi2Nom);
383 if (SysCorrCode != CorrectionCode::Ok) return CBpT;
384
385
386 double statCombPtNom = std::sin(parsCBNom[3]) / std::abs(parsCBNom[4]);
387 double statCombPtCorr = std::sin(parsCBCorr[3]) / std::abs(parsCBCorr[4]);
388 double corrCBpT = CBpT * (statCombPtCorr / statCombPtNom);
389
390 return corrCBpT;
391
392 }
394 const AmgSymMatrix(5)& covMS, int charge, AmgVector(5) & parsCB,
395 AmgSymMatrix(5) & covCB, double& chi2) const {
396 chi2 = 1e20;
397 parsID[4] = std::abs(parsID[4]);
398 parsMS[4] = std::abs(parsMS[4]);
399
400
401 Eigen::FullPivLU<AmgSymMatrix(5)> matID(covID);
402 if (!matID.isInvertible()) {
403 ATH_MSG_DEBUG(" ID weight matrix computation failed ");
405 }
406 const AmgSymMatrix(5) weightID = matID.inverse();
407
408
409 Eigen::FullPivLU<AmgSymMatrix(5)> matMS(covMS);
410 if (!matMS.isInvertible()) {
411 ATH_MSG_DEBUG(" MS weight matrix computation failed ");
413 }
414 const AmgSymMatrix(5) weightMS = matMS.inverse();
415
416
417 Eigen::FullPivLU<AmgSymMatrix(5)> matCB(weightID + weightMS);
418 if (!matCB.isInvertible()) {
419 ATH_MSG_DEBUG(" Inversion of weightCB failed ");
421 }
422 covCB = matCB.inverse();
423
424
425 Eigen::FullPivLU<AmgSymMatrix(5)> matSum(covID + covMS);
426 if (!matSum.isInvertible()) {
427 ATH_MSG_DEBUG(" Inversion of weightCB failed ");
429 }
430 AmgSymMatrix(5) invCovSum = matSum.inverse();
431
432
433 AmgVector(5) diffPars = parsID - parsMS;
434 chi2 = diffPars.transpose() * invCovSum * diffPars;
435 chi2 = chi2 / 5.;
436
437 parsCB = covCB * (weightID * parsID + weightMS * parsMS);
438 parsCB[4] *= charge;
439
440 if (parsCB[2] > M_PI)
441 parsCB[2] -= 2. * M_PI;
442 else if (parsCB[2] < -M_PI)
443 parsCB[2] += 2. * M_PI;
444 return CorrectionCode::Ok;
445 }
446
447
448
450 {
452 return sys.find(systematic) != sys.end();
453 }
454
456 {
457 SystematicSet result;
461 if (!m_useFixedRho || m_sysScheme == "AllSys") {
462 result.insert(SystematicVariation("MUON_SAGITTA_RHO", 1));
463 result.insert(SystematicVariation("MUON_SAGITTA_RHO", -1));
464 }
465
466 if (m_doEtaSagittaSys) {
467 // Sagitta correction residual bias
468 result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS_NEGETA", 1));
469 result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS_NEGETA", -1));
470
471 result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS_POSETA", 1));
472 result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS_POSETA", -1));
473
474 }
475 else {
476 // Sagitta correction residual bias
477 result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS", 1));
478 result.insert(SystematicVariation("MUON_SAGITTA_RESBIAS", -1));
479 }
480
481 result.insert(SystematicVariation("MUON_SAGITTA_DATASTAT", 1));
482 result.insert(SystematicVariation("MUON_SAGITTA_DATASTAT", -1));
483
484 result.insert(SystematicVariation("MUON_SAGITTA_GLOBAL", 1));
485 result.insert(SystematicVariation("MUON_SAGITTA_GLOBAL", -1));
486
487 result.insert(SystematicVariation("MUON_SAGITTA_PTEXTRA", 1));
488 result.insert(SystematicVariation("MUON_SAGITTA_PTEXTRA", -1));
489
490 return result;
491 }
492
494
496 {
503
504 // Sagitta Rho systematics
505 SystematicVariation syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_RHO");
506
507 if (syst == SystematicVariation("MUON_SAGITTA_RHO", 1)) param.SagittaRho = MCP::SystVariation::Down;
508 else if (syst == SystematicVariation("MUON_SAGITTA_RHO", -1)) param.SagittaRho = MCP::SystVariation::Up;
509 else if (!syst.empty()) return StatusCode::FAILURE;
510
511 // Sagitta Residual Bias systematics
512 syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_RESBIAS");
513
514 if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS", 1)) param.SagittaBias = MCP::SystVariation::Down;
515 else if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS", -1)) param.SagittaBias = MCP::SystVariation::Up;
516 else if (!syst.empty()) return StatusCode::FAILURE;
517
518 // Sagitta Residual Global Bias systematics
519 syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_GLOBAL");
520
521 if (syst == SystematicVariation("MUON_SAGITTA_GLOBAL", 1)) param.SagittaGlobal = MCP::SystVariation::Down;
522 else if (syst == SystematicVariation("MUON_SAGITTA_GLOBAL", -1)) param.SagittaGlobal = MCP::SystVariation::Up;
523 else if (!syst.empty()) return StatusCode::FAILURE;
524
525 // Sagitta Residual Bias systematics pt extrapolation
526 syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_PTEXTRA");
527
528 if (syst == SystematicVariation("MUON_SAGITTA_PTEXTRA", 1)) param.SagittaPtExtra = MCP::SystVariation::Down;
529 else if (syst == SystematicVariation("MUON_SAGITTA_PTEXTRA", -1)) param.SagittaPtExtra = MCP::SystVariation::Up;
530 else if (!syst.empty()) return StatusCode::FAILURE;
531
532 // Sagitta Residual Bias systematics
533 syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_RESBIAS_POSETA");
534
535 if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS_POSETA", 1))
536 {
539 }
540 else if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS_POSETA", -1))
541 {
544 }
545 else if (!syst.empty()) return StatusCode::FAILURE;
546
547 // Sagitta Residual Bias systematics
548 syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_RESBIAS_NEGETA");
549
550 if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS_NEGETA", 1))
551 {
554 }
555 else if (syst == SystematicVariation("MUON_SAGITTA_RESBIAS_NEGETA", -1))
556 {
559 }
560 else if (!syst.empty()) return StatusCode::FAILURE;
561
562 // Sagitta Residual Bias systematics
563 syst = systConfig.getSystematicByBaseName("MUON_SAGITTA_DATASTAT");
564
565 if (syst == SystematicVariation("MUON_SAGITTA_DATASTAT", 1)) param.SagittaDataStat = MCP::SystVariation::Up;
566 else if (syst == SystematicVariation("MUON_SAGITTA_DATASTAT", -1)) param.SagittaDataStat = MCP::SystVariation::Down;
567 else if (!syst.empty()) return StatusCode::FAILURE;
568
569 //
570 ATH_MSG_DEBUG("Systematic variation's parameters, SagittaRho: " << param.SagittaRho);
571 ATH_MSG_DEBUG("Systematic variation's parameters, SagittaBias: " << param.SagittaBias);
572 ATH_MSG_DEBUG("Systematic variation's parameters, SagittaGlobal: " << param.SagittaGlobal);
573 ATH_MSG_DEBUG("Systematic variation's parameters, SagittaPtExtra: " << param.SagittaPtExtra);
574 ATH_MSG_DEBUG("Systematic variation's parameters, SagittaDataStat: " << param.SagittaDataStat);
575 ATH_MSG_DEBUG("Systematic variation's parameters, SagittaEtaSlice: " << param.SagittaEtaSlice);
576
577 return StatusCode::SUCCESS;
578 }
579
581 {
582 return m_Parameters.get(systConfig, m_currentParameters);
583 }
584
585
586
587} // 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
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