42 const double GeV = 1000.;
59 "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
61 "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
62 return std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
91 folder =
"egammaMVACalib/v1";
94 folder =
"egammaMVACalib/v1";
100 folder =
"egammaMVACalib/offline/v3";
104 folder =
"egammaMVACalib/offline/v3_E4crack_bis";
113 folder =
"egammaMVACalib/offline/v4.0";
123 folder =
"egammaMVACalib/offline/v7";
127 folder =
"egammaMVACalib/offline/v9";
130 folder =
"egammaMVACalib/offline/v10";
141 std::string
tune =
"";
146 tune =
"2011_alt_with_layer2";
160 tune =
"2012_alt_with_layer2";
164 tune =
"es2017_20.7_improved";
167 tune =
"es2017_20.7_final";
175 tune =
"es2017_21.0_v0";
178 tune =
"es2018_21.0_v0";
181 tune =
"es2022_22.0_Precision";
184 tune =
"es2022_22.0_Precision_v1";
187 tune =
"es2024_run3_extrapolate_v0";
192 return std::make_unique<egammaLayerRecalibTool>(
tune, enableSacc);
288 const std::string&
name)
292 m_use_mapping_correction(false),
295 m_currentResolutionVariation_MC(
egEnergyCorr::Resolution::Nominal),
296 m_currentResolutionVariation_data(
egEnergyCorr::Resolution::None),
303 auto cluster =
acc.caloClusterAcc(
egamma)[0].value();
305 std::abs(
acc.clusterPhiAcc(cluster)) * 1E6 +
306 std::abs(
acc.clusterEtaAcc(cluster)) * 1E3 +
307 acc.eventNumberAcc(ei));
309 m_accessors(std::make_unique<Accessors>(*
this)) {
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);
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");
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");
389 }
else if (
m_ESModel ==
"es2015PRE_res_improved") {
393 }
else if (
m_ESModel ==
"es2015cPRE_res_improved") {
395 }
else if (
m_ESModel ==
"es2015c_summer") {
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") {
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") {
433 return StatusCode::FAILURE;
436 return StatusCode::FAILURE;
447 return StatusCode::FAILURE;
452 "Property useAFII is deprecated. It is now replaced with useFastSim, "
453 "which should be explicitly configured");
454 return StatusCode::FAILURE;
462 ATH_MSG_ERROR(
"Property useFastSim should be explicitly configured");
463 return StatusCode::FAILURE;
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;
492 ATH_MSG_WARNING(
"no decorrelation model specified, assuming full model");
501 return StatusCode::FAILURE;
507 "flag decorrelation model ignored for scale decorrelation model");
518 ATH_MSG_FATAL(
"cannot understand the scale decorrelation model '"
520 return StatusCode::FAILURE;
534 return StatusCode::FAILURE;
538 "not information how to initialize the scale decorrelation model");
539 return StatusCode::FAILURE;
547 "flag decorrelation model ignored for resolution decorrelation "
555 ATH_MSG_FATAL(
"cannot understand the resolution decorrelation model '"
557 return StatusCode::FAILURE;
571 return StatusCode::FAILURE;
578 m_rootTool = std::make_unique<AtlasRoot::egammaEnergyCorrectionTool>();
581 return StatusCode::FAILURE;
590 "Using linear interpolation in the gain tool (uncertainties only)");
608 "egammaMVACalibTool/tool_mva_electron");
617 "egammaMVACalibTool/tool_mva_unconverted");
620 config_mva_unconverted.
setProperty(
"use_layer_corrected",
true));
626 "egammaMVACalibTool/tool_mva_converted");
634 std::ostringstream mva_service_name;
635 mva_service_name <<
"egammaMVASvc/service_mva_egamma_id"
636 << (
void const*)
this;
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);
646 config_mva_service.setProperty(
"OutputLevel", this->msg().level()));
659 ATH_MSG_INFO(
"Layer recalibration already applied at cell level");
664 ATH_MSG_DEBUG(
"initializing layer recalibration tool (if needed)");
698 m_rootTool->use_uA2MeV_2015_first2weeks_correction(
707 throw std::runtime_error(
"ep combination not supported yet");
736 "cannot instantiate gain tool for this model (you can only disable "
737 "the gain tool, but not enable it)");
741 "initializing gain tool for run2 final precision recommendations");
743 "Gain corrections required but Zee scales are derived without Gain, "
744 "will cause inconsistency!");
746 "ElectronPhotonFourMomentumCorrection/v29/"
747 "gain_uncertainty_specialRun.root");
749 gain_tool_run_2_filename,
false,
"GainCorrection",
762 "ElectronPhotonFourMomentumCorrection/v25/linearity_ADC.root");
768 m_ESModel +
" recommendations use ADC corrections for scale "
769 "derivation. Disabling the ADCLinearity flag will create "
783 "ElectronPhotonFourMomentumCorrection/v33/"
784 "egammaEnergyCorrectionData.root");
785 std::unique_ptr<TFile> fCorr(
786 TFile::Open(phiUnifCorrfileName.c_str(),
"READ"));
788 dynamic_cast<TH2*
>(fCorr->Get(
"CaloDistortionPhiUniformityCorrection/"
789 "es2023_R22_Run2_v0/h2DcorrPhiUnif")));
793 m_ESModel +
" recommendations use CaloDistPhiUnif for scale "
794 "derivation. Disabling the CaloDistPhiUnif flag will create "
834 if (
registry.registerSystematics(*
this) != StatusCode::SUCCESS)
835 return StatusCode::FAILURE;
838 ATH_MSG_ERROR(
"Cannot select both onlyElectrons and onlyPhotons");
839 return StatusCode::FAILURE;
854 return StatusCode::SUCCESS;
893 throw std::runtime_error(
"particle is not electron or photon");
901 const auto cl_etaCalo =
905 cl_etaCalo, ptype, withCT,
910 double energy,
double cl_eta,
double cl_etaCalo,
932 "Non-null pointer received. "
933 "There's a possible memory leak!");
936 output->makePrivateStore(input);
945 "Non-null pointer received. "
946 "There's a possible memory leak!");
949 output->makePrivateStore(input);
957 const double e = new_particle->
e();
966 const double e = new_particle->
e();
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));
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)))
1008 if (
acc.authorAcc (input) !=
1029 const double etaden =
1031 ?
static_cast<const xAOD::Electron&
>(input.getXAODObject()).trackParticle()->
eta()
1032 :
acc.clusterEtaAcc(inputCluster);
1034 energy / cosh(etaden), ptype);
1048 unsigned int runNumber_for_tool = 0;
1053 runNumber_for_tool =
acc.runNumberAcc(event_info);
1055 const auto cl_eta =
acc.clusterEtaAcc(inputCluster);
1056 double etaCalo = 0, phiCalo = 0;
1058 etaCalo =
acc.etaCaloAcc(inputCluster,
acc.authorAcc(input),
false);
1061 acc.phiCaloAcc(inputCluster,
acc.authorAcc(input),
false);
1078 double etaC =
acc.clusterEtaAcc(inputCluster);
1079 double phiC =
acc.clusterPhiAcc(inputCluster);
1081 ieta = ieta == 0 ? 1
1086 iphi = iphi == 0 ? 1
1092 "energy after phi uniformity correction (for calo distortion) = "
1105 double et =
energy / std::cosh(cl_eta);
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)
1124 double et =
energy / std::cosh(cl_eta);
1132 if (
acc.randomrunnumber_getter.isAvailable(event_info)) {
1133 runNumber_for_tool =
acc.randomrunnumber_getter(event_info);
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");
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)));
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),
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));
1233 const float el_tracketa = eTrack->
eta();
1234 const float el_trackmomentum = eTrack->
pt() * cosh(
el->eta());
1244 return sys.find(systematic) !=
sys.end();
1251 affecting_systematics.
insert(
it.first);
1254 affecting_systematics.
insert(
it.first);
1257 return affecting_systematics;
1401 "EG_SCALE_S12EXTRALASTETABINRUN2", +1)] =
1404 "EG_SCALE_S12EXTRALASTETABINRUN2", -1)] =
1410 ScaleDecorrelation::FULL_ETA_CORRELATED or
1449 ScaleDecorrelation::FULL_ETA_CORRELATED) {
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"
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"
1495 "EG_SCALE_LARCALIB_EXTRA2015PRE", +1)] =
1498 "EG_SCALE_LARCALIB_EXTRA2015PRE", -1)] =
1509 "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE", +1)] =
1512 "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE", -1)] =
1519 "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE", +1)] =
1522 "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE", -1)] =
1599 ScaleDecorrelation::ONENP_PLUS_UNCONR) {
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"
1619 "EG_SCALE_S12EXTRALASTETABINRUN2", +1)] =
1622 "EG_SCALE_S12EXTRALASTETABINRUN2", -1)] =
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,
1635 std::vector<double> decorrelation_edges_S12_EXTRARUN3 = {
1638 std::vector<double> decorrelation_edges_S12;
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};
1650 decorrelation_edges_MODULE[7] = 1.4;
1651 decorrelation_edges_MODULE[8] = 1.5;
1656 decorrelation_edges_S12.resize(6);
1657 decorrelation_edges_S12 = {0., 0.6, 1.4, 1.5, 2.4, 2.5};
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}; \
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}; \
1687 #include "ElectronPhotonFourMomentumCorrection/systematics.def"
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}; \
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}; \
1707 #include "ElectronPhotonFourMomentumCorrection/systematics_S12_2022.def"
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}; \
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}; \
1726 #include "ElectronPhotonFourMomentumCorrection/systematics_es2024_Run3_v0.def"
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}; \
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}; \
1745 #include "ElectronPhotonFourMomentumCorrection/systematics_S12.def"
1752 const TAxis& axis_statistical_error(
m_rootTool->get_ZeeStat_eta_axis());
1753 for (
int ibin = 1; ibin <= axis_statistical_error.GetNbins(); ++ibin) {
1755 axis_statistical_error.GetBinLowEdge(ibin),
1756 axis_statistical_error.GetBinLowEdge(ibin + 1));
1778 "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN0", +1)] =
1782 "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN0", -1)] =
1786 "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN1", +1)] =
1790 "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN1", -1)] =
1794 "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN2", +1)] =
1798 "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN2", -1)] =
1810 "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN0", +1)] =
1814 "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN0", -1)] =
1818 "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN1", +1)] =
1822 "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN1", -1)] =
1830 "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN0", +1)] =
1834 "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN1", +1)] =
1838 "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN0", -1)] =
1842 "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN1", -1)] =
1939 "EG_SCALE_E4SCINTILLATOR__ETABIN0", +1)] =
1943 "EG_SCALE_E4SCINTILLATOR__ETABIN1", +1)] =
1947 "EG_SCALE_E4SCINTILLATOR__ETABIN2", +1)] =
1951 "EG_SCALE_E4SCINTILLATOR__ETABIN0", -1)] =
1955 "EG_SCALE_E4SCINTILLATOR__ETABIN1", -1)] =
1959 "EG_SCALE_E4SCINTILLATOR__ETABIN2", -1)] =
1964 "EG_SCALE_E4SCINTILLATOR__ETABIN3", +1)] =
1968 "EG_SCALE_E4SCINTILLATOR__ETABIN3", -1)] =
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)] =
2043 "EG_RESOLUTION_MATERIALIBL", +1)] =
2046 "EG_RESOLUTION_MATERIALIBL", -1)] =
2049 "EG_RESOLUTION_MATERIALPP0", +1)] =
2052 "EG_RESOLUTION_MATERIALPP0", -1)] =
2112 if (systConfig.
empty())
2113 return StatusCode::SUCCESS;
2118 bool first_scale =
true;
2119 bool first_resolution =
true;
2120 for (
const auto&
it : systConfig) {
2123 if (not first_scale) {
2125 throw std::runtime_error(
"multiple scale variations not supported");
2127 first_scale =
false;
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");
2139 first_resolution =
false;
2144 return StatusCode::SUCCESS;
2148 double Ecl,
double phi,
double eta)
const {
2154 double Ecl_corr = 0.;
2173 phi_mod = fmod(
phi, 2 *
pi / 16.) +
pi / 8.;
2175 phi_mod = fmod(
phi, 2 *
pi / 16.);
2178 if (std::abs(eta) <= 1.37) {
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))
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))
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))
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))
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))
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))
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))
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))
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))
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))
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))
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))
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))
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))
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))
2274 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 199.1735))) *
2275 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-176.4056))))));
2290 DivInt = (
int)(
phi / ((2 *
pi) / 16.));
2291 double phi_mod =
phi - DivInt * (2 *
pi / 16.);
2298 if (std::abs(eta) <= 1.4) {
2303 Ecl / (1 - 0.131 * ((1 / (1 +
exp((phi_mod - 0.2) * 199.08))) *
2304 (1 / (1 +
exp((phi_mod - 0.2) * (-130.36))))));
2308 if (phi < pi / 4. && phi >= -
pi / 4.) {
2310 Ecl / (1 - 0.0879 * ((1 / (1 +
exp((phi_mod - 0.2) * 221.01))) *
2311 (1 / (1 +
exp((phi_mod - 0.2) * (-149.51))))));
2314 if (phi < -pi / 4. && phi >= (-3 *
pi) / 4.) {
2316 Ecl / (1 - 0.0605 * ((1 / (1 +
exp((phi_mod - 0.2) * 281.37))) *
2317 (1 / (1 +
exp((phi_mod - 0.2) * (-170.29))))));
2320 if ((
phi < (-3 *
pi) / 4.) || (
phi >= (3 *
pi) / 4.)) {
2322 Ecl / (1 - 0.102 * ((1 / (1 +
exp((phi_mod - 0.2) * 235.37))) *
2323 (1 / (1 +
exp((phi_mod - 0.2) * (-219.04))))));
2338 constexpr
double PI =
M_PI;
2343 if (eta < -0.4 && eta > -0.6) {
2344 if (
phi < (14 *
PI / 32.) &&
phi > (13 *
PI / 32.)) {
2346 }
else if (
phi < (13 *
PI / 32.) &&
phi > (12 *
PI / 32.)) {
2365 if (eta < 0.2 && eta > 0.) {
2366 if (
phi < (-7 * 2 *
PI / 32.) &&
phi > (-8 * 2 *
PI / 32.)) {
2371 else if (eta < 0.6 && eta > 0.4) {
2372 if (phi < 0 && phi > (-2 *
PI / 32.)) {
2374 }
else if (
phi < (-4 * 2 *
PI / 32.) &&
phi > (-5 * 2 *
PI / 32.)) {
2379 else if (eta < 0.8 && eta > 0.6) {
2380 if (
phi < (7 * 2 *
PI / 32.) &&
phi > (6 * 2 *
PI / 32.)) {
2385 else if (eta < 1.4 && eta > 1.2) {
2386 if (
phi < (-9 * 2 *
PI / 32.) &&
phi > (-10 * 2 *
PI / 32.)) {
2388 }
else if (
phi < (-11 * 2 *
PI / 32.) &&
phi > (-12 * 2 *
PI / 32.)) {
2393 else if (eta < 2.3 && eta > 2.1) {
2394 if (
phi < (-12 * 2 *
PI / 32.) &&
phi > (-13 * 2 *
PI / 32.)) {
2399 else if (eta < 0. && eta > -0.2) {
2400 if (
phi < (-12 * 2 *
PI / 32.) &&
phi > (-13 * 2 *
PI / 32.)) {
2402 }
else if (
phi < (-8 * 2 *
PI / 32.) &&
phi > (-9 * 2 *
PI / 32.)) {
2407 else if (eta < -0.2 && eta > -0.4) {
2408 if (
phi < (-9 * 2 *
PI / 32.) &&
phi > (-10 * 2 *
PI / 32.)) {
2413 else if (eta < -1.2 && eta > -1.4) {
2414 if (
phi < (-6 * 2 *
PI / 32.) &&
phi > (-7 * 2 *
PI / 32.)) {
2419 else if (eta < -1.6 && eta > -1.8) {
2420 if (
phi < (9 * 2 *
PI / 32.) &&
phi > (8 * 2 *
PI / 32.)) {
2425 else if (eta < -2.3 && eta > -2.5) {
2426 if (
phi < (-8 * 2 *
PI / 32.) &&
phi > (-9 * 2 *
PI / 32.)) {
2428 }
else if (
phi < (5 * 2 *
PI / 32.) &&
phi > (4 * 2 *
PI / 32.)) {
2430 }
else if (
phi < (9 * 2 *
PI / 32.) &&
phi > (8 * 2 *
PI / 32.)) {
2432 }
else if (
phi < (10 * 2 *
PI / 32.) &&
phi > (9 * 2 *
PI / 32.)) {
2434 }
else if (
phi < (11 * 2 *
PI / 32.) &&
phi > (10 * 2 *
PI / 32.)) {
2442 if (eta < 0.6 && eta > 0.4) {
2443 if (phi < 0 && phi > (-2 *
PI / 32.)) {
2445 }
else if (
phi < (-4 * 2 *
PI / 32.) &&
phi > (-5 * 2 *
PI / 32.)) {
2450 else if (eta < 0.8 && eta > 0.6) {
2451 if (
phi < (7 * 2 *
PI / 32.) &&
phi > (6 * 2 *
PI / 32.)) {
2456 else if (eta < 1.4 && eta > 1.2) {
2457 if (
phi < (-11 * 2 *
PI / 32.) &&
phi > (-12 * 2 *
PI / 32.)) {
2462 else if (eta < 2.0 && eta > 1.9) {
2463 if (
phi < (10 * 2 *
PI / 32.) &&
phi > (9 * 2 *
PI / 32.)) {
2468 else if (eta < -1.2 && eta > -1.4) {
2469 if (
phi < (-4 * 2 *
PI / 32.) &&
phi > (-5 * 2 *
PI / 32.)) {
2471 }
else if (
phi < (-6 * 2 *
PI / 32.) &&
phi > (-7 * 2 *
PI / 32.)) {
2476 else if (eta < -1.6 && eta > -1.8) {
2477 if (
phi < (9 * 2 *
PI / 32.) &&
phi > (8 * 2 *
PI / 32.)) {
2482 else if (eta < -2.3 && eta > -2.5) {
2483 if (
phi < (-8 * 2 *
PI / 32.) &&
phi > (-9 * 2 *
PI / 32.)) {
2485 }
else if (
phi < (5 * 2 *
PI / 32.) &&
phi > (4 * 2 *
PI / 32.)) {
2487 }
else if (
phi < (9 * 2 *
PI / 32.) &&
phi > (8 * 2 *
PI / 32.)) {
2489 }
else if (
phi < (10 * 2 *
PI / 32.) &&
phi > (9 * 2 *
PI / 32.)) {
2491 }
else if (
phi < (11 * 2 *
PI / 32.) &&
phi > (10 * 2 *
PI / 32.)) {
2503 for (
auto egamma : egammas) {
2505 throw std::runtime_error (
"EgammaCalibrationAndSmearingTool::callEvents: apply failed");
2514 auto eventInfo =
acc.m_eventHandle(
event);