20 #include "TGraphErrors.h"
35 #include <type_traits>
40 double qsum(
double x,
double y) {
41 return std::hypot(
x,
y);
44 template <
typename TargetPtr,
typename SourcePtr>
45 TargetPtr checked_own_cast(SourcePtr
ptr) {
48 "attempt to cast to no ptr object");
50 "attempt to cast from no ptr object");
54 throw std::runtime_error(
55 "Attempt to cast from nullptr in egammaEnergyCorrectionTool");
59 TargetPtr
obj =
dynamic_cast<TargetPtr
>(
ptr);
61 throw std::runtime_error(
"failed dynamic cast for " +
62 std::string(
ptr->GetName()) +
63 " in egammaEnergyCorrectionTool");
68 if constexpr (std::is_same_v<TAxis, std::remove_pointer_t<TargetPtr>>) {
71 else if constexpr (std::is_same_v<TList, std::remove_pointer_t<TargetPtr>>) {
75 obj->SetDirectory(
nullptr);
81 double getValueHistoAt(
const TH1&
histo,
double xvalue,
82 bool use_lastbin_overflow =
false,
83 bool use_firstbin_underflow =
false) {
85 if (use_lastbin_overflow and
histo.IsBinOverflow(
bin)) {
88 if (use_firstbin_underflow and
histo.IsBinUnderflow(
bin)) {
94 double getValueHistAt(
const TH2&
histo,
double xvalue,
double yvalue,
95 bool use_lastbin_x_overflow =
false,
96 bool use_lastbin_y_overflow =
false,
97 bool use_fistbin_x_underflow =
false,
98 bool use_firstbin_y_underflow =
false) {
99 int xbin =
histo.GetXaxis()->FindFixBin(xvalue);
100 if (use_lastbin_x_overflow and xbin ==
histo.GetXaxis()->GetNbins() + 1) {
101 xbin =
histo.GetXaxis()->GetNbins();
103 if (use_fistbin_x_underflow and xbin == 0) {
106 int ybin =
histo.GetYaxis()->FindFixBin(yvalue);
107 if (use_lastbin_y_overflow and ybin ==
histo.GetYaxis()->GetNbins() + 1) {
108 ybin =
histo.GetYaxis()->GetNbins();
110 if (use_firstbin_y_underflow and ybin == 0) {
113 return histo.GetBinContent(xbin, ybin);
122 :
asg::AsgMessaging(
"egammaEnergyCorrectionTool"),
125 "egammaEnergyCorrectionData.root")),
130 throw std::runtime_error(
"cannot find file");
183 const std::unique_ptr<char[]>
fname(
185 std::unique_ptr<TFile>
rootFile(TFile::Open(
fname.get(),
"READ"));
204 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2010/alphaPS_errTot")));
206 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2010/alphaS12_errTot")));
207 m_zeeNom.reset(checked_own_cast<TH1*>(
208 rootFile->Get(
"Scales/es2010/alphaZee_errStat")));
210 rootFile->Get(
"Scales/es2010/alphaZee_errSyst")));
211 m_resNom.reset(checked_own_cast<TH1*>(
212 rootFile->Get(
"Resolution/es2010/ctZee_errStat")));
214 rootFile->Get(
"Resolution/es2010/ctZee_errSyst")));
216 checked_own_cast<TH1*>(
rootFile->Get(
"Resolution/es2010/resZee_Data")));
218 checked_own_cast<TH1*>(
rootFile->Get(
"Resolution/es2010/resZee_MC")));
227 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2011c/alphaPS_errTot")));
229 rootFile->Get(
"Scales/es2011c/alphaS12_errTot")));
230 m_zeeNom.reset(checked_own_cast<TH1*>(
231 rootFile->Get(
"Scales/es2011c/alphaZee_errStat")));
233 rootFile->Get(
"Scales/es2011c/alphaZee_errSyst")));
234 m_resNom.reset(checked_own_cast<TH1*>(
235 rootFile->Get(
"Resolution/es2011c/ctZee_errStat")));
237 rootFile->Get(
"Resolution/es2011c/ctZee_errSyst")));
239 rootFile->Get(
"Resolution/es2011c/resZee_Data")));
241 checked_own_cast<TH1*>(
rootFile->Get(
"Resolution/es2011c/resZee_MC")));
254 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2011d/alphaPS_uncor")));
256 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2011d/dalphaPS_cor")));
258 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2011d/alphaS12_uncor")));
260 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2011d/dalphaS12_cor")));
262 rootFile->Get(
"Scales/es2011d/momentum_errSyst")));
266 m_zeeNom.reset(checked_own_cast<TH1*>(
267 rootFile->Get(
"Scales/es2011d/alphaZee_errStat")));
269 rootFile->Get(
"Scales/es2011d/alphaZee_errSyst")));
270 m_resNom.reset(checked_own_cast<TH1*>(
271 rootFile->Get(
"Resolution/es2011d/ctZee_errStat")));
273 rootFile->Get(
"Resolution/es2011d/ctZee_errSyst")));
277 m_zeeNom.reset(checked_own_cast<TH1*>(
278 rootFile->Get(
"Scales/es2011dMedium/alphaZee_errStat")));
280 rootFile->Get(
"Scales/es2011dMedium/alphaZee_errSyst")));
282 rootFile->Get(
"Scales/es2011dMedium/alphaZee_errPhys")));
283 m_resNom.reset(checked_own_cast<TH1*>(
284 rootFile->Get(
"Resolution/es2011dMedium/ctZee_errStat")));
286 rootFile->Get(
"Resolution/es2011dMedium/ctZee_errSyst")));
290 m_zeeNom.reset(checked_own_cast<TH1*>(
291 rootFile->Get(
"Scales/es2011dTight/alphaZee_errStat")));
293 rootFile->Get(
"Scales/es2011dTight/alphaZee_errSyst")));
295 rootFile->Get(
"Scales/es2011dTight/alphaZee_errPhys")));
296 m_resNom.reset(checked_own_cast<TH1*>(
297 rootFile->Get(
"Resolution/es2011dTight/ctZee_errStat")));
299 rootFile->Get(
"Resolution/es2011dTight/ctZee_errSyst")));
303 rootFile->Get(
"Pedestals/es2011d/pedestals_l0")));
305 rootFile->Get(
"Pedestals/es2011d/pedestals_l1")));
307 rootFile->Get(
"Pedestals/es2011d/pedestals_l2")));
309 rootFile->Get(
"Pedestals/es2011d/pedestals_l3")));
312 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigA")));
315 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errUncor")));
317 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errLAr")));
320 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errUncor")));
322 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errLAr")));
324 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errG4")));
326 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errGL1")));
329 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errUncor")));
331 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errLAr")));
333 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errG4")));
336 rootFile->Get(
"Conversions/es2011d/convRadiusMigrations")));
338 rootFile->Get(
"Conversions/es2011d/convFakeRate")));
340 rootFile->Get(
"Conversions/es2011d/convRecoEfficiency")));
346 "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
348 "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
350 std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
354 "e1hg_systematics_histos.root"));
361 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012a/alphaPS_errTot")));
363 rootFile->Get(
"Scales/es2012a/alphaS12_errTot")));
365 m_zeeNom.reset(checked_own_cast<TH1*>(
366 rootFile->Get(
"Scales/es2012a/alphaZee_errStat")));
368 rootFile->Get(
"Scales/es2012a/alphaZee_errSyst")));
370 m_resNom.reset(checked_own_cast<TH1*>(
371 rootFile->Get(
"Resolution/es2012a/ctZee_errStat")));
373 rootFile->Get(
"Resolution/es2012a/ctZee_errSyst")));
375 rootFile->Get(
"Resolution/es2012a/resZee_Data")));
377 checked_own_cast<TH1*>(
rootFile->Get(
"Resolution/es2012a/resZee_MC")));
389 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/alphaPS_uncor")));
391 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaPS_cor")));
393 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/alphaS12_uncor")));
395 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaS12_cor")));
398 rootFile->Get(
"Scales/es2012c/momentum_errSyst")));
400 m_zeeNom.reset(checked_own_cast<TH1*>(
401 rootFile->Get(
"Scales/es2012c/alphaZee_errStat")));
403 rootFile->Get(
"Scales/es2012c/alphaZee_errSyst")));
405 m_resNom.reset(checked_own_cast<TH1*>(
406 rootFile->Get(
"Resolution/es2012c/ctZee_errStat")));
408 rootFile->Get(
"Resolution/es2012c/ctZee_errSyst")));
411 rootFile->Get(
"Pedestals/es2012c/pedestals_l0")));
413 rootFile->Get(
"Pedestals/es2012c/pedestals_l1")));
415 rootFile->Get(
"Pedestals/es2012c/pedestals_l2")));
417 rootFile->Get(
"Pedestals/es2012c/pedestals_l3")));
420 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigA")));
423 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errUncor")));
425 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errLAr")));
428 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errUncor")));
430 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errLAr")));
432 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errG4")));
434 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errGL1")));
437 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errUncor")));
439 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errLAr")));
441 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errG4")));
444 rootFile->Get(
"Conversions/es2012c/convRadiusMigrations")));
446 rootFile->Get(
"Conversions/es2012c/convFakeRate")));
448 rootFile->Get(
"Conversions/es2012c/convRecoEfficiency")));
454 "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
456 "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
458 std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
462 "e1hg_systematics_histos.root"));
469 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/alphaPS_uncor")));
471 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaPS_cor")));
473 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/alphaS12_uncor")));
475 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaS12_cor")));
478 rootFile->Get(
"Scales/es2012c/momentum_errSyst")));
480 m_zeeNom.reset(checked_own_cast<TH1*>(
481 rootFile->Get(
"Scales/es2015PRE/alphaZee_errStat")));
483 rootFile->Get(
"Scales/es2012c/alphaZee_errSyst")));
485 m_resNom.reset(checked_own_cast<TH1*>(
486 rootFile->Get(
"Resolution/es2015PRE/ctZee_errStat")));
488 rootFile->Get(
"Resolution/es2012c/ctZee_errSyst")));
491 rootFile->Get(
"Pedestals/es2012c/pedestals_l0")));
493 rootFile->Get(
"Pedestals/es2012c/pedestals_l1")));
495 rootFile->Get(
"Pedestals/es2012c/pedestals_l2")));
497 rootFile->Get(
"Pedestals/es2012c/pedestals_l3")));
500 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigA")));
503 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errUncor")));
505 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errLAr")));
508 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errUncor")));
510 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errLAr")));
512 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errG4")));
514 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errGL1")));
517 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errUncor")));
519 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errLAr")));
521 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errG4")));
524 rootFile->Get(
"Conversions/es2012c/convRadiusMigrations")));
526 rootFile->Get(
"Conversions/es2012c/convFakeRate")));
528 rootFile->Get(
"Conversions/es2012c/convRecoEfficiency")));
534 "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
536 "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
538 std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
542 "e1hg_systematics_histos.root"));
550 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/alphaPS_uncor")));
552 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaPS_cor")));
554 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/alphaS12_uncor")));
556 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaS12_cor")));
559 rootFile->Get(
"Scales/es2012c/momentum_errSyst")));
561 m_zeeNom.reset(checked_own_cast<TH1*>(
562 rootFile->Get(
"Scales/es2015PRE/alphaZee_errStat")));
564 rootFile->Get(
"Scales/es2015PRE/alphaZee_errSyst")));
566 rootFile->Get(
"Scales/es2015PRE/histo_uA2MeV_week12")));
568 m_resNom.reset(checked_own_cast<TH1*>(
569 rootFile->Get(
"Resolution/es2015PRE/ctZee_errStat")));
571 rootFile->Get(
"Resolution/es2015PRE/ctZee_errSyst")));
574 rootFile->Get(
"Pedestals/es2012c/pedestals_l0")));
576 rootFile->Get(
"Pedestals/es2012c/pedestals_l1")));
578 rootFile->Get(
"Pedestals/es2012c/pedestals_l2")));
580 rootFile->Get(
"Pedestals/es2012c/pedestals_l3")));
583 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigA")));
586 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errUncor")));
588 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errLAr")));
591 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errUncor")));
593 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errLAr")));
595 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errG4")));
597 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errGL1")));
600 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errUncor")));
602 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errLAr")));
604 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errG4")));
607 rootFile->Get(
"Conversions/es2012c/convRadiusMigrations")));
609 rootFile->Get(
"Conversions/es2012c/convFakeRate")));
611 rootFile->Get(
"Conversions/es2012c/convRecoEfficiency")));
617 rootFile->Get(
"FastSim/es2015/el_full_fast_resolution")));
619 rootFile->Get(
"FastSim/es2015/ph_unconv_full_fast_resolution")));
621 rootFile->Get(
"FastSim/es2015/ph_conv_full_fast_resolution")));
628 "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
630 "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
632 std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
636 "e1hg_systematics_histos.root"));
644 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/alphaPS_uncor")));
646 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaPS_cor")));
648 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/alphaS12_uncor")));
650 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaS12_cor")));
653 rootFile->Get(
"Scales/es2012c/momentum_errSyst")));
655 m_zeeNom.reset(checked_own_cast<TH1*>(
656 rootFile->Get(
"Scales/es2015PRE/alphaZee_errStat")));
658 rootFile->Get(
"Scales/es2015PRE/alphaZee_errSyst")));
660 rootFile->Get(
"Scales/es2015PRE/histo_uA2MeV_week12")));
662 m_resNom.reset(checked_own_cast<TH1*>(
663 rootFile->Get(
"Resolution/es2015PRE/ctZee_errStat")));
665 rootFile->Get(
"Resolution/es2015PRE_res_improved/ctZee_errSyst")));
668 rootFile->Get(
"Pedestals/es2012c/pedestals_l0")));
670 rootFile->Get(
"Pedestals/es2012c/pedestals_l1")));
672 rootFile->Get(
"Pedestals/es2012c/pedestals_l2")));
674 rootFile->Get(
"Pedestals/es2012c/pedestals_l3")));
677 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigA")));
680 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errUncor")));
682 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errLAr")));
685 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errUncor")));
687 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errLAr")));
689 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errG4")));
691 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errGL1")));
694 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errUncor")));
696 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errLAr")));
698 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errG4")));
701 rootFile->Get(
"Conversions/es2012c/convRadiusMigrations")));
703 rootFile->Get(
"Conversions/es2012c/convFakeRate")));
705 rootFile->Get(
"Conversions/es2012c/convRecoEfficiency")));
711 rootFile->Get(
"FastSim/es2015/el_full_fast_resolution")));
713 rootFile->Get(
"FastSim/es2015/ph_unconv_full_fast_resolution")));
715 rootFile->Get(
"FastSim/es2015/ph_conv_full_fast_resolution")));
721 "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
723 "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
725 std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
729 "e1hg_systematics_histos.root"));
736 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/alphaPS_uncor")));
738 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaPS_cor")));
740 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/alphaS12_uncor")));
742 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaS12_cor")));
745 rootFile->Get(
"Scales/es2012c/momentum_errSyst")));
747 m_zeeNom.reset(checked_own_cast<TH1*>(
748 rootFile->Get(
"Scales/es2015Summer/alphaZee_errStat")));
750 rootFile->Get(
"Scales/es2015Summer/alphaZee_errSyst")));
753 m_resNom.reset(checked_own_cast<TH1*>(
754 rootFile->Get(
"Resolution/es2015Summer/ctZee_errStat")));
756 rootFile->Get(
"Resolution/es2015Summer/ctZee_errSyst")));
759 rootFile->Get(
"Pedestals/es2012c/pedestals_l0")));
761 rootFile->Get(
"Pedestals/es2012c/pedestals_l1")));
763 rootFile->Get(
"Pedestals/es2012c/pedestals_l2")));
765 rootFile->Get(
"Pedestals/es2012c/pedestals_l3")));
768 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigA")));
771 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errUncor")));
773 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errLAr")));
776 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errUncor")));
778 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errLAr")));
780 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errG4")));
782 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errGL1")));
785 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errUncor")));
787 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errLAr")));
789 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errG4")));
792 rootFile->Get(
"Conversions/es2012c/convRadiusMigrations")));
794 rootFile->Get(
"Conversions/es2012c/convFakeRate")));
796 rootFile->Get(
"Conversions/es2012c/convRecoEfficiency")));
802 rootFile->Get(
"FastSim/es2015/el_full_fast_resolution")));
804 rootFile->Get(
"FastSim/es2015/ph_unconv_full_fast_resolution")));
806 rootFile->Get(
"FastSim/es2015/ph_conv_full_fast_resolution")));
813 "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
815 "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
817 std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
821 "e1hg_systematics_histos.root"));
830 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/alphaPS_uncor")));
832 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaPS_cor")));
834 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/alphaS12_uncor")));
836 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaS12_cor")));
839 rootFile->Get(
"Scales/es2012c/momentum_errSyst")));
841 m_zeeNom.reset(checked_own_cast<TH1*>(
842 rootFile->Get(
"Scales/es2015Summer/alphaZee_errStat")));
844 rootFile->Get(
"Scales/es2015Summer/alphaZee_errSyst")));
846 m_resNom.reset(checked_own_cast<TH1*>(
847 rootFile->Get(
"Resolution/es2015Summer/ctZee_errStat")));
849 rootFile->Get(
"Resolution/es2015Summer/ctZee_errSyst")));
852 rootFile->Get(
"Pedestals/es2012c/pedestals_l0")));
854 rootFile->Get(
"Pedestals/es2012c/pedestals_l1")));
856 rootFile->Get(
"Pedestals/es2012c/pedestals_l2")));
858 rootFile->Get(
"Pedestals/es2012c/pedestals_l3")));
861 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigA")));
864 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errUncor")));
866 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errLAr")));
869 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errUncor")));
871 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errLAr")));
873 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errG4")));
875 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errGL1")));
878 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errUncor")));
880 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errLAr")));
882 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errG4")));
885 rootFile->Get(
"Conversions/es2012c/convRadiusMigrations")));
887 rootFile->Get(
"Conversions/es2012c/convFakeRate")));
889 rootFile->Get(
"Conversions/es2012c/convRecoEfficiency")));
895 rootFile->Get(
"FastSim/es2015/el_full_fast_resolution")));
897 rootFile->Get(
"FastSim/es2015/ph_unconv_full_fast_resolution")));
899 rootFile->Get(
"FastSim/es2015/ph_conv_full_fast_resolution")));
906 "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
908 "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
910 std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
914 "e1hg_systematics_histos.root"));
951 m_aPSNom.reset(checked_own_cast<TH1*>(
952 rootFile->Get(
"Scales/es2017_summer_final/alphaPS_uncor")));
954 rootFile->Get(
"Scales/es2017_summer_final/dalphaPS_b12")));
956 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaPS_cor")));
958 rootFile->Get(
"Scales/es2017_summer_final/alphaS12_uncor")));
960 rootFile->Get(
"Scales/es2012c/dalphaS12_cor")));
962 m_aPSNom.reset(checked_own_cast<TH1*>(
963 rootFile->Get(
"Scales/es2017_summer_final/alphaPS_uncor")));
965 rootFile->Get(
"Scales/es2017_summer_final/dalphaPS_b12")));
967 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaPS_cor")));
969 rootFile->Get(
"Scales/es2018_R21_v1/alphaS12_uncor")));
971 rootFile->Get(
"Scales/es2012c/dalphaS12_cor")));
973 m_aPSNom.reset(checked_own_cast<TH1*>(
974 rootFile->Get(
"Scales/es2023_R22_Run2_v0/alphaPS_uncor")));
976 rootFile->Get(
"Scales/es2023_R22_Run2_v0/alphaS12_uncor")));
978 m_aPSNom.reset(checked_own_cast<TH1*>(
979 rootFile->Get(
"Scales/es2012c/alphaPS_uncor")));
981 checked_own_cast<TH1*>(
rootFile->Get(
"Scales/es2012c/dalphaPS_cor")));
983 rootFile->Get(
"Scales/es2012c/alphaS12_uncor")));
985 rootFile->Get(
"Scales/es2012c/dalphaS12_cor")));
988 rootFile->Get(
"Scales/es2012c/momentum_errSyst")));
991 m_zeeNom.reset(checked_own_cast<TH1*>(
992 rootFile->Get(
"Scales/es2017/alphaZee_errStat_period_2016")));
994 rootFile->Get(
"Scales/es2017/alphaZee_errStat_period_2015")));
997 m_zeeNom.reset(checked_own_cast<TH1*>(
998 rootFile->Get(
"Scales/es2017_summer/alphaZee_errStat_period_2016")));
1000 rootFile->Get(
"Scales/es2017_summer/alphaZee_errStat_period_2015")));
1003 "Scales/es2017_summer_final/alphaZee_errStat_period_2016")));
1005 "Scales/es2017_summer_final/alphaZee_errStat_period_2015")));
1007 m_zeeNom.reset(checked_own_cast<TH1*>(
1008 rootFile->Get(
"Scales/es2015_5TeV/alphaZee_errStat_period_2015")));
1011 rootFile->Get(
"Scales/es2015_5TeV/alphaZee_errStat_period_2015")));
1013 m_zeeNom.reset(checked_own_cast<TH1*>(
1014 rootFile->Get(
"Scales/es2017_R21_v0/alphaZee_errStat_period_2017")));
1016 rootFile->Get(
"Scales/es2017_R21_v0/alphaZee_errStat_period_2016")));
1018 rootFile->Get(
"Scales/es2017_R21_v0/alphaZee_errStat_period_2015")));
1020 m_zeeNom.reset(checked_own_cast<TH1*>(
1021 rootFile->Get(
"Scales/es2017_R21_v1/alphaZee_errStat_period_2017")));
1023 rootFile->Get(
"Scales/es2017_R21_v1/alphaZee_errStat_period_2016")));
1025 rootFile->Get(
"Scales/es2017_R21_v1/alphaZee_errStat_period_2015")));
1027 rootFile->Get(
"Scales/es2017_R21_v1/alphaFwd_Finalk")));
1029 rootFile->Get(
"Scales/es2017_R21_v1/alphaFwd_Finalb")));
1032 "Scales/es2017_R21_ofc0_v1/alphaZee_errStat_period_2017")));
1034 "Scales/es2017_R21_ofc0_v1/alphaZee_errStat_period_2016")));
1036 "Scales/es2017_R21_ofc0_v1/alphaZee_errStat_period_2015")));
1038 "Scales/es2017_R21_ofc0_v1/alphaZee_errStat_period_2018")));
1040 rootFile->Get(
"Scales/es2017_R21_v1/alphaFwd_Finalk")));
1042 rootFile->Get(
"Scales/es2017_R21_v1/alphaFwd_Finalb")));
1045 m_zeeNom.reset(checked_own_cast<TH1*>(
1046 rootFile->Get(
"Scales/es2018_R21_v0/alphaZee_errStat_period_2018")));
1048 rootFile->Get(
"Scales/es2018_R21_v0/alphaZee_errStat_period_2017")));
1050 rootFile->Get(
"Scales/es2018_R21_v0/alphaZee_errStat_period_2016")));
1052 rootFile->Get(
"Scales/es2018_R21_v0/alphaZee_errStat_period_2015")));
1054 rootFile->Get(
"Scales/es2018_R21_v0/alphaFwd_Finalk")));
1056 rootFile->Get(
"Scales/es2018_R21_v0/alphaFwd_Finalb")));
1058 m_zeeNom.reset(checked_own_cast<TH1*>(
1059 rootFile->Get(
"Scales/es2018_R21_v1/alphaZee_errStat_period_2018")));
1061 rootFile->Get(
"Scales/es2018_R21_v1/alphaZee_errStat_period_2017")));
1063 rootFile->Get(
"Scales/es2018_R21_v1/alphaZee_errStat_period_2016")));
1065 rootFile->Get(
"Scales/es2018_R21_v1/alphaZee_errStat_period_2015")));
1068 rootFile->Get(
"Scales/es2018_R21_v0/alphaFwd_Finalk")));
1070 rootFile->Get(
"Scales/es2018_R21_v0/alphaFwd_Finalb")));
1072 m_zeeNom.reset(checked_own_cast<TH1*>(
1073 rootFile->Get(
"Scales/es2022_R22_PRE/alphaZee_errStat_period_2018")));
1076 rootFile->Get(
"Scales/es2018_R21_v0/alphaFwd_Finalk")));
1078 rootFile->Get(
"Scales/es2018_R21_v0/alphaFwd_Finalb")));
1082 "Scales/es2023_R22_Run2_v0/alphaZee_errStat_period_2018")));
1084 "Scales/es2023_R22_Run2_v0/alphaZee_errStat_period_2017")));
1086 "Scales/es2023_R22_Run2_v0/alphaZee_errStat_period_2016")));
1088 "Scales/es2023_R22_Run2_v0/alphaZee_errStat_period_2015")));
1091 rootFile->Get(
"Scales/es2018_R21_v0/alphaFwd_Finalk")));
1093 rootFile->Get(
"Scales/es2018_R21_v0/alphaFwd_Finalb")));
1095 m_zeeNom.reset(checked_own_cast<TH1*>(
1096 rootFile->Get(
"Scales/es2017_R21_PRE/alphaZee_errStat_period_2016")));
1099 rootFile->Get(
"Scales/es2017_R21_PRE/alphaZee_errStat_period_2016")));
1103 rootFile->Get(
"Scales/es2017/alphaZee_errSyst")));
1106 rootFile->Get(
"Scales/es2017_summer_final/alphaZee_errSyst")));
1109 rootFile->Get(
"Scales/es2015_5TeV/alphaZee_errSyst")));
1112 rootFile->Get(
"Scales/es2017_summer_final/alphaZee_errSyst")));
1115 rootFile->Get(
"Scales/es2017_R21_v1/alphaZee_errSyst")));
1118 rootFile->Get(
"Scales/es2017_R21_ofc0_v1/alphaZee_errSyst")));
1121 rootFile->Get(
"Scales/es2018_R21_v0/alphaZee_errSyst")));
1125 rootFile->Get(
"Scales/es2018_R21_v1/alphaZee_errSyst")));
1128 rootFile->Get(
"Scales/es2022_R22_PRE/alphaZee_errSyst")));
1130 rootFile->Get(
"Scales/es2022_R22_PRE/alphaZee_errOFCSyst")));
1133 rootFile->Get(
"Scales/es2017_summer/alphaZee_errSyst")));
1138 m_resNom.reset(checked_own_cast<TH1*>(
1139 rootFile->Get(
"Resolution/es2017/ctZee_errStat")));
1143 m_resNom.reset(checked_own_cast<TH1*>(
1144 rootFile->Get(
"Resolution/es2017_summer/ctZee_errStat")));
1146 m_resNom.reset(checked_own_cast<TH1*>(
1147 rootFile->Get(
"Resolution/es2017_summer_final/ctZee_errStat")));
1149 m_resNom.reset(checked_own_cast<TH1*>(
1150 rootFile->Get(
"Resolution/es2017_R21_v0/ctZee_errStat")));
1152 m_resNom.reset(checked_own_cast<TH1*>(
1153 rootFile->Get(
"Resolution/es2017_R21_v1/ctZee_errStat")));
1155 m_resNom.reset(checked_own_cast<TH1*>(
1156 rootFile->Get(
"Resolution/es2017_R21_ofc0_v1/ctZee_errStat")));
1158 m_resNom.reset(checked_own_cast<TH1*>(
1159 rootFile->Get(
"Resolution/es2018_R21_v0/ctZee_errStat")));
1161 m_resNom.reset(checked_own_cast<TH1*>(
1162 rootFile->Get(
"Resolution/es2018_R21_v1/ctZee_errStat")));
1164 m_resNom.reset(checked_own_cast<TH1*>(
1165 rootFile->Get(
"Resolution/es2022_R22_PRE/ctZee_errStat")));
1167 m_resNom.reset(checked_own_cast<TH1*>(
1168 rootFile->Get(
"Resolution/es2023_R22_Run2_v0/ctZee_errStat")));
1170 m_resNom.reset(checked_own_cast<TH1*>(
1171 rootFile->Get(
"Resolution/es2017_R21_PRE/ctZee_errStat")));
1176 rootFile->Get(
"Resolution/es2017/ctZee_errSyst")));
1179 rootFile->Get(
"Resolution/es2017_summer_final/ctZee_errSyst")));
1182 rootFile->Get(
"Resolution/es2015_5TeV/ctZee_errSyst")));
1185 rootFile->Get(
"Resolution/es2017_summer_final/ctZee_errSyst")));
1188 rootFile->Get(
"Resolution/es2017_R21_v1/ctZee_errSyst")));
1191 rootFile->Get(
"Resolution/es2017_R21_ofc0_v1/ctZee_errSyst")));
1194 rootFile->Get(
"Resolution/es2018_R21_v0/ctZee_errSyst")));
1198 rootFile->Get(
"Resolution/es2018_R21_v1/ctZee_errSyst")));
1201 rootFile->Get(
"Resolution/es2022_R22_PRE/ctZee_errSyst")));
1203 rootFile->Get(
"Resolution/es2022_R22_PRE/ctZee_errOFCSyst")));
1206 rootFile->Get(
"Resolution/es2017_summer/ctZee_errSyst")));
1214 checked_own_cast<TH1*>(
rootFile->Get(
"Pedestals/es2017/pedestals")));
1217 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigA")));
1220 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errUncor")));
1222 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errLAr")));
1225 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errUncor")));
1227 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errLAr")));
1229 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errG4")));
1231 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errGL1")));
1234 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errUncor")));
1236 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errLAr")));
1238 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errG4")));
1241 rootFile->Get(
"Conversions/es2012c/convRadiusMigrations")));
1244 rootFile->Get(
"Conversions/es2012c/convFakeRate")));
1246 rootFile->Get(
"Conversions/es2012c/convRecoEfficiency")));
1249 rootFile->Get(
"Conversions/es2023_R22_Run2_v0/convFakeRate")));
1251 rootFile->Get(
"Conversions/es2023_R22_Run2_v0/convRecoEfficiency")));
1254 rootFile->Get(
"Conversions/es2017_summer/convFakeRate")));
1256 rootFile->Get(
"Conversions/es2017_summer/convRecoEfficiency")));
1263 "ElectronPhotonFourMomentumCorrection/v8/PP0sys.root");
1265 TFile file_pp0(filename_pp0.c_str());
1266 m_pp0_elec.reset(checked_own_cast<TH2*>(file_pp0.Get(
"elec")));
1267 m_pp0_conv.reset(checked_own_cast<TH2*>(file_pp0.Get(
"conv")));
1268 m_pp0_unconv.reset(checked_own_cast<TH2*>(file_pp0.Get(
"unco")));
1272 "ElectronPhotonFourMomentumCorrection/v8/wstot_related_syst.root");
1274 TFile file_wstot(filename_wstot.c_str());
1276 checked_own_cast<TH1*>(file_wstot.Get(
"A_data")));
1279 checked_own_cast<TH1*>(file_wstot.Get(
"wstot_pT_el_data_p0")));
1281 checked_own_cast<TH1*>(file_wstot.Get(
"wstot_pT_el_data_p1")));
1283 checked_own_cast<TH1*>(file_wstot.Get(
"wstot_pT_uc_data_p0")));
1285 checked_own_cast<TH1*>(file_wstot.Get(
"wstot_pT_uc_data_p1")));
1287 checked_own_cast<TH1*>(file_wstot.Get(
"wstot_pT_c_data_p0")));
1289 checked_own_cast<TH1*>(file_wstot.Get(
"wstot_pT_c_data_p1")));
1291 checked_own_cast<TH1*>(file_wstot.Get(
"wstot_pT_el_mc_p0")));
1293 checked_own_cast<TH1*>(file_wstot.Get(
"wstot_pT_el_mc_p1")));
1295 checked_own_cast<TH1*>(file_wstot.Get(
"wstot_pT_ph_uc_mc_p0")));
1297 checked_own_cast<TH1*>(file_wstot.Get(
"wstot_pT_ph_uc_mc_p1")));
1299 checked_own_cast<TH1*>(file_wstot.Get(
"wstot_pT_ph_c_mc_p0")));
1301 checked_own_cast<TH1*>(file_wstot.Get(
"wstot_pT_ph_c_mc_p1")));
1313 rootFile->Get(
"FastSim/es2017_v1/resol_Af2ToG4_elec_rel21")));
1315 rootFile->Get(
"FastSim/es2017_v1/resol_Af2ToG4_unco_rel21")));
1317 rootFile->Get(
"FastSim/es2017_v1/resol_Af2ToG4_conv_rel21")));
1320 rootFile->Get(
"FastSim/es2017/el_full_fast_resolution")));
1322 rootFile->Get(
"FastSim/es2017/ph_unconv_full_fast_resolution")));
1324 rootFile->Get(
"FastSim/es2017/ph_conv_full_fast_resolution")));
1331 "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
1333 "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
1336 std::string gain_tool_run_2_filename;
1342 "ElectronPhotonFourMomentumCorrection/v11/"
1343 "gain_uncertainty_specialRun.root");
1346 "ElectronPhotonFourMomentumCorrection/v29/"
1347 "gain_uncertainty_specialRun.root");
1350 "ElectronPhotonFourMomentumCorrection/v14/"
1351 "gain_uncertainty_specialRun.root");
1355 gain_tool_run_2_filename,
true,
"GainUncertainty",
1359 std::make_unique<egGain::GainUncertainty>(gain_tool_run_2_filename);
1367 "e1hg_systematics_histos.root"));
1371 "e1hg_systematics_histos.root"));
1380 m_aPSNom.reset(checked_own_cast<TH1*>(
1381 rootFile->Get(
"Scales/es2015_day0/alphaPS_uncor")));
1383 rootFile->Get(
"Scales/es2015_day0/dalphaPS_cor")));
1385 rootFile->Get(
"Scales/es2015_day0/alphaS12_uncor")));
1387 rootFile->Get(
"Scales/es2015_day0/dalphaS12_cor")));
1390 rootFile->Get(
"Scales/es2015_day0/momentum_errSyst")));
1392 m_zeeNom.reset(checked_own_cast<TH1*>(
1393 rootFile->Get(
"Scales/es2015_day0/alphaZee_errStat")));
1395 rootFile->Get(
"Scales/es2015_day0/alphaZee_errSyst")));
1397 m_resNom.reset(checked_own_cast<TH1*>(
1398 rootFile->Get(
"Resolution/es2012c/ctZee_errStat")));
1400 rootFile->Get(
"Resolution/es2012c/ctZee_errSyst")));
1403 rootFile->Get(
"Pedestals/es2012c/pedestals_l0")));
1405 rootFile->Get(
"Pedestals/es2012c/pedestals_l1")));
1407 rootFile->Get(
"Pedestals/es2012c/pedestals_l2")));
1409 rootFile->Get(
"Pedestals/es2012c/pedestals_l3")));
1412 rootFile->Get(
"Material/DX0_ConfigA")));
1415 "Material/Measured/DXerr_IPPS_NewG_errUncor")));
1417 rootFile->Get(
"Material/Measured/DXerr_IPPS_NewG_errLAr")));
1420 "Material/Measured/DXerr_IPAcc_NewG_errUncor")));
1422 "Material/Measured/DXerr_IPAcc_NewG_errLAr")));
1424 rootFile->Get(
"Material/Measured/DXerr_IPAcc_NewG_errG4")));
1426 "Material/Measured/DXerr_IPAcc_NewG_errGL1")));
1429 "Material/Measured/DXerr_PSAcc_NewG_errUncor")));
1431 "Material/Measured/DXerr_PSAcc_NewG_errLAr")));
1433 rootFile->Get(
"Material/Measured/DXerr_PSAcc_NewG_errG4")));
1436 rootFile->Get(
"Conversions/es2012c/convRadiusMigrations")));
1438 rootFile->Get(
"Conversions/es2012c/convFakeRate")));
1440 rootFile->Get(
"Conversions/es2012c/convRecoEfficiency")));
1446 "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
1448 "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
1450 std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
1454 "e1hg_systematics_histos.root"));
1459 ATH_MSG_FATAL(
"ES model not initialized - Initialization fails");
1462 ATH_MSG_FATAL(
"ES model not recognized - Initialization fails");
1485 rootFile->Get(
"E4Recalibration/v4/electron_eta_axis")));
1487 checked_own_cast<TList*>(
rootFile->Get(
"E4Recalibration/v4/electron")));
1490 rootFile->Get(
"E4Recalibration/v4/electron_eta_axis")));
1492 checked_own_cast<TList*>(
rootFile->Get(
"E4Recalibration/v4/electron")));
1494 rootFile->Get(
"E4Recalibration/v4/electron_eta_axis")));
1496 checked_own_cast<TList*>(
rootFile->Get(
"E4Recalibration/v4/electron")));
1520 rootFile->Get(
"PSRecalibration/es2015PRE/ElectronAxis")));
1522 rootFile->Get(
"PSRecalibration/es2015PRE/ElectronBiasPS")));
1524 rootFile->Get(
"PSRecalibration/es2015PRE/UnconvertedAxis")));
1526 rootFile->Get(
"PSRecalibration/es2015PRE/UnconvertedBiasPS")));
1528 rootFile->Get(
"PSRecalibration/es2015PRE/ConvertedAxis")));
1530 rootFile->Get(
"PSRecalibration/es2015PRE/ConvertedBiasPS")));
1533 rootFile->Get(
"S1Recalibration/es2015PRE/ElectronAxis")));
1535 rootFile->Get(
"S1Recalibration/es2015PRE/ElectronBiasS1")));
1537 rootFile->Get(
"S1Recalibration/es2015PRE/UnconvertedAxis")));
1539 rootFile->Get(
"S1Recalibration/es2015PRE/UnconvertedBiasS1")));
1541 rootFile->Get(
"S1Recalibration/es2015PRE/ConvertedAxis")));
1543 rootFile->Get(
"S1Recalibration/es2015PRE/ConvertedBiasS1")));
1546 rootFile->Get(
"PSRecalibration/es2023_R22_Run2_v0/ElectronAxis")));
1548 rootFile->Get(
"PSRecalibration/es2023_R22_Run2_v0/ElectronBiasPS")));
1550 rootFile->Get(
"PSRecalibration/es2023_R22_Run2_v0/UnconvertedAxis")));
1552 rootFile->Get(
"PSRecalibration/es2023_R22_Run2_v0/UnconvertedBiasPS")));
1554 rootFile->Get(
"PSRecalibration/es2023_R22_Run2_v0/ConvertedAxis")));
1556 rootFile->Get(
"PSRecalibration/es2023_R22_Run2_v0/ConvertedBiasPS")));
1559 rootFile->Get(
"S2Recalibration/ElectronAxis")));
1561 rootFile->Get(
"S2Recalibration/ElectronBiasS2")));
1563 rootFile->Get(
"S2Recalibration/UnconvertedAxis")));
1565 rootFile->Get(
"S2Recalibration/UnconvertedBiasS2")));
1567 rootFile->Get(
"S2Recalibration/ConvertedAxis")));
1569 rootFile->Get(
"S2Recalibration/ConvertedBiasS2")));
1572 rootFile->Get(
"SaccRecalibration/ElectronAxis")));
1574 rootFile->Get(
"SaccRecalibration/ElectronBiasSacc")));
1576 rootFile->Get(
"SaccRecalibration/UnconvertedAxis")));
1578 rootFile->Get(
"SaccRecalibration/UnconvertedBiasSacc")));
1580 rootFile->Get(
"SaccRecalibration/ConvertedAxis")));
1582 rootFile->Get(
"SaccRecalibration/ConvertedBiasSacc")));
1586 rootFile->Get(
"PSRecalibration/ElectronAxis")));
1588 rootFile->Get(
"PSRecalibration/ElectronBiasPS")));
1590 rootFile->Get(
"PSRecalibration/UnconvertedAxis")));
1592 rootFile->Get(
"PSRecalibration/UnconvertedBiasPS")));
1594 rootFile->Get(
"PSRecalibration/ConvertedAxis")));
1596 rootFile->Get(
"PSRecalibration/ConvertedBiasPS")));
1599 rootFile->Get(
"S1Recalibration/ElectronAxis")));
1601 rootFile->Get(
"S1Recalibration/ElectronBiasS1")));
1603 rootFile->Get(
"S1Recalibration/UnconvertedAxis")));
1605 rootFile->Get(
"S1Recalibration/UnconvertedBiasS1")));
1607 rootFile->Get(
"S1Recalibration/ConvertedAxis")));
1609 rootFile->Get(
"S1Recalibration/ConvertedBiasS1")));
1616 std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1617 rootFile->Get(
"Material/unconvertedBiasSubtracted_ConfigA"))));
1619 std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1620 rootFile->Get(
"Material/unconvertedBiasSubtracted_ConfigCpDp"))));
1622 std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1623 rootFile->Get(
"Material/unconvertedBiasSubtracted_ConfigEpLp"))));
1625 std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1626 rootFile->Get(
"Material/unconvertedBiasSubtracted_ConfigFpMX"))));
1628 std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1629 rootFile->Get(
"Material/unconvertedBiasSubtracted_ConfigGp"))));
1632 rootFile->Get(
"Material/convertedBiasSubtracted_ConfigA"))));
1634 rootFile->Get(
"Material/convertedBiasSubtracted_ConfigCpDp"))));
1636 rootFile->Get(
"Material/convertedBiasSubtracted_ConfigEpLp"))));
1638 rootFile->Get(
"Material/convertedBiasSubtracted_ConfigFpMX"))));
1640 rootFile->Get(
"Material/convertedBiasSubtracted_ConfigGp"))));
1643 rootFile->Get(
"Material/electronCstTerm_ConfigA"))));
1645 rootFile->Get(
"Material/electronCstTerm_ConfigCpDp"))));
1647 rootFile->Get(
"Material/electronCstTerm_ConfigEpLp"))));
1649 rootFile->Get(
"Material/electronCstTerm_ConfigFpMX"))));
1651 rootFile->Get(
"Material/electronCstTerm_ConfigGp"))));
1661 checked_own_cast<TH1*>(
rootFile->Get(
"Material_rel21/DX0_ConfigA"))));
1663 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigCpDp"))));
1665 rootFile->Get(
"Material_rel21/DX0_ConfigEpLp"))));
1667 rootFile->Get(
"Material_rel21/DX0_ConfigFpMX"))));
1669 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigGp"))));
1671 checked_own_cast<TH1*>(
rootFile->Get(
"Material_rel21/DX0_ConfigN"))));
1674 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigA"))));
1676 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigCpDp"))));
1678 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigEpLp"))));
1680 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigFpMX"))));
1682 checked_own_cast<TH1*>(
rootFile->Get(
"Material/DX0_ConfigGp"))));
1686 checked_own_cast<TAxis*>(
rootFile->Get(
"Material/LinearityEtaBins")));
1688 std::unique_ptr<TList>(checked_own_cast<TList*>(
1689 rootFile->Get(
"Material/Linearity_Cluster_ConfigA"))));
1691 std::unique_ptr<TList>(checked_own_cast<TList*>(
1692 rootFile->Get(
"Material/Linearity_Cluster_ConfigCpDp"))));
1694 std::unique_ptr<TList>(checked_own_cast<TList*>(
1695 rootFile->Get(
"Material/Linearity_Cluster_ConfigEpLp"))));
1697 std::unique_ptr<TList>(checked_own_cast<TList*>(
1698 rootFile->Get(
"Material/Linearity_Cluster_ConfigFpMX"))));
1700 std::unique_ptr<TList>(checked_own_cast<TList*>(
1701 rootFile->Get(
"Material/Linearity_Cluster_ConfigGp"))));
1710 rootFile->Get(
"Material_rel21/electronBias_ConfigA")));
1712 rootFile->Get(
"Material_rel21/electronBias_ConfigEpLp")));
1714 rootFile->Get(
"Material_rel21/electronBias_ConfigFpMX")));
1716 rootFile->Get(
"Material_rel21/electronBias_ConfigN")));
1718 rootFile->Get(
"Material_rel21/electronBias_ConfigIBL")));
1720 rootFile->Get(
"Material_rel21/electronBias_ConfigPP0")));
1722 rootFile->Get(
"Material_rel21/unconvertedBias_ConfigA")));
1724 rootFile->Get(
"Material_rel21/unconvertedBias_ConfigEpLp")));
1726 rootFile->Get(
"Material_rel21/unconvertedBias_ConfigFpMX")));
1728 rootFile->Get(
"Material_rel21/unconvertedBias_ConfigN")));
1730 rootFile->Get(
"Material_rel21/unconvertedBias_ConfigIBL")));
1732 rootFile->Get(
"Material_rel21/unconvertedBias_ConfigPP0")));
1734 rootFile->Get(
"Material_rel21/convertedBias_ConfigA")));
1736 rootFile->Get(
"Material_rel21/convertedBias_ConfigEpLp")));
1738 rootFile->Get(
"Material_rel21/convertedBias_ConfigFpMX")));
1740 rootFile->Get(
"Material_rel21/convertedBias_ConfigN")));
1742 rootFile->Get(
"Material_rel21/convertedBias_ConfigIBL")));
1744 rootFile->Get(
"Material_rel21/convertedBias_ConfigPP0")));
1757 rootFile->Get(
"FastSim/es2015/el_scale_full_fast_peak_gaussian")));
1759 "FastSim/es2015/ph_unconv_scale_full_fast_peak_gaussian")));
1761 rootFile->Get(
"FastSim/es2015/ph_conv_scale_full_fast_peak_gaussian")));
1770 rootFile->Get(
"FastSim/es2017/el_scale_full_fast_peak_gaussian")));
1772 "FastSim/es2017/ph_unconv_scale_full_fast_peak_gaussian")));
1774 rootFile->Get(
"FastSim/es2017/ph_conv_scale_full_fast_peak_gaussian")));
1782 rootFile->Get(
"FastSim/es2017_v1/scale_Af2ToG4_elec_rel21")));
1785 rootFile->Get(
"FastSim/es2017_v1/scale_Af2ToG4_unco_rel21")));
1787 rootFile->Get(
"FastSim/es2017_v1/scale_Af2ToG4_conv_rel21")));
1790 checked_own_cast<TH1*>(
rootFile->Get(
"FastSim/hG4OverAF")));
1793 checked_own_cast<TH1*>(
rootFile->Get(
"FastSim/hG4OverFS")));
1809 checked_own_cast<TH1*>(
rootFile->Get(
"Leakage/LeakageDiffConverted")));
1811 rootFile->Get(
"Leakage/LeakageDiffUnconverted")));
1814 rootFile->Get(
"Leakage/es2017_summer/LeakageDiffConverted")));
1816 rootFile->Get(
"Leakage/es2017_summer/LeakageDiffUnconverted")));
1819 rootFile->Get(
"Leakage/es2023_R22_Run2_v0/LeakageDiffConverted")));
1821 rootFile->Get(
"Leakage/es2023_R22_Run2_v0/LeakageDiffUnconverted")));
1823 rootFile->Get(
"Leakage/es2023_R22_Run2_v0/LeakageDiffElectron")));
1830 ATH_MSG_INFO(
"No leakage systematic uncertainty for ES model "
1836 checked_own_cast<TH1*>(
rootFile->Get(
"ZeeEnergyProfiles/p2MC")));
1839 rootFile->Get(
"ZeeMeanET/MC_eta_vs_et_profiled")));
1852 double correctedMomentum =
momentum;
1853 double aeta = std::abs(trk_eta);
1864 correctedMomentum *= 1. + corr * varSF;
1867 return correctedMomentum;
1879 double fullyCorrectedEnergy =
energy;
1887 fullyCorrectedEnergy =
1896 return fullyCorrectedEnergy;
1907 energyS2, eraw, ptype, scaleVar, varSF);
1908 fullyCorrectedEnergy /= (1 + alpha);
1912 int ieta_k =
m_zeeFwdk->GetXaxis()->FindFixBin(cl_eta);
1913 double value_k =
m_zeeFwdk->GetBinContent(ieta_k);
1914 int ieta_b =
m_zeeFwdb->GetXaxis()->FindFixBin(cl_eta);
1915 double value_b =
m_zeeFwdb->GetBinContent(ieta_b);
1916 fullyCorrectedEnergy =
1917 value_k * fullyCorrectedEnergy +
1930 fullyCorrectedEnergy, energyS2,
1931 eraw, ptype, scaleVar, varSF);
1934 fullyCorrectedEnergy *= (1 + deltaAlpha);
1968 fullyCorrectedEnergy *= (1 + daAF2);
1974 fullyCorrectedEnergy *=
1981 return fullyCorrectedEnergy;
1993 long int runnumber,
double cl_eta,
double cl_etaS2,
double cl_etaCalo,
2003 double meanE = meanET * std::cosh(cl_eta);
2004 double Et =
energy / std::cosh(cl_eta);
2013 double daPS, daS12, linPS, linS12, linEacc, linPS_40_elec, linEacc_40_elec,
2015 daPS = daS12 = linPS = linS12 = linEacc = linPS_40_elec = linEacc_40_elec =
2016 linS12_40_elec = 0.;
2018 double daE4 = 0., linE4 = 0.;
2045 double daWtots1 = 0.;
2063 daWtots1 = -daWtots1;
2091 "es2023_R22_Run2_v0 PS non-linearity before Acc correction: "
2093 linPS = linPS - linEacc * linPS_40_elec / linEacc_40_elec;
2094 ATH_MSG_DEBUG(
"es2023_R22_Run2_v0 PS non-linearity after Acc correction: "
2127 "es2023_R22_Run2_v0 S12 non-linearity before Acc correction: "
2129 linS12 = linS12 - linEacc * linS12_40_elec / linEacc_40_elec;
2131 "es2023_R22_Run2_v0 S12 non-linearity after Acc correction: "
2138 double daMatID, daMatCryo, daMatCalo;
2139 daMatID = daMatCryo = daMatCalo = 0;
2195 double daL1GainSwitch = 0.;
2212 daL1GainSwitch = -daL1GainSwitch;
2217 double daL2GainSwitch = 0.;
2218 double daL2MediumGainSwitch = 0.;
2219 double daL2LowGainSwitch = 0.;
2225 if (!(std::abs(cl_eta) < 1.52 && std::abs(cl_eta) > 1.37) &&
2226 std::abs(cl_eta) < 2.4) {
2228 energyS2 /
GeV, ptype);
2233 daL2GainSwitch = evar /
energy - eref / meanE;
2235 daL2GainSwitch = -daL2GainSwitch;
2241 daL2GainSwitch *= -1;
2245 "trying to compute gain systematic, but no tool for doing it has "
2246 "been instantiated, setting sys to 0");
2247 daL2GainSwitch = 0.;
2259 daL2MediumGainSwitch *= -1;
2260 ATH_MSG_DEBUG(
"L2 gain Medium uncertainty: " << daL2MediumGainSwitch);
2263 "trying to compute gain systematic, but no tool for doing it has "
2264 "been instantiated, setting sys to 0");
2265 daL2MediumGainSwitch = 0.;
2277 daL2LowGainSwitch *= -1;
2278 ATH_MSG_DEBUG(
"L2 gain Low uncertainty: " << daL2LowGainSwitch);
2281 "trying to compute Low gain systematic, but no tool for doing it has "
2282 "been instantiated, setting sys to 0");
2283 daL2LowGainSwitch = 0.;
2302 if (std::abs(cl_eta) < 1.5)
2323 const TH2*
histo =
nullptr;
2333 const double aeta = std::abs(cl_eta);
2334 dapp0 = getValueHistAt(*
histo, aeta,
energy /
GeV / cosh(cl_eta),
false,
2341 if (aeta > 1.5 and aeta < 2.0) {
2343 }
else if (aeta >= 2.0 and aeta <= 2.5) {
2355 double daTopoCluster = 0;
2365 double Et =
energy / cosh(cl_eta);
2366 double Et0 = 10000.;
2370 daTopoCluster = 1
e-3 * (1. / (Et / Et0) - 1. / (meanET / Et0));
2372 daTopoCluster = -1
e-3 * (1. / (Et / Et0) - 1. / (meanET / Et0));
2378 double daADCLin = 0;
2384 daADCLin = 0.3 * corr;
2387 "trying to compute ADC correction systematic, but no tool for doing "
2388 "it has been instantiated, setting sys to 0");
2396 double alphaTot = alphaZee;
2397 alphaTot += daE4 * linE4;
2398 alphaTot += daPS * linPS;
2399 alphaTot += daS12 * linS12;
2400 alphaTot += daMatID + daMatCryo + daMatCalo;
2401 alphaTot += daLeakage;
2402 alphaTot += daL1GainSwitch;
2403 alphaTot += daL2GainSwitch;
2404 alphaTot += daL2MediumGainSwitch;
2405 alphaTot += daL2LowGainSwitch;
2406 alphaTot += daConvSyst;
2407 alphaTot += daPedestal;
2408 alphaTot += daWtots1;
2410 alphaTot += daTopoCluster;
2411 alphaTot += daADCLin;
2421 long int runnumber,
double cl_eta,
double cl_etaS2,
double cl_etaCalo,
double energy,
2428 double alphaVar = 0.;
2436 eraw, ptype,
var, varSF) -
2445 energyS2, eraw, ptype,
ivar, varSF) -
2449 alphaVar +=
pow(
v, 2);
2451 alphaVar = sqrt(alphaVar);
2459 energyS2, eraw, ptype,
ivar, varSF) -
2463 alphaVar +=
pow(
v, 2);
2465 alphaVar = -sqrt(alphaVar);
2477 energyS2, eraw, ptype,
ivar, varSF) -
2479 alphaVar +=
pow(
v, 2);
2481 alphaVar = sqrt(alphaVar);
2493 energyS2, eraw, ptype,
ivar, varSF) -
2495 alphaVar +=
pow(
v, 2);
2497 alphaVar = -sqrt(alphaVar);
2508 if (std::abs(cl_eta) >= 2.47)
2522 double aeta = std::abs(cl_eta);
2523 double sampling = 0.;
2528 else if (aeta < 1.37)
2529 sampling = 0.036 + 0.130 * aeta;
2531 else if (aeta < 1.52)
2534 else if (aeta < 2.0)
2535 sampling = 0.85 - 0.36 * aeta;
2537 else if (aeta < 2.3)
2540 else if (aeta < 2.5)
2541 sampling = -1.05 + 0.52 * aeta;
2558 double aeta = std::abs(cl_eta);
2561 double noise37[25] = {0.27, 0.27, 0.27, 0.27, 0.27, 0.26, 0.25, 0.23, 0.21,
2562 0.19, 0.17, 0.16, 0.15, 0.14, 0.27, 0.23, 0.17, 0.15,
2563 0.13, 0.10, 0.07, 0.06, 0.05, 0.04, 0.03};
2565 int ieta = (
int)(aeta / 0.1);
2567 if (ieta >= 0 && ieta < 25)
2568 noise = noise37[ieta] * cosh(cl_eta);
2577 double aeta = std::abs(cl_eta);
2583 else if (aeta < 1.75)
2586 else if (aeta < 2.5)
2587 cst = 0.0055 * (2.69 - aeta);
2613 std::as_const(*m_peakResData).GetXaxis()->FindBin(cl_eta));
2621 std::as_const(*m_peakResMC).GetXaxis()->FindBin(cl_eta));
2627 double cl_eta)
const {
2639 sqrt(2 * (resData * resData - resMC * resMC) /
mz /
mz + cmc * cmc);
2641 sqrt(2 * (resData * resData - resMC * resMC * smpup * smpup) /
mz /
mz +
2644 sqrt(2 * (resData * resData - resMC * resMC * smpdo * smpdo) /
mz /
mz +
2647 double errdown = std::abs(central - vardown);
2648 double errup = std::abs(central - varup);
2650 return .5 * (errup + errdown);
2663 int eg_resolution_ptype;
2665 eg_resolution_ptype = 0;
2667 eg_resolution_ptype = 1;
2669 eg_resolution_ptype = 2;
2740 double resolution_error;
2741 double resolution_error_up;
2742 double resolution_error_down;
2745 resolution, resolution_error, resolution_error_up,
2746 resolution_error_down, resType,
2755 resolution_error = resolution_error_up /
resolution;
2757 resolution_error = resolution_error_down /
resolution;
2760 return resolution_error;
2766 double cl_eta,
double& errUp,
2767 double& errDown)
const {
2773 double Cdata_unc = 0.;
2774 if (Cdata_err > Cdata_cor)
2775 Cdata_unc = sqrt(Cdata_err * Cdata_err - Cdata_cor * Cdata_cor);
2776 if (Cdata_unc < 0.001)
2785 double err2 =
fcn_sigma(
energy, Cdata, -Cdata_unc, Smc, 0.) - central;
2786 double err3 =
fcn_sigma(
energy, Cdata, -Cdata_cor, Smc, Smc_err) - central;
2787 double err4 = -err3;
2791 errUp = sqrt(errUp * errUp + err1 * err1);
2793 errUp = sqrt(errUp * errUp + err2 * err2);
2795 errUp = sqrt(errUp * errUp + err3 * err3);
2797 errUp = sqrt(errUp * errUp + err4 * err4);
2805 double energy,
double cl_eta,
double cl_etaCalo,
2808 int eg_resolution_ptype;
2810 eg_resolution_ptype = 0;
2812 eg_resolution_ptype = 1;
2814 eg_resolution_ptype = 2;
2826 const double et =
energy / cosh(cl_eta);
2835 sig2 =
a *
a / energyGeV +
b *
b / energyGeV / energyGeV +
c *
c;
2838 if (withCT and
fast) {
2839 throw std::runtime_error(
2840 "It doesn't make sense to ask resolution fast sim + additional CT."
2841 " The resolution on data is FULL sim resolution + CT");
2844 if (
fast and std::abs(cl_eta) < 2.5) {
2865 double ratio_IQR_full_fast = 1.;
2866 const double ptGeV =
energy / cosh(cl_eta) / 1E3;
2881 ptGeV,
true,
true,
true,
true);
2884 ptGeV,
true,
true,
true,
true);
2887 ptGeV,
true,
true,
true,
true);
2892 ratio_IQR_full_fast = getValueHistAt(
2895 ratio_IQR_full_fast = getValueHistAt(
2898 ratio_IQR_full_fast = getValueHistAt(
2902 sig2 /= ratio_IQR_full_fast * ratio_IQR_full_fast;
2919 double Cdata_er,
double S,
2927 sigma = sqrt(sigma2);
2942 ATH_MSG_FATAL(
"Trying to compute smearing correction on data");
2951 const double resMC =
2958 ATH_MSG_DEBUG(
"resolution in data: " << resData <<
" in MC: " << resMC);
2962 ptype,
value, resType);
2964 double errUp, errDown;
2977 ATH_MSG_DEBUG(
"resolution in data after systematics: " << resData);
2979 const double sigma2 =
2989 const double sigma = sqrt(sigma2);
2993 const double DeltaE0 =
rng.Gaus(0,
sigma);
2994 const double cor0 = (energyGeV + DeltaE0) / energyGeV;
2997 << cor0 <<
"|" <<
rng.GetSeed());
3012 double aeta = std::abs(eta);
3014 if (aeta < 1.42 || aeta > 1.55)
3017 const int nBoundaries = 18;
3018 double ETBoundaries[nBoundaries] = {0., 5.4, 8.5, 12.9, 16., 20.,
3019 25., 30., 35., 40., 45., 50.,
3020 55., 60., 65., 70., 75., 99999.};
3022 double CalibFactors[nBoundaries - 1] = {
3023 0.884845, 0.898526, 0.902439, 0.91899, 0.925868, 0.929440,
3024 0.948080, 0.943788, 0.96026, 0.955709, 0.964285, 0.95762,
3025 0.970385, 0.963489, 0.968149, 0.970799, 0.961617};
3028 for (
int i = 0;
i < nBoundaries - 1;
i++)
3029 if (ET /
GeV > ETBoundaries[
i] && ET /
GeV <= ETBoundaries[
i + 1])
3032 if (i0 >= 0 && i0 < nBoundaries - 1)
3033 return 1. / CalibFactors[i0];
3042 const double aeta = std::abs(eta);
3077 true,
true,
true,
true));
3080 true,
true,
true,
true));
3083 true,
true,
true,
true));
3085 throw std::runtime_error(
"particle not valid");
3095 throw std::runtime_error(
"particle not valid");
3101 std::as_const(*m_G4OverAFII_electron).GetXaxis()->FindBin(eta));
3109 double aeta = std::abs(eta);
3110 if (aeta < 3.3 || aeta > 4.9)
3114 std::as_const(*m_G4OverFrSh).GetXaxis()->FindBin(aeta));
3121 double varSF)
const {
3130 int ieta = std::as_const(*m_zeeNom).GetXaxis()->FindBin(eta);
3135 int ieta = std::as_const(*m_zeeNom).GetXaxis()->FindBin(eta);
3139 "es2023_R22_Run2_v0 is only valid for Run-2 data! using 2018 scales");
3140 int ieta = std::as_const(*m_zeeNom).GetXaxis()->FindBin(eta);
3148 runnumber <= 341649 && runnumber >= 324320) {
3149 int ieta = std::as_const(*m_zeeNom_data2017).GetXaxis()->FindBin(eta);
3156 int ieta = std::as_const(*m_zeeNom_data2016).GetXaxis()->FindBin(eta);
3164 runnumber < 322817 && runnumber >= 297000) {
3165 int ieta = std::as_const(*m_zeeNom_data2016).GetXaxis()->FindBin(eta);
3171 int ieta = std::as_const(*m_zeeNom_data2016).GetXaxis()->FindBin(eta);
3176 int ieta = std::as_const(*m_zeeNom_data2015).GetXaxis()->FindBin(eta);
3181 int ieta = std::as_const(*m_zeeNom_data2018).GetXaxis()->FindBin(eta);
3198 int ieta = std::as_const(*m_zeeNom_data2015).GetXaxis()->FindBin(eta);
3225 else if (eta > -3.2)
3233 const double uA2MeV_correction =
3247 if (eta < -2.5 and eta > -3.2)
3264 else if (eta > -3.2)
3310 double stat_error =
h->GetBinError(
h->FindFixBin(eta));
3312 stat_error = stat_error / sqrt(
h->GetNbinsX());
3337 value -= 0.4E-2 * varSF;
3342 int ieta = std::as_const(*m_zeePhys).GetXaxis()->FindBin(eta);
3347 int ieta = std::as_const(*m_zeePhys).GetXaxis()->FindBin(eta);
3361 const double aeta = std::abs(eta);
3366 }
else if (aeta > 1.45 and aeta < 3.2) {
3377 const double aeta = std::abs(eta);
3380 if (aeta > 2.5 and aeta < 3.2) {
3393 value += qsum(0.05
E-2, 0.02
E-2) *
3400 int ieta = std::as_const(*m_zeeNom).GetXaxis()->FindBin(eta);
3408 ieta = std::as_const(*m_zeePhys).GetXaxis()->FindBin(eta);
3422 const double aeta = std::abs(eta);
3423 if ((aeta > 1.6) or (aeta < 1.4)) {
3429 double data_mc_difference = 0.;
3431 data_mc_difference = 1
E-2;
3433 else if (aeta < 1.52) {
3434 data_mc_difference = 3
E-2;
3437 data_mc_difference = 4.3E-2;
3440 const double em_scale = 2.4E-2;
3441 const double mbias = 1
E-2;
3442 const double laser = 4
E-2;
3444 return std::sqrt(data_mc_difference * data_mc_difference +
3445 em_scale * em_scale + mbias * mbias + laser * laser);
3469 double ETGeV =
energy / cosh(cl_eta) / 1E3;
3470 double wstot_pT_data_p0 = 0.;
3471 double wstot_pT_data_p1 = 0.;
3472 double wstot_pT_MC_p0 = 0.;
3473 double wstot_pT_MC_p1 = 0.;
3475 double wstot_40_data =
3478 double wstot_40_MC =
3501 double wstot_pT_data = 0.;
3502 double wstot_pT_MC = 0.;
3514 wstot_pT_data = wstot_pT_data_p0 + wstot_pT_data_p1 / sqrt(ETGeV);
3515 wstot_pT_MC = wstot_pT_MC_p0 + wstot_pT_MC_p1 / sqrt(ETGeV);
3517 value = 2 *
A / 91.2 * (wstot_pT_data - wstot_40_data) -
3518 2 * B / 91.2 * (wstot_pT_MC - wstot_40_MC);
3528 double varSF)
const {
3536 double nearestEta = cl_eta;
3562 else if (iLayer == 1) {
3589 const double aeta = std::abs(cl_eta);
3591 if (aeta >= 1.37 and aeta < 2.5) {
3617 const double aeta = std::abs(cl_eta);
3619 if (aeta >= 1.37 and aeta < 2.5) {
3645 const double aeta = std::abs(cl_eta);
3646 if (aeta >= 2.4 and aeta < 2.5) {
3656 return value * varSF;
3662 const double aeta = std::abs(cl_eta);
3663 const double ETGeV =
energy / cosh(cl_eta) / 1E3;
3683 const int ieta =
axis->FindFixBin(aeta) - 1;
3684 if (ieta >= 0 and ieta < graphs->GetSize()) {
3685 value =
static_cast<TGraph*
>(
graphs->At(ieta))->Eval(ETGeV);
3692 int iLayer,
double cl_eta,
double energy,
3697 if (iLayer == 6 && std::abs(cl_eta) >= 2.47)
3699 double aeta = std::abs(cl_eta);
3700 double ET =
energy / cosh(cl_eta);
3708 if (iLayer == 0 && aeta >= 1.82)
3716 if (ieta >= 0 and ieta < m_psElectronGraphs->GetSize()) {
3719 }
else if (iLayer == 1) {
3722 if (ieta >= 0 and ieta < m_s12ElectronGraphs->GetSize()) {
3725 }
else if (iLayer == 6) {
3728 if (ieta >= 0 && ieta < m_EaccElectronGraphs->GetSize()) {
3738 if (ieta >= 0 and ieta < m_psUnconvertedGraphs->GetSize()) {
3742 }
else if (iLayer == 1) {
3745 if (ieta >= 0 and ieta < m_s12UnconvertedGraphs->GetSize()) {
3748 }
else if (iLayer == 6) {
3751 if (ieta >= 0 && ieta < m_EaccUnconvertedGraphs->GetSize()) {
3761 if (ieta >= 0 and ieta < m_psConvertedGraphs->GetSize()) {
3765 }
else if (iLayer == 1) {
3768 if (ieta >= 0 and ieta < m_s12ConvertedGraphs->GetSize()) {
3771 }
else if (iLayer == 6) {
3774 if (ieta >= 0 && ieta < m_EaccConvertedGraphs->GetSize()) {
3775 if (ET < 10000. && (aeta < 1.2 || (aeta >= 1.59 && aeta < 1.73))) {
3807 double aeta = std::abs(cl_eta);
3910 double varSF)
const {
3920 if (std::abs(cl_eta) < 2.)
3934 double DAlphaDXID, DAlphaDXCryo, DAlphaDXCalo, DAlphaDXGp;
3935 DAlphaDXID = DAlphaDXCryo = DAlphaDXCalo = DAlphaDXGp = 0;
3963 value = -DAlphaDXGp;
3990 value = DeltaX * (DAlphaDXID - DAlphaDXCryo);
3992 value = DeltaX * DAlphaDXCryo;
3994 value = DeltaX * DAlphaDXCalo;
3996 return value * varSF;
4001 double cl_eta,
double ET)
const {
4056 double aeta = std::abs(cl_eta);
4057 int ieta = hmat->GetXaxis()->FindBin(aeta);
4059 int ipt = hmat->GetYaxis()->FindBin(ET);
4060 double ptBin = hmat->GetYaxis()->GetBinCenter(ipt);
4068 pt2 = hmat->GetYaxis()->GetBinCenter(i2);
4072 pt1 = hmat->GetYaxis()->GetBinCenter(i1);
4076 int nbins = hmat->GetYaxis()->GetNbins();
4078 if (i1 >= 1 && i1 <
nbins) {
4079 double v1 = hmat->GetBinContent(ieta, i1);
4080 double v2 = hmat->GetBinContent(ieta, i2);
4081 value = (v1 * (pt2 - ET) +
v2 * (ET - pt1)) / (pt2 - pt1);
4087 value = hmat->GetBinContent(ieta, ipt);
4097 double varSF)
const {
4100 double ET =
energy / cosh(cl_eta) /
GeV;
4114 if (std::abs(cl_eta) < 2.)
4122 if (std::abs(cl_eta) > 1.52 &&
4143 double DAlphaDXGp, DAlphaDXID, DAlphaDXCryo, DAlphaDXCalo;
4164 ->GetFunction(
"fNonLin")
4167 ->GetFunction(
"fNonLin")
4170 ->GetFunction(
"fNonLin")
4173 ->GetFunction(
"fNonLin")
4184 value = -DAlphaDXGp;
4221 value = DeltaX * (DAlphaDXID - DAlphaDXCryo);
4223 value = DeltaX * DAlphaDXCryo;
4225 value = DeltaX * DAlphaDXCalo;
4227 return value * varSF;
4235 double aeta = std::abs(cl_eta);
4262 return alpha * varSF;
4281 double aeta = std::abs(cl_eta);
4297 double etGeV =
et /
GeV;
4298 double alpha = 0, dalpha = 0;
4312 std::pair<double, double>
p =
4338 return alpha * varSF;
4342 const TH1&
hh,
double aeta,
double et,
bool useInterp)
const {
4346 int ibeta =
hh.GetXaxis()->FindBin(aeta);
4347 int nbpT =
hh.GetYaxis()->GetNbins();
4348 int ibpT =
hh.GetYaxis()->FindBin(
et);
4349 bool isOUFlow =
false;
4353 }
else if (ibpT == 0) {
4358 double pTp =
hh.GetYaxis()->GetBinCenter(ibpT), pTn = pTp;
4359 if (!useInterp || isOUFlow || (ibpT == nbpT &&
et > pTp) ||
4360 (ibpT == 1 &&
et < pTp))
4361 alpha =
hh.GetBinContent(ibeta, ibpT);
4363 int jp = ibpT, jn = ibpT - 1;
4368 pTp =
hh.GetYaxis()->GetBinCenter(jp);
4370 pTn =
hh.GetYaxis()->GetBinCenter(jn);
4372 double aPos =
hh.GetBinContent(ibeta, jp);
4373 double aNeg =
hh.GetBinContent(ibeta, jn);
4374 alpha = (aPos * (
et - pTn) + aNeg * (pTp -
et)) / (pTp - pTn);
4376 << aNeg <<
" alpha = " << alpha);
4378 double dalpha =
hh.GetBinError(ibeta, ibpT);
4380 return std::make_pair(alpha, dalpha);
4388 double aeta = std::abs(cl_eta);
4391 double ET =
energy / std::cosh(cl_eta);
4437 return alpha * varSF;
4441 const TH2& conv_hist,
double aeta,
double ET)
const {
4444 int ieta = conv_hist.GetXaxis()->FindBin(aeta);
4446 int ipt = conv_hist.GetYaxis()->FindBin(ET);
4447 double ptBin = conv_hist.GetYaxis()->GetBinCenter(ipt);
4455 pt2 = conv_hist.GetYaxis()->GetBinCenter(i2);
4459 pt1 = conv_hist.GetYaxis()->GetBinCenter(i1);
4463 int nbins = conv_hist.GetYaxis()->GetNbins();
4465 if (i1 >= 1 && i1 <
nbins) {
4466 double v1 = conv_hist.GetBinContent(ieta, i1);
4467 double v2 = conv_hist.GetBinContent(ieta, i2);
4468 value = (v1 * (pt2 - ET) +
v2 * (ET - pt1)) / (pt2 - pt1);
4474 value = conv_hist.GetBinContent(ieta, ipt);
4481 double cl_eta,
double energy,
double eraw,
4488 const double delta =
4490 alpha = delta / (
energy / cosh(cl_eta));
4506 alpha = 10. / (
energy / cosh(cl_eta));
4519 alpha = pedestal /
energy *
4522 alpha = pedestal / eraw;
4526 return alpha * varSF;
4533 double pedestal = 0.;
4534 double aeta = std::abs(cl_eta);
4541 else if (iLayer == 1)
4543 else if (iLayer == 2)
4545 else if (iLayer == 3)
4551 else if (iLayer == 2)
4552 pedestal *= 15. / 21.;
4559 return pedestal * varSF;
4564 return std::abs(cl_eta) >= 1.35 && std::abs(cl_eta) <= 1.55;
4569 double newEta = cl_eta;
4574 if (newEta >= 1.35 && newEta <= 1.45)
4576 if (newEta >= 1.45 && newEta <= 1.55)
4579 if (newEta >= -1.55 && newEta <= -1.45)
4581 if (newEta >= -1.45 && newEta <= -1.35)
4610 pileupNoise = sqrt(avgmu) * (60. + 40. *
log(
et / 10000.) /
log(5.));
4617 if (std::abs(eta) < 1.4)
4626 double&
resolution,
double& resolution_error,
double& resolution_error_up,
4627 double& resolution_error_down,
int resol_type,
bool fast)
const {
4642 (pileupNoise * pileupNoise) / (
et *
et);
4645 double_t sum_sigma_resolution2 = 0.;
4646 double sum_deltaDown = 0.;
4647 double sum_deltaUp = 0.;
4649 for (
int isys = 0; isys < 11; isys++) {
4651 if (syst_mask & (1 << isys)) {
4654 double sigma2up = 0.;
4655 double sigma2down = 0.;
4659 double d1 = (smearingZ + esmearingZ) * (smearingZ + esmearingZ) -
4660 smearingZ * smearingZ;
4661 double d2 = smearingZ * smearingZ -
4662 (smearingZ - esmearingZ) * (smearingZ - esmearingZ);
4663 double d = 0.5 * (
d1 +
d2);
4668 std::format(
"sys resolution Zsmearing: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
4674 3, 40000. * cosh(eta), eta, resol_type);
4675 double deltaSigma2 = (1.1 * resolutionZ) * (1.1 * resolutionZ) -
4676 resolutionZ * resolutionZ;
4677 double resolution1 =
4679 sigma2up = (1.1 * resolution1) * (1.1 * resolution1) -
4680 resolution1 * resolution1 - deltaSigma2;
4681 deltaSigma2 = (0.9 * resolutionZ) * (0.9 * resolutionZ) -
4682 resolutionZ * resolutionZ;
4683 sigma2down = (0.9 * resolution1) * (0.9 * resolution1) -
4684 resolution1 * resolution1 - deltaSigma2;
4685 sigma2 = 0.5 * (sigma2up - sigma2down);
4687 std::format(
"sys resolution intrinsic: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
4691 else if (isys == 2) {
4694 sigma2 = sigmaA * sigmaA;
4696 sigma2down = -1. * sigma2;
4698 std::format(
"sys resolution configA ID material: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
4703 else if (isys == 3) {
4704 if (std::abs(eta) < 1.45) {
4707 sigma2 = 0.5 * sigmaM * sigmaM;
4711 sigma2down = -1. * sigma2;
4713 std::format(
"sys resolution presampler-layer1: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
4718 else if (isys == 4) {
4719 if (std::abs(eta) > 1.52 && std::abs(eta) < 1.82) {
4726 sigma2down = -1. * sigma2;
4728 std::format(
"sys resolution barrel-endcap gap: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
4733 else if (isys == 5) {
4736 sigma2 = 0.5 * sigmaEL * sigmaEL;
4738 sigma2down = -1. * sigma2;
4740 std::format(
"sys resolution cryostat area: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
4745 else if (isys == 6) {
4747 double sigmaPileUp = 0.;
4757 sqrt(1.1 * 1.1 - 1.0) *
4759 sigmaPileUp = deltaNoise /
et;
4760 sigmaZ = deltaNoise / 40000.;
4769 double deltaPileupNoise = 100.;
4770 if (std::abs(eta) >= 1.4 && std::abs(eta) < 1.8)
4771 deltaPileupNoise = 200.;
4772 double scaleNcells = 1;
4774 scaleNcells = sqrt(3. / 5.);
4776 sigmaPileUp = deltaPileupNoise * scaleNcells /
et;
4778 deltaPileupNoise / (40000.);
4782 sigma2down = -1. * sigma2;
4787 else if (isys == 7 && std::abs(eta) < 1.5 &&
4802 sigma2 = sigmaE * sigmaE;
4804 sigma2down = -1. * sigma2;
4806 std::format(
"sys resolution ibl material: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
4810 else if (isys == 8 && std::abs(eta) > 1.5 &&
4826 sigma2 = 2.3 * sigmaE * sigmaE;
4828 sigma2down = -1. * sigma2;
4830 std::format(
"sys resolution pp0 material: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
4836 else if (isys == 9 &&
4844 const double ptGeV =
et / 1
e3;
4847 true,
true,
true,
true);
4850 ptGeV,
true,
true,
true,
true);
4853 ptGeV,
true,
true,
true,
true);
4854 sigma2up = -1. * sigma2;
4856 sigma2down = sigma2;
4861 double d1 = (smearingZ + esmearingOFC) * (smearingZ + esmearingOFC) -
4862 smearingZ * smearingZ;
4863 double d2 = smearingZ * smearingZ -
4864 (smearingZ - esmearingOFC) * (smearingZ - esmearingOFC);
4865 double d = 0.5 * (
d1 +
d2);
4886 if ((resolution2 + sigma2up) > 0.)
4887 rr1 = sqrt(resolution2 + sigma2up);
4889 if ((resolution2 + sigma2down) > 0.)
4890 rr2 = sqrt(resolution2 +
4892 double deltaSigma_sys;
4898 sum_sigma_resolution2 += deltaSigma_sys * deltaSigma_sys;
4900 if ((resolution2 + sigma2up) > 0.)
4901 rr1 = sqrt(resolution2 + sigma2up);
4907 if ((resolution2 + sigma2down) > 0.)
4908 rr2 = sqrt(resolution2 + sigma2down);
4912 ATH_MSG_VERBOSE(
"relative resolution change Down " << deltaSigmaDown);
4914 sum_deltaUp += deltaSigmaUp;
4915 sum_deltaDown += deltaSigmaDown;
4920 resolution_error = sqrt(sum_sigma_resolution2) *
4923 resolution_error_up = sum_deltaUp *
resolution;
4924 resolution_error_down = sum_deltaDown *
resolution;
4928 <<
" Resolution Error (MeV): " << resolution_error <<
" down "
4929 << resolution_error_down <<
" up " << resolution_error_up
4930 <<
" Z smearing " << smearingZ <<
" +- " << esmearingZ
4931 <<
" using mask " << syst_mask);
4942 return "topoClusterThresUp";
4944 return "topoClusterThresDown";
4946 return "MomentumUp";
4948 return "MomentumDown";
4952 return "ZeeStatDown";
4956 return "ZeeSystDown";
4960 return "ZeePhysDown";
4964 return "ZeeAllDown";
4966 return "LArCalibUp";
4968 return "LArCalibDown";
4970 return "LArUnconvCalibUp";
4972 return "LArUnconvCalibDown";
4974 return "LArElecCalibUp";
4976 return "LArElecCalibDown";
4978 return "LArCalibExtra2015PreUp";
4980 return "LArCalibExtra2015PreDown";
4982 return "LArElecUnconvUp";
4984 return "LArElecUnconvDown";
5002 return "S12ExtraLastEtaBinRun2Up";
5004 return "S12ExtraLastEtaBinRun2Down";
5012 return "MatCryoDown";
5016 return "MatCaloDown";
5020 return "L1GainDown";
5024 return "L2GainDown";
5026 return "L2LowGainDown";
5028 return "L2LowGainUp";
5030 return "L2MediumGainDown";
5032 return "L2MediumGainUp";
5036 return "ADCLinDown";
5038 return "LeakageElecUp";
5040 return "LeakageElecDown";
5042 return "ConvRecoUp";
5044 return "ConvRecoDown";
5050 return "LeakageUnconvUp";
5052 return "LeakageUnconvDown";
5054 return "LeakageConvUp";
5056 return "LeakageConvDown";
5058 return "ConvEfficiencyUp";
5060 return "ConvEfficiencyDown";
5062 return "ConvFakeRateUp";
5064 return "ConvFakeRateDown";
5066 return "ConvRadiusUp";
5068 return "ConvRadiusDown";
5070 return "PedestalUp";
5072 return "PedestalDown";
5078 return "AllCorrelatedUp";
5080 return "AllCorrelatedDown";
5082 return "LArTemperature2015PreUp";
5084 return "LArTemperature2015PreDown";
5086 return "LArTemperature2016PreUp";
5088 return "LArTemperature2016PreDown";
5090 return "E4ScintillatorUp";
5092 return "E4ScintillatorDown";
5096 return "MatPP0Down";
5100 return "Wtots1Down";
5102 return "LastScaleVariation";
5108 return "EXTRARUN3PREUp";
5110 return "EXTRARUN3PREDown";
5120 return "Resolution::None";
5122 return "Resolution::Nominal";
5124 return "Resolution::AllDown";
5126 return "Resolution::AllUp";
5128 return "Resolution::ZSmearingUp";
5130 return "Resolution::ZSmearingDown";
5132 return "Resolution::SamplingTermUp";
5134 return "Resolution::SamplingTermDown";
5136 return "Resolution::MaterialUp";
5138 return "Resolution::MaterialDown";
5140 return "Resolution::MaterialUp";
5142 return "Resolution::MaterialDown";
5144 return "Resolution::MaterialUp";
5146 return "Resolution::MaterialDown";
5148 return "Resolution::MaterialUp";
5150 return "Resolution::MaterialDown";
5152 return "Resolution::PileUpUp";
5154 return "Resolution::PileUpDown";
5156 return "Resolution::MaterialPP0Up";
5158 return "Resolution::MaterialPP0Down";
5160 return "Resolution::MaterialIBLUp";
5162 return "Resolution::MaterialIBLDown";
5164 return "Resolution::af2Up";
5166 return "Resolution::af2Down";
5168 return "Resolution::OFCUp";
5170 return "Resolution::OFCDown";
5172 return "LastResolutionVariation";
5174 return "Resolution::Unknown";
5179 const auto ieta = std::as_const(*m_zeeSyst).GetXaxis()->FindFixBin(eta);
5180 auto value_histo =
m_zeeSyst->GetBinContent(ieta);
5186 const auto ieta = std::as_const(*m_zeeSystOFC).GetXaxis()->FindFixBin(eta);
5193 return *std::as_const(*m_zeeNom).GetXaxis();