ATLAS Offline Software
EgammaCalibrationAndSmearingTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 #include <algorithm>
9 #include <format>
10 #include <memory>
11 #include <string>
12 #include <utility>
13 
18 #include "xAODEgamma/Egamma.h"
19 #include "xAODEgamma/EgammaDefs.h"
24 #include "xAODTracking/Vertex.h"
25 
26 #ifndef ROOTCORE
28 #endif
29 
30 // internal (old) tool
31 #include <cmath>
32 
39 
40 namespace CP {
41 
42 const double GeV = 1000.;
43 
44 std::unique_ptr<egGain::GainTool> gainToolFactory(egEnergyCorr::ESModel model) {
45  switch (model) {
58  const std::string gain_filename1 = PathResolverFindCalibFile(
59  "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
60  const std::string gain_filename2 = PathResolverFindCalibFile(
61  "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
62  return std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
63  }
79  return nullptr;
80  default:
81  return nullptr;
82  }
83 }
84 
86  std::string folder;
87  switch (model) {
91  folder = "egammaMVACalib/v1";
92  break;
94  folder = "egammaMVACalib/v1";
95  break;
100  folder = "egammaMVACalib/offline/v3";
101  break;
104  folder = "egammaMVACalib/offline/v3_E4crack_bis";
105  break;
113  folder = "egammaMVACalib/offline/v4.0";
114  break;
123  folder = "egammaMVACalib/offline/v7";
124  break;
127  folder = "egammaMVACalib/offline/v9";
128  break;
130  folder = "egammaMVACalib/offline/v10";
131  break;
132  default:
133  folder = "";
134  }
135 
136  return folder;
137 }
138 
139 std::unique_ptr<egammaLayerRecalibTool> egammaLayerRecalibToolFactory(
140  egEnergyCorr::ESModel model, int enableSacc) {
141  std::string tune = "";
142  switch (model) {
146  tune = "2011_alt_with_layer2";
147  break;
160  tune = "2012_alt_with_layer2";
161  break;
164  tune = "es2017_20.7_improved";
165  break;
167  tune = "es2017_20.7_final";
168  break;
175  tune = "es2017_21.0_v0";
176  break;
178  tune = "es2018_21.0_v0";
179  break;
181  tune = "es2022_22.0_Precision";
182  break;
184  tune = "es2022_22.0_Precision_v1";
185  break;
187  tune = "es2024_run3_extrapolate_v0";
188  break;
189  default:
190  return nullptr;
191  }
192  return std::make_unique<egammaLayerRecalibTool>(tune, enableSacc);
193 }
194 
196  switch (model) {
203  return false;
231  return true;
232  case egEnergyCorr::UNDEFINED: // TODO: find better logic
233  return false;
234  }
235  assert(false);
236  return false;
237 }
238 
240  return use_intermodule_correction(model); // they are equal
241 }
242 
244  switch (model) {
254  return false;
279  return true;
280  case egEnergyCorr::UNDEFINED: // TODO: find better logic
281  return false;
282  }
283  assert(false);
284  return false;
285 }
286 
288  const std::string& name)
289  : asg::AsgMetadataTool(name),
290  m_TESModel(egEnergyCorr::UNDEFINED),
291  m_TResolutionType(egEnergyCorr::Resolution::SigmaEff90),
292  m_use_mapping_correction(false),
293  m_currentScaleVariation_MC(egEnergyCorr::Scale::None),
294  m_currentScaleVariation_data(egEnergyCorr::Scale::Nominal),
295  m_currentResolutionVariation_MC(egEnergyCorr::Resolution::Nominal),
296  m_currentResolutionVariation_data(egEnergyCorr::Resolution::None),
297  m_set_seed_function([](const EgammaCalibrationAndSmearingTool& tool,
299  columnar::EventInfoId ei) {
300  const Accessors& acc = *tool.m_accessors;
301  // avoid 0 as result, see
302  // https://root.cern.ch/root/html/TRandom3.html#TRandom3:SetSeed
303  auto cluster = acc.caloClusterAcc(egamma)[0].value();
304  return 1 + static_cast<RandomNumber>(
305  std::abs(acc.clusterPhiAcc(cluster)) * 1E6 +
306  std::abs(acc.clusterEtaAcc(cluster)) * 1E3 +
307  acc.eventNumberAcc(ei));
308  }),
309  m_accessors(std::make_unique<Accessors>(*this)) {
310 
311  declareProperty("ESModel", m_ESModel = "");
312  declareProperty("decorrelationModel", m_decorrelation_model_name = "");
313  declareProperty("decorrelationModelScale",
314  m_decorrelation_model_scale_name = "");
315  declareProperty("decorrelationModelResolution",
316  m_decorrelation_model_resolution_name = "");
317  declareProperty("ResolutionType", m_ResolutionType = "SigmaEff90");
318  declareProperty("varSF", m_varSF = 1.0);
319  declareProperty("doScaleCorrection", m_doScaleCorrection = AUTO);
320  declareProperty("doSmearing", m_doSmearing = AUTO);
321  declareProperty("useLayerCorrection", m_useLayerCorrection = AUTO);
322  declareProperty("usePSCorrection", m_usePSCorrection = AUTO);
323  declareProperty("useS12Correction", m_useS12Correction = AUTO);
324  declareProperty("useSaccCorrection", m_useSaccCorrection = AUTO);
325  declareProperty("useIntermoduleCorrection",
326  m_useIntermoduleCorrection = AUTO);
327  declareProperty("usePhiUniformCorrection", m_usePhiUniformCorrection = AUTO);
328  declareProperty("useCaloDistPhiUnifCorrection",
329  m_useCaloDistPhiUnifCorrection = AUTO);
330  declareProperty("useGainCorrection", m_useGainCorrection = AUTO);
331  declareProperty("useGainInterpolation", m_useGainInterpolation = AUTO);
332  declareProperty("doADCLinearityCorrection",
333  m_doADCLinearityCorrection = AUTO);
334  declareProperty("doLeakageCorrection", m_doLeakageCorrection = AUTO);
335  declareProperty("MVAfolder", m_MVAfolder = "");
336  declareProperty("layerRecalibrationTune", m_layer_recalibration_tune = "");
337  declareProperty("useEPCombination", m_use_ep_combination = false);
338  declareProperty("useMVACalibration", m_use_mva_calibration = AUTO);
339  declareProperty("use_full_statistical_error",
340  m_use_full_statistical_error = false);
341  declareProperty("use_temp_correction201215",
342  m_use_temp_correction201215 = AUTO);
343  declareProperty("use_uA2MeV_2015_first2weeks_correction",
344  m_use_uA2MeV_2015_first2weeks_correction = AUTO);
345  declareProperty("randomRunNumber", m_user_random_run_number = 0);
346  // this is the user input, it is never changed by the tool. The tool uses
347  // m_simulation.
348  declareProperty("useFastSim", m_useFastSim = -1,
349  "This should be explicitly set by the user depending on the "
350  "data type (int)0=full sim, (int)1=fast sim");
351  declareProperty(
352  "useAFII", m_use_AFII = -1,
353  "This is now deprecated. Kept for explicit error message for now");
354  declareProperty("decorateEmva", m_decorateEmva = false, "whether to decorate the eMVA value");
355 }
356 
358  ATH_MSG_DEBUG("destructor");
360  delete m_gain_tool;
361 }
362 
364  ATH_MSG_INFO("Initialization");
365 
366  if (m_ESModel == "es2015XX") {
367  ATH_MSG_ERROR("es2015XX is deprecated. Use es2015PRE");
368  }
369 
370  if (m_ESModel == "es2010") {
372  } // legacy
373  else if (m_ESModel == "es2011c") {
375  } // mc11c : faulty G4; old geometry
376  else if (m_ESModel == "es2011d") {
378  } // mc11d : corrected G4; new geometry == final Run1 scheme
379  else if (m_ESModel == "es2012a") {
381  } // mc12a : "crude" G4 fix; old geometry
382  else if (m_ESModel == "es2012c") {
384  } // mc12c : corrected G4; new geometry == final Run1 scheme
385  else if (m_ESModel == "es2012XX") {
387  } else if (m_ESModel == "es2015PRE") {
389  } else if (m_ESModel == "es2015PRE_res_improved") {
391  } else if (m_ESModel == "es2015cPRE") {
393  } else if (m_ESModel == "es2015cPRE_res_improved") {
395  } else if (m_ESModel == "es2015c_summer") {
397  } else if (m_ESModel == "es2016PRE") {
399  } else if (m_ESModel == "es2016data_mc15c") {
401  } else if (m_ESModel == "es2016data_mc15c_summer") {
403  } else if (m_ESModel == "es2016data_mc15c_summer_improved") {
405  } else if (m_ESModel == "es2016data_mc15c_final") {
407  } else if (m_ESModel == "es2015_5TeV") {
409  } else if (m_ESModel == "es2017_R21_PRE") {
411  } else if (m_ESModel == "es2017_R21_v0") {
413  } else if (m_ESModel == "es2017_R21_v1") {
415  } else if (m_ESModel == "es2017_R21_ofc0_v1") {
417  } else if (m_ESModel == "es2018_R21_v0") {
419  } else if (m_ESModel == "es2018_R21_v1") {
421  } else if (m_ESModel == "es2022_R22_PRE") {
423  } else if (m_ESModel == "es2023_R22_Run2_v0") {
425  } else if (m_ESModel == "es2023_R22_Run2_v1") {
427  } else if (m_ESModel == "es2024_Run3_ofc0_v0") {
429  } else if (m_ESModel == "es2024_Run3_v0") {
431  } else if (m_ESModel.empty()) {
432  ATH_MSG_ERROR("you must set ESModel property");
433  return StatusCode::FAILURE;
434  } else {
435  ATH_MSG_ERROR("Cannot understand model " << m_ESModel);
436  return StatusCode::FAILURE;
437  }
438 
439  if (m_ResolutionType == "Gaussian") {
441  } else if (m_ResolutionType == "SigmaEff80") {
443  } else if (m_ResolutionType == "SigmaEff90") {
445  } else {
446  ATH_MSG_ERROR("Cannot understand resolution " << m_ResolutionType);
447  return StatusCode::FAILURE;
448  }
449 
450  if (m_use_AFII != -1) {
452  "Property useAFII is deprecated. It is now replaced with useFastSim, "
453  "which should be explicitly configured");
454  return StatusCode::FAILURE;
455  }
456 
457  if (m_useFastSim == 1) {
459  } else if (m_useFastSim == 0) {
461  } else {
462  ATH_MSG_ERROR("Property useFastSim should be explicitly configured");
463  return StatusCode::FAILURE;
464  }
465 
469  "Sample is FastSim but no AF3 calibration is supported with "
470  "MC23 pre-recommendations (es2022_R22_PRE and es2024_Run3_ofc0_v0). "
471  "Please swtich to Run3 consolidated recommendations (es2024_Run3_v0), "
472  "or get in touch with the EGamma CP group in case you are using this");
473  return StatusCode::FAILURE;
474  }
475 
476  // configure decorrelation model, translate string property to internal class
477  // enum
478  /* S R SR
479  0. 0 0 0 WARNING Full, Full (this is the default without configuration)
480  1. 0 0 1 SR
481  2. 0 1 0 FATAL
482  3. 0 1 1 WARNING SR then R
483  4. 1 0 0 FATAL
484  5. 1 0 1 WARNING SR then S
485  6. 1 1 0 S, R
486  7. 1 1 1 FATAL
487  */
488  if (m_decorrelation_model_name.empty() and
491  // case 0
492  ATH_MSG_WARNING("no decorrelation model specified, assuming full model");
495  m_decorrelation_model_name = "FULL_v1";
496  } else if (not m_decorrelation_model_name.empty() and
497  not m_decorrelation_model_scale_name.empty() and
499  // case 7
500  ATH_MSG_FATAL("too many flags for the decorrelation model");
501  return StatusCode::FAILURE;
502  } else {
503  // set scale decorrelation model
504  if (not m_decorrelation_model_scale_name.empty()) { // case 4, 5, 6, (7)
505  if (not m_decorrelation_model_name.empty()) {
507  "flag decorrelation model ignored for scale decorrelation model");
508  } // case 5
509  if (m_decorrelation_model_scale_name == "1NP_v1")
510  m_decorrelation_model_scale = ScaleDecorrelation::ONENP;
511  else if (m_decorrelation_model_scale_name == "FULL_ETACORRELATED_v1")
512  m_decorrelation_model_scale = ScaleDecorrelation::FULL_ETA_CORRELATED;
513  else if (m_decorrelation_model_scale_name == "1NPCOR_PLUS_UNCOR")
514  m_decorrelation_model_scale = ScaleDecorrelation::ONENP_PLUS_UNCONR;
515  else if (m_decorrelation_model_scale_name == "FULL_v1")
517  else {
518  ATH_MSG_FATAL("cannot understand the scale decorrelation model '"
519  << m_decorrelation_model_scale_name << "'(typo?)");
520  return StatusCode::FAILURE;
521  }
522  } else if (not m_decorrelation_model_name.empty()) { // case 1, 3
523  if (m_decorrelation_model_name == "1NP_v1")
524  m_decorrelation_model_scale = ScaleDecorrelation::ONENP;
525  else if (m_decorrelation_model_name == "FULL_ETACORRELATED_v1")
526  m_decorrelation_model_scale = ScaleDecorrelation::FULL_ETA_CORRELATED;
527  else if (m_decorrelation_model_name == "1NPCOR_PLUS_UNCOR")
528  m_decorrelation_model_scale = ScaleDecorrelation::ONENP_PLUS_UNCONR;
529  else if (m_decorrelation_model_name == "FULL_v1")
531  else {
532  ATH_MSG_FATAL("cannot understand the decorrelation model '"
533  << m_decorrelation_model_name << "'(typo?)");
534  return StatusCode::FAILURE;
535  }
536  } else { // case 2, (7)
538  "not information how to initialize the scale decorrelation model");
539  return StatusCode::FAILURE;
540  }
541 
542  // set resolution decorralation model
544  .empty()) { // case 2, 3, 6, (7)
545  if (not m_decorrelation_model_name.empty()) {
547  "flag decorrelation model ignored for resolution decorrelation "
548  "model");
549  } // case 3
552  else if (m_decorrelation_model_resolution_name == "FULL_v1")
554  else {
555  ATH_MSG_FATAL("cannot understand the resolution decorrelation model '"
556  << m_decorrelation_model_resolution_name << "'(typo?)");
557  return StatusCode::FAILURE;
558  }
559  } else if (not m_decorrelation_model_name.empty()) { // case 1, 5
560  if (m_decorrelation_model_name == "1NP_v1")
562  else if (m_decorrelation_model_name == "FULL_ETACORRELATED_v1")
564  else if (m_decorrelation_model_name == "1NPCOR_PLUS_UNCOR")
566  else if (m_decorrelation_model_name == "FULL_v1")
568  else {
569  ATH_MSG_FATAL("cannot understand the decorrelation model '"
570  << m_decorrelation_model_name << "'(typo?)");
571  return StatusCode::FAILURE;
572  }
573  }
574  }
575 
576  // create correction tool
577  ATH_MSG_DEBUG("creating internal correction tool");
578  m_rootTool = std::make_unique<AtlasRoot::egammaEnergyCorrectionTool>();
579  if (!m_rootTool) {
580  ATH_MSG_ERROR("Cannot initialize underlying tool");
581  return StatusCode::FAILURE;
582  }
583  m_rootTool->setESModel(m_TESModel);
584 
590  "Using linear interpolation in the gain tool (uncertainties only)");
592  m_rootTool->setApplyL2GainInterpolation();
593  }
594  m_rootTool->msg().setLevel(this->msg().level());
595  m_rootTool->initialize();
596 
597  // configure MVA calibration
598  if (m_use_mva_calibration != 0) {
599  ATH_MSG_DEBUG("creating MVA calibration tool (if needed)");
600  if (m_MVAfolder.empty()) { // automatically configure MVA tool
602  }
603 
604  if (not m_MVAfolder.empty()) {
605 
606  // electron MVA tool
607  asg::AsgToolConfig config_mva_electron(
608  "egammaMVACalibTool/tool_mva_electron");
609  config_mva_electron.setPropertyFromString("folder", m_MVAfolder);
610  ATH_CHECK(config_mva_electron.setProperty("use_layer_corrected", true));
611  ;
612  ATH_CHECK(config_mva_electron.setProperty(
613  "ParticleType", xAOD::EgammaParameters::electron));
614 
615  // unconverted photon MVA tool
616  asg::AsgToolConfig config_mva_unconverted(
617  "egammaMVACalibTool/tool_mva_unconverted");
618  config_mva_unconverted.setPropertyFromString("folder", m_MVAfolder);
619  ATH_CHECK(
620  config_mva_unconverted.setProperty("use_layer_corrected", true));
621  ATH_CHECK(config_mva_unconverted.setProperty(
623 
624  // converted photon MVA tool
625  asg::AsgToolConfig config_mva_converted(
626  "egammaMVACalibTool/tool_mva_converted");
627  config_mva_converted.setPropertyFromString("folder", m_MVAfolder);
628  ATH_CHECK(config_mva_converted.setProperty("use_layer_corrected", true));
629  ATH_CHECK(config_mva_converted.setProperty(
630  "ParticleType", xAOD::EgammaParameters::convertedPhoton));
631 
632  // initialize the ServiceHandler egammaMVASvc
633  // make the name unique
634  std::ostringstream mva_service_name;
635  mva_service_name << "egammaMVASvc/service_mva_egamma_id"
636  << (void const*)this;
637  asg::AsgServiceConfig config_mva_service(mva_service_name.str());
638  ATH_CHECK(config_mva_service.addPrivateTool("ElectronTool",
639  config_mva_electron));
640  ATH_CHECK(config_mva_service.addPrivateTool("UnconvertedPhotonTool",
641  config_mva_unconverted));
642  ATH_CHECK(config_mva_service.addPrivateTool("ConvertedPhotonTool",
643  config_mva_converted));
644  config_mva_service.setPropertyFromString("folder", m_MVAfolder);
645  ATH_CHECK(
646  config_mva_service.setProperty("OutputLevel", this->msg().level()));
647  ATH_CHECK(config_mva_service.makeService(m_MVACalibSvc));
648  } else {
649  m_use_mva_calibration = false;
650  }
651  }
652 
653  // configure layer recalibration tool
654  // For now: layer recalibration not applied to PRE release 21 (using run 1
655  // based calibration applied at reco level)
656  // for following R21 recommendations, need to apply the run2/run1 layer
657  // calibration ratio
658  if (m_ESModel == "es2017_R21_PRE") {
659  ATH_MSG_INFO("Layer recalibration already applied at cell level");
660  m_useLayerCorrection = false;
661  } else if (!m_useLayerCorrection) {
662  ATH_MSG_INFO("Layer corrections disabled!");
663  } else {
664  ATH_MSG_DEBUG("initializing layer recalibration tool (if needed)");
666  .empty()) { // automatically configure layer recalibration tool
669  .release();
671  ATH_MSG_INFO("not using layer recalibration");
672  }
673  } else {
676  }
678  m_layer_recalibration_tool->msg().setLevel(this->msg().level());
680  if (!m_usePSCorrection) {
681  ATH_MSG_INFO("PS corrections disabled!");
683  }
684  if (!m_useS12Correction) {
685  ATH_MSG_INFO("S12 corrections disabled!");
687  }
688  if (!m_useSaccCorrection) {
689  ATH_MSG_INFO("Sacc corrections disabled!");
691  }
692  }
693  }
694 
696  m_rootTool->use_temp_correction201215(m_use_temp_correction201215);
698  m_rootTool->use_uA2MeV_2015_first2weeks_correction(
700  if (not m_use_full_statistical_error and
702  m_rootTool->useStatErrorScaling(true);
703  }
704 
705  if (m_use_ep_combination) {
706  ATH_MSG_ERROR("ep combination not supported yet");
707  throw std::runtime_error("ep combination not supported yet");
708  }
709 
712  }
715  }
717 
718  if (m_useGainCorrection == AUTO) {
723  }
724  else {
725  ATH_MSG_DEBUG("initializing gain tool");
728  }
729  }
730  else if (m_useGainCorrection == 1) {
736  "cannot instantiate gain tool for this model (you can only disable "
737  "the gain tool, but not enable it)");
738  }
739  else {
740  ATH_MSG_INFO(
741  "initializing gain tool for run2 final precision recommendations");
743  "Gain corrections required but Zee scales are derived without Gain, "
744  "will cause inconsistency!");
745  std::string gain_tool_run_2_filename = PathResolverFindCalibFile(
746  "ElectronPhotonFourMomentumCorrection/v29/"
747  "gain_uncertainty_specialRun.root");
748  m_gain_tool_run2 = std::make_unique<egGain::GainUncertainty>(
749  gain_tool_run_2_filename, false, "GainCorrection",
751  m_gain_tool_run2->msg().setLevel(this->msg().level());
752  }
753  }
754 
758  // ADC non linearity correction
761  std::string adcLinearityCorr_filename = PathResolverFindCalibFile(
762  "ElectronPhotonFourMomentumCorrection/v25/linearity_ADC.root");
763  m_ADCLinearity_tool = std::make_shared<LinearityADC>(adcLinearityCorr_filename);
764  m_ADCLinearity_tool->msg().setLevel(this->msg().level());
765  m_rootTool->setADCTool(m_ADCLinearity_tool);
766  } else {
768  m_ESModel + " recommendations use ADC corrections for scale "
769  "derivation. Disabling the ADCLinearity flag will create "
770  "inconsistency!");
771  }
772 
775  m_rootTool->setApplyLeakageCorrection(true);
776  }
777 
778  // Calo distortion phi unif correction
782  std::string phiUnifCorrfileName = PathResolverFindCalibFile(
783  "ElectronPhotonFourMomentumCorrection/v33/"
784  "egammaEnergyCorrectionData.root");
785  std::unique_ptr<TFile> fCorr(
786  TFile::Open(phiUnifCorrfileName.c_str(), "READ"));
787  m_caloDistPhiUnifCorr.reset(
788  dynamic_cast<TH2*>(fCorr->Get("CaloDistortionPhiUniformityCorrection/"
789  "es2023_R22_Run2_v0/h2DcorrPhiUnif")));
790  m_caloDistPhiUnifCorr->SetDirectory(nullptr);
791  } else {
793  m_ESModel + " recommendations use CaloDistPhiUnif for scale "
794  "derivation. Disabling the CaloDistPhiUnif flag will create "
795  "inconsistency!");
796  }
797  }
798 
799  // No scale correction for release 21 ==> obsolete
800  /*if (m_ESModel == "es2017_R21_PRE"){
801  m_doScaleCorrection = 0;
802  }
803  */
804 
805  ATH_MSG_INFO("ESModel: " << m_ESModel);
806  ATH_MSG_INFO("ResolutionType: " << m_ResolutionType);
807  ATH_MSG_INFO("decorrelation Model: " << m_decorrelation_model_name);
808  ATH_MSG_DEBUG("layer correction = " << m_useLayerCorrection);
809  ATH_MSG_DEBUG("PS correction = " << m_usePSCorrection);
810  ATH_MSG_DEBUG("S12 correction = " << m_useS12Correction);
811  ATH_MSG_DEBUG("Sacc correction = " << m_useSaccCorrection);
812  ATH_MSG_DEBUG("intermodule correction = " << m_useIntermoduleCorrection);
813  ATH_MSG_DEBUG("phi uniformity correction = " << m_usePhiUniformCorrection);
814  ATH_MSG_DEBUG("distorted calo phi uniformity correction = "
816  ATH_MSG_DEBUG("gain correction = " << m_useGainCorrection);
817  ATH_MSG_DEBUG("ADC non-linearity correction = " << m_doADCLinearityCorrection);
818  ATH_MSG_DEBUG("leakage correction for photons = " << m_doLeakageCorrection);
819  ATH_MSG_DEBUG("smearing = " << m_doSmearing);
820  ATH_MSG_DEBUG("insitu scales = " << m_doScaleCorrection);
821  ATH_MSG_DEBUG("ep combination = " << m_use_ep_combination);
822  ATH_MSG_DEBUG("use MVA calibration = " << m_use_mva_calibration);
824  "use temperature correction 2015 = " << m_use_temp_correction201215);
825  ATH_MSG_DEBUG("use uA2MeV correction 2015 1/2 week = "
827 
829 
831  .ignore(); // this set the flags for the internal tool without
832  // systematics
834  if (registry.registerSystematics(*this) != StatusCode::SUCCESS)
835  return StatusCode::FAILURE;
836 
837  if (m_onlyElectrons.value() && m_onlyPhotons.value()) {
838  ATH_MSG_ERROR("Cannot select both onlyElectrons and onlyPhotons");
839  return StatusCode::FAILURE;
840  }
841  if (m_onlyElectrons.value()) {
843  resetAccessor (m_accessors->electronTrackAcc, *this, "trackParticleLinks");
844  }
845  }
846  if (m_onlyPhotons.value()) {
847  resetAccessor (m_accessors->photonVertexAcc, *this, "vertexLinks");
848  }
849  if (m_decorateEmva)
850  resetAccessor (m_accessors->decEmva, *this, "E_mva_only");
851 
852  ANA_CHECK (initializeColumns ());
853 
854  return StatusCode::SUCCESS;
855 }
856 
857 
859 {
860  const Accessors& acc = *m_accessors;
861 
862  // this is departing from the logic below, as we are now requiring the
863  // user to specify at configuration time whether we run on electrons
864  // or photons. this is necessary to configure the columns we need
865  // correctly.
866  if (m_onlyElectrons.value())
867  {
869  }
870  if (m_onlyPhotons.value())
871  {
872  if (acc.photonVertexAcc(particle).size() > 0)
873  {
875  }
876  else
877  {
879  }
880  }
881 
882  // this is the old logic and should not be visited in columnar mode
883  // (disabled by turning on onlyElectrons or onlyPhotons)
884  auto ptype = PATCore::ParticleType::Electron;
885  //no ForwardElectron ptype: consider them as Electron
887  else if (xAOD::EgammaHelpers::isPhoton(&particle.getXAODObject())) {
890  }
891  else {
892  ATH_MSG_ERROR("particle is not electron of photon");
893  throw std::runtime_error("particle is not electron or photon");
894  }
895  return ptype;
896 }
897 
899  const xAOD::Egamma& particle, bool withCT) const {
900  const auto ptype = xAOD2ptype(particle);
901  const auto cl_etaCalo =
902  xAOD::get_eta_calo(*particle.caloCluster(), particle.author());
903 
904  return m_rootTool->resolution(particle.e(), particle.caloCluster()->eta(),
905  cl_etaCalo, ptype, withCT,
906  false); // TODO: always for full simulation
907 }
908 
910  double energy, double cl_eta, double cl_etaCalo,
911  PATCore::ParticleType::Type ptype, bool withCT) const {
912  return m_rootTool->resolution(energy, cl_eta, cl_etaCalo, ptype, withCT,
913  false);
914 }
915 
917  xAOD::Egamma& input) const {
918  // Retrieve the event information:
919  const xAOD::EventInfo* event_info = nullptr;
920  if (evtStore()->retrieve(event_info, "EventInfo").isFailure()) {
921  ATH_MSG_ERROR("No EventInfo object could be retrieved");
923  }
924  return applyCorrection(input, *event_info);
925 }
926 
928  const xAOD::Electron& input, xAOD::Electron*& output) const {
929  // A sanity check:
930  if (output)
932  "Non-null pointer received. "
933  "There's a possible memory leak!");
934 
935  output = new xAOD::Electron();
936  output->makePrivateStore(input);
937  return applyCorrection(*output);
938 }
939 
941  const xAOD::Photon& input, xAOD::Photon*& output) const {
942  // A sanity check:
943  if (output)
945  "Non-null pointer received. "
946  "There's a possible memory leak!");
947 
948  output = new xAOD::Photon();
949  output->makePrivateStore(input);
950  return applyCorrection(*output);
951 }
952 
954  const xAOD::Photon& input) const {
955  xAOD::Photon* new_particle = nullptr;
956  ANA_CHECK_THROW(correctedCopy(input, new_particle));
957  const double e = new_particle->e();
958  delete new_particle;
959  return e;
960 }
961 
963  const xAOD::Electron& input) const {
964  xAOD::Electron* new_particle = nullptr;
965  ANA_CHECK_THROW(correctedCopy(input, new_particle));
966  const double e = new_particle->e();
967  delete new_particle;
968  return e;
969 }
970 
972  columnar::MutableEgammaId input, columnar::EventInfoId event_info) const {
973  const Accessors& acc = *m_accessors;
974 
975  // only used in simulation (for the smearing)
976  RandomNumber seed = m_set_seed_function(*this, input, event_info);
977 
978  columnar::ClusterId inputCluster = acc.caloClusterAcc (input)[0].value();
979 
981  ATH_MSG_DEBUG("applying energy recalibration before E0|E1|E2|E3 = "
982  << acc.energyBEAcc (inputCluster, 0) << "|"
983  << acc.energyBEAcc (inputCluster, 1) << "|"
984  << acc.energyBEAcc (inputCluster, 2) << "|"
985  << acc.energyBEAcc (inputCluster, 3));
986  // for now just go back to the xAOD object to access the subtool
987  const CP::CorrectionCode status_layer_recalibration = m_layer_recalibration_tool->applyCorrection(input.getXAODObject(), event_info.getXAODObject());
988  if (status_layer_recalibration == CP::CorrectionCode::Error) { return CP::CorrectionCode::Error; }
989  ATH_MSG_DEBUG("eta|phi = " << acc.etaAcc (input) << "|" << acc.phiAcc (input));
990  if (status_layer_recalibration == CP::CorrectionCode::Ok) {
991  ATH_MSG_DEBUG("decoration E0|E1|E2|E3 = "
992  << acc.Es0Acc(inputCluster) << "|"
993  << acc.Es1Acc(inputCluster) << "|"
994  << acc.Es2Acc(inputCluster) << "|"
995  << acc.Es3Acc(inputCluster) << "|");
996  if (acc.Es2Acc(inputCluster) == 0 and acc.Es1Acc(inputCluster) == 0 and
997  acc.Es3Acc(inputCluster) == 0 and acc.Es0Acc(inputCluster) == 0 and
998  (std::abs(acc.etaAcc (input)) < 1.37 or (std::abs(acc.etaAcc (input)) > 1.55 and std::abs(acc.etaAcc (input)) < 2.47)))
999  {
1000  ATH_MSG_WARNING("all layer energies are zero");
1001  }
1002  }
1003  }
1004 
1005  double energy = 0.;
1006  // apply MVA calibration
1007  if (!m_MVACalibSvc.empty()) {
1008  if (acc.authorAcc (input) !=
1009  xAOD::EgammaParameters::AuthorFwdElectron) { // do not apply MVA
1010  // calibration to fwd
1011  // electrons
1012  m_MVACalibSvc->getEnergy(inputCluster.getXAODObject(), input.getXAODObject(), energy)
1013  .ignore(); // TODO check StatusCode
1014  } else {
1015  energy = acc.eAcc (input);
1016  }
1017  ATH_MSG_DEBUG("energy after MVA calibration = " << std::format("{:.2f}", energy));
1018  } else {
1019  energy = acc.eAcc (input);
1020  }
1021  if (m_decorateEmva)
1022  {
1023  acc.decEmva(input) = energy;
1024  }
1025 
1027  // Crack calibation correction for es2011c (calibration hits calibration)
1028  const auto ptype = xAOD2ptype(input);
1029  const double etaden =
1031  ? static_cast<const xAOD::Electron&>(input.getXAODObject()).trackParticle()->eta()
1032  : acc.clusterEtaAcc(inputCluster);
1033  energy *= m_rootTool->applyMCCalibration(acc.clusterEtaAcc(inputCluster),
1034  energy / cosh(etaden), ptype);
1035  ATH_MSG_DEBUG("energy after crack calibration es2011c = "
1036  << std::format("{:.2f}", energy));
1037  }
1038 
1039  /*
1040  * Here we check for each event the kind of data DATA vs FullSim
1041  * The m_simulation flavour has already been configured
1042  */
1044  (acc.eventTypeAcc(event_info,xAOD::EventInfo::IS_SIMULATION))
1045  ? m_simulation
1047 
1048  unsigned int runNumber_for_tool = 0;
1049 
1050  // apply uniformity corrections to data
1052  // Get run number
1053  runNumber_for_tool = acc.runNumberAcc(event_info);
1054  // Get etaCalo, phiCalo
1055  const auto cl_eta = acc.clusterEtaAcc(inputCluster);
1056  double etaCalo = 0, phiCalo = 0;
1058  etaCalo = acc.etaCaloAcc(inputCluster, acc.authorAcc(input), false);
1060  phiCalo =
1061  acc.phiCaloAcc(inputCluster, acc.authorAcc(input), false);
1062  }
1063  }
1064 
1065  // Intermodule
1067  energy =
1068  intermodule_correction(energy, acc.clusterPhiAcc(inputCluster), cl_eta);
1069  ATH_MSG_DEBUG("energy after intermodule correction = "
1070  << std::format("{:.2f}", energy));
1071  }
1072 
1073  // Calo distortion
1078  double etaC = acc.clusterEtaAcc(inputCluster);
1079  double phiC = acc.clusterPhiAcc(inputCluster);
1080  int ieta = m_caloDistPhiUnifCorr->GetXaxis()->FindBin(etaC);
1081  ieta = ieta == 0 ? 1
1082  : (ieta > m_caloDistPhiUnifCorr->GetNbinsX()
1083  ? m_caloDistPhiUnifCorr->GetNbinsX()
1084  : ieta);
1085  int iphi = m_caloDistPhiUnifCorr->GetYaxis()->FindBin(phiC);
1086  iphi = iphi == 0 ? 1
1087  : (iphi > m_caloDistPhiUnifCorr->GetNbinsY()
1088  ? m_caloDistPhiUnifCorr->GetNbinsY()
1089  : iphi);
1090  energy *= m_caloDistPhiUnifCorr->GetBinContent(ieta, iphi);
1091  ATH_MSG_DEBUG(
1092  "energy after phi uniformity correction (for calo distortion) = "
1093  << std::format("{:.2f}", energy));
1094  }
1095 
1096  // Phi
1098  energy *= correction_phi_unif(etaCalo, phiCalo);
1099  ATH_MSG_DEBUG("energy after uniformity correction = "
1100  << std::format("{:.2f}", energy));
1101  }
1102 
1103  // ADC
1104  if (m_ADCLinearity_tool) {
1105  double et = energy / std::cosh(cl_eta);
1106  double corr =
1107  m_ADCLinearity_tool->getCorr(etaCalo, et, xAOD2ptype(input));
1108  energy *= corr;
1109  ATH_MSG_DEBUG("energy after ADC linearity correction = "
1110  << std::format("{:.2f}", energy));
1111  }
1112 
1113  // Gain
1114  if (m_gain_tool) {
1115  const auto es2 = acc.Es2Acc.isAvailable(inputCluster)
1116  ? acc.Es2Acc(inputCluster)
1117  : acc.energyBEAcc (inputCluster,2);
1118  if (!(std::abs(cl_eta) < 1.52 and std::abs(cl_eta) > 1.37) and
1119  std::abs(cl_eta) < 2.4)
1121  cl_eta, energy / GeV, es2 / GeV,
1122  xAOD2ptype(input)); // cl_eta ok, TODO: check corrected E2
1123  } else if (m_gain_tool_run2) {
1124  double et = energy / std::cosh(cl_eta);
1125  double corr = m_gain_tool_run2->getUncertainty(etaCalo, et,
1126  xAOD2ptype(input), true);
1127  energy /= (1 + corr);
1128  }
1129  ATH_MSG_DEBUG("energy after gain correction = " << std::format("{:.2f}", energy));
1130  } else {
1131  if (m_user_random_run_number == 0) {
1132  if (acc.randomrunnumber_getter.isAvailable(event_info)) {
1133  runNumber_for_tool = acc.randomrunnumber_getter(event_info);
1134  } else {
1135  ATH_MSG_ERROR(
1136  "Pileup tool not run before using "
1137  "ElectronPhotonFourMomentumCorrection! Assuming it is 2016. If you "
1138  "want to force a specific period set the property randomRunNumber "
1139  "of the tool, e.g. in the job option: "
1140  "tool.randomRunNumber = 123456 or "
1141  "tool.randomRunNumber = "
1142  "EgammaCalibrationAndSmearingToolRunNumbersExample.run_2016");
1143  runNumber_for_tool = EgammaCalibPeriodRunNumbersExample::run_2016;
1144  }
1145  } else {
1146  runNumber_for_tool = m_user_random_run_number;
1147  }
1148  }
1149 
1150  const double eraw = ((acc.Es0Acc.isAvailable(inputCluster)
1151  ? acc.Es0Acc(inputCluster)
1152  : acc.energyBEAcc(inputCluster,0)) +
1153  (acc.Es1Acc.isAvailable(inputCluster)
1154  ? acc.Es1Acc(inputCluster)
1155  : acc.energyBEAcc(inputCluster,1)) +
1156  (acc.Es2Acc.isAvailable(inputCluster)
1157  ? acc.Es2Acc(inputCluster)
1158  : acc.energyBEAcc(inputCluster,2)) +
1159  (acc.Es3Acc.isAvailable(inputCluster)
1160  ? acc.Es3Acc(inputCluster)
1161  : acc.energyBEAcc(inputCluster,3)));
1162 
1163 
1165  ATH_MSG_DEBUG("is fast");
1167  ATH_MSG_DEBUG("is full");
1169  ATH_MSG_DEBUG("is data");
1170 
1171  // apply scale factors or systematics
1172  energy = m_rootTool->getCorrectedEnergy(
1173  runNumber_for_tool, dataType, xAOD2ptype(input),
1174  inputCluster(acc.clusterEtaAcc),
1175  inputCluster(acc.clusterEtaBEAcc,2),
1176  acc.etaCaloAcc(inputCluster, acc.authorAcc (input), false), energy,
1177  acc.Es2Acc.isAvailable(inputCluster)
1178  ? acc.Es2Acc(inputCluster)
1179  : inputCluster(acc.energyBEAcc,2),
1180  eraw, seed, oldtool_scale_flag_this_event(input, event_info),
1182  m_varSF);
1183 
1184  ATH_MSG_DEBUG("energy after scale/systematic correction = " << std::format("{:.2f}", energy));
1185 
1186  // TODO: this check should be done before systematics variations
1187  const double new_energy2 = energy * energy;
1188  const double m2 = acc.mAcc (input) * acc.mAcc (input);
1189  const double p2 = new_energy2 > m2 ? new_energy2 - m2 : 0.;
1190  acc.ptOutDec (input) = sqrt(p2) / cosh(acc.etaAcc (input));
1191  ATH_MSG_DEBUG("after setting pt, energy = " << acc.eAcc (input));
1192  return CP::CorrectionCode::Ok;
1193 }
1194 
1196  xAOD::Egamma* p, const xAOD::EventInfo* event_info) {
1197  ANA_CHECK_THROW(applyCorrection(*p, *event_info));
1198  ATH_MSG_DEBUG("returning " << p->e());
1199  return p->e();
1200 }
1201 
1204  columnar::EgammaId p, columnar::EventInfoId event_info) const {
1205  const Accessors& acc = *m_accessors;
1206  if (!acc.eventTypeAcc (event_info, xAOD::EventInfo::IS_SIMULATION))
1208  if (m_currentScalePredicate(*this,p))
1210  else
1212 }
1213 
1216  columnar::EgammaId, columnar::EventInfoId event_info) const {
1217  const Accessors& acc = *m_accessors;
1218  return acc.eventTypeAcc (event_info, xAOD::EventInfo::IS_SIMULATION)
1221 }
1222 
1224  const xAOD::Electron* el, const xAOD::EventInfo* event_info) {
1227  ? m_simulation
1229 
1230  const xAOD::TrackParticle* eTrack = el->trackParticle();
1231 
1232  // track momentum and eta
1233  const float el_tracketa = eTrack->eta();
1234  const float el_trackmomentum = eTrack->pt() * cosh(el->eta());
1235 
1236  return m_rootTool->getCorrectedMomentum(
1237  dataType, PATCore::ParticleType::Electron, el_trackmomentum, el_tracketa,
1238  oldtool_scale_flag_this_event(*el, *event_info), m_varSF);
1239 }
1240 
1242  const CP::SystematicVariation& systematic) const {
1244  return sys.find(systematic) != sys.end();
1245 }
1246 
1248  const {
1249  CP::SystematicSet affecting_systematics;
1250  for (const auto& it : m_syst_description) {
1251  affecting_systematics.insert(it.first);
1252  }
1253  for (const auto& it : m_syst_description_resolution) {
1254  affecting_systematics.insert(it.first);
1255  }
1256 
1257  return affecting_systematics;
1258 }
1259 
1261  const EgammaPredicate always = [](const EgammaCalibrationAndSmearingTool&, columnar::EgammaId) { return true; };
1262 
1263  // Try to simplify a bit for the ones that are fully correlate in eta,
1264  // whatever the model and that are not included in the macros including
1265  // - ADC non linearity
1266  // - L2Gain
1267  // - Leakage
1268  // - Conversion related
1269  // - TopoCluster threshold
1270  // - AF2
1271  // - PS_BARREL_B12
1272  // - S12EXTRALASTETABINRUN2
1273  // - ZEESTAT
1274  // - Run3 pre OFC + EXTRA
1275  if (m_decorrelation_model_scale == ScaleDecorrelation::FULL_ETA_CORRELATED ||
1277  // Electron leakage, ADCLin, convReco only in final run2 recommendations
1281  // systematic related to ADC non linearity correction. Before 2022, there
1282  // was not correction, nor related systematic
1284  m_syst_description[CP::SystematicVariation("EG_SCALE_ADCLIN", +1)] =
1286  m_syst_description[CP::SystematicVariation("EG_SCALE_ADCLIN", -1)] =
1288  }
1289  // Gain splitted uncertainty
1290  m_syst_description[CP::SystematicVariation("EG_SCALE_L2MEDIUMGAIN", +1)] =
1292  m_syst_description[CP::SystematicVariation("EG_SCALE_L2MEDIUMGAIN", -1)] =
1294  m_syst_description[CP::SystematicVariation("EG_SCALE_L2LOWGAIN", +1)] =
1296  m_syst_description[CP::SystematicVariation("EG_SCALE_L2LOWGAIN", -1)] =
1298 
1299  // Electron leakage
1300  m_syst_description[CP::SystematicVariation("EG_SCALE_LEAKAGEELEC", +1)] =
1302  m_syst_description[CP::SystematicVariation("EG_SCALE_LEAKAGEELEC", -1)] =
1304 
1305  // Conversion related
1306  m_syst_description[CP::SystematicVariation("PH_SCALE_CONVRECO", +1)] =
1308  m_syst_description[CP::SystematicVariation("PH_SCALE_CONVRECO", -1)] =
1310  }
1311  // The equivalent of convReco (convefficiency and convfakerate) for other
1312  // models
1313  else {
1314  m_syst_description[CP::SystematicVariation("PH_SCALE_CONVEFFICIENCY",
1315  +1)] =
1317  m_syst_description[CP::SystematicVariation("PH_SCALE_CONVEFFICIENCY",
1318  -1)] =
1320  m_syst_description[CP::SystematicVariation("PH_SCALE_CONVFAKERATE", +1)] =
1322  m_syst_description[CP::SystematicVariation("PH_SCALE_CONVFAKERATE", -1)] =
1324  }
1325 
1326  // additional systematics for R22 OFC and MC21 pre and bulk
1328  m_syst_description[CP::SystematicVariation("EG_SCALE_OFC", +1)] =
1330  m_syst_description[CP::SystematicVariation("EG_SCALE_OFC", -1)] =
1332 
1333  m_syst_description[CP::SystematicVariation("EG_SCALE_EXTRARUN3PRE", +1)] =
1335  m_syst_description[CP::SystematicVariation("EG_SCALE_EXTRARUN3PRE", -1)] =
1337  }
1338 
1349 
1350  // topo clustr threshold systematics aded to release 21 recommendations
1351  m_syst_description[CP::SystematicVariation("EG_SCALE_TOPOCLUSTER_THRES",
1352  +1)] =
1354  m_syst_description[CP::SystematicVariation("EG_SCALE_TOPOCLUSTER_THRES",
1355  -1)] =
1357 
1358  // AF3 for run3 models: es2022_R22_PRE and esmodel >= es2023_R22_Run2_v1
1359  // although we prevent AF for es2022_R22_PRE and es2024_Run3_ofc0_v0
1360  // AF3 are still technically added in the tool
1361  // but normally uncertainty will be 0
1363  m_syst_description[CP::SystematicVariation("EG_SCALE_AF3", +1)] =
1365  m_syst_description[CP::SystematicVariation("EG_SCALE_AF3", -1)] =
1367  }
1368  else {
1369  // and extra AF2 systematics for release 21 recommendations - Moriond 2018
1370  // - pending proper AF2 to FullSim correction with release 21
1371  m_syst_description[CP::SystematicVariation("EG_SCALE_AF2", +1)] =
1373  m_syst_description[CP::SystematicVariation("EG_SCALE_AF2", -1)] =
1375  }
1376  }
1377 
1378  // PS correlated barrel uncertainty
1387  m_syst_description[CP::SystematicVariation("EG_SCALE_PS_BARREL_B12",
1388  +1)] =
1390  m_syst_description[CP::SystematicVariation("EG_SCALE_PS_BARREL_B12",
1391  -1)] =
1393  }
1394 
1395  // additional systematic for S12 last eta bin run2
1401  "EG_SCALE_S12EXTRALASTETABINRUN2", +1)] =
1404  "EG_SCALE_S12EXTRALASTETABINRUN2", -1)] =
1406  }
1407 
1408  // Zee stat, if for FULL we do not ask for m_use_full_statistical_error
1410  ScaleDecorrelation::FULL_ETA_CORRELATED or
1412  // return 1 variation only, fully correlated in eta, equal to the correct
1413  // value but scaled by sqrt(number of bins) the scaling is done by the old
1414  // tool
1415  m_syst_description[CP::SystematicVariation("EG_SCALE_ZEESTAT", +1)] =
1417  m_syst_description[CP::SystematicVariation("EG_SCALE_ZEESTAT", -1)] =
1419  }
1420  }
1421  if (m_decorrelation_model_scale == ScaleDecorrelation::ONENP) {
1422  // TODO: independet implementation of ALL UP looping on all the variations
1423  m_syst_description[CP::SystematicVariation("EG_SCALE_ALL", +1)] =
1425  m_syst_description[CP::SystematicVariation("EG_SCALE_ALL", -1)] =
1427 
1428  // to be consistent with other schemes, we add
1429  // extra AF systematics in addition to the 1NP
1436  m_syst_description[CP::SystematicVariation("EG_SCALE_AF2", +1)] =
1438  m_syst_description[CP::SystematicVariation("EG_SCALE_AF2", -1)] =
1440  }
1442  m_syst_description[CP::SystematicVariation("EG_SCALE_AF3", +1)] =
1444  m_syst_description[CP::SystematicVariation("EG_SCALE_AF3", -1)] =
1446  }
1447  }
1448  else if (m_decorrelation_model_scale ==
1449  ScaleDecorrelation::FULL_ETA_CORRELATED) {
1450 // all the physical effects separately, considered as fully correlated in eta
1452 #define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown) \
1453  m_syst_description[CP::SystematicVariation(#name, +1)] = \
1454  SysInfo{always, flagup}; \
1455  m_syst_description[CP::SystematicVariation(#name, -1)] = \
1456  SysInfo{always, flagdown};
1457 #include "ElectronPhotonFourMomentumCorrection/systematics_es2024_Run3_v0.def"
1458 #undef SYSMACRO
1459  }
1460  else {
1461 // common systematics for all the esmodels
1462 #define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown) \
1463  m_syst_description[CP::SystematicVariation(#name, +1)] = \
1464  SysInfo{always, flagup}; \
1465  m_syst_description[CP::SystematicVariation(#name, -1)] = \
1466  SysInfo{always, flagdown};
1467 #include "ElectronPhotonFourMomentumCorrection/systematics_S12_2022.def"
1468 #undef SYSMACRO
1469  }
1470 
1474  m_syst_description[CP::SystematicVariation("EG_SCALE_LARCALIB", +1)] =
1476  m_syst_description[CP::SystematicVariation("EG_SCALE_LARCALIB", -1)] =
1478  m_syst_description[CP::SystematicVariation("EG_SCALE_L2GAIN", +1)] =
1480  m_syst_description[CP::SystematicVariation("EG_SCALE_L2GAIN", -1)] =
1482  }
1483 
1484  // additional systematics for S12 run2
1495  "EG_SCALE_LARCALIB_EXTRA2015PRE", +1)] =
1498  "EG_SCALE_LARCALIB_EXTRA2015PRE", -1)] =
1500  }
1501 
1502  // additional systematics for temperature run1->run2
1509  "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE", +1)] =
1512  "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE", -1)] =
1514  }
1515 
1516  // additional systematic for temperature 2015->2016
1519  "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE", +1)] =
1522  "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE", -1)] =
1524  }
1525 
1526  // additional systematic for PP0 region
1542  m_syst_description[CP::SystematicVariation("EG_SCALE_MATPP0", +1)] =
1544  m_syst_description[CP::SystematicVariation("EG_SCALE_MATPP0", -1)] =
1546  }
1547 
1548  // systematic related to wtots1
1564  m_syst_description[CP::SystematicVariation("EG_SCALE_WTOTS1", +1)] =
1566  m_syst_description[CP::SystematicVariation("EG_SCALE_WTOTS1", -1)] =
1568  }
1569 
1570  // systematic for the scintillators
1589  // scintillator systematics
1590  m_syst_description[CP::SystematicVariation("EG_SCALE_E4SCINTILLATOR",
1591  +1)] =
1593  m_syst_description[CP::SystematicVariation("EG_SCALE_E4SCINTILLATOR",
1594  -1)] =
1596  }
1597 
1598  } else if (m_decorrelation_model_scale ==
1599  ScaleDecorrelation::ONENP_PLUS_UNCONR) {
1600 // qsum of all variations correlated 8/13 TeV + uncorrelated (additional
1601 // systematics for 2015PRE or 2016) all the physical effects separately,
1602 // considered as fully correlated in eta
1603 // TODO: fix for es2017
1604 #define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown) \
1605  m_syst_description[CP::SystematicVariation(#name, +1)] = \
1606  SysInfo{always, flagup}; \
1607  m_syst_description[CP::SystematicVariation(#name, -1)] = \
1608  SysInfo{always, flagdown};
1609 #include "ElectronPhotonFourMomentumCorrection/systematics_1NPCOR_PLUS_UNCOR.def"
1610 #undef SYSMACRO
1611 
1612  // additional systematic for S12 last eta bin run2 - not needed anymore for
1613  // last 20.7 model since it is part of bin per bin E1/E2 uncertainty in root
1614  // file
1619  "EG_SCALE_S12EXTRALASTETABINRUN2", +1)] =
1622  "EG_SCALE_S12EXTRALASTETABINRUN2", -1)] =
1624  }
1625 
1627  using pairvector = std::vector<std::pair<double, double>>;
1628  const pairvector decorrelation_bins_BE = {{0., 1.45}, {1.52, 2.5}};
1629  const std::vector<double> decorrelation_edges_TWELVE = {
1630  0., 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4};
1631  std::vector<double> decorrelation_edges_MODULE = {
1632  0., 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.37, 1.52, 1.8};
1633  const std::vector<double> decorrelation_edges_MATERIAL = {0.0, 1.1, 1.5,
1634  2.1, 2.5};
1635  std::vector<double> decorrelation_edges_S12_EXTRARUN3 = {
1636  0., 0.8, 1.5, 2.5};
1637 
1638  std::vector<double> decorrelation_edges_S12;
1639  // for es2018_R21_v1 : 4 eta bins for muon E1/E2 uncertainty correlation
1641  decorrelation_edges_S12.resize(5);
1642  decorrelation_edges_S12 = {0., 1.35, 1.5, 2.4, 2.5};
1646  decorrelation_edges_S12.resize(8);
1647  decorrelation_edges_S12 = {0., 0.6, 1.0, 1.35, 1.5, 1.8, 2.4, 2.5};
1648  //
1649  // PS scale from muons, so "crack" is a bit different
1650  decorrelation_edges_MODULE[7] = 1.4;
1651  decorrelation_edges_MODULE[8] = 1.5;
1652  }
1653  // for previous run 2 muon calibration with 20.7, 5 eta bins for E1/E2
1654  // uncertainty correlation
1655  else {
1656  decorrelation_edges_S12.resize(6);
1657  decorrelation_edges_S12 = {0., 0.6, 1.4, 1.5, 2.4, 2.5};
1658  }
1659 
1671 #define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown) \
1672  if (bool(fullcorrelated)) { \
1673  m_syst_description[CP::SystematicVariation(#name, +1)] = \
1674  SysInfo{always, flagup}; \
1675  m_syst_description[CP::SystematicVariation(#name, -1)] = \
1676  SysInfo{always, flagdown}; \
1677  } else { \
1678  int i = 0; \
1679  for (const auto& p : AbsEtaCaloPredicatesFactory(decorrelation)) { \
1680  m_syst_description[CP::SystematicVariation( \
1681  #name "__ETABIN" + std::to_string(i), +1)] = SysInfo{p, flagup}; \
1682  m_syst_description[CP::SystematicVariation( \
1683  #name "__ETABIN" + std::to_string(i), -1)] = SysInfo{p, flagdown}; \
1684  i += 1; \
1685  } \
1686  }
1687 #include "ElectronPhotonFourMomentumCorrection/systematics.def"
1688 #undef SYSMACRO
1691 #define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown) \
1692  if (bool(fullcorrelated)) { \
1693  m_syst_description[CP::SystematicVariation(#name, +1)] = \
1694  SysInfo{always, flagup}; \
1695  m_syst_description[CP::SystematicVariation(#name, -1)] = \
1696  SysInfo{always, flagdown}; \
1697  } else { \
1698  int i = 0; \
1699  for (const auto& p : AbsEtaCaloPredicatesFactory(decorrelation)) { \
1700  m_syst_description[CP::SystematicVariation( \
1701  #name "__ETABIN" + std::to_string(i), +1)] = SysInfo{p, flagup}; \
1702  m_syst_description[CP::SystematicVariation( \
1703  #name "__ETABIN" + std::to_string(i), -1)] = SysInfo{p, flagdown}; \
1704  i += 1; \
1705  } \
1706  }
1707 #include "ElectronPhotonFourMomentumCorrection/systematics_S12_2022.def"
1708 #undef SYSMACRO
1709  } else if (m_TESModel == egEnergyCorr::es2024_Run3_v0) {
1710 #define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown) \
1711  if (bool(fullcorrelated)) { \
1712  m_syst_description[CP::SystematicVariation(#name, +1)] = \
1713  SysInfo{always, flagup}; \
1714  m_syst_description[CP::SystematicVariation(#name, -1)] = \
1715  SysInfo{always, flagdown}; \
1716  } else { \
1717  int i = 0; \
1718  for (const auto& p : AbsEtaCaloPredicatesFactory(decorrelation)) { \
1719  m_syst_description[CP::SystematicVariation( \
1720  #name "__ETABIN" + std::to_string(i), +1)] = SysInfo{p, flagup}; \
1721  m_syst_description[CP::SystematicVariation( \
1722  #name "__ETABIN" + std::to_string(i), -1)] = SysInfo{p, flagdown}; \
1723  i += 1; \
1724  } \
1725  }
1726 #include "ElectronPhotonFourMomentumCorrection/systematics_es2024_Run3_v0.def"
1727 #undef SYSMACRO
1728  } else {
1729 #define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown) \
1730  if (bool(fullcorrelated)) { \
1731  m_syst_description[CP::SystematicVariation(#name, +1)] = \
1732  SysInfo{always, flagup}; \
1733  m_syst_description[CP::SystematicVariation(#name, -1)] = \
1734  SysInfo{always, flagdown}; \
1735  } else { \
1736  int i = 0; \
1737  for (const auto& p : AbsEtaCaloPredicatesFactory(decorrelation)) { \
1738  m_syst_description[CP::SystematicVariation( \
1739  #name "__ETABIN" + std::to_string(i), +1)] = SysInfo{p, flagup}; \
1740  m_syst_description[CP::SystematicVariation( \
1741  #name "__ETABIN" + std::to_string(i), -1)] = SysInfo{p, flagdown}; \
1742  i += 1; \
1743  } \
1744  }
1745 #include "ElectronPhotonFourMomentumCorrection/systematics_S12.def"
1746 #undef SYSMACRO
1747  } // else
1748 
1750  // statistical error, decorrelate in *all* the bins
1751  int i = 0;
1752  const TAxis& axis_statistical_error(m_rootTool->get_ZeeStat_eta_axis());
1753  for (int ibin = 1; ibin <= axis_statistical_error.GetNbins(); ++ibin) {
1754  auto p = EtaCaloPredicateFactory(
1755  axis_statistical_error.GetBinLowEdge(ibin),
1756  axis_statistical_error.GetBinLowEdge(ibin + 1));
1758  "EG_SCALE_ZEESTAT__ETABIN" + std::to_string(i), +1)] =
1761  "EG_SCALE_ZEESTAT__ETABIN" + std::to_string(i), -1)] =
1763  ++i;
1764  }
1765  }
1766 
1767  // additional systematics for S12 run2
1778  "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN0", +1)] =
1782  "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN0", -1)] =
1786  "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN1", +1)] =
1787  SysInfo{AbsEtaCaloPredicateFactory({1.45, 2.47}),
1790  "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN1", -1)] =
1791  SysInfo{AbsEtaCaloPredicateFactory({1.45, 2.47}),
1794  "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN2", +1)] =
1795  SysInfo{AbsEtaCaloPredicateFactory({2.47, 3.2}),
1798  "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN2", -1)] =
1799  SysInfo{AbsEtaCaloPredicateFactory({2.47, 3.2}),
1801  }
1802 
1803  // additional systematics for temperature run1->run2
1810  "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN0", +1)] =
1811  SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[0]),
1814  "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN0", -1)] =
1815  SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[0]),
1818  "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN1", +1)] =
1819  SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[1]),
1822  "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN1", -1)] =
1823  SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[1]),
1825  }
1826 
1827  // additional systematic for temperature 2015->2016
1830  "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN0", +1)] =
1831  SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[0]),
1834  "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN1", +1)] =
1835  SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[1]),
1838  "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN0", -1)] =
1839  SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[0]),
1842  "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN1", -1)] =
1843  SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[1]),
1845  }
1846 
1847  // additional systematic for PP0 region
1863  m_syst_description[CP::SystematicVariation("EG_SCALE_MATPP0__ETABIN0",
1864  +1)] = SysInfo{
1866  m_syst_description[CP::SystematicVariation("EG_SCALE_MATPP0__ETABIN1",
1867  +1)] = SysInfo{
1869  m_syst_description[CP::SystematicVariation("EG_SCALE_MATPP0__ETABIN0",
1870  -1)] = SysInfo{
1872  m_syst_description[CP::SystematicVariation("EG_SCALE_MATPP0__ETABIN1",
1873  -1)] =
1876  }
1877 
1878  // systematic related to wtots1
1891  m_syst_description[CP::SystematicVariation("EG_SCALE_WTOTS1", +1)] =
1893  m_syst_description[CP::SystematicVariation("EG_SCALE_WTOTS1", -1)] =
1895  }
1896 
1897  // systematic related to wtots1, decorrelate eta bin [1.52,1.82] from rest
1901  m_syst_description[CP::SystematicVariation("EG_SCALE_WTOTS1__ETABIN0",
1902  +1)] =
1903  SysInfo{DoubleOrAbsEtaCaloPredicate(0, 1.52, 1.82, 2.47),
1905  m_syst_description[CP::SystematicVariation("EG_SCALE_WTOTS1__ETABIN0",
1906  -1)] =
1907  SysInfo{DoubleOrAbsEtaCaloPredicate(0, 1.52, 1.82, 2.47),
1909  m_syst_description[CP::SystematicVariation("EG_SCALE_WTOTS1__ETABIN1",
1910  +1)] =
1911  SysInfo{AbsEtaCaloPredicateFactory({1.52, 1.82}),
1913  m_syst_description[CP::SystematicVariation("EG_SCALE_WTOTS1__ETABIN1",
1914  -1)] =
1915  SysInfo{AbsEtaCaloPredicateFactory({1.52, 1.82}),
1917  }
1918 
1919  // systematic for the scintillators
1939  "EG_SCALE_E4SCINTILLATOR__ETABIN0", +1)] =
1943  "EG_SCALE_E4SCINTILLATOR__ETABIN1", +1)] =
1944  SysInfo{AbsEtaCaloPredicateFactory(1.46, 1.52),
1947  "EG_SCALE_E4SCINTILLATOR__ETABIN2", +1)] =
1951  "EG_SCALE_E4SCINTILLATOR__ETABIN0", -1)] =
1955  "EG_SCALE_E4SCINTILLATOR__ETABIN1", -1)] =
1956  SysInfo{AbsEtaCaloPredicateFactory(1.46, 1.52),
1959  "EG_SCALE_E4SCINTILLATOR__ETABIN2", -1)] =
1962  if (m_TESModel == egEnergyCorr::es2024_Run3_v0) { // extended E4 in Run 3
1964  "EG_SCALE_E4SCINTILLATOR__ETABIN3", +1)] =
1968  "EG_SCALE_E4SCINTILLATOR__ETABIN3", -1)] =
1971  }
1972  }
1973  } else {
1974  ATH_MSG_FATAL("scale decorrelation model invalid");
1975  }
1976 
1977  // resolution systematics
1979  // ALL will not include AF2/AF3 systematic
1980  // individual AF NP is always provided
1981  // linghua.guo@cern.ch 2025-04-23
1983  "EG_RESOLUTION_ALL", +1)] = egEnergyCorr::Resolution::AllUp;
1985  "EG_RESOLUTION_ALL", -1)] = egEnergyCorr::Resolution::AllDown;
1986  } else if (m_decorrelation_model_resolution ==
1989  "EG_RESOLUTION_ZSMEARING", +1)] = egEnergyCorr::Resolution::ZSmearingUp;
1991  "EG_RESOLUTION_ZSMEARING", -1)] =
1994  "EG_RESOLUTION_SAMPLINGTERM", +1)] =
1997  "EG_RESOLUTION_SAMPLINGTERM", -1)] =
2000  "EG_RESOLUTION_MATERIALID", +1)] =
2003  "EG_RESOLUTION_MATERIALID", -1)] =
2006  "EG_RESOLUTION_MATERIALCALO", +1)] =
2009  "EG_RESOLUTION_MATERIALCALO", -1)] =
2012  "EG_RESOLUTION_MATERIALGAP", +1)] =
2015  "EG_RESOLUTION_MATERIALGAP", -1)] =
2018  "EG_RESOLUTION_MATERIALCRYO", +1)] =
2021  "EG_RESOLUTION_MATERIALCRYO", -1)] =
2024  "EG_RESOLUTION_PILEUP", +1)] = egEnergyCorr::Resolution::PileUpUp;
2026  "EG_RESOLUTION_PILEUP", -1)] = egEnergyCorr::Resolution::PileUpDown;
2043  "EG_RESOLUTION_MATERIALIBL", +1)] =
2046  "EG_RESOLUTION_MATERIALIBL", -1)] =
2049  "EG_RESOLUTION_MATERIALPP0", +1)] =
2052  "EG_RESOLUTION_MATERIALPP0", -1)] =
2054 
2055  if (m_TESModel == egEnergyCorr::es2022_R22_PRE) { // exta sys. for Run-3
2056  // pre-recommendations
2058  "EG_RESOLUTION_OFC", +1)] = egEnergyCorr::Resolution::OFCUp;
2060  "EG_RESOLUTION_OFC", -1)] = egEnergyCorr::Resolution::OFCDown;
2061  }
2062  }
2063  } else {
2064  ATH_MSG_FATAL("resolution decorrelation model invalid");
2065  }
2066 
2067  // Always use individual AF2/AF3 systematics for resolution
2073  "EG_RESOLUTION_AF2", +1)] = egEnergyCorr::Resolution::afUp;
2075  "EG_RESOLUTION_AF2", -1)] = egEnergyCorr::Resolution::afDown;
2076  }
2079  "EG_RESOLUTION_AF3", +1)] = egEnergyCorr::Resolution::afUp;
2081  "EG_RESOLUTION_AF3", -1)] = egEnergyCorr::Resolution::afDown;
2082  }
2083 
2084  // ep combination systematics
2085  if (m_use_ep_combination) {
2086  m_syst_description[CP::SystematicVariation("EL_SCALE_MOMENTUM", +1)] =
2088  m_syst_description[CP::SystematicVariation("EL_SCALE_MOMENTUM", -1)] =
2090  }
2091 }
2092 
2094  const {
2095  return affectingSystematics();
2096 }
2097 
2099  const CP::SystematicSet& systConfig) {
2100 
2101  // set the nominal one (no systematics)
2111 
2112  if (systConfig.empty())
2113  return StatusCode::SUCCESS;
2114 
2115  // the following code allows only ONE systematic variation at a time (1 for
2116  // scale, 1 for resolution)
2117 
2118  bool first_scale = true;
2119  bool first_resolution = true;
2120  for (const auto& it : systConfig) {
2121  const auto found_scale = m_syst_description.find(it);
2122  if (found_scale != m_syst_description.end()) {
2123  if (not first_scale) {
2124  ATH_MSG_ERROR("multiple scale variations not supported");
2125  throw std::runtime_error("multiple scale variations not supported");
2126  }
2127  first_scale = false;
2128  m_currentScaleVariation_MC = found_scale->second.effect;
2129  m_currentScalePredicate = found_scale->second.predicate;
2130  }
2131 
2132  const auto found_resolution = m_syst_description_resolution.find(it);
2133  if (found_resolution != m_syst_description_resolution.end()) {
2134  if (not first_resolution) {
2135  ATH_MSG_ERROR("multiple resolution variations not supported");
2136  throw std::runtime_error(
2137  "multiple resolution variations not supported");
2138  }
2139  first_resolution = false;
2140  m_currentResolutionVariation_MC = found_resolution->second;
2141  }
2142  }
2143 
2144  return StatusCode::SUCCESS;
2145 }
2146 
2148  double Ecl, double phi, double eta) const {
2149 
2150  // Intermodule Widening Correction: E_corr = E / (a' - b' * ((1 / (1 +
2151  // exp((phi_mod - 2 * pi / 32) * c))) * (1 / (1 + exp((phi_mod - 2 * pi / 32)
2152  // * (d)))))) (phi_min, phi_max) : [a' = a / a, b' = b / a, c, d]
2153 
2154  double Ecl_corr = 0.;
2155  int DivInt = 0;
2156  double pi = M_PI;
2157 
2170 
2171  double phi_mod = 0;
2172  if (phi < 0)
2173  phi_mod = fmod(phi, 2 * pi / 16.) + pi / 8.;
2174  else
2175  phi_mod = fmod(phi, 2 * pi / 16.);
2176 
2177  // The correction concerns only the barrel
2178  if (std::abs(eta) <= 1.37) {
2179 
2180  if (phi < (-7 * pi / 8) && phi > (-1 * pi))
2181  Ecl_corr =
2182  Ecl /
2183  (1 - 0.1086 *
2184  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 175.2759))) *
2185  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-189.3612))))));
2186  if (phi < (-6 * pi / 8) && phi > (-7 * pi / 8))
2187  Ecl_corr =
2188  Ecl /
2189  (1 - 0.0596 *
2190  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 170.8305))) *
2191  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-233.3782))))));
2192  if (phi < (-5 * pi / 8) && phi > (-6 * pi / 8))
2193  Ecl_corr =
2194  Ecl /
2195  (1 - 0.0596 *
2196  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 147.1451))) *
2197  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-139.3386))))));
2198  if (phi < (-4 * pi / 8) && phi > (-5 * pi / 8))
2199  Ecl_corr =
2200  Ecl /
2201  (1 - 0.0583 *
2202  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 168.4644))) *
2203  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-246.2897))))));
2204  if (phi < (-3 * pi / 8) && phi > (-4 * pi / 8))
2205  Ecl_corr =
2206  Ecl /
2207  (1 - 0.0530 *
2208  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 177.6703))) *
2209  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-198.3227))))));
2210  if (phi < (-2 * pi / 8) && phi > (-3 * pi / 8))
2211  Ecl_corr =
2212  Ecl /
2213  (1 - 0.0672 *
2214  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 145.0693))) *
2215  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-242.1771))))));
2216  if (phi < (-1 * pi / 8) && phi > (-2 * pi / 8))
2217  Ecl_corr =
2218  Ecl /
2219  (1 - 0.0871 *
2220  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 132.3303))) *
2221  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-166.1833))))));
2222  if (phi < (0 * pi / 8) && phi > (-1 * pi / 8))
2223  Ecl_corr =
2224  Ecl /
2225  (1 - 0.0948 *
2226  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 127.6780))) *
2227  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-150.0700))))));
2228  if (phi < (1 * pi / 8) && phi > (0 * pi / 8))
2229  Ecl_corr =
2230  Ecl /
2231  (1 - 0.1166 *
2232  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 172.0679))) *
2233  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-235.3293))))));
2234  if (phi < (2 * pi / 8) && phi > (1 * pi / 8))
2235  Ecl_corr =
2236  Ecl /
2237  (1 - 0.1172 *
2238  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 190.3524))) *
2239  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-198.9400))))));
2240  if (phi < (3 * pi / 8) && phi > (2 * pi / 8))
2241  Ecl_corr =
2242  Ecl /
2243  (1 - 0.1292 *
2244  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 158.0540))) *
2245  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-165.3893))))));
2246  if (phi < (4 * pi / 8) && phi > (3 * pi / 8))
2247  Ecl_corr =
2248  Ecl /
2249  (1 - 0.1557 *
2250  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 162.2793))) *
2251  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-133.5131))))));
2252  if (phi < (5 * pi / 8) && phi > (4 * pi / 8))
2253  Ecl_corr =
2254  Ecl /
2255  (1 - 0.1659 *
2256  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 180.5270))) *
2257  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-168.5074))))));
2258  if (phi < (6 * pi / 8) && phi > (5 * pi / 8))
2259  Ecl_corr =
2260  Ecl /
2261  (1 - 0.1123 *
2262  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 128.2277))) *
2263  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-154.4455))))));
2264  if (phi < (7 * pi / 8) && phi > (6 * pi / 8))
2265  Ecl_corr =
2266  Ecl /
2267  (1 - 0.1394 *
2268  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 192.1216))) *
2269  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-198.0727))))));
2270  if (phi < (8 * pi / 8) && phi > (7 * pi / 8))
2271  Ecl_corr =
2272  Ecl /
2273  (1 - 0.1001 *
2274  ((1 / (1 + exp((phi_mod - 2 * pi / 32.) * 199.1735))) *
2275  (1 / (1 + exp((phi_mod - 2 * pi / 32.) * (-176.4056))))));
2276  }
2277 
2278  // No correction for the EC
2279  else {
2280  Ecl_corr = Ecl;
2281  }
2282 
2283  }
2284 
2285  else {
2286 
2287  // Definitions of module folding into four quarters (top, left, bottom and
2288  // right)
2289 
2290  DivInt = (int)(phi / ((2 * pi) / 16.));
2291  double phi_mod = phi - DivInt * (2 * pi / 16.);
2292 
2293  // Centring on the intermodule --> phi_mod will now be in [0,0.4]
2294  if (phi_mod < 0)
2295  phi_mod += pi / 8.;
2296 
2297  // The correction concerns only the barrel
2298  if (std::abs(eta) <= 1.4) {
2299 
2300  // Top quarter
2301  if (phi < (3 * pi) / 4. && phi >= pi / 4.) {
2302  Ecl_corr =
2303  Ecl / (1 - 0.131 * ((1 / (1 + exp((phi_mod - 0.2) * 199.08))) *
2304  (1 / (1 + exp((phi_mod - 0.2) * (-130.36))))));
2305  }
2306 
2307  // Right quarter
2308  if (phi < pi / 4. && phi >= -pi / 4.) {
2309  Ecl_corr =
2310  Ecl / (1 - 0.0879 * ((1 / (1 + exp((phi_mod - 0.2) * 221.01))) *
2311  (1 / (1 + exp((phi_mod - 0.2) * (-149.51))))));
2312  }
2313  // Bottom quarter
2314  if (phi < -pi / 4. && phi >= (-3 * pi) / 4.) {
2315  Ecl_corr =
2316  Ecl / (1 - 0.0605 * ((1 / (1 + exp((phi_mod - 0.2) * 281.37))) *
2317  (1 / (1 + exp((phi_mod - 0.2) * (-170.29))))));
2318  }
2319  // Left quarter
2320  if ((phi < (-3 * pi) / 4.) || (phi >= (3 * pi) / 4.)) {
2321  Ecl_corr =
2322  Ecl / (1 - 0.102 * ((1 / (1 + exp((phi_mod - 0.2) * 235.37))) *
2323  (1 / (1 + exp((phi_mod - 0.2) * (-219.04))))));
2324  }
2325  }
2326 
2327  // No correction for the EC
2328  else {
2329  Ecl_corr = Ecl;
2330  }
2331  }
2332 
2333  return Ecl_corr;
2334 }
2335 
2337  double phi) const {
2338  constexpr double PI = M_PI;
2339  double Fcorr = 1.0;
2340 
2342  // wrong mapping HV -> sectors in run1
2343  if (eta < -0.4 && eta > -0.6) {
2344  if (phi < (14 * PI / 32.) && phi > (13 * PI / 32.)) {
2345  Fcorr += 0.035;
2346  } else if (phi < (13 * PI / 32.) && phi > (12 * PI / 32.)) {
2347  Fcorr -= 0.035;
2348  }
2349  }
2350  }
2351 
2364 
2365  if (eta < 0.2 && eta > 0.) {
2366  if (phi < (-7 * 2 * PI / 32.) && phi > (-8 * 2 * PI / 32.)) {
2367  Fcorr = 1.016314;
2368  }
2369  }
2370 
2371  else if (eta < 0.6 && eta > 0.4) {
2372  if (phi < 0 && phi > (-2 * PI / 32.)) {
2373  Fcorr = 1.041591;
2374  } else if (phi < (-4 * 2 * PI / 32.) && phi > (-5 * 2 * PI / 32.)) {
2375  Fcorr = 1.067346;
2376  }
2377  }
2378 
2379  else if (eta < 0.8 && eta > 0.6) {
2380  if (phi < (7 * 2 * PI / 32.) && phi > (6 * 2 * PI / 32.)) {
2381  Fcorr = 1.027980;
2382  }
2383  }
2384 
2385  else if (eta < 1.4 && eta > 1.2) {
2386  if (phi < (-9 * 2 * PI / 32.) && phi > (-10 * 2 * PI / 32.)) {
2387  Fcorr = 1.020299;
2388  } else if (phi < (-11 * 2 * PI / 32.) && phi > (-12 * 2 * PI / 32.)) {
2389  Fcorr = 1.051426;
2390  }
2391  }
2392 
2393  else if (eta < 2.3 && eta > 2.1) {
2394  if (phi < (-12 * 2 * PI / 32.) && phi > (-13 * 2 * PI / 32.)) {
2395  Fcorr = 1.071695;
2396  }
2397  }
2398 
2399  else if (eta < 0. && eta > -0.2) {
2400  if (phi < (-12 * 2 * PI / 32.) && phi > (-13 * 2 * PI / 32.)) {
2401  Fcorr = 1.008227;
2402  } else if (phi < (-8 * 2 * PI / 32.) && phi > (-9 * 2 * PI / 32.)) {
2403  Fcorr = 1.013929;
2404  }
2405  }
2406 
2407  else if (eta < -0.2 && eta > -0.4) {
2408  if (phi < (-9 * 2 * PI / 32.) && phi > (-10 * 2 * PI / 32.)) {
2409  Fcorr = 1.015749;
2410  }
2411  }
2412 
2413  else if (eta < -1.2 && eta > -1.4) {
2414  if (phi < (-6 * 2 * PI / 32.) && phi > (-7 * 2 * PI / 32.)) {
2415  Fcorr = 1.064954;
2416  }
2417  }
2418 
2419  else if (eta < -1.6 && eta > -1.8) {
2420  if (phi < (9 * 2 * PI / 32.) && phi > (8 * 2 * PI / 32.)) {
2421  Fcorr = 1.027448;
2422  }
2423  }
2424 
2425  else if (eta < -2.3 && eta > -2.5) {
2426  if (phi < (-8 * 2 * PI / 32.) && phi > (-9 * 2 * PI / 32.)) {
2427  Fcorr = 1.025882;
2428  } else if (phi < (5 * 2 * PI / 32.) && phi > (4 * 2 * PI / 32.)) {
2429  Fcorr = 1.036616;
2430  } else if (phi < (9 * 2 * PI / 32.) && phi > (8 * 2 * PI / 32.)) {
2431  Fcorr = 1.053838;
2432  } else if (phi < (10 * 2 * PI / 32.) && phi > (9 * 2 * PI / 32.)) {
2433  Fcorr = 1.026856;
2434  } else if (phi < (11 * 2 * PI / 32.) && phi > (10 * 2 * PI / 32.)) {
2435  Fcorr = 0.994382;
2436  }
2437  }
2438 
2439  } // es2017_summer_improved end
2440 
2441  else {
2442  if (eta < 0.6 && eta > 0.4) {
2443  if (phi < 0 && phi > (-2 * PI / 32.)) {
2444  Fcorr = 1.028;
2445  } else if (phi < (-4 * 2 * PI / 32.) && phi > (-5 * 2 * PI / 32.)) {
2446  Fcorr = 1.044;
2447  }
2448  }
2449 
2450  else if (eta < 0.8 && eta > 0.6) {
2451  if (phi < (7 * 2 * PI / 32.) && phi > (6 * 2 * PI / 32.)) {
2452  Fcorr = 1.022;
2453  }
2454  }
2455 
2456  else if (eta < 1.4 && eta > 1.2) {
2457  if (phi < (-11 * 2 * PI / 32.) && phi > (-12 * 2 * PI / 32.)) {
2458  Fcorr = 1.038;
2459  }
2460  }
2461 
2462  else if (eta < 2.0 && eta > 1.9) {
2463  if (phi < (10 * 2 * PI / 32.) && phi > (9 * 2 * PI / 32.)) {
2464  Fcorr = 1.029;
2465  }
2466  }
2467 
2468  else if (eta < -1.2 && eta > -1.4) {
2469  if (phi < (-4 * 2 * PI / 32.) && phi > (-5 * 2 * PI / 32.)) {
2470  Fcorr = 1.048;
2471  } else if (phi < (-6 * 2 * PI / 32.) && phi > (-7 * 2 * PI / 32.)) {
2472  Fcorr = 1.048;
2473  }
2474  }
2475 
2476  else if (eta < -1.6 && eta > -1.8) {
2477  if (phi < (9 * 2 * PI / 32.) && phi > (8 * 2 * PI / 32.)) {
2478  Fcorr = 1.024;
2479  }
2480  }
2481 
2482  else if (eta < -2.3 && eta > -2.5) {
2483  if (phi < (-8 * 2 * PI / 32.) && phi > (-9 * 2 * PI / 32.)) {
2484  Fcorr = 1.037;
2485  } else if (phi < (5 * 2 * PI / 32.) && phi > (4 * 2 * PI / 32.)) {
2486  Fcorr = 1.031;
2487  } else if (phi < (9 * 2 * PI / 32.) && phi > (8 * 2 * PI / 32.)) {
2488  Fcorr = 1.040;
2489  } else if (phi < (10 * 2 * PI / 32.) && phi > (9 * 2 * PI / 32.)) {
2490  Fcorr = 1.030;
2491  } else if (phi < (11 * 2 * PI / 32.) && phi > (10 * 2 * PI / 32.)) {
2492  Fcorr = 1.020;
2493  }
2494  }
2495  }
2496 
2497  return Fcorr;
2498 }
2499 
2502 {
2503  for (auto egamma : egammas) {
2505  throw std::runtime_error ("EgammaCalibrationAndSmearingTool::callEvents: apply failed");
2506  }
2507 }
2508 
2511 {
2512  const Accessors& acc = *m_accessors;
2513  for (auto event : events) {
2514  auto eventInfo = acc.m_eventHandle(event);
2515  callSingleEvent (acc.m_egammaHandle(event), eventInfo);
2516  }
2517 }
2518 
2519 } // namespace CP
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
python.Dso.registry
registry
Definition: Control/AthenaServices/python/Dso.py:158
CP::EgammaCalibrationAndSmearingTool::m_useFastSim
int m_useFastSim
Definition: EgammaCalibrationAndSmearingTool.h:262
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:74
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CP::EgammaCalibrationAndSmearingTool::EgammaPredicate
std::function< bool(const EgammaCalibrationAndSmearingTool &, columnar::EgammaId)> EgammaPredicate
Definition: EgammaCalibrationAndSmearingTool.h:204
egEnergyCorr::Resolution::MaterialPP0Up
@ MaterialPP0Up
Definition: egammaEnergyCorrectionTool.h:93
egEnergyCorr::es2024_Run3_v0
@ es2024_Run3_v0
Definition: egammaEnergyCorrectionTool.h:343
egEnergyCorr::Scale::OFCDown
@ OFCDown
Definition: egammaEnergyCorrectionTool.h:266
CP::EgammaCalibrationAndSmearingTool::m_doADCLinearityCorrection
int m_doADCLinearityCorrection
Definition: EgammaCalibrationAndSmearingTool.h:271
PATCore::ParticleType::UnconvertedPhoton
@ UnconvertedPhoton
Definition: PATCoreEnums.h:38
CP::EgammaCalibrationAndSmearingTool::oldtool_resolution_flag_this_event
egEnergyCorr::Resolution::Variation oldtool_resolution_flag_this_event(columnar::EgammaId p, columnar::EventInfoId event_info) const
Definition: EgammaCalibrationAndSmearingTool.cxx:1215
et
Extra patterns decribing particle interation process.
CP::EgammaCalibrationAndSmearingTool::getElectronMomentum
virtual double getElectronMomentum(const xAOD::Electron *, const xAOD::EventInfo *)
Definition: EgammaCalibrationAndSmearingTool.cxx:1223
egEnergyCorr::Resolution::SamplingTermUp
@ SamplingTermUp
Definition: egammaEnergyCorrectionTool.h:74
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
egEnergyCorr::es2011c
@ es2011c
Definition: egammaEnergyCorrectionTool.h:299
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:79
egEnergyCorr::Scale::LArCalibExtra2015PreDown
@ LArCalibExtra2015PreDown
Definition: egammaEnergyCorrectionTool.h:166
xAOD::Electron
Electron_v1 Electron
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Electron.h:17
xAOD::EgammaParameters::convertedPhoton
@ convertedPhoton
Definition: EgammaEnums.h:20
CP::EgammaCalibrationAndSmearingTool::isAffectedBySystematic
virtual bool isAffectedBySystematic(const CP::SystematicVariation &systematic) const override
Declare the interface that this class provides.
Definition: EgammaCalibrationAndSmearingTool.cxx:1241
egEnergyCorr::es2011d
@ es2011d
Definition: egammaEnergyCorrectionTool.h:301
CP::EgammaCalibrationAndSmearingTool::affectingSystematics
virtual CP::SystematicSet affectingSystematics() const override
the list of all systematics this tool can be affected by
Definition: EgammaCalibrationAndSmearingTool.cxx:1247
egEnergyCorr::Scale::OFCUp
@ OFCUp
Definition: egammaEnergyCorrectionTool.h:265
CP::EgammaCalibrationAndSmearingTool::m_ResolutionType
std::string m_ResolutionType
Definition: EgammaCalibrationAndSmearingTool.h:260
vtune_athena.format
format
Definition: vtune_athena.py:14
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PATCore::ParticleType::Type
Type
Definition: PATCoreEnums.h:35
CP::EgammaCalibrationAndSmearingTool::EgammaCalibrationAndSmearingTool
EgammaCalibrationAndSmearingTool(const std::string &name)
Definition: EgammaCalibrationAndSmearingTool.cxx:287
correlationModel::FULL
@ FULL
Definition: AsgElectronEfficiencyCorrectionTool.cxx:49
egEnergyCorr::Scale::afUp
@ afUp
Definition: egammaEnergyCorrectionTool.h:245
egEnergyCorr::Scale::LArTemperature2016PreUp
@ LArTemperature2016PreUp
Definition: egammaEnergyCorrectionTool.h:171
CP::EgammaCalibrationAndSmearingTool::m_use_ep_combination
bool m_use_ep_combination
Definition: EgammaCalibrationAndSmearingTool.h:273
CP::EgammaCalibrationAndSmearingTool::recommendedSystematics
virtual CP::SystematicSet recommendedSystematics() const override
the list of all systematics this tool recommends to use
Definition: EgammaCalibrationAndSmearingTool.cxx:2093
CP::EgammaCalibrationAndSmearingTool::m_caloDistPhiUnifCorr
std::unique_ptr< TH2 > m_caloDistPhiUnifCorr
Definition: EgammaCalibrationAndSmearingTool.h:289
egEnergyCorr::Scale::ConvFakeRateDown
@ ConvFakeRateDown
Definition: egammaEnergyCorrectionTool.h:255
egEnergyCorr::Resolution::ZSmearingUp
@ ZSmearingUp
Definition: egammaEnergyCorrectionTool.h:70
egEnergyCorr::Scale::AllDown
@ AllDown
Definition: egammaEnergyCorrectionTool.h:283
CP::EgammaCalibrationAndSmearingTool::getResolution
double getResolution(const xAOD::Egamma &particle, bool withCT=true) const override
Definition: EgammaCalibrationAndSmearingTool.cxx:898
xAOD::Egamma_v1::e
virtual double e() const override final
The total energy of the particle.
Definition: Egamma_v1.cxx:90
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:78
NNPDF30NNLO.tune
tune
Definition: GeneratorFilters/share/common/NNPDF30NNLO.py:1
egEnergyCorr::Scale::L2GainDown
@ L2GainDown
Definition: egammaEnergyCorrectionTool.h:226
egEnergyCorr::Resolution::SigmaEff90
@ SigmaEff90
Definition: egammaEnergyCorrectionTool.h:116
CP::SystematicSet::empty
bool empty() const
returns: whether the set is empty
Definition: SystematicSet.h:67
egEnergyCorr::Scale::LArTemperature2015PreDown
@ LArTemperature2015PreDown
Definition: egammaEnergyCorrectionTool.h:168
PATCore::ParticleDataType::Fast
@ Fast
Definition: PATCoreEnums.h:22
egEnergyCorr::es2012cMedium
@ es2012cMedium
Definition: egammaEnergyCorrectionTool.h:308
CP::EgammaCalibrationAndSmearingTool::m_currentScaleVariation_data
egEnergyCorr::Scale::Variation m_currentScaleVariation_data
Definition: EgammaCalibrationAndSmearingTool.h:427
egEnergyCorr::es2017_R21_v1
@ es2017_R21_v1
Definition: egammaEnergyCorrectionTool.h:330
egEnergyCorr::Scale::LeakageElecUp
@ LeakageElecUp
Definition: egammaEnergyCorrectionTool.h:197
CP::EgammaCalibrationAndSmearingTool::m_useSaccCorrection
int m_useSaccCorrection
Definition: EgammaCalibrationAndSmearingTool.h:284
CP::EgammaCalibrationAndSmearingTool::ResolutionDecorrelation::ONENP
@ ONENP
CP::EgammaCalibrationAndSmearingTool::correctedCopy
virtual CP::CorrectionCode correctedCopy(const xAOD::Electron &, xAOD::Electron *&) const override
Definition: EgammaCalibrationAndSmearingTool.cxx:927
CP::EgammaCalibrationAndSmearingTool::m_decorrelation_model_name
std::string m_decorrelation_model_name
Definition: EgammaCalibrationAndSmearingTool.h:250
egEnergyCorr::Scale::MatPP0Down
@ MatPP0Down
Definition: egammaEnergyCorrectionTool.h:242
skel.it
it
Definition: skel.GENtoEVGEN.py:407
CP::use_intermodule_correction
bool use_intermodule_correction(egEnergyCorr::ESModel model)
Definition: EgammaCalibrationAndSmearingTool.cxx:195
egEnergyCorr::es2015PRE_res_improved
@ es2015PRE_res_improved
Definition: egammaEnergyCorrectionTool.h:314
asg
Definition: DataHandleTestTool.h:28
CP::EgammaCalibrationAndSmearingTool::m_currentScalePredicate
EgammaPredicate m_currentScalePredicate
Definition: EgammaCalibrationAndSmearingTool.h:431
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
M_PI
#define M_PI
Definition: ActiveFraction.h:11
egammaEnergyCorrectionTool.h
egEnergyCorr::Scale::Nominal
@ Nominal
Definition: egammaEnergyCorrectionTool.h:132
downloadSingle.dataType
string dataType
Definition: downloadSingle.py:18
egEnergyCorr::Resolution::Gaussian
@ Gaussian
Definition: egammaEnergyCorrectionTool.h:112
CP::EgammaCalibrationAndSmearingTool::m_gain_tool
egGain::GainTool * m_gain_tool
Definition: EgammaCalibrationAndSmearingTool.h:408
CP::EgammaCalibrationAndSmearingTool::m_doScaleCorrection
int m_doScaleCorrection
Definition: EgammaCalibrationAndSmearingTool.h:257
egEnergyCorr::Scale::EXTRARUN3PREDown
@ EXTRARUN3PREDown
Definition: egammaEnergyCorrectionTool.h:270
egEnergyCorr::Scale::L2LowGainDown
@ L2LowGainDown
Definition: egammaEnergyCorrectionTool.h:230
CP::EgammaCalibrationAndSmearingTool::m_doLeakageCorrection
int m_doLeakageCorrection
Definition: EgammaCalibrationAndSmearingTool.h:272
CP::EgammaCalibrationAndSmearingTool::~EgammaCalibrationAndSmearingTool
~EgammaCalibrationAndSmearingTool()
Definition: EgammaCalibrationAndSmearingTool.cxx:357
egEnergyCorr::Scale::ZeeStatUp
@ ZeeStatUp
Definition: egammaEnergyCorrectionTool.h:144
PI
const float PI
Definition: test_isolaitonTool.cxx:61
CP::EgammaCalibrationAndSmearingTool::Accessors
Definition: EgammaCalibrationAndSmearingTool.h:445
egEnergyCorr::es2011dMedium
@ es2011dMedium
Definition: egammaEnergyCorrectionTool.h:302
CP::EgammaCalibrationAndSmearingTool::m_simulation
PATCore::ParticleDataType::DataType m_simulation
Definition: EgammaCalibrationAndSmearingTool.h:264
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
CP::egammaMVAToolFolder
std::string egammaMVAToolFolder(egEnergyCorr::ESModel model)
Definition: EgammaCalibrationAndSmearingTool.cxx:85
egammaLayerRecalibTool::disable_S12Corrections
void disable_S12Corrections()
Definition: egammaLayerRecalibTool.h:325
egammaLayerRecalibTool::applyCorrection
CP::CorrectionCode applyCorrection(xAOD::Egamma &, const xAOD::EventInfo &event_info) const
Definition: egammaLayerRecalibTool.cxx:1010
egEnergyCorr::Resolution::afDown
@ afDown
Definition: egammaEnergyCorrectionTool.h:98
CP::EgammaCalibrationAndSmearingTool::m_use_mva_calibration
int m_use_mva_calibration
Definition: EgammaCalibrationAndSmearingTool.h:274
egEnergyCorr::Scale::Wtots1Up
@ Wtots1Up
Definition: egammaEnergyCorrectionTool.h:237
CP::EgammaCalibrationAndSmearingTool::RandomNumber
unsigned int RandomNumber
Definition: EgammaCalibrationAndSmearingTool.h:200
CP::EgammaCalibrationAndSmearingTool::m_use_temp_correction201215
int m_use_temp_correction201215
Definition: EgammaCalibrationAndSmearingTool.h:276
CP::EgammaCalibrationAndSmearingTool::getEnergy
double getEnergy(const xAOD::Photon &) const
Definition: EgammaCalibrationAndSmearingTool.cxx:953
xAOD::EgammaParameters::AuthorFwdElectron
const uint16_t AuthorFwdElectron
Electron reconstructed by the Forward cluster-based algorithm.
Definition: EgammaDefs.h:30
CP::EgammaCalibrationAndSmearingTool::xAOD2ptype
PATCore::ParticleType::Type xAOD2ptype(columnar::EgammaId particle) const
Definition: EgammaCalibrationAndSmearingTool.cxx:858
egEnergyCorr::ESModel
ESModel
Definition: egammaEnergyCorrectionTool.h:295
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
CP::SystematicVariation
Definition: SystematicVariation.h:47
CP::EgammaCalibrationAndSmearingTool::m_useGainCorrection
int m_useGainCorrection
Definition: EgammaCalibrationAndSmearingTool.h:270
egEnergyCorr::es2023_R22_Run2_v1
@ es2023_R22_Run2_v1
Definition: egammaEnergyCorrectionTool.h:340
egEnergyCorr::Scale::ConvRecoDown
@ ConvRecoDown
Definition: egammaEnergyCorrectionTool.h:262
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
CP::EgammaCalibrationAndSmearingTool::m_decorrelation_model_scale_name
std::string m_decorrelation_model_scale_name
Definition: EgammaCalibrationAndSmearingTool.h:251
columnar::ObjectRange
a class representing a continuous sequence of objects (a.k.a. a container)
Definition: ContainerId.h:175
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
egEnergyCorr::Resolution::PileUpUp
@ PileUpUp
Definition: egammaEnergyCorrectionTool.h:88
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:49
PATCore::ParticleDataType::Data
@ Data
Definition: PATCoreEnums.h:22
python.DataFormatRates.events
events
Definition: DataFormatRates.py:105
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
pi
#define pi
Definition: TileMuonFitter.cxx:65
egEnergyCorr::Scale::L2GainUp
@ L2GainUp
Definition: egammaEnergyCorrectionTool.h:225
PATCore::ParticleDataType::DataType
DataType
Definition: PATCoreEnums.h:22
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
egEnergyCorr::Resolution::MaterialGapUp
@ MaterialGapUp
Definition: egammaEnergyCorrectionTool.h:82
egEnergyCorr::es2017_R21_v0
@ es2017_R21_v0
Definition: egammaEnergyCorrectionTool.h:328
egamma
Definition: egamma.h:58
egEnergyCorr::Scale::LeakageElecDown
@ LeakageElecDown
Definition: egammaEnergyCorrectionTool.h:198
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
egEnergyCorr::Scale::L2LowGainUp
@ L2LowGainUp
Definition: egammaEnergyCorrectionTool.h:229
ANA_CHECK_THROW
#define ANA_CHECK_THROW(EXP)
check whether the given expression was successful, throwing an exception on failure
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:339
CP::EgammaCalibrationAndSmearingTool::m_use_full_statistical_error
bool m_use_full_statistical_error
Definition: EgammaCalibrationAndSmearingTool.h:275
egEnergyCorr::Scale::MomentumUp
@ MomentumUp
Definition: egammaEnergyCorrectionTool.h:137
PATCore::ParticleDataType::Full
@ Full
Definition: PATCoreEnums.h:22
PATCore::ParticleType::ConvertedPhoton
@ ConvertedPhoton
Definition: PATCoreEnums.h:39
egEnergyCorr::es2015cPRE
@ es2015cPRE
Definition: egammaEnergyCorrectionTool.h:315
Egamma.h
CP::EgammaCalibrationAndSmearingTool::m_usePhiUniformCorrection
int m_usePhiUniformCorrection
Definition: EgammaCalibrationAndSmearingTool.h:268
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
egEnergyCorr::Scale::LArTemperature2015PreUp
@ LArTemperature2015PreUp
Definition: egammaEnergyCorrectionTool.h:167
CP::EgammaCalibrationAndSmearingTool::m_onlyElectrons
Gaudi::Property< bool > m_onlyElectrons
Definition: EgammaCalibrationAndSmearingTool.h:442
CP::EgammaCalibrationAndSmearingTool::m_decorrelation_model_resolution
ResolutionDecorrelation m_decorrelation_model_resolution
Definition: EgammaCalibrationAndSmearingTool.h:254
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
CP::EgammaCalibrationAndSmearingTool::m_user_random_run_number
int m_user_random_run_number
Definition: EgammaCalibrationAndSmearingTool.h:279
CP::EgammaCalibrationAndSmearingTool::m_useIntermoduleCorrection
int m_useIntermoduleCorrection
Definition: EgammaCalibrationAndSmearingTool.h:267
egEnergyCorr::Scale::AllUp
@ AllUp
Definition: egammaEnergyCorrectionTool.h:282
CP::EgammaCalibrationAndSmearingTool::m_currentResolutionVariation_MC
egEnergyCorr::Resolution::Variation m_currentResolutionVariation_MC
Definition: EgammaCalibrationAndSmearingTool.h:428
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
egEnergyCorr::Resolution::ZSmearingDown
@ ZSmearingDown
Definition: egammaEnergyCorrectionTool.h:69
EgammaxAODHelpers.h
CP::EgammaCalibrationAndSmearingTool::m_MVACalibSvc
ServiceHandle< IegammaMVASvc > m_MVACalibSvc
Definition: EgammaCalibrationAndSmearingTool.h:404
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
egEnergyCorr::es2015_day0_3percent
@ es2015_day0_3percent
Definition: egammaEnergyCorrectionTool.h:311
egEnergyCorr::Scale::LArCalibUp
@ LArCalibUp
Definition: egammaEnergyCorrectionTool.h:155
egEnergyCorr::Resolution::MaterialPP0Down
@ MaterialPP0Down
Definition: egammaEnergyCorrectionTool.h:94
egEnergyCorr::es2010
@ es2010
Definition: egammaEnergyCorrectionTool.h:297
CP::EgammaCalibrationAndSmearingTool::m_currentScaleVariation_MC
egEnergyCorr::Scale::Variation m_currentScaleVariation_MC
Definition: EgammaCalibrationAndSmearingTool.h:426
CP::EgammaCalibrationAndSmearingTool::m_ESModel
std::string m_ESModel
Definition: EgammaCalibrationAndSmearingTool.h:249
xAOD::EgammaHelpers::isConvertedPhoton
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
Definition: EgammaxAODHelpers.cxx:25
CP::EgammaCalibrationAndSmearingTool::m_decorateEmva
bool m_decorateEmva
Definition: EgammaCalibrationAndSmearingTool.h:285
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
asg::AsgToolConfig
an object that can create a AsgTool
Definition: AsgToolConfig.h:22
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
UNDEFINED
@ UNDEFINED
Definition: sTGCenumeration.h:18
egEnergyCorr::Resolution::MaterialCryoUp
@ MaterialCryoUp
Definition: egammaEnergyCorrectionTool.h:84
egEnergyCorr::es2017_R21_PRE
@ es2017_R21_PRE
Definition: egammaEnergyCorrectionTool.h:326
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
CP::EgammaCalibrationAndSmearingTool::AbsEtaCaloPredicateFactory
const EgammaPredicate AbsEtaCaloPredicateFactory(double eta_min, double eta_max) const
Definition: EgammaCalibrationAndSmearingTool.h:331
CP::EgammaCalibrationAndSmearingTool::resolution
virtual double resolution(double energy, double cl_eta, double cl_etaCalo, PATCore::ParticleType::Type ptype=PATCore::ParticleType::Electron, bool withCT=false) const override
Definition: EgammaCalibrationAndSmearingTool.cxx:909
egEnergyCorr::es2015cPRE_res_improved
@ es2015cPRE_res_improved
Definition: egammaEnergyCorrectionTool.h:316
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloCluster.h
egEnergyCorr::Scale::topoClusterThresUp
@ topoClusterThresUp
Definition: egammaEnergyCorrectionTool.h:207
egEnergyCorr::Scale::ConvEfficiencyDown
@ ConvEfficiencyDown
Definition: egammaEnergyCorrectionTool.h:253
SystematicRegistry.h
CP::EgammaCalibrationAndSmearingTool::initialize
StatusCode initialize() override
Definition: EgammaCalibrationAndSmearingTool.cxx:363
LinearityADC.h
CP::EgammaCalibrationAndSmearingTool::oldtool_scale_flag_this_event
egEnergyCorr::Scale::Variation oldtool_scale_flag_this_event(columnar::EgammaId p, columnar::EventInfoId event_info) const
Definition: EgammaCalibrationAndSmearingTool.cxx:1203
GainUncertainty.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::EgammaCalibrationAndSmearingTool::applySystematicVariation
virtual StatusCode applySystematicVariation(const CP::SystematicSet &systConfig) override
effects: configure this tool for the given list of systematic variations.
Definition: EgammaCalibrationAndSmearingTool.cxx:2098
CP::EgammaCalibrationAndSmearingTool::m_currentResolutionVariation_data
egEnergyCorr::Resolution::Variation m_currentResolutionVariation_data
Definition: EgammaCalibrationAndSmearingTool.h:429
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::EgammaHelpers::isElectron
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Definition: EgammaxAODHelpers.cxx:12
CP::EgammaCalibrationAndSmearingTool::m_TESModel
egEnergyCorr::ESModel m_TESModel
Definition: EgammaCalibrationAndSmearingTool.h:256
egEnergyCorr::Resolution::afUp
@ afUp
Definition: egammaEnergyCorrectionTool.h:97
egEnergyCorr::Scale::MomentumDown
@ MomentumDown
Definition: egammaEnergyCorrectionTool.h:138
egEnergyCorr::Scale::ConvRecoUp
@ ConvRecoUp
Definition: egammaEnergyCorrectionTool.h:261
AsgToolConfig.h
egEnergyCorr::Resolution::Nominal
@ Nominal
Definition: egammaEnergyCorrectionTool.h:62
CP::EgammaCalibrationAndSmearingTool::m_varSF
double m_varSF
Definition: EgammaCalibrationAndSmearingTool.h:259
asg::AsgMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AsgMessaging.cxx:49
egEnergyCorr::es2012a
@ es2012a
Definition: egammaEnergyCorrectionTool.h:305
CP::EgammaCalibrationAndSmearingTool::m_useGainInterpolation
int m_useGainInterpolation
Definition: EgammaCalibrationAndSmearingTool.h:280
egammaLayerRecalibTool::disable_PSCorrections
void disable_PSCorrections()
Definition: egammaLayerRecalibTool.h:324
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
CP::EgammaCalibrationAndSmearingTool::SysInfo
Definition: EgammaCalibrationAndSmearingTool.h:416
egEnergyCorr::es2012cTight
@ es2012cTight
Definition: egammaEnergyCorrectionTool.h:309
egEnergyCorr::es2017_summer
@ es2017_summer
Definition: egammaEnergyCorrectionTool.h:320
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
egEnergyCorr::es2015c_summer
@ es2015c_summer
Definition: egammaEnergyCorrectionTool.h:317
egammaLayerRecalibTool.h
CP::EgammaCalibrationAndSmearingTool::m_usePSCorrection
int m_usePSCorrection
Definition: EgammaCalibrationAndSmearingTool.h:282
egEnergyCorr::Scale::L2MediumGainUp
@ L2MediumGainUp
Definition: egammaEnergyCorrectionTool.h:227
CP::EgammaCalibrationAndSmearingTool::m_use_mapping_correction
bool m_use_mapping_correction
Definition: EgammaCalibrationAndSmearingTool.h:278
egEnergyCorr::Scale::None
@ None
Definition: egammaEnergyCorrectionTool.h:129
Scale
void Scale(TH1 *h, double d=1)
Definition: comparitor.cxx:79
CP::EgammaCalibrationAndSmearingTool::EtaCaloPredicateFactory
const EgammaPredicate EtaCaloPredicateFactory(double eta_min, double eta_max) const
Definition: EgammaCalibrationAndSmearingTool.h:310
egEnergyCorr::Resolution::MaterialCryoDown
@ MaterialCryoDown
Definition: egammaEnergyCorrectionTool.h:83
Vertex.h
egEnergyCorr::UNDEFINED
@ UNDEFINED
Definition: egammaEnergyCorrectionTool.h:344
GainTool.h
CP::EgammaCalibrationAndSmearingTool::m_ADCLinearity_tool
std::shared_ptr< LinearityADC > m_ADCLinearity_tool
Definition: EgammaCalibrationAndSmearingTool.h:407
CP::EgammaCalibrationAndSmearingTool::m_TResolutionType
egEnergyCorr::Resolution::resolutionType m_TResolutionType
Definition: EgammaCalibrationAndSmearingTool.h:261
CP::EgammaCalibrationAndSmearingTool::m_gain_tool_run2
std::unique_ptr< egGain::GainUncertainty > m_gain_tool_run2
Definition: EgammaCalibrationAndSmearingTool.h:406
egGain::GainTool::CorrectionGainTool
double CorrectionGainTool(double eta_input, double energy_input, double energy_layer2_input, PATCore::ParticleType::Type ptype=PATCore::ParticleType::Electron) const
Definition: GainTool.cxx:139
egEnergyCorr::Scale::ZeeStatDown
@ ZeeStatDown
Definition: egammaEnergyCorrectionTool.h:145
CP::EgammaCalibrationAndSmearingTool::correction_phi_unif
double correction_phi_unif(double eta, double phi) const
Definition: EgammaCalibrationAndSmearingTool.cxx:2336
CP::EgammaCalibrationAndSmearingTool::m_doSmearing
int m_doSmearing
Definition: EgammaCalibrationAndSmearingTool.h:258
CP::GeV
const double GeV
Definition: EgammaCalibrationAndSmearingTool.cxx:42
CP::EgammaCalibrationAndSmearingTool::ResolutionDecorrelation::FULL
@ FULL
CP::EgammaCalibrationAndSmearingTool::AUTO
static const int AUTO
Definition: EgammaCalibrationAndSmearingTool.h:198
egEnergyCorr::Resolution::None
@ None
Definition: egammaEnergyCorrectionTool.h:59
CP::EgammaCalibrationAndSmearingTool::m_use_AFII
int m_use_AFII
Definition: EgammaCalibrationAndSmearingTool.h:263
CP::EgammaCalibrationAndSmearingTool::m_rootTool
std::unique_ptr< AtlasRoot::egammaEnergyCorrectionTool > m_rootTool
Definition: EgammaCalibrationAndSmearingTool.h:413
egEnergyCorr::Resolution::PileUpDown
@ PileUpDown
Definition: egammaEnergyCorrectionTool.h:87
egEnergyCorr::Scale::E4ScintillatorUp
@ E4ScintillatorUp
Definition: egammaEnergyCorrectionTool.h:179
egEnergyCorr::Scale::Variation
Variation
Definition: egammaEnergyCorrectionTool.h:126
columnar::ObjectId
a class representing a single object (electron, muons, etc.)
Definition: ContainerId.h:176
CP::EgammaCalibrationAndSmearingTool::setupSystematics
void setupSystematics()
Definition: EgammaCalibrationAndSmearingTool.cxx:1260
PathResolver.h
egEnergyCorr::Scale::LArCalibExtra2015PreUp
@ LArCalibExtra2015PreUp
Definition: egammaEnergyCorrectionTool.h:165
CP::SystematicSet::insert
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
Definition: SystematicSet.cxx:88
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
egEnergyCorr::Resolution::MaterialIBLUp
@ MaterialIBLUp
Definition: egammaEnergyCorrectionTool.h:91
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
egEnergyCorr::Resolution::Variation
Variation
Definition: egammaEnergyCorrectionTool.h:55
AsgServiceConfig.h
egEnergyCorr::es2016PRE
@ es2016PRE
Definition: egammaEnergyCorrectionTool.h:318
egEnergyCorr::es2017_summer_final
@ es2017_summer_final
Definition: egammaEnergyCorrectionTool.h:322
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:452
egEnergyCorr::Scale::ADCLinUp
@ ADCLinUp
Definition: egammaEnergyCorrectionTool.h:193
asg::AsgServiceConfig
an object that can create a AsgService
Definition: AsgServiceConfig.h:25
CP::EgammaCalibrationAndSmearingTool::callEvents
void callEvents(columnar::EventContextRange events) const override
Definition: EgammaCalibrationAndSmearingTool.cxx:2510
egEnergyCorr::Resolution::OFCUp
@ OFCUp
Definition: egammaEnergyCorrectionTool.h:101
CP::EgammaCalibrationAndSmearingTool::m_MVAfolder
std::string m_MVAfolder
Definition: EgammaCalibrationAndSmearingTool.h:414
CP::is_after_run1
bool is_after_run1(egEnergyCorr::ESModel model)
Definition: EgammaCalibrationAndSmearingTool.cxx:243
egEnergyCorr::Scale::MatPP0Up
@ MatPP0Up
Definition: egammaEnergyCorrectionTool.h:241
egEnergyCorr::es2012XX
@ es2012XX
Definition: egammaEnergyCorrectionTool.h:312
egEnergyCorr::Scale::ADCLinDown
@ ADCLinDown
Definition: egammaEnergyCorrectionTool.h:194
CP::EgammaCalibrationAndSmearingTool::m_onlyPhotons
Gaudi::Property< bool > m_onlyPhotons
Definition: EgammaCalibrationAndSmearingTool.h:443
xAOD::Electron_v1
Definition: Electron_v1.h:34
egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Down
@ S12ExtraLastEtaBinRun2Down
Definition: egammaEnergyCorrectionTool.h:212
egEnergyCorr::es2023_R22_Run2_v0
@ es2023_R22_Run2_v0
Definition: egammaEnergyCorrectionTool.h:339
egEnergyCorr::es2012c
@ es2012c
Definition: egammaEnergyCorrectionTool.h:307
egEnergyCorr::Resolution::OFCDown
@ OFCDown
Definition: egammaEnergyCorrectionTool.h:102
EventInfo.h
egEnergyCorr::Scale::PSb12Down
@ PSb12Down
Definition: egammaEnergyCorrectionTool.h:190
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
CP::EgammaCalibrationAndSmearingTool::m_syst_description
std::map< CP::SystematicVariation, SysInfo > m_syst_description
Definition: EgammaCalibrationAndSmearingTool.h:421
egEnergyCorr::es2017
@ es2017
Definition: egammaEnergyCorrectionTool.h:319
xAOD::Photon
Photon_v1 Photon
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Photon.h:17
egEnergyCorr::es2018_R21_v1
@ es2018_R21_v1
Definition: egammaEnergyCorrectionTool.h:335
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:283
AthAnalysisHelper.h
CP::EgammaCalibrationAndSmearingTool::intermodule_correction
double intermodule_correction(double Ecl, double phi, double eta) const
Definition: EgammaCalibrationAndSmearingTool.cxx:2147
TrackParticle.h
egEnergyCorr::Resolution::SigmaEff80
@ SigmaEff80
Definition: egammaEnergyCorrectionTool.h:114
egEnergyCorr::Scale::ConvEfficiencyUp
@ ConvEfficiencyUp
Definition: egammaEnergyCorrectionTool.h:252
CP::EgammaCalibrationAndSmearingTool::m_set_seed_function
IdFunction m_set_seed_function
Definition: EgammaCalibrationAndSmearingTool.h:433
egEnergyCorr::Scale::PSb12Up
@ PSb12Up
Definition: egammaEnergyCorrectionTool.h:189
CP::EgammaCalibrationAndSmearingTool
Definition: EgammaCalibrationAndSmearingTool.h:184
egammaLayerRecalibTool
Definition: egammaLayerRecalibTool.h:283
egEnergyCorr::Scale::E4ScintillatorDown
@ E4ScintillatorDown
Definition: egammaEnergyCorrectionTool.h:180
CP::EgammaCalibrationAndSmearingTool::DoubleOrAbsEtaCaloPredicate
Definition: EgammaCalibrationAndSmearingTool.h:366
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
egEnergyCorr::Resolution::MaterialIDDown
@ MaterialIDDown
Definition: egammaEnergyCorrectionTool.h:77
CP::EgammaCalibrationAndSmearingTool::m_useLayerCorrection
int m_useLayerCorrection
Definition: EgammaCalibrationAndSmearingTool.h:281
egEnergyCorr::Scale::ConvFakeRateUp
@ ConvFakeRateUp
Definition: egammaEnergyCorrectionTool.h:254
egEnergyCorr::Resolution::MaterialIDUp
@ MaterialIDUp
Definition: egammaEnergyCorrectionTool.h:78
egEnergyCorr::Scale::Wtots1Down
@ Wtots1Down
Definition: egammaEnergyCorrectionTool.h:238
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
egEnergyCorr::es2017_summer_improved
@ es2017_summer_improved
Definition: egammaEnergyCorrectionTool.h:321
xAOD::Photon_v1
Definition: Photon_v1.h:37
columnar
Definition: ClusterDef.h:16
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CP::SystematicRegistry
This module implements the central registry for handling systematic uncertainties with CP tools.
Definition: SystematicRegistry.h:25
correlationModel::model
model
Definition: AsgElectronEfficiencyCorrectionTool.cxx:46
egEnergyCorr::es2011dTight
@ es2011dTight
Definition: egammaEnergyCorrectionTool.h:303
xAOD::EgammaHelpers::isPhoton
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
Definition: EgammaxAODHelpers.cxx:21
egEnergyCorr::es2024_Run3_ofc0_v0
@ es2024_Run3_ofc0_v0
Definition: egammaEnergyCorrectionTool.h:341
egEnergyCorr::Resolution::MaterialCaloUp
@ MaterialCaloUp
Definition: egammaEnergyCorrectionTool.h:80
asg::AsgComponentConfig::setProperty
StatusCode setProperty(const std::string &name, const T &value)
set the given property
egEnergyCorr::Resolution::SamplingTermDown
@ SamplingTermDown
Definition: egammaEnergyCorrectionTool.h:73
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
CP::EgammaCalibrationAndSmearingTool::m_layer_recalibration_tool
egammaLayerRecalibTool * m_layer_recalibration_tool
Definition: EgammaCalibrationAndSmearingTool.h:409
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
EgammaDefs.h
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
asg::AsgComponentConfig::setPropertyFromString
void setPropertyFromString(const std::string &name, const std::string &value)
set a given property from a string value
Definition: AsgComponentConfig.cxx:133
CP::use_phi_uniform_correction
bool use_phi_uniform_correction(egEnergyCorr::ESModel model)
Definition: EgammaCalibrationAndSmearingTool.cxx:239
xAOD::get_eta_calo
float get_eta_calo(const xAOD::CaloCluster &cluster, int author, bool do_throw=false)
Definition: EgammaCalibrationAndSmearingTool.h:73
egEnergyCorr::Scale::afDown
@ afDown
Definition: egammaEnergyCorrectionTool.h:246
CP::EgammaCalibrationAndSmearingTool::m_decorrelation_model_resolution_name
std::string m_decorrelation_model_resolution_name
Definition: EgammaCalibrationAndSmearingTool.h:252
egEnergyCorr::Scale::L2MediumGainDown
@ L2MediumGainDown
Definition: egammaEnergyCorrectionTool.h:228
egEnergyCorr::Resolution::MaterialGapDown
@ MaterialGapDown
Definition: egammaEnergyCorrectionTool.h:81
EgammaCalibPeriodRunNumbersExample::run_2016
const int run_2016
Definition: Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IEgammaCalibrationAndSmearingTool.h:21
egEnergyCorr::es2017_R21_ofc0_v1
@ es2017_R21_ofc0_v1
Definition: egammaEnergyCorrectionTool.h:332
CaloCondBlobAlgs_fillNoiseFromASCII.folder
folder
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:55
egEnergyCorr::Scale::EXTRARUN3PREUp
@ EXTRARUN3PREUp
Definition: egammaEnergyCorrectionTool.h:269
CP::gainToolFactory
std::unique_ptr< egGain::GainTool > gainToolFactory(egEnergyCorr::ESModel model)
Definition: EgammaCalibrationAndSmearingTool.cxx:44
egEnergyCorr::Scale::LArTemperature2016PreDown
@ LArTemperature2016PreDown
Definition: egammaEnergyCorrectionTool.h:172
egEnergyCorr::es2022_R22_PRE
@ es2022_R22_PRE
Definition: egammaEnergyCorrectionTool.h:338
xAOD::Egamma_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: Egamma_v1.cxx:70
egEnergyCorr::Scale::LArCalibDown
@ LArCalibDown
Definition: egammaEnergyCorrectionTool.h:156
PATCore::ParticleType::Electron
@ Electron
Definition: PATCoreEnums.h:40
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
egammaLayerRecalibTool::fixForMissingCells
void fixForMissingCells(bool fix=true)
Definition: egammaLayerRecalibTool.h:322
CP::EgammaCalibrationAndSmearingTool::callSingleEvent
void callSingleEvent(columnar::MutableEgammaRange egammas, columnar::EventInfoId event) const
Definition: EgammaCalibrationAndSmearingTool.cxx:2501
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
CP::egammaLayerRecalibToolFactory
std::unique_ptr< egammaLayerRecalibTool > egammaLayerRecalibToolFactory(egEnergyCorr::ESModel model, int enableSacc)
Definition: EgammaCalibrationAndSmearingTool.cxx:139
egammaLayerRecalibTool::disable_SaccCorrections
void disable_SaccCorrections()
Definition: egammaLayerRecalibTool.h:326
columnar::resetAccessor
void resetAccessor(AccessorTemplate< CI, CT, CAM, CM > &accessor, ColumnarTool< CM > &columnBase, const std::string &name, ColumnInfo &&info={})
reset a column accessor to point to a new column
Definition: ColumnAccessor.h:210
CP::EgammaCalibrationAndSmearingTool::applyCorrection
virtual CP::CorrectionCode applyCorrection(xAOD::Egamma &) const override
Definition: EgammaCalibrationAndSmearingTool.cxx:916
columnar::EgammaId
ObjectId< ContainerId::egamma > EgammaId
Definition: EgammaDef.h:50
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
python.SystemOfUnits.m2
float m2
Definition: SystemOfUnits.py:107
CP::EgammaCalibrationAndSmearingTool::m_syst_description_resolution
std::map< CP::SystematicVariation, egEnergyCorr::Resolution::Variation > m_syst_description_resolution
Definition: EgammaCalibrationAndSmearingTool.h:423
EgammaCalibrationAndSmearingTool.h
egEnergyCorr::es2015_5TeV
@ es2015_5TeV
Definition: egammaEnergyCorrectionTool.h:324
egEnergyCorr::Resolution::AllUp
@ AllUp
Definition: egammaEnergyCorrectionTool.h:66
egEnergyCorr::Resolution::MaterialCaloDown
@ MaterialCaloDown
Definition: egammaEnergyCorrectionTool.h:79
egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Up
@ S12ExtraLastEtaBinRun2Up
Definition: egammaEnergyCorrectionTool.h:211
TrackingPrimitives.h
CP::EgammaCalibrationAndSmearingTool::m_decorrelation_model_scale
ScaleDecorrelation m_decorrelation_model_scale
Definition: EgammaCalibrationAndSmearingTool.h:253
egEnergyCorr::es2018_R21_v0
@ es2018_R21_v0
Definition: egammaEnergyCorrectionTool.h:334
CP::EgammaCalibrationAndSmearingTool::m_useS12Correction
int m_useS12Correction
Definition: EgammaCalibrationAndSmearingTool.h:283
egEnergyCorr::es2015PRE
@ es2015PRE
Definition: egammaEnergyCorrectionTool.h:313
CP::EgammaCalibrationAndSmearingTool::m_layer_recalibration_tune
std::string m_layer_recalibration_tune
Definition: EgammaCalibrationAndSmearingTool.h:410
CP::EgammaCalibrationAndSmearingTool::m_useCaloDistPhiUnifCorrection
int m_useCaloDistPhiUnifCorrection
Definition: EgammaCalibrationAndSmearingTool.h:269
xAOD::EventInfo_v1::eventType
bool eventType(EventType type) const
Check for one particular bitmask value.
egEnergyCorr
Definition: egammaEnergyCorrectionTool.h:44
CP::SystematicRegistry::getInstance
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Definition: SystematicRegistry.cxx:25
CP::EgammaCalibrationAndSmearingTool::m_use_uA2MeV_2015_first2weeks_correction
int m_use_uA2MeV_2015_first2weeks_correction
Definition: EgammaCalibrationAndSmearingTool.h:277
egEnergyCorr::Scale::topoClusterThresDown
@ topoClusterThresDown
Definition: egammaEnergyCorrectionTool.h:208
CP::EgammaCalibrationAndSmearingTool::m_fixForMissingCells
Gaudi::Property< bool > m_fixForMissingCells
Definition: EgammaCalibrationAndSmearingTool.h:291
egEnergyCorr::Resolution::MaterialIBLDown
@ MaterialIBLDown
Definition: egammaEnergyCorrectionTool.h:92
columnar::EventInfoId
ObjectId< ContainerId::eventInfo > EventInfoId
Definition: EventInfoDef.h:32
xAOD::EgammaParameters::unconvertedPhoton
@ unconvertedPhoton
Definition: EgammaEnums.h:19
egEnergyCorr::Resolution::AllDown
@ AllDown
Definition: egammaEnergyCorrectionTool.h:65
CP::EgammaCalibrationAndSmearingTool::m_accessors
std::unique_ptr< Accessors > m_accessors
Definition: EgammaCalibrationAndSmearingTool.h:477