41 {
42
43const double GeV = 1000.;
44
46 switch (model) {
60 "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
62 "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
63 return std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
64 }
80 return nullptr;
81 default:
82 return nullptr;
83 }
84}
85
88 switch (model) {
92 folder =
"egammaMVACalib/v1";
93 break;
95 folder =
"egammaMVACalib/v1";
96 break;
101 folder =
"egammaMVACalib/offline/v3";
102 break;
105 folder =
"egammaMVACalib/offline/v3_E4crack_bis";
106 break;
114 folder =
"egammaMVACalib/offline/v4.0";
115 break;
124 folder =
"egammaMVACalib/offline/v7";
125 break;
128 folder =
"egammaMVACalib/offline/v9";
129 break;
131 folder =
"egammaMVACalib/offline/v10";
132 break;
133 default:
135 }
136
138}
139
140std::unique_ptr<egammaLayerRecalibTool> egammaLayerRecalibToolFactory(
142 std::string
tune =
"";
143 switch (model) {
147 tune =
"2011_alt_with_layer2";
148 break;
161 tune =
"2012_alt_with_layer2";
162 break;
165 tune =
"es2017_20.7_improved";
166 break;
168 tune =
"es2017_20.7_final";
169 break;
176 tune =
"es2017_21.0_v0";
177 break;
179 tune =
"es2018_21.0_v0";
180 break;
182 tune =
"es2022_22.0_Precision";
183 break;
185 tune =
"es2022_22.0_Precision_v1";
186 break;
188 tune =
"es2024_run3_extrapolate_v0";
189 break;
190 default:
191 return nullptr;
192 }
193 return std::make_unique<egammaLayerRecalibTool>(tune, enableSacc);
194}
195
197 switch (model) {
204 return false;
233 return true;
235 return false;
236 }
237 assert(false);
238 return false;
239}
240
242 return use_intermodule_correction(model);
243}
244
246 switch (model) {
256 return false;
282 return true;
284 return false;
285 }
286 assert(false);
287 return false;
288}
289
290EgammaCalibrationAndSmearingTool::EgammaCalibrationAndSmearingTool(
291 const std::string& name)
295 m_use_mapping_correction(false),
300 m_set_seed_function([](
const EgammaCalibrationAndSmearingTool&
tool,
303 const Accessors&
acc = *
tool.m_accessors;
304
305
306 auto cluster =
acc.caloClusterAcc(egamma)[0].
value();
307 return 1 + static_cast<RandomNumber>(
308 std::abs(
acc.clusterPhiAcc(cluster)) * 1E6 +
309 std::abs(
acc.clusterEtaAcc(cluster)) * 1E3 +
310 acc.eventNumberAcc(ei));
311 }),
312 m_accessors(std::make_unique<Accessors>(*this)) {
313
314 declareProperty("ESModel", m_ESModel = "");
315 declareProperty("decorrelationModel", m_decorrelation_model_name = "");
316 declareProperty("decorrelationModelScale",
317 m_decorrelation_model_scale_name = "");
318 declareProperty("decorrelationModelResolution",
319 m_decorrelation_model_resolution_name = "");
320 declareProperty("ResolutionType", m_ResolutionType = "SigmaEff90");
321 declareProperty("varSF", m_varSF = 1.0);
322 declareProperty("doScaleCorrection", m_doScaleCorrection = AUTO);
323 declareProperty("doSmearing", m_doSmearing = AUTO);
324 declareProperty("useLayerCorrection", m_useLayerCorrection = AUTO);
325 declareProperty("usePSCorrection", m_usePSCorrection = AUTO);
326 declareProperty("useS12Correction", m_useS12Correction = AUTO);
327 declareProperty("useSaccCorrection", m_useSaccCorrection = AUTO);
328 declareProperty("useIntermoduleCorrection",
329 m_useIntermoduleCorrection = AUTO);
330 declareProperty("usePhiUniformCorrection", m_usePhiUniformCorrection = AUTO);
331 declareProperty("useCaloDistPhiUnifCorrection",
332 m_useCaloDistPhiUnifCorrection = AUTO);
333 declareProperty("useGainCorrection", m_useGainCorrection = AUTO);
334 declareProperty("useGainInterpolation", m_useGainInterpolation = AUTO);
335 declareProperty("doADCLinearityCorrection",
336 m_doADCLinearityCorrection = AUTO);
337 declareProperty("doLeakageCorrection", m_doLeakageCorrection = AUTO);
338 declareProperty("MVAfolder", m_MVAfolder = "");
339 declareProperty("layerRecalibrationTune", m_layer_recalibration_tune = "");
340 declareProperty("useEPCombination", m_use_ep_combination = false);
341 declareProperty("useMVACalibration", m_use_mva_calibration = AUTO);
342 declareProperty("use_full_statistical_error",
343 m_use_full_statistical_error = false);
344 declareProperty("use_temp_correction201215",
345 m_use_temp_correction201215 = AUTO);
346 declareProperty("use_uA2MeV_2015_first2weeks_correction",
347 m_use_uA2MeV_2015_first2weeks_correction = AUTO);
348 declareProperty("randomRunNumber", m_user_random_run_number = 0);
349
350
351 declareProperty("useFastSim", m_useFastSim = -1,
352 "This should be explicitly set by the user depending on the "
353 "data type (int)0=full sim, (int)1=fast sim");
354 declareProperty(
355 "useAFII", m_use_AFII = -1,
356 "This is now deprecated. Kept for explicit error message for now");
357 declareProperty("decorateEmva", m_decorateEmva = false, "whether to decorate the eMVA value");
358}
359
360EgammaCalibrationAndSmearingTool::~EgammaCalibrationAndSmearingTool() {
362 delete m_layer_recalibration_tool;
363 delete m_gain_tool;
364}
365
366StatusCode EgammaCalibrationAndSmearingTool::initialize() {
368
369 if (m_ESModel == "es2015XX") {
371 }
372
373 if (m_ESModel == "es2010") {
375 }
376 else if (m_ESModel == "es2011c") {
378 }
379 else if (m_ESModel == "es2011d") {
381 }
382 else if (m_ESModel == "es2012a") {
384 }
385 else if (m_ESModel == "es2012c") {
387 }
388 else if (m_ESModel == "es2012XX") {
390 } else if (m_ESModel == "es2015PRE") {
392 } else if (m_ESModel == "es2015PRE_res_improved") {
394 } else if (m_ESModel == "es2015cPRE") {
396 } else if (m_ESModel == "es2015cPRE_res_improved") {
398 } else if (m_ESModel == "es2015c_summer") {
400 } else if (m_ESModel == "es2016PRE") {
402 } else if (m_ESModel == "es2016data_mc15c") {
404 } else if (m_ESModel == "es2016data_mc15c_summer") {
406 } else if (m_ESModel == "es2016data_mc15c_summer_improved") {
408 } else if (m_ESModel == "es2016data_mc15c_final") {
410 } else if (m_ESModel == "es2015_5TeV") {
412 } else if (m_ESModel == "es2017_R21_PRE") {
414 } else if (m_ESModel == "es2017_R21_v0") {
416 } else if (m_ESModel == "es2017_R21_v1") {
418 } else if (m_ESModel == "es2017_R21_ofc0_v1") {
420 } else if (m_ESModel == "es2018_R21_v0") {
422 } else if (m_ESModel == "es2018_R21_v1") {
424 } else if (m_ESModel == "es2022_R22_PRE") {
426 } else if (m_ESModel == "es2023_R22_Run2_v0") {
428 } else if (m_ESModel == "es2023_R22_Run2_v1") {
430 } else if (m_ESModel == "es2024_Run3_ofc0_v0") {
432 } else if (m_ESModel == "es2024_Run3_v0") {
434 } else if (m_ESModel == "es2025_Run3_GNN_v0") {
436 } else if (m_ESModel.empty()) {
438 return StatusCode::FAILURE;
439 } else {
441 return StatusCode::FAILURE;
442 }
443
444 if (m_ResolutionType == "Gaussian") {
446 } else if (m_ResolutionType == "SigmaEff80") {
448 } else if (m_ResolutionType == "SigmaEff90") {
450 } else {
451 ATH_MSG_ERROR(
"Cannot understand resolution " << m_ResolutionType);
452 return StatusCode::FAILURE;
453 }
454
455 if (m_use_AFII != -1) {
457 "Property useAFII is deprecated. It is now replaced with useFastSim, "
458 "which should be explicitly configured");
459 return StatusCode::FAILURE;
460 }
461
462 if (m_useFastSim == 1) {
464 } else if (m_useFastSim == 0) {
466 } else {
467 ATH_MSG_ERROR(
"Property useFastSim should be explicitly configured");
468 return StatusCode::FAILURE;
469 }
470
474 "Sample is FastSim but no AF3 calibration is supported with "
475 "MC23 pre-recommendations (es2022_R22_PRE and es2024_Run3_ofc0_v0). "
476 "Please swtich to Run3 consolidated recommendations (es2024_Run3_v0), "
477 "or get in touch with the EGamma CP group in case you are using this");
478 return StatusCode::FAILURE;
479 }
480
481
482
483
484
485
486
487
488
489
490
491
492
493 if (m_decorrelation_model_name.empty() and
494 m_decorrelation_model_scale_name.empty() and
495 m_decorrelation_model_resolution_name.empty()) {
496
497 ATH_MSG_WARNING(
"no decorrelation model specified, assuming full model");
498 m_decorrelation_model_scale = ScaleDecorrelation::FULL;
499 m_decorrelation_model_resolution = ResolutionDecorrelation::FULL;
500 m_decorrelation_model_name = "FULL_v1";
501 } else if (not m_decorrelation_model_name.empty() and
502 not m_decorrelation_model_scale_name.empty() and
503 not m_decorrelation_model_resolution_name.empty()) {
504
506 return StatusCode::FAILURE;
507 } else {
508
509 if (not m_decorrelation_model_scale_name.empty()) {
510 if (not m_decorrelation_model_name.empty()) {
512 "flag decorrelation model ignored for scale decorrelation model");
513 }
514 if (m_decorrelation_model_scale_name == "1NP_v1")
515 m_decorrelation_model_scale = ScaleDecorrelation::ONENP;
516 else if (m_decorrelation_model_scale_name == "FULL_ETACORRELATED_v1")
517 m_decorrelation_model_scale = ScaleDecorrelation::FULL_ETA_CORRELATED;
518 else if (m_decorrelation_model_scale_name == "1NPCOR_PLUS_UNCOR")
519 m_decorrelation_model_scale = ScaleDecorrelation::ONENP_PLUS_UNCONR;
520 else if (m_decorrelation_model_scale_name == "FULL_v1")
521 m_decorrelation_model_scale = ScaleDecorrelation::FULL;
522 else {
523 ATH_MSG_FATAL(
"cannot understand the scale decorrelation model '"
524 << m_decorrelation_model_scale_name << "'(typo?)");
525 return StatusCode::FAILURE;
526 }
527 } else if (not m_decorrelation_model_name.empty()) {
528 if (m_decorrelation_model_name == "1NP_v1")
529 m_decorrelation_model_scale = ScaleDecorrelation::ONENP;
530 else if (m_decorrelation_model_name == "FULL_ETACORRELATED_v1")
531 m_decorrelation_model_scale = ScaleDecorrelation::FULL_ETA_CORRELATED;
532 else if (m_decorrelation_model_name == "1NPCOR_PLUS_UNCOR")
533 m_decorrelation_model_scale = ScaleDecorrelation::ONENP_PLUS_UNCONR;
534 else if (m_decorrelation_model_name == "FULL_v1")
535 m_decorrelation_model_scale = ScaleDecorrelation::FULL;
536 else {
538 << m_decorrelation_model_name << "'(typo?)");
539 return StatusCode::FAILURE;
540 }
541 } else {
543 "not information how to initialize the scale decorrelation model");
544 return StatusCode::FAILURE;
545 }
546
547
548 if (not m_decorrelation_model_resolution_name
550 if (not m_decorrelation_model_name.empty()) {
552 "flag decorrelation model ignored for resolution decorrelation "
553 "model");
554 }
555 if (m_decorrelation_model_resolution_name == "1NP_v1")
556 m_decorrelation_model_resolution = ResolutionDecorrelation::ONENP;
557 else if (m_decorrelation_model_resolution_name == "FULL_v1")
558 m_decorrelation_model_resolution = ResolutionDecorrelation::FULL;
559 else {
560 ATH_MSG_FATAL(
"cannot understand the resolution decorrelation model '"
561 << m_decorrelation_model_resolution_name << "'(typo?)");
562 return StatusCode::FAILURE;
563 }
564 } else if (not m_decorrelation_model_name.empty()) {
565 if (m_decorrelation_model_name == "1NP_v1")
566 m_decorrelation_model_resolution = ResolutionDecorrelation::ONENP;
567 else if (m_decorrelation_model_name == "FULL_ETACORRELATED_v1")
568 m_decorrelation_model_resolution = ResolutionDecorrelation::FULL;
569 else if (m_decorrelation_model_name == "1NPCOR_PLUS_UNCOR")
570 m_decorrelation_model_resolution = ResolutionDecorrelation::ONENP;
571 else if (m_decorrelation_model_name == "FULL_v1")
572 m_decorrelation_model_resolution = ResolutionDecorrelation::FULL;
573 else {
575 << m_decorrelation_model_name << "'(typo?)");
576 return StatusCode::FAILURE;
577 }
578 }
579 }
580
581
583 m_rootTool = std::make_unique<AtlasRoot::egammaEnergyCorrectionTool>();
584 if (!m_rootTool) {
586 return StatusCode::FAILURE;
587 }
588 m_rootTool->setESModel(m_TESModel);
589
593 (m_useGainInterpolation == AUTO || m_useGainInterpolation == 1)) {
595 "Using linear interpolation in the gain tool (uncertainties only)");
596 m_useGainInterpolation = 1;
597 m_rootTool->setApplyL2GainInterpolation();
598 }
599 m_rootTool->msg().setLevel(this->
msg().
level());
600 m_rootTool->initialize();
601
602
603 if (m_use_mva_calibration != 0) {
605 if (m_MVAfolder.empty()) {
606 m_MVAfolder = egammaMVAToolFolder(m_TESModel);
607 }
608
609 if (not m_MVAfolder.empty()) {
610
611
613 "egammaMVACalibTool/tool_mva_electron");
614 config_mva_electron.setPropertyFromString("folder", m_MVAfolder);
615 ATH_CHECK(config_mva_electron.setProperty(
"use_layer_corrected",
true));
616 ATH_CHECK(config_mva_electron.setProperty(
618
619
621 "egammaMVACalibTool/tool_mva_unconverted");
622 config_mva_unconverted.setPropertyFromString("folder", m_MVAfolder);
624 config_mva_unconverted.setProperty("use_layer_corrected", true));
625 ATH_CHECK(config_mva_unconverted.setProperty(
627 ATH_CHECK(config_mva_unconverted.setProperty(
"OutputLevel",
628 this->msg().level()));
629
630
632 "egammaMVACalibTool/tool_mva_converted");
633 config_mva_converted.setPropertyFromString("folder", m_MVAfolder);
634 ATH_CHECK(config_mva_converted.setProperty(
"use_layer_corrected",
true));
635 ATH_CHECK(config_mva_converted.setProperty(
637 ATH_CHECK(config_mva_converted.setProperty(
"OutputLevel",
638 this->msg().level()));
639
640
641
642 std::ostringstream mva_service_name;
643 size_t dot = this->name().find(
'.');
644 size_t underscore = this->name().rfind(
'_',
dot);
645 std::string collection = "";
646 if (
dot != std::string::npos &&
647 underscore != std::string::npos &&
649 {
650 collection = this->name().substr(underscore + 1,
dot - underscore - 1);
651 mva_service_name << "egammaMVASvc/service_mva_egamma_id"
652 << collection;;
653 }
654 else
655 {
656 mva_service_name << "egammaMVASvc/service_mva_egamma_id"
657 << (void const*)this;
658 }
660
661 if (m_doElectronMVA) {
662 ATH_CHECK(config_mva_service.addPrivateTool(
"ElectronTool",
663 std::move(config_mva_electron)));
664 }
665 if (m_doPhotonMVA) {
666 ATH_CHECK(config_mva_service.addPrivateTool(
"UnconvertedPhotonTool",
667 std::move(config_mva_unconverted)));
668 ATH_CHECK(config_mva_service.addPrivateTool(
"ConvertedPhotonTool",
669 std::move(config_mva_converted)));
670 }
671
672 if (m_doFwdCalib) {
674 "egammaMVACalibTool/tool_mva_fwdelectron");
675 config_mva_fwdelectron.setPropertyFromString("folder", m_MVAfolder);
676 ATH_CHECK(config_mva_fwdelectron.setProperty(
678 ATH_CHECK(config_mva_fwdelectron.setProperty(
"ShiftType", 0));
679 ATH_CHECK(config_mva_fwdelectron.setProperty(
"OutputLevel", this->msg().level()));
680 ATH_CHECK(config_mva_service.addPrivateTool(
"FwdElectronTool",
681 std::move(config_mva_fwdelectron)));
682 }
683 config_mva_service.setPropertyFromString("folder", m_MVAfolder);
685 config_mva_service.setProperty("OutputLevel", this->msg().level()));
686 ATH_CHECK(config_mva_service.makeService(m_MVACalibSvc));
689 "WIP: testing GNN based calibration for Run3,"
690 "requring decorated GNN energy (gnn_energy) from input,"
691 "which should already have the layer calibration applied");
692 } else {
693 m_use_mva_calibration = false;
694 }
695 }
696
697
698
699
700
701
702 if (m_ESModel == "es2017_R21_PRE") {
703 ATH_MSG_INFO(
"Layer recalibration already applied at cell level");
704 m_useLayerCorrection = false;
705 } else if (!m_useLayerCorrection) {
707 } else {
708 ATH_MSG_DEBUG(
"initializing layer recalibration tool (if needed)");
709 if (m_layer_recalibration_tune
711 m_layer_recalibration_tool =
712 egammaLayerRecalibToolFactory(m_TESModel, m_useSaccCorrection)
713 .release();
714 if (!m_layer_recalibration_tool) {
716 }
717 } else {
718 m_layer_recalibration_tool =
720 }
721 if (m_layer_recalibration_tool) {
722 m_layer_recalibration_tool->msg().setLevel(this->
msg().
level());
723 m_layer_recalibration_tool->fixForMissingCells(m_fixForMissingCells);
724 if (!m_usePSCorrection) {
726 m_layer_recalibration_tool->disable_PSCorrections();
727 }
728 if (!m_useS12Correction) {
730 m_layer_recalibration_tool->disable_S12Corrections();
731 }
732 if (!m_useSaccCorrection) {
734 m_layer_recalibration_tool->disable_SaccCorrections();
735 }
736 }
737 }
738
739 if (m_use_temp_correction201215 != AUTO)
740 m_rootTool->use_temp_correction201215(m_use_temp_correction201215);
741 if (m_use_uA2MeV_2015_first2weeks_correction != AUTO)
742 m_rootTool->use_uA2MeV_2015_first2weeks_correction(
743 m_use_uA2MeV_2015_first2weeks_correction);
744 if (not m_use_full_statistical_error and
745 m_decorrelation_model_scale == ScaleDecorrelation::FULL) {
746 m_rootTool->useStatErrorScaling(true);
747 }
748
749 if (m_use_ep_combination) {
751 throw std::runtime_error("ep combination not supported yet");
752 }
753
754 if (m_useIntermoduleCorrection == AUTO) {
755 m_useIntermoduleCorrection = use_intermodule_correction(m_TESModel);
756 }
757 if (m_usePhiUniformCorrection == AUTO) {
758 m_usePhiUniformCorrection = use_phi_uniform_correction(m_TESModel);
759 }
760 m_use_mapping_correction = not is_after_run1(m_TESModel);
761
762 if (m_useGainCorrection == AUTO) {
766 m_useGainCorrection = 0;
767 }
768 else {
770 m_gain_tool = gainToolFactory(m_TESModel).release();
771 m_useGainCorrection =
bool(m_gain_tool);
772 }
773 }
774 else if (m_useGainCorrection == 1) {
778 m_useGainCorrection = 0;
780 "cannot instantiate gain tool for this model (you can only disable "
781 "the gain tool, but not enable it)");
782 }
783 else {
785 "initializing gain tool for run2 final precision recommendations");
787 "Gain corrections required but Zee scales are derived without Gain, "
788 "will cause inconsistency!");
790 "ElectronPhotonFourMomentumCorrection/v29/"
791 "gain_uncertainty_specialRun.root");
792 m_gain_tool_run2 = std::make_unique<egGain::GainUncertainty>(
793 gain_tool_run_2_filename, false, "GainCorrection",
794 m_useGainInterpolation);
795 m_gain_tool_run2->msg().setLevel(this->
msg().
level());
796 }
797 }
798
803
804 if (m_doADCLinearityCorrection == AUTO || m_doADCLinearityCorrection == 1) {
805 m_doADCLinearityCorrection = 1;
807 "ElectronPhotonFourMomentumCorrection/v25/linearity_ADC.root");
808 m_ADCLinearity_tool = std::make_shared<LinearityADC>(adcLinearityCorr_filename);
809 m_ADCLinearity_tool->msg().setLevel(this->
msg().
level());
810 m_rootTool->setADCTool(m_ADCLinearity_tool);
811 } else {
813 m_ESModel + " recommendations use ADC corrections for scale "
814 "derivation. Disabling the ADCLinearity flag will create "
815 "inconsistency!");
816 }
817
818 if (m_doLeakageCorrection == AUTO || m_doLeakageCorrection == 1) {
819 m_doLeakageCorrection = 1;
820 m_rootTool->setApplyLeakageCorrection(true);
821 }
822
823
824 if (m_useCaloDistPhiUnifCorrection == AUTO ||
825 m_useCaloDistPhiUnifCorrection == 1) {
826 m_useCaloDistPhiUnifCorrection = 1;
828 "ElectronPhotonFourMomentumCorrection/v33/"
829 "egammaEnergyCorrectionData.root");
830 std::unique_ptr<TFile> fCorr(
831 TFile::Open(phiUnifCorrfileName.c_str(), "READ"));
832 m_caloDistPhiUnifCorr.reset(
833 dynamic_cast<TH2*>(fCorr->Get("CaloDistortionPhiUniformityCorrection/"
834 "es2023_R22_Run2_v0/h2DcorrPhiUnif")));
835 m_caloDistPhiUnifCorr->SetDirectory(nullptr);
836 } else {
838 m_ESModel + " recommendations use CaloDistPhiUnif for scale "
839 "derivation. Disabling the CaloDistPhiUnif flag will create "
840 "inconsistency!");
841 }
842 }
843
844
845
846
847
848
849
852 ATH_MSG_INFO(
"decorrelation Model: " << m_decorrelation_model_name);
853 ATH_MSG_DEBUG(
"layer correction = " << m_useLayerCorrection);
857 ATH_MSG_DEBUG(
"intermodule correction = " << m_useIntermoduleCorrection);
858 ATH_MSG_DEBUG(
"phi uniformity correction = " << m_usePhiUniformCorrection);
860 << m_useCaloDistPhiUnifCorrection);
862 ATH_MSG_DEBUG(
"ADC non-linearity correction = " << m_doADCLinearityCorrection);
863 ATH_MSG_DEBUG(
"leakage correction for photons = " << m_doLeakageCorrection);
867 ATH_MSG_DEBUG(
"use MVA calibration = " << m_use_mva_calibration);
869 "use temperature correction 2015 = " << m_use_temp_correction201215);
871 << m_use_uA2MeV_2015_first2weeks_correction);
872
873 setupSystematics();
874
876 .ignore();
877
879 if (
registry.registerSystematics(*
this) != StatusCode::SUCCESS)
880 return StatusCode::FAILURE;
881
882
883
884
885
886
887
888
890 resetAccessor (m_accessors->gnn_energy_Acc, *
this,
"TransformerEnergy");
891 }
892 if (m_onlyElectrons.value() && m_onlyPhotons.value()) {
893 ATH_MSG_ERROR(
"Cannot select both onlyElectrons and onlyPhotons");
894 return StatusCode::FAILURE;
895 }
896 if (m_onlyElectrons.value()) {
899 resetAccessor (m_accessors->electronTrackAcc, *
this,
"trackParticleLinks");
900 }
901 }
902 if (m_onlyPhotons.value()) {
904 resetAccessor (m_accessors->photonVertexAcc, *
this,
"vertexLinks");
905 }
906 if (m_decorateEmva)
908
910
911 return StatusCode::SUCCESS;
912}
913
914
916{
917 const Accessors&
acc = *m_accessors;
918
919
920
921
922
923 if (m_onlyElectrons.value())
924 {
926 }
927 if (m_onlyPhotons.value())
928 {
929 if (
acc.photonVertexAcc(particle).size() > 0)
930 {
932 }
933 else
934 {
936 }
937 }
938
939
940
942
947 }
948 else {
950 throw std::runtime_error("particle is not electron or photon");
951 }
952 return ptype;
953}
954
955double EgammaCalibrationAndSmearingTool::getResolution(
957 const auto ptype = xAOD2ptype(particle);
958 const auto cl_etaCalo =
960
962 cl_etaCalo, ptype, withCT,
963 false);
964}
965
966double EgammaCalibrationAndSmearingTool::resolution(
967 double energy, double cl_eta, double cl_etaCalo,
969 return m_rootTool->resolution(energy, cl_eta, cl_etaCalo, ptype, withCT,
970 false);
971}
972
975
977 if (evtStore()->retrieve(event_info, "EventInfo").isFailure()) {
980 }
981 return applyCorrection(input, *event_info);
982}
983
986
987 if (output)
989 "Non-null pointer received. "
990 "There's a possible memory leak!");
991
993 output->makePrivateStore(input);
994 return applyCorrection(*output);
995}
996
999
1000 if (output)
1002 "Non-null pointer received. "
1003 "There's a possible memory leak!");
1004
1006 output->makePrivateStore(input);
1007 return applyCorrection(*output);
1008}
1009
1010double EgammaCalibrationAndSmearingTool::getEnergy(
1014 const double e = new_particle->
e();
1015 delete new_particle;
1017}
1018
1019double EgammaCalibrationAndSmearingTool::getEnergy(
1023 const double e = new_particle->
e();
1024 delete new_particle;
1026}
1027
1030 const Accessors&
acc = *m_accessors;
1031
1032
1033 RandomNumber
seed = m_set_seed_function(*
this, input, event_info);
1034
1036
1037 if (m_layer_recalibration_tool &&
acc.authorAcc (input) !=
1039 ATH_MSG_DEBUG(
"applying energy recalibration before E0|E1|E2|E3 = "
1040 <<
acc.energyBEAcc (inputCluster, 0) <<
"|"
1041 <<
acc.energyBEAcc (inputCluster, 1) <<
"|"
1042 <<
acc.energyBEAcc (inputCluster, 2) <<
"|"
1043 <<
acc.energyBEAcc (inputCluster, 3));
1044
1045 const CP::CorrectionCode status_layer_recalibration = m_layer_recalibration_tool->applyCorrection(
input.getXAODObject(), event_info.getXAODObject());
1050 <<
acc.Es0Acc(inputCluster) <<
"|"
1051 <<
acc.Es1Acc(inputCluster) <<
"|"
1052 <<
acc.Es2Acc(inputCluster) <<
"|"
1053 <<
acc.Es3Acc(inputCluster) <<
"|");
1054 if (
acc.Es2Acc(inputCluster) == 0 and
acc.Es1Acc(inputCluster) == 0 and
1055 acc.Es3Acc(inputCluster) == 0 and
acc.Es0Acc(inputCluster) == 0 and
1056 (std::abs(
acc.etaAcc (input)) < 1.37 or (std::abs(
acc.etaAcc (input)) > 1.55 and std::abs(
acc.etaAcc (input)) < 2.47)))
1057 {
1059 }
1060 }
1061 }
1062
1064
1065 if (!m_MVACalibSvc.empty()) {
1067 if (
acc.authorAcc (input) ==
1070 if (evtStore()->retrieve(pVtxCont, m_pVtxKey).isFailure()) {
1071 ATH_MSG_ERROR(
"No primary vertex container " << m_pVtxKey <<
" could be retrieved");
1073 }
1074 unsigned int npv(0);
1075 for (const auto *vtx : *pVtxCont) {
1078 }
1080 gei.
acmu =
acc.actIntPerXingAcc(event_info);
1082 }
1083 if (
acc.authorAcc (input) !=
1085 if (m_MVACalibSvc->getEnergy(inputCluster.getXAODObject(),
input.getXAODObject(), energy, gei)
1086 .isFailure()) {
1089 }
1090 ATH_MSG_DEBUG(
"energy after MVA calibration = " << std::format(
"{:.2f}", energy));
1091 }
1092 }
1094
1095
1096 if (!
acc.gnn_energy_Acc.isAvailable(input)) {
1097 ATH_MSG_ERROR(
"GNN energy requested but decoration TransformerEnergy not found");
1099 }
1101 ATH_MSG_DEBUG(
"energy after GNN calibration = " << std::format(
"{:.2f}", energy));
1102
1103 }
1104 if (m_decorateEmva)
1105 {
1107 }
1108
1109
1110 if (
acc.authorAcc (input) ==
1112 setPt(input, energy);
1114 }
1115
1117
1118 const auto ptype = xAOD2ptype(input);
1119 const double etaden =
1122 :
acc.clusterEtaAcc(inputCluster);
1123 energy *= m_rootTool->applyMCCalibration(
acc.clusterEtaAcc(inputCluster),
1124 energy / cosh(etaden), ptype);
1126 << std::format("{:.2f}", energy));
1127 }
1128
1129
1130
1131
1132
1135 ? m_simulation
1137
1138 unsigned int runNumber_for_tool = 0;
1139
1140
1142
1143 runNumber_for_tool =
acc.runNumberAcc(event_info);
1144
1145 const auto cl_eta =
acc.clusterEtaAcc(inputCluster);
1146 double etaCalo = 0, phiCalo = 0;
1147 if (m_ADCLinearity_tool || m_gain_tool_run2 || m_usePhiUniformCorrection) {
1148 etaCalo =
acc.etaCaloAcc(inputCluster,
acc.authorAcc(input),
false);
1149 if (m_usePhiUniformCorrection) {
1150 phiCalo =
1151 acc.phiCaloAcc(inputCluster,
acc.authorAcc(input),
false);
1152 }
1153 }
1154
1155
1156 if (m_useIntermoduleCorrection) {
1158 intermodule_correction(energy,
acc.clusterPhiAcc(inputCluster), cl_eta);
1160 << std::format("{:.2f}", energy));
1161 }
1162
1163
1168 m_useCaloDistPhiUnifCorrection) {
1169 double etaC =
acc.clusterEtaAcc(inputCluster);
1170 double phiC =
acc.clusterPhiAcc(inputCluster);
1171 int ieta = m_caloDistPhiUnifCorr->GetXaxis()->FindBin(etaC);
1172 ieta = ieta == 0 ? 1
1173 : (ieta > m_caloDistPhiUnifCorr->GetNbinsX()
1174 ? m_caloDistPhiUnifCorr->GetNbinsX()
1175 : ieta);
1176 int iphi = m_caloDistPhiUnifCorr->GetYaxis()->FindBin(phiC);
1177 iphi = iphi == 0 ? 1
1178 : (iphi > m_caloDistPhiUnifCorr->GetNbinsY()
1179 ? m_caloDistPhiUnifCorr->GetNbinsY()
1180 : iphi);
1181 energy *= m_caloDistPhiUnifCorr->GetBinContent(ieta, iphi);
1183 "energy after phi uniformity correction (for calo distortion) = "
1184 << std::format("{:.2f}", energy));
1185 }
1186
1187
1188 if (m_usePhiUniformCorrection) {
1189 energy *= correction_phi_unif(etaCalo, phiCalo);
1191 << std::format("{:.2f}", energy));
1192 }
1193
1194
1195 if (m_ADCLinearity_tool) {
1196 double et =
energy / std::cosh(cl_eta);
1197 double corr =
1198 m_ADCLinearity_tool->getCorr(etaCalo,
et, xAOD2ptype(input));
1201 << std::format("{:.2f}", energy));
1202 }
1203
1204
1205 if (m_gain_tool) {
1206 const auto es2 =
acc.Es2Acc.isAvailable(inputCluster)
1207 ?
acc.Es2Acc(inputCluster)
1208 :
acc.energyBEAcc (inputCluster,2);
1209 if (!(std::abs(cl_eta) < 1.52 and std::abs(cl_eta) > 1.37) and
1210 std::abs(cl_eta) < 2.4)
1211 energy = m_gain_tool->CorrectionGainTool(
1212 cl_eta, energy /
GeV, es2 /
GeV,
1213 xAOD2ptype(input));
1214 } else if (m_gain_tool_run2) {
1215 double et =
energy / std::cosh(cl_eta);
1216 double corr = m_gain_tool_run2->getUncertainty(etaCalo,
et,
1217 xAOD2ptype(input), true);
1219 }
1220 ATH_MSG_DEBUG(
"energy after gain correction = " << std::format(
"{:.2f}", energy));
1221 } else {
1222 if (m_user_random_run_number == 0) {
1223 if (
acc.randomrunnumber_getter.isAvailable(event_info)) {
1224 runNumber_for_tool =
acc.randomrunnumber_getter(event_info);
1225 } else {
1227 "Pileup tool not run before using "
1228 "ElectronPhotonFourMomentumCorrection! Assuming it is 2016. If you "
1229 "want to force a specific period set the property randomRunNumber "
1230 "of the tool, e.g. in the job option: "
1231 "tool.randomRunNumber = 123456 or "
1232 "tool.randomRunNumber = "
1233 "EgammaCalibrationAndSmearingToolRunNumbersExample.run_2016");
1235 }
1236 } else {
1237 runNumber_for_tool = m_user_random_run_number;
1238 }
1239 }
1240
1241 const double eraw = ((
acc.Es0Acc.isAvailable(inputCluster)
1242 ?
acc.Es0Acc(inputCluster)
1243 :
acc.energyBEAcc(inputCluster,0)) +
1244 (
acc.Es1Acc.isAvailable(inputCluster)
1245 ?
acc.Es1Acc(inputCluster)
1246 :
acc.energyBEAcc(inputCluster,1)) +
1247 (
acc.Es2Acc.isAvailable(inputCluster)
1248 ?
acc.Es2Acc(inputCluster)
1249 :
acc.energyBEAcc(inputCluster,2)) +
1250 (
acc.Es3Acc.isAvailable(inputCluster)
1251 ?
acc.Es3Acc(inputCluster)
1252 :
acc.energyBEAcc(inputCluster,3)));
1253
1254
1261
1262
1263 energy = m_rootTool->getCorrectedEnergy(
1264 runNumber_for_tool, dataType, xAOD2ptype(input),
1265 inputCluster(
acc.clusterEtaAcc),
1266 inputCluster(
acc.clusterEtaBEAcc,2),
1267 acc.etaCaloAcc(inputCluster,
acc.authorAcc (input),
false), energy,
1268 acc.Es2Acc.isAvailable(inputCluster)
1269 ?
acc.Es2Acc(inputCluster)
1270 : inputCluster(
acc.energyBEAcc,2),
1271 eraw, seed, oldtool_scale_flag_this_event(input, event_info),
1272 oldtool_resolution_flag_this_event(input, event_info), m_TResolutionType,
1273 m_varSF);
1274
1275 ATH_MSG_DEBUG(
"energy after scale/systematic correction = " << std::format(
"{:.2f}", energy));
1276
1277
1278 setPt(input, energy);
1280}
1281
1284 const auto ptype = xAOD2ptype(input);
1286 const double m2 =
m *
m;
1287 const double p2 = new_energy2 >
m2 ? new_energy2 -
m2 : 0.;
1288 m_accessors->ptOutDec (input) = sqrt(p2) / cosh(m_accessors->etaAcc (input));
1289 ATH_MSG_DEBUG(
"after setting pt, energy = " << m_accessors->momAcc.e (input));
1290}
1291
1292double EgammaCalibrationAndSmearingTool::getEnergy(
1297}
1298
1300EgammaCalibrationAndSmearingTool::oldtool_scale_flag_this_event(
1302 const Accessors&
acc = *m_accessors;
1304 return m_currentScaleVariation_data;
1305 if (m_currentScalePredicate(*this,p))
1306 return m_currentScaleVariation_MC;
1307 else
1309}
1310
1312EgammaCalibrationAndSmearingTool::oldtool_resolution_flag_this_event(
1314 const Accessors&
acc = *m_accessors;
1316 ? m_currentResolutionVariation_MC
1317 : m_currentResolutionVariation_data;
1318}
1319
1320double EgammaCalibrationAndSmearingTool::getElectronMomentum(
1324 ? m_simulation
1326
1328
1329
1330 const float el_tracketa = eTrack->
eta();
1331 const float el_trackmomentum = eTrack->
pt() * cosh(
el->eta());
1332
1333 return m_rootTool->getCorrectedMomentum(
1335 oldtool_scale_flag_this_event(*el, *event_info), m_varSF);
1336}
1337
1338bool EgammaCalibrationAndSmearingTool::isAffectedBySystematic(
1341 return sys.find(systematic) !=
sys.end();
1342}
1343
1345 const {
1347 for (const auto& it : m_syst_description) {
1348 affecting_systematics.
insert(
it.first);
1349 }
1350 for (const auto& it : m_syst_description_resolution) {
1351 affecting_systematics.
insert(
it.first);
1352 }
1353
1354 return affecting_systematics;
1355}
1356
1357void EgammaCalibrationAndSmearingTool::setupSystematics() {
1358 const EgammaPredicate always = [](
const EgammaCalibrationAndSmearingTool&,
columnar::EgammaId) {
return true; };
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372 if (m_decorrelation_model_scale == ScaleDecorrelation::FULL_ETA_CORRELATED ||
1373 m_decorrelation_model_scale == ScaleDecorrelation::FULL) {
1374
1378
1379
1380 if (m_doADCLinearityCorrection) {
1385 }
1386
1395
1396
1401
1402
1407 }
1408
1409
1410 else {
1412 +1)] =
1415 -1)] =
1421 }
1422
1423
1429
1434 }
1435
1446
1447
1449 +1)] =
1452 -1)] =
1454
1455
1456
1457
1458
1464 }
1465 else {
1466
1467
1472 }
1473 }
1474
1475
1485 +1)] =
1488 -1)] =
1490 }
1491
1492
1498 "EG_SCALE_S12EXTRALASTETABINRUN2", +1)] =
1501 "EG_SCALE_S12EXTRALASTETABINRUN2", -1)] =
1503 }
1504
1505
1506 if (m_decorrelation_model_scale ==
1507 ScaleDecorrelation::FULL_ETA_CORRELATED or
1508 !m_use_full_statistical_error) {
1509
1510
1511
1516 }
1517 }
1518 if (m_decorrelation_model_scale == ScaleDecorrelation::ONENP) {
1519
1524
1525
1526
1537 }
1543 }
1544 }
1545 else if (m_decorrelation_model_scale ==
1546 ScaleDecorrelation::FULL_ETA_CORRELATED) {
1547
1549#define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown) \
1550 m_syst_description[CP::SystematicVariation(#name, +1)] = \
1551 SysInfo{always, flagup}; \
1552 m_syst_description[CP::SystematicVariation(#name, -1)] = \
1553 SysInfo{always, flagdown};
1554#include "ElectronPhotonFourMomentumCorrection/systematics_es2024_Run3_v0.def"
1555#undef SYSMACRO
1556 }
1557 else {
1558
1559#define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown) \
1560 m_syst_description[CP::SystematicVariation(#name, +1)] = \
1561 SysInfo{always, flagup}; \
1562 m_syst_description[CP::SystematicVariation(#name, -1)] = \
1563 SysInfo{always, flagdown};
1564#include "ElectronPhotonFourMomentumCorrection/systematics_S12_2022.def"
1565#undef SYSMACRO
1566 }
1567
1579 }
1580
1581
1592 "EG_SCALE_LARCALIB_EXTRA2015PRE", +1)] =
1595 "EG_SCALE_LARCALIB_EXTRA2015PRE", -1)] =
1597 }
1598
1599
1606 "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE", +1)] =
1609 "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE", -1)] =
1611 }
1612
1613
1616 "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE", +1)] =
1619 "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE", -1)] =
1621 }
1622
1623
1643 }
1644
1645
1665 }
1666
1667
1686
1688 +1)] =
1691 -1)] =
1693 }
1694
1695 } else if (m_decorrelation_model_scale ==
1696 ScaleDecorrelation::ONENP_PLUS_UNCONR) {
1697
1698
1699
1700
1701#define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown) \
1702 m_syst_description[CP::SystematicVariation(#name, +1)] = \
1703 SysInfo{always, flagup}; \
1704 m_syst_description[CP::SystematicVariation(#name, -1)] = \
1705 SysInfo{always, flagdown};
1706#include "ElectronPhotonFourMomentumCorrection/systematics_1NPCOR_PLUS_UNCOR.def"
1707#undef SYSMACRO
1708
1709
1710
1711
1716 "EG_SCALE_S12EXTRALASTETABINRUN2", +1)] =
1719 "EG_SCALE_S12EXTRALASTETABINRUN2", -1)] =
1721 }
1722
1723 } else if (m_decorrelation_model_scale == ScaleDecorrelation::FULL) {
1724 using pairvector = std::vector<std::pair<double, double>>;
1725 const pairvector decorrelation_bins_BE = {{0., 1.45}, {1.52, 2.5}};
1726 const std::vector<double> decorrelation_edges_TWELVE = {
1727 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};
1728 std::vector<double> decorrelation_edges_MODULE = {
1729 0., 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.37, 1.52, 1.8};
1730 const std::vector<double> decorrelation_edges_MATERIAL = {0.0, 1.1, 1.5,
1731 2.1, 2.5};
1732 std::vector<double> decorrelation_edges_S12_EXTRARUN3 = {
1733 0., 0.8, 1.5, 2.5};
1734
1735 std::vector<double> decorrelation_edges_S12;
1736
1738 decorrelation_edges_S12.resize(5);
1739 decorrelation_edges_S12 = {0., 1.35, 1.5, 2.4, 2.5};
1743 decorrelation_edges_S12.resize(8);
1744 decorrelation_edges_S12 = {0., 0.6, 1.0, 1.35, 1.5, 1.8, 2.4, 2.5};
1745
1746
1747 decorrelation_edges_MODULE[7] = 1.4;
1748 decorrelation_edges_MODULE[8] = 1.5;
1749 }
1750
1751
1752 else {
1753 decorrelation_edges_S12.resize(6);
1754 decorrelation_edges_S12 = {0., 0.6, 1.4, 1.5, 2.4, 2.5};
1755 }
1756
1768#define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown) \
1769 if (bool(fullcorrelated)) { \
1770 m_syst_description[CP::SystematicVariation(#name, +1)] = \
1771 SysInfo{always, flagup}; \
1772 m_syst_description[CP::SystematicVariation(#name, -1)] = \
1773 SysInfo{always, flagdown}; \
1774 } else { \
1775 int i = 0; \
1776 for (const auto& p : AbsEtaCaloPredicatesFactory(decorrelation)) { \
1777 m_syst_description[CP::SystematicVariation( \
1778 #name "__ETABIN" + std::to_string(i), +1)] = SysInfo{p, flagup}; \
1779 m_syst_description[CP::SystematicVariation( \
1780 #name "__ETABIN" + std::to_string(i), -1)] = SysInfo{p, flagdown}; \
1781 i += 1; \
1782 } \
1783 }
1784#include "ElectronPhotonFourMomentumCorrection/systematics.def"
1785#undef SYSMACRO
1788#define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown) \
1789 if (bool(fullcorrelated)) { \
1790 m_syst_description[CP::SystematicVariation(#name, +1)] = \
1791 SysInfo{always, flagup}; \
1792 m_syst_description[CP::SystematicVariation(#name, -1)] = \
1793 SysInfo{always, flagdown}; \
1794 } else { \
1795 int i = 0; \
1796 for (const auto& p : AbsEtaCaloPredicatesFactory(decorrelation)) { \
1797 m_syst_description[CP::SystematicVariation( \
1798 #name "__ETABIN" + std::to_string(i), +1)] = SysInfo{p, flagup}; \
1799 m_syst_description[CP::SystematicVariation( \
1800 #name "__ETABIN" + std::to_string(i), -1)] = SysInfo{p, flagdown}; \
1801 i += 1; \
1802 } \
1803 }
1804#include "ElectronPhotonFourMomentumCorrection/systematics_S12_2022.def"
1805#undef SYSMACRO
1807#define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown) \
1808 if (bool(fullcorrelated)) { \
1809 m_syst_description[CP::SystematicVariation(#name, +1)] = \
1810 SysInfo{always, flagup}; \
1811 m_syst_description[CP::SystematicVariation(#name, -1)] = \
1812 SysInfo{always, flagdown}; \
1813 } else { \
1814 int i = 0; \
1815 for (const auto& p : AbsEtaCaloPredicatesFactory(decorrelation)) { \
1816 m_syst_description[CP::SystematicVariation( \
1817 #name "__ETABIN" + std::to_string(i), +1)] = SysInfo{p, flagup}; \
1818 m_syst_description[CP::SystematicVariation( \
1819 #name "__ETABIN" + std::to_string(i), -1)] = SysInfo{p, flagdown}; \
1820 i += 1; \
1821 } \
1822 }
1823#include "ElectronPhotonFourMomentumCorrection/systematics_es2024_Run3_v0.def"
1824#undef SYSMACRO
1825 } else {
1826#define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown) \
1827 if (bool(fullcorrelated)) { \
1828 m_syst_description[CP::SystematicVariation(#name, +1)] = \
1829 SysInfo{always, flagup}; \
1830 m_syst_description[CP::SystematicVariation(#name, -1)] = \
1831 SysInfo{always, flagdown}; \
1832 } else { \
1833 int i = 0; \
1834 for (const auto& p : AbsEtaCaloPredicatesFactory(decorrelation)) { \
1835 m_syst_description[CP::SystematicVariation( \
1836 #name "__ETABIN" + std::to_string(i), +1)] = SysInfo{p, flagup}; \
1837 m_syst_description[CP::SystematicVariation( \
1838 #name "__ETABIN" + std::to_string(i), -1)] = SysInfo{p, flagdown}; \
1839 i += 1; \
1840 } \
1841 }
1842#include "ElectronPhotonFourMomentumCorrection/systematics_S12.def"
1843#undef SYSMACRO
1844 }
1845
1846 if (m_use_full_statistical_error) {
1847
1849 const TAxis& axis_statistical_error(m_rootTool->get_ZeeStat_eta_axis());
1850 for (int ibin = 1; ibin <= axis_statistical_error.GetNbins(); ++ibin) {
1851 auto p = EtaCaloPredicateFactory(
1852 axis_statistical_error.GetBinLowEdge(ibin),
1853 axis_statistical_error.GetBinLowEdge(ibin + 1));
1855 "EG_SCALE_ZEESTAT__ETABIN" + std::to_string(i), +1)] =
1858 "EG_SCALE_ZEESTAT__ETABIN" + std::to_string(i), -1)] =
1861 }
1862 }
1863
1864
1875 "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN0", +1)] =
1876 SysInfo{AbsEtaCaloPredicateFactory({0, 1.45}),
1879 "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN0", -1)] =
1880 SysInfo{AbsEtaCaloPredicateFactory({0, 1.45}),
1883 "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN1", +1)] =
1884 SysInfo{AbsEtaCaloPredicateFactory({1.45, 2.47}),
1887 "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN1", -1)] =
1888 SysInfo{AbsEtaCaloPredicateFactory({1.45, 2.47}),
1891 "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN2", +1)] =
1892 SysInfo{AbsEtaCaloPredicateFactory({2.47, 3.2}),
1895 "EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN2", -1)] =
1896 SysInfo{AbsEtaCaloPredicateFactory({2.47, 3.2}),
1898 }
1899
1900
1907 "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN0", +1)] =
1908 SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[0]),
1911 "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN0", -1)] =
1912 SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[0]),
1915 "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN1", +1)] =
1916 SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[1]),
1919 "EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN1", -1)] =
1920 SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[1]),
1922 }
1923
1924
1927 "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN0", +1)] =
1928 SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[0]),
1931 "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN1", +1)] =
1932 SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[1]),
1935 "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN0", -1)] =
1936 SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[0]),
1939 "EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN1", -1)] =
1940 SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[1]),
1942 }
1943
1944
1961 +1)] = SysInfo{
1964 +1)] = SysInfo{
1967 -1)] = SysInfo{
1970 -1)] =
1971 SysInfo{AbsEtaCaloPredicateFactory(1.5, 2.5),
1973 }
1974
1975
1992 }
1993
1994
1999 +1)] =
2000 SysInfo{DoubleOrAbsEtaCaloPredicate(0, 1.52, 1.82, 2.47),
2003 -1)] =
2004 SysInfo{DoubleOrAbsEtaCaloPredicate(0, 1.52, 1.82, 2.47),
2007 +1)] =
2008 SysInfo{AbsEtaCaloPredicateFactory({1.52, 1.82}),
2011 -1)] =
2012 SysInfo{AbsEtaCaloPredicateFactory({1.52, 1.82}),
2014 }
2015
2016
2036 "EG_SCALE_E4SCINTILLATOR__ETABIN0", +1)] =
2037 SysInfo{AbsEtaCaloPredicateFactory(1.4, 1.46),
2040 "EG_SCALE_E4SCINTILLATOR__ETABIN1", +1)] =
2041 SysInfo{AbsEtaCaloPredicateFactory(1.46, 1.52),
2044 "EG_SCALE_E4SCINTILLATOR__ETABIN2", +1)] =
2045 SysInfo{AbsEtaCaloPredicateFactory(1.52, 1.6),
2048 "EG_SCALE_E4SCINTILLATOR__ETABIN0", -1)] =
2049 SysInfo{AbsEtaCaloPredicateFactory(1.4, 1.46),
2052 "EG_SCALE_E4SCINTILLATOR__ETABIN1", -1)] =
2053 SysInfo{AbsEtaCaloPredicateFactory(1.46, 1.52),
2056 "EG_SCALE_E4SCINTILLATOR__ETABIN2", -1)] =
2057 SysInfo{AbsEtaCaloPredicateFactory(1.52, 1.6),
2061 "EG_SCALE_E4SCINTILLATOR__ETABIN3", +1)] =
2062 SysInfo{AbsEtaCaloPredicateFactory(1.6, 1.72),
2065 "EG_SCALE_E4SCINTILLATOR__ETABIN3", -1)] =
2066 SysInfo{AbsEtaCaloPredicateFactory(1.6, 1.72),
2068 }
2069 }
2070 } else {
2072 }
2073
2074
2075 if (m_decorrelation_model_resolution == ResolutionDecorrelation::ONENP) {
2076
2077
2078
2083 } else if (m_decorrelation_model_resolution ==
2084 ResolutionDecorrelation::FULL) {
2088 "EG_RESOLUTION_ZSMEARING", -1)] =
2091 "EG_RESOLUTION_SAMPLINGTERM", +1)] =
2094 "EG_RESOLUTION_SAMPLINGTERM", -1)] =
2097 "EG_RESOLUTION_MATERIALID", +1)] =
2100 "EG_RESOLUTION_MATERIALID", -1)] =
2103 "EG_RESOLUTION_MATERIALCALO", +1)] =
2106 "EG_RESOLUTION_MATERIALCALO", -1)] =
2109 "EG_RESOLUTION_MATERIALGAP", +1)] =
2112 "EG_RESOLUTION_MATERIALGAP", -1)] =
2115 "EG_RESOLUTION_MATERIALCRYO", +1)] =
2118 "EG_RESOLUTION_MATERIALCRYO", -1)] =
2140 "EG_RESOLUTION_MATERIALIBL", +1)] =
2143 "EG_RESOLUTION_MATERIALIBL", -1)] =
2146 "EG_RESOLUTION_MATERIALPP0", +1)] =
2149 "EG_RESOLUTION_MATERIALPP0", -1)] =
2151
2153
2158 }
2159 }
2160 } else {
2162 }
2163
2164
2173 }
2179 }
2180
2181
2182 if (m_use_ep_combination) {
2187 }
2188}
2189
2191 const {
2192 return affectingSystematics();
2193}
2194
2195StatusCode EgammaCalibrationAndSmearingTool::applySystematicVariation(
2197
2198
2200 m_currentScaleVariation_data = m_doScaleCorrection
2203 m_currentResolutionVariation_MC = m_doSmearing
2207 m_currentScalePredicate = [](
const EgammaCalibrationAndSmearingTool&,
columnar::EgammaId) {
return true; };
2208
2209 if (systConfig.
empty())
2210 return StatusCode::SUCCESS;
2211
2212
2213
2214
2215 bool first_scale = true;
2216 bool first_resolution = true;
2217 for (const auto& it : systConfig) {
2218 const auto found_scale = m_syst_description.find(it);
2219 if (found_scale != m_syst_description.end()) {
2220 if (not first_scale) {
2222 throw std::runtime_error("multiple scale variations not supported");
2223 }
2224 first_scale = false;
2225 m_currentScaleVariation_MC = found_scale->second.effect;
2226 m_currentScalePredicate = found_scale->second.predicate;
2227 }
2228
2229 const auto found_resolution = m_syst_description_resolution.find(it);
2230 if (found_resolution != m_syst_description_resolution.end()) {
2231 if (not first_resolution) {
2232 ATH_MSG_ERROR(
"multiple resolution variations not supported");
2233 throw std::runtime_error(
2234 "multiple resolution variations not supported");
2235 }
2236 first_resolution = false;
2237 m_currentResolutionVariation_MC = found_resolution->second;
2238 }
2239 }
2240
2241 return StatusCode::SUCCESS;
2242}
2243
2244double EgammaCalibrationAndSmearingTool::intermodule_correction(
2245 double Ecl,
double phi,
double eta)
const {
2246
2247
2248
2249
2250
2251 double Ecl_corr = 0.;
2252 int DivInt = 0;
2254
2268
2269 double phi_mod = 0;
2271 phi_mod = fmod(
phi, 2 *
pi / 16.) +
pi / 8.;
2272 else
2273 phi_mod = fmod(
phi, 2 *
pi / 16.);
2274
2275
2276 if (std::abs(
eta) <= 1.37) {
2277
2279 Ecl_corr =
2280 Ecl /
2281 (1 - 0.1086 *
2282 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 175.2759))) *
2283 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-189.3612))))));
2284 if (
phi < (-6 *
pi / 8) &&
phi > (-7 *
pi / 8))
2285 Ecl_corr =
2286 Ecl /
2287 (1 - 0.0596 *
2288 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 170.8305))) *
2289 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-233.3782))))));
2290 if (
phi < (-5 *
pi / 8) &&
phi > (-6 *
pi / 8))
2291 Ecl_corr =
2292 Ecl /
2293 (1 - 0.0596 *
2294 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 147.1451))) *
2295 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-139.3386))))));
2296 if (
phi < (-4 *
pi / 8) &&
phi > (-5 *
pi / 8))
2297 Ecl_corr =
2298 Ecl /
2299 (1 - 0.0583 *
2300 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 168.4644))) *
2301 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-246.2897))))));
2302 if (
phi < (-3 *
pi / 8) &&
phi > (-4 *
pi / 8))
2303 Ecl_corr =
2304 Ecl /
2305 (1 - 0.0530 *
2306 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 177.6703))) *
2307 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-198.3227))))));
2308 if (
phi < (-2 *
pi / 8) &&
phi > (-3 *
pi / 8))
2309 Ecl_corr =
2310 Ecl /
2311 (1 - 0.0672 *
2312 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 145.0693))) *
2313 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-242.1771))))));
2314 if (
phi < (-1 *
pi / 8) &&
phi > (-2 *
pi / 8))
2315 Ecl_corr =
2316 Ecl /
2317 (1 - 0.0871 *
2318 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 132.3303))) *
2319 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-166.1833))))));
2320 if (
phi < (0 *
pi / 8) &&
phi > (-1 *
pi / 8))
2321 Ecl_corr =
2322 Ecl /
2323 (1 - 0.0948 *
2324 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 127.6780))) *
2325 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-150.0700))))));
2326 if (
phi < (1 *
pi / 8) &&
phi > (0 *
pi / 8))
2327 Ecl_corr =
2328 Ecl /
2329 (1 - 0.1166 *
2330 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 172.0679))) *
2331 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-235.3293))))));
2332 if (
phi < (2 *
pi / 8) &&
phi > (1 *
pi / 8))
2333 Ecl_corr =
2334 Ecl /
2335 (1 - 0.1172 *
2336 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 190.3524))) *
2337 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-198.9400))))));
2338 if (
phi < (3 *
pi / 8) &&
phi > (2 *
pi / 8))
2339 Ecl_corr =
2340 Ecl /
2341 (1 - 0.1292 *
2342 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 158.0540))) *
2343 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-165.3893))))));
2344 if (
phi < (4 *
pi / 8) &&
phi > (3 *
pi / 8))
2345 Ecl_corr =
2346 Ecl /
2347 (1 - 0.1557 *
2348 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 162.2793))) *
2349 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-133.5131))))));
2350 if (
phi < (5 *
pi / 8) &&
phi > (4 *
pi / 8))
2351 Ecl_corr =
2352 Ecl /
2353 (1 - 0.1659 *
2354 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 180.5270))) *
2355 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-168.5074))))));
2356 if (
phi < (6 *
pi / 8) &&
phi > (5 *
pi / 8))
2357 Ecl_corr =
2358 Ecl /
2359 (1 - 0.1123 *
2360 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 128.2277))) *
2361 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-154.4455))))));
2362 if (
phi < (7 *
pi / 8) &&
phi > (6 *
pi / 8))
2363 Ecl_corr =
2364 Ecl /
2365 (1 - 0.1394 *
2366 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 192.1216))) *
2367 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-198.0727))))));
2368 if (
phi < (8 *
pi / 8) &&
phi > (7 *
pi / 8))
2369 Ecl_corr =
2370 Ecl /
2371 (1 - 0.1001 *
2372 ((1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * 199.1735))) *
2373 (1 / (1 +
exp((phi_mod - 2 *
pi / 32.) * (-176.4056))))));
2374 }
2375
2376
2377 else {
2378 Ecl_corr = Ecl;
2379 }
2380
2381 }
2382
2383 else {
2384
2385
2386
2387
2388 DivInt = (int)(
phi / ((2 *
pi) / 16.));
2389 double phi_mod =
phi - DivInt * (2 *
pi / 16.);
2390
2391
2392 if (phi_mod < 0)
2394
2395
2396 if (std::abs(
eta) <= 1.4) {
2397
2398
2400 Ecl_corr =
2401 Ecl / (1 - 0.131 * ((1 / (1 +
exp((phi_mod - 0.2) * 199.08))) *
2402 (1 / (1 +
exp((phi_mod - 0.2) * (-130.36))))));
2403 }
2404
2405
2407 Ecl_corr =
2408 Ecl / (1 - 0.0879 * ((1 / (1 +
exp((phi_mod - 0.2) * 221.01))) *
2409 (1 / (1 +
exp((phi_mod - 0.2) * (-149.51))))));
2410 }
2411
2413 Ecl_corr =
2414 Ecl / (1 - 0.0605 * ((1 / (1 +
exp((phi_mod - 0.2) * 281.37))) *
2415 (1 / (1 +
exp((phi_mod - 0.2) * (-170.29))))));
2416 }
2417
2418 if ((
phi < (-3 *
pi) / 4.) || (
phi >= (3 *
pi) / 4.)) {
2419 Ecl_corr =
2420 Ecl / (1 - 0.102 * ((1 / (1 +
exp((phi_mod - 0.2) * 235.37))) *
2421 (1 / (1 +
exp((phi_mod - 0.2) * (-219.04))))));
2422 }
2423 }
2424
2425
2426 else {
2427 Ecl_corr = Ecl;
2428 }
2429 }
2430
2431 return Ecl_corr;
2432}
2433
2434double EgammaCalibrationAndSmearingTool::correction_phi_unif(
double eta,
2436 constexpr double PI =
M_PI;
2437 double Fcorr = 1.0;
2438
2439 if (m_use_mapping_correction) {
2440
2442 if (
phi < (14 *
PI / 32.) &&
phi > (13 *
PI / 32.)) {
2443 Fcorr += 0.035;
2444 }
else if (
phi < (13 *
PI / 32.) &&
phi > (12 *
PI / 32.)) {
2445 Fcorr -= 0.035;
2446 }
2447 }
2448 }
2449
2463
2465 if (
phi < (-7 * 2 *
PI / 32.) &&
phi > (-8 * 2 *
PI / 32.)) {
2466 Fcorr = 1.016314;
2467 }
2468 }
2469
2472 Fcorr = 1.041591;
2473 }
else if (
phi < (-4 * 2 *
PI / 32.) &&
phi > (-5 * 2 *
PI / 32.)) {
2474 Fcorr = 1.067346;
2475 }
2476 }
2477
2479 if (
phi < (7 * 2 *
PI / 32.) &&
phi > (6 * 2 *
PI / 32.)) {
2480 Fcorr = 1.027980;
2481 }
2482 }
2483
2485 if (
phi < (-9 * 2 *
PI / 32.) &&
phi > (-10 * 2 *
PI / 32.)) {
2486 Fcorr = 1.020299;
2487 }
else if (
phi < (-11 * 2 *
PI / 32.) &&
phi > (-12 * 2 *
PI / 32.)) {
2488 Fcorr = 1.051426;
2489 }
2490 }
2491
2493 if (
phi < (-12 * 2 *
PI / 32.) &&
phi > (-13 * 2 *
PI / 32.)) {
2494 Fcorr = 1.071695;
2495 }
2496 }
2497
2499 if (
phi < (-12 * 2 *
PI / 32.) &&
phi > (-13 * 2 *
PI / 32.)) {
2500 Fcorr = 1.008227;
2501 }
else if (
phi < (-8 * 2 *
PI / 32.) &&
phi > (-9 * 2 *
PI / 32.)) {
2502 Fcorr = 1.013929;
2503 }
2504 }
2505
2507 if (
phi < (-9 * 2 *
PI / 32.) &&
phi > (-10 * 2 *
PI / 32.)) {
2508 Fcorr = 1.015749;
2509 }
2510 }
2511
2513 if (
phi < (-6 * 2 *
PI / 32.) &&
phi > (-7 * 2 *
PI / 32.)) {
2514 Fcorr = 1.064954;
2515 }
2516 }
2517
2519 if (
phi < (9 * 2 *
PI / 32.) &&
phi > (8 * 2 *
PI / 32.)) {
2520 Fcorr = 1.027448;
2521 }
2522 }
2523
2525 if (
phi < (-8 * 2 *
PI / 32.) &&
phi > (-9 * 2 *
PI / 32.)) {
2526 Fcorr = 1.025882;
2527 }
else if (
phi < (5 * 2 *
PI / 32.) &&
phi > (4 * 2 *
PI / 32.)) {
2528 Fcorr = 1.036616;
2529 }
else if (
phi < (9 * 2 *
PI / 32.) &&
phi > (8 * 2 *
PI / 32.)) {
2530 Fcorr = 1.053838;
2531 }
else if (
phi < (10 * 2 *
PI / 32.) &&
phi > (9 * 2 *
PI / 32.)) {
2532 Fcorr = 1.026856;
2533 }
else if (
phi < (11 * 2 *
PI / 32.) &&
phi > (10 * 2 *
PI / 32.)) {
2534 Fcorr = 0.994382;
2535 }
2536 }
2537
2538 }
2539
2540 else {
2543 Fcorr = 1.028;
2544 }
else if (
phi < (-4 * 2 *
PI / 32.) &&
phi > (-5 * 2 *
PI / 32.)) {
2545 Fcorr = 1.044;
2546 }
2547 }
2548
2550 if (
phi < (7 * 2 *
PI / 32.) &&
phi > (6 * 2 *
PI / 32.)) {
2551 Fcorr = 1.022;
2552 }
2553 }
2554
2556 if (
phi < (-11 * 2 *
PI / 32.) &&
phi > (-12 * 2 *
PI / 32.)) {
2557 Fcorr = 1.038;
2558 }
2559 }
2560
2562 if (
phi < (10 * 2 *
PI / 32.) &&
phi > (9 * 2 *
PI / 32.)) {
2563 Fcorr = 1.029;
2564 }
2565 }
2566
2568 if (
phi < (-4 * 2 *
PI / 32.) &&
phi > (-5 * 2 *
PI / 32.)) {
2569 Fcorr = 1.048;
2570 }
else if (
phi < (-6 * 2 *
PI / 32.) &&
phi > (-7 * 2 *
PI / 32.)) {
2571 Fcorr = 1.048;
2572 }
2573 }
2574
2576 if (
phi < (9 * 2 *
PI / 32.) &&
phi > (8 * 2 *
PI / 32.)) {
2577 Fcorr = 1.024;
2578 }
2579 }
2580
2582 if (
phi < (-8 * 2 *
PI / 32.) &&
phi > (-9 * 2 *
PI / 32.)) {
2583 Fcorr = 1.037;
2584 }
else if (
phi < (5 * 2 *
PI / 32.) &&
phi > (4 * 2 *
PI / 32.)) {
2585 Fcorr = 1.031;
2586 }
else if (
phi < (9 * 2 *
PI / 32.) &&
phi > (8 * 2 *
PI / 32.)) {
2587 Fcorr = 1.040;
2588 }
else if (
phi < (10 * 2 *
PI / 32.) &&
phi > (9 * 2 *
PI / 32.)) {
2589 Fcorr = 1.030;
2590 }
else if (
phi < (11 * 2 *
PI / 32.) &&
phi > (10 * 2 *
PI / 32.)) {
2591 Fcorr = 1.020;
2592 }
2593 }
2594 }
2595
2596 return Fcorr;
2597}
2598
2599void EgammaCalibrationAndSmearingTool ::
2601{
2602 for (auto egamma : egammas) {
2604 throw std::runtime_error ("EgammaCalibrationAndSmearingTool::callEvents: apply failed");
2605 }
2606}
2607
2608void EgammaCalibrationAndSmearingTool ::
2610{
2611 const Accessors&
acc = *m_accessors;
2612 for (auto event : events) {
2613 auto eventInfo =
acc.m_eventHandle(event);
2614 callSingleEvent (
acc.m_egammaHandle(event), eventInfo);
2615 }
2616}
2617
2618}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
static const Attributes_t empty
Return value from object correction CP tools.
@ Error
Some error happened during the object correction.
@ Ok
The correction was done successfully.
This module implements the central registry for handling systematic uncertainties with CP tools.
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Class to wrap a set of SystematicVariations.
bool empty() const
returns: whether the set is empty
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
an object that can create a AsgService
virtual double e() const override
The total energy of the particle.
bool eventType(EventType type) const
Check for one particular bitmask value.
@ IS_SIMULATION
true: simulation, false: data
virtual double e() const override final
The total energy of the particle.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
void Scale(TH1 *h, double d=1)
::StatusCode StatusCode
StatusCode definition for legacy code.
constexpr double electronMassInMeV
the mass of the electron (in MeV)
constexpr double photonMassInMeV
various mass-less particles
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
ObjectRange< MutableEgammaDef > MutableEgammaRange
ObjectId< MutableEgammaDef > MutableEgammaId
void resetElectron(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool)
ObjectRange< EventContextDef > EventContextRange
void resetPhoton(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool)
ObjectId< ClusterDef > ClusterId
ObjectId< EgammaDef > EgammaId
ObjectId< EventInfoDef > EventInfoId
void resetAccessor(AccessorTemplate< CI, CT, CAM, CM > &accessor, ColumnarTool< CM > &columnBase, const std::string &name, ColumnAccessorOptions &&options={})
reset a column accessor to point to a new column
@ LArCalibExtra2015PreDown
@ S12ExtraLastEtaBinRun2Down
@ LArTemperature2016PreDown
@ LArTemperature2015PreUp
@ S12ExtraLastEtaBinRun2Up
@ LArTemperature2015PreDown
@ LArTemperature2016PreUp
@ es2015cPRE_res_improved
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
const uint16_t AuthorFwdElectron
Electron reconstructed by the Forward cluster-based algorithm.
EventInfo_v1 EventInfo
Definition of the latest event info version.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Egamma_v1 Egamma
Definition of the current "egamma version".
float get_eta_calo(const xAOD::CaloCluster &cluster, int author, bool do_throw=false)
Photon_v1 Photon
Definition of the current "egamma version".
setBGCode setTAP setLVL2ErrorBits bool
Electron_v1 Electron
Definition of the current "egamma version".
A structure holding some global event information.
Extra patterns decribing particle interation process.