diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/egammaEnergyCorrectionTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/egammaEnergyCorrectionTool.h index 638ebcea7e8876c14798c11020797e2f04c0b6be..96f966a299367eee19b3756157980502565b4de7 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/egammaEnergyCorrectionTool.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/egammaEnergyCorrectionTool.h @@ -22,13 +22,8 @@ #include "PATCore/PATCoreEnums.h" #include <AsgTools/AsgMessaging.h> - // ROOT includes #include "TRandom3.h" -//#include "TList.h" -//#include "TFile.h" -//#include "TGraphErrors.h" -#include "TSystem.h" // Forward declarations class eg_resolution; @@ -39,7 +34,6 @@ class linearity_ADC; class TH1; class TH2; class TAxis; -class TFile; class TList; namespace egGain { class GainTool; // run1 tool @@ -185,6 +179,8 @@ namespace egEnergyCorr { // ... Conversion efficiency (-> vary unconverted photon calib), fake rate (-> vary converted photon calib) ConvEfficiencyUp, ConvEfficiencyDown, ConvFakeRateUp, ConvFakeRateDown, ConvRadiusUp, ConvRadiusDown, + // ... in R21, 2022, Precision : NP is correlated between conv and unconv, let's call it ConvReco + ConvRecoUp, ConvRecoDown, AllUp, AllDown, AllCorrelatedUp, AllCorrelatedDown, @@ -484,8 +480,6 @@ namespace AtlasRoot { private: - - std::unique_ptr<TFile> m_rootFile; std::string m_rootFileName; mutable TRandom3 m_random3; diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/systematics_S12_2022.def b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/systematics_S12_2022.def index cd90e647e1f6c83e8aa0a96150a956008e102ada..89cc426317967d83bb4f89acd55ce7dd69f09968 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/systematics_S12_2022.def +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/systematics_S12_2022.def @@ -13,6 +13,5 @@ SYSMACRO(EG_SCALE_L2GAIN, 1, std::vector<double>(), egEnergyCorr: SYSMACRO(EG_SCALE_PEDESTAL, 1, std::vector<double>(), egEnergyCorr::Scale::PedestalUp, egEnergyCorr::Scale::PedestalDown) SYSMACRO(PH_SCALE_LEAKAGEUNCONV, 1, std::vector<double>(), egEnergyCorr::Scale::LeakageUnconvUp, egEnergyCorr::Scale::LeakageUnconvDown) SYSMACRO(PH_SCALE_LEAKAGECONV, 1, std::vector<double>(), egEnergyCorr::Scale::LeakageConvUp, egEnergyCorr::Scale::LeakageConvDown) -SYSMACRO(PH_SCALE_CONVEFFICIENCY, 1, std::vector<double>(), egEnergyCorr::Scale::ConvEfficiencyUp, egEnergyCorr::Scale::ConvEfficiencyDown) -SYSMACRO(PH_SCALE_CONVFAKERATE, 1, std::vector<double>(), egEnergyCorr::Scale::ConvFakeRateUp, egEnergyCorr::Scale::ConvFakeRateDown) +SYSMACRO(PH_SCALE_CONVRECO, 1, std::vector<double>(), egEnergyCorr::Scale::ConvRecoUp, egEnergyCorr::Scale::ConvRecoDown) SYSMACRO(PH_SCALE_CONVRADIUS, 1, std::vector<double>(), egEnergyCorr::Scale::ConvRadiusUp, egEnergyCorr::Scale::ConvRadiusDown) diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/egammaEnergyCorrectionTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/egammaEnergyCorrectionTool.cxx index fdb2ffe4239da81dc21707c779274c268b23c33c..9d2253d29aa62a3367ffd891fb9f73b7fe912cb2 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/egammaEnergyCorrectionTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/egammaEnergyCorrectionTool.cxx @@ -17,6 +17,7 @@ #include "TF1.h" #include "TFile.h" #include "TList.h" +#include "TSystem.h" #include "TGraphErrors.h" #include "ElectronPhotonFourMomentumCorrection/egammaEnergyCorrectionTool.h" @@ -27,19 +28,8 @@ #include "ElectronPhotonFourMomentumCorrection/GainUncertainty.h" #include "ElectronPhotonFourMomentumCorrection/linearity_ADC.h" - #include "PathResolver/PathResolver.h" -inline double qsum(double x, double y) { return std::hypot(x, y); } - -template<typename T> -T* get_object(TFile& file, const std::string& name) -{ - T* obj = dynamic_cast<T*>(file.Get(name.c_str())); - if (not obj) { throw std::runtime_error("object " + name + " not found in file " + std::string(file.GetName())); } - return obj; -} - inline double getValueHistoAt(const TH1& histo, double xvalue, bool use_lastbin_overflow=false, bool use_firstbin_underflow=false) @@ -144,6 +134,7 @@ namespace AtlasRoot { // Load the ROOT filea const std::unique_ptr<char[]> fname(gSystem->ExpandPathName(m_rootFileName.c_str())); + std::unique_ptr<TFile> m_rootFile; m_rootFile.reset(TFile::Open( fname.get(), "READ" )); if ( !m_rootFile ) { @@ -200,12 +191,12 @@ namespace AtlasRoot { m_begRunNumber = 177531; m_endRunNumber = 194382; - - // mc11d : correct MSc in G4; new geometry // Final Run1 calibration scheme - } else if ( m_esmodel==egEnergyCorr::es2011d || m_esmodel==egEnergyCorr::es2011dMedium || m_esmodel==egEnergyCorr::es2011dTight ) { + } else if ( m_esmodel==egEnergyCorr::es2011d || + m_esmodel==egEnergyCorr::es2011dMedium || + m_esmodel==egEnergyCorr::es2011dTight ) { m_use_new_resolution_model = true; m_resolution_tool.reset(new eg_resolution("run1")); m_aPSNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2011d/alphaPS_uncor"))); m_aPSNom->SetDirectory(nullptr); @@ -396,7 +387,8 @@ namespace AtlasRoot { m_e1hg_tool.reset(new e1hg_systematics()); } - else if (m_esmodel == egEnergyCorr::es2015PRE or m_esmodel == egEnergyCorr::es2015cPRE) { + else if (m_esmodel == egEnergyCorr::es2015PRE or + m_esmodel == egEnergyCorr::es2015cPRE) { m_use_etaCalo_scales = true; m_use_new_resolution_model = true; m_resolution_tool.reset( new eg_resolution("run2_pre")) ; @@ -460,7 +452,8 @@ namespace AtlasRoot { m_e1hg_tool.reset(new e1hg_systematics()); } - else if (m_esmodel == egEnergyCorr::es2015PRE_res_improved or m_esmodel == egEnergyCorr::es2015cPRE_res_improved) { + else if (m_esmodel == egEnergyCorr::es2015PRE_res_improved or + m_esmodel == egEnergyCorr::es2015cPRE_res_improved) { m_use_etaCalo_scales = true; m_use_new_resolution_model = true; m_resolution_tool.reset(new eg_resolution("run2_pre")); @@ -655,77 +648,95 @@ namespace AtlasRoot { m_use_temp_correction201516 = true; } - else if (m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved - or m_esmodel == egEnergyCorr::es2017_summer_final or m_esmodel == egEnergyCorr::es2015_5TeV or m_esmodel == egEnergyCorr::es2017_R21_PRE - or m_esmodel == egEnergyCorr::es2017_R21_v0 or m_esmodel == egEnergyCorr::es2017_R21_v1 - or m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 or m_esmodel == egEnergyCorr::es2018_R21_v0 or m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 - or m_esmodel == egEnergyCorr::es2018_R21_v1 or m_esmodel == egEnergyCorr::es2022_R21_Precision) {//add release 21 here for now + else if (m_esmodel == egEnergyCorr::es2017 or + m_esmodel == egEnergyCorr::es2017_summer or + m_esmodel == egEnergyCorr::es2017_summer_improved or + m_esmodel == egEnergyCorr::es2017_summer_final or + m_esmodel == egEnergyCorr::es2015_5TeV or + m_esmodel == egEnergyCorr::es2017_R21_PRE or + m_esmodel == egEnergyCorr::es2017_R21_v0 or + m_esmodel == egEnergyCorr::es2017_R21_v1 or + m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 or + m_esmodel == egEnergyCorr::es2018_R21_v0 or + m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 or + m_esmodel == egEnergyCorr::es2018_R21_v1 or + m_esmodel == egEnergyCorr::es2022_R21_Precision) { //add release 21 here for now + m_use_etaCalo_scales = true; m_use_new_resolution_model = true; - if (m_esmodel == egEnergyCorr::es2017_R21_v1 || m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 || m_esmodel == egEnergyCorr::es2018_R21_v0 ||m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || m_esmodel == egEnergyCorr::es2018_R21_v1 || m_esmodel == egEnergyCorr::es2022_R21_Precision) + if (m_esmodel == egEnergyCorr::es2017_R21_v1 || + m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 || + m_esmodel == egEnergyCorr::es2018_R21_v0 || + m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || + m_esmodel == egEnergyCorr::es2018_R21_v1 || + m_esmodel == egEnergyCorr::es2022_R21_Precision) m_resolution_tool.reset(new eg_resolution("run2_R21_v1")); else m_resolution_tool.reset(new eg_resolution("run2_pre")); - - if(m_esmodel == egEnergyCorr::es2017_summer_final or - m_esmodel == egEnergyCorr::es2017_R21_v0 or m_esmodel == egEnergyCorr::es2017_R21_v1 or - m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 or m_esmodel == egEnergyCorr::es2018_R21_v0 or m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 ){ - m_aPSNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/alphaPS_uncor"))); m_aPSNom->SetDirectory(nullptr); - m_daPSb12.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/dalphaPS_b12"))); m_daPSb12->SetDirectory(nullptr); - m_daPSCor.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/dalphaPS_cor"))); m_daPSCor->SetDirectory(nullptr); - m_aS12Nom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/alphaS12_uncor"))); m_aS12Nom->SetDirectory(nullptr); - m_daS12Cor.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/dalphaS12_cor"))); m_daS12Cor->SetDirectory(nullptr); - } - else if (m_esmodel == egEnergyCorr::es2018_R21_v1){ - m_aPSNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/alphaPS_uncor"))); m_aPSNom->SetDirectory(nullptr); - m_daPSb12.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/dalphaPS_b12"))); m_daPSb12->SetDirectory(nullptr); - m_daPSCor.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/dalphaPS_cor"))); m_daPSCor->SetDirectory(nullptr); - m_aS12Nom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v1/alphaS12_uncor"))); m_aS12Nom->SetDirectory(nullptr); - m_daS12Cor.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/dalphaS12_cor"))); m_daS12Cor->SetDirectory(nullptr); - } - else if (m_esmodel == egEnergyCorr::es2022_R21_Precision){ - m_aPSNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2022_R21_Precision/alphaPS_uncor"))); m_aPSNom->SetDirectory(nullptr); - m_aS12Nom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2022_R21_Precision/alphaS12_uncor"))); m_aS12Nom->SetDirectory(nullptr); + + if (m_esmodel == egEnergyCorr::es2017_summer_final or + m_esmodel == egEnergyCorr::es2017_R21_v0 or + m_esmodel == egEnergyCorr::es2017_R21_v1 or + m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 or + m_esmodel == egEnergyCorr::es2018_R21_v0 or + m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0) { + m_aPSNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/alphaPS_uncor"))); m_aPSNom->SetDirectory(nullptr); + m_daPSb12.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/dalphaPS_b12"))); m_daPSb12->SetDirectory(nullptr); + m_daPSCor.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/dalphaPS_cor"))); m_daPSCor->SetDirectory(nullptr); + m_aS12Nom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/alphaS12_uncor"))); m_aS12Nom->SetDirectory(nullptr); + m_daS12Cor.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/dalphaS12_cor"))); m_daS12Cor->SetDirectory(nullptr); } - else{ - m_aPSNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/alphaPS_uncor"))); m_aPSNom->SetDirectory(nullptr); - m_daPSCor.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/dalphaPS_cor"))); m_daPSCor->SetDirectory(nullptr); - m_aS12Nom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/alphaS12_uncor"))); m_aS12Nom->SetDirectory(nullptr); + else if (m_esmodel == egEnergyCorr::es2018_R21_v1) { + m_aPSNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/alphaPS_uncor"))); m_aPSNom->SetDirectory(nullptr); + m_daPSb12.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/dalphaPS_b12"))); m_daPSb12->SetDirectory(nullptr); + m_daPSCor.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/dalphaPS_cor"))); m_daPSCor->SetDirectory(nullptr); + m_aS12Nom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v1/alphaS12_uncor"))); m_aS12Nom->SetDirectory(nullptr); m_daS12Cor.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/dalphaS12_cor"))); m_daS12Cor->SetDirectory(nullptr); } - m_trkSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/momentum_errSyst"))); m_trkSyst->SetDirectory(nullptr); + else if (m_esmodel == egEnergyCorr::es2022_R21_Precision) { + m_aPSNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2022_R21_Precision/alphaPS_uncor"))); m_aPSNom->SetDirectory(nullptr); + m_aS12Nom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2022_R21_Precision/alphaS12_uncor"))); m_aS12Nom->SetDirectory(nullptr); + } + else { + m_aPSNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/alphaPS_uncor"))); m_aPSNom->SetDirectory(nullptr); + m_daPSCor.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/dalphaPS_cor"))); m_daPSCor->SetDirectory(nullptr); + m_aS12Nom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/alphaS12_uncor"))); m_aS12Nom->SetDirectory(nullptr); + m_daS12Cor.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/dalphaS12_cor"))); m_daS12Cor->SetDirectory(nullptr); + } + m_trkSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2012c/momentum_errSyst"))); m_trkSyst->SetDirectory(nullptr); - if(m_esmodel == egEnergyCorr::es2017){ - m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017/alphaZee_errStat_period_2016"))); m_zeeNom->SetDirectory(nullptr); - m_zeeNom_data2015.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017/alphaZee_errStat_period_2015"))); m_zeeNom_data2015->SetDirectory(nullptr); + if (m_esmodel == egEnergyCorr::es2017) { + m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017/alphaZee_errStat_period_2016"))); m_zeeNom->SetDirectory(nullptr); + m_zeeNom_data2015.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017/alphaZee_errStat_period_2015"))); m_zeeNom_data2015->SetDirectory(nullptr); } - else if(m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved){ - m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer/alphaZee_errStat_period_2016"))); m_zeeNom->SetDirectory(nullptr); - m_zeeNom_data2015.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer/alphaZee_errStat_period_2015"))); m_zeeNom_data2015->SetDirectory(nullptr); + else if (m_esmodel == egEnergyCorr::es2017_summer or + m_esmodel == egEnergyCorr::es2017_summer_improved) { + m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer/alphaZee_errStat_period_2016"))); m_zeeNom->SetDirectory(nullptr); + m_zeeNom_data2015.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer/alphaZee_errStat_period_2015"))); m_zeeNom_data2015->SetDirectory(nullptr); } - else if(m_esmodel == egEnergyCorr::es2017_summer_final){ - m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/alphaZee_errStat_period_2016"))); m_zeeNom->SetDirectory(nullptr); - m_zeeNom_data2015.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/alphaZee_errStat_period_2015"))); m_zeeNom_data2015->SetDirectory(nullptr); + else if (m_esmodel == egEnergyCorr::es2017_summer_final) { + m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/alphaZee_errStat_period_2016"))); m_zeeNom->SetDirectory(nullptr); + m_zeeNom_data2015.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/alphaZee_errStat_period_2015"))); m_zeeNom_data2015->SetDirectory(nullptr); } - else if(m_esmodel == egEnergyCorr::es2015_5TeV){ - m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2015_5TeV/alphaZee_errStat_period_2015"))); m_zeeNom->SetDirectory(nullptr); + else if (m_esmodel == egEnergyCorr::es2015_5TeV) { + m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2015_5TeV/alphaZee_errStat_period_2015"))); m_zeeNom->SetDirectory(nullptr); //Same histogram added twice for simplicity m_zeeNom_data2015.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2015_5TeV/alphaZee_errStat_period_2015"))); m_zeeNom_data2015->SetDirectory(nullptr); } else if (m_esmodel==egEnergyCorr::es2017_R21_v0) { - m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_v0/alphaZee_errStat_period_2017"))); m_zeeNom->SetDirectory(nullptr); + m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_v0/alphaZee_errStat_period_2017"))); m_zeeNom->SetDirectory(nullptr); m_zeeNom_data2016.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_v0/alphaZee_errStat_period_2016"))); m_zeeNom_data2016->SetDirectory(nullptr); m_zeeNom_data2015.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_v0/alphaZee_errStat_period_2015"))); m_zeeNom_data2015->SetDirectory(nullptr); } else if (m_esmodel==egEnergyCorr::es2017_R21_v1) { - m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_v1/alphaZee_errStat_period_2017"))); m_zeeNom->SetDirectory(nullptr); + m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_v1/alphaZee_errStat_period_2017"))); m_zeeNom->SetDirectory(nullptr); m_zeeNom_data2016.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_v1/alphaZee_errStat_period_2016"))); m_zeeNom_data2016->SetDirectory(nullptr); m_zeeNom_data2015.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_v1/alphaZee_errStat_period_2015"))); m_zeeNom_data2015->SetDirectory(nullptr); m_zeeFwdk.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_v1/alphaFwd_Finalk"))); m_zeeFwdk->SetDirectory(nullptr); m_zeeFwdb.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_v1/alphaFwd_Finalb"))); m_zeeFwdb->SetDirectory(nullptr); } else if (m_esmodel==egEnergyCorr::es2017_R21_ofc0_v1) { - m_zeeNom.reset(dynamic_cast<TH1*> (m_rootFile->Get("Scales/es2017_R21_ofc0_v1/alphaZee_errStat_period_2017"))); m_zeeNom->SetDirectory(nullptr); + m_zeeNom.reset(dynamic_cast<TH1*> (m_rootFile->Get("Scales/es2017_R21_ofc0_v1/alphaZee_errStat_period_2017"))); m_zeeNom->SetDirectory(nullptr); m_zeeNom_data2016.reset(dynamic_cast<TH1*> (m_rootFile->Get("Scales/es2017_R21_ofc0_v1/alphaZee_errStat_period_2016"))); m_zeeNom_data2016->SetDirectory(nullptr); m_zeeNom_data2015.reset(dynamic_cast<TH1*> (m_rootFile->Get("Scales/es2017_R21_ofc0_v1/alphaZee_errStat_period_2015"))); m_zeeNom_data2015->SetDirectory(nullptr); m_zeeNom_data2018.reset(dynamic_cast<TH1*> (m_rootFile->Get("Scales/es2017_R21_ofc0_v1/alphaZee_errStat_period_2018"))); m_zeeNom_data2018->SetDirectory(nullptr); @@ -734,22 +745,21 @@ namespace AtlasRoot { } else if (m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0){ // only 1 set of alpha for 13TEV 2018 and 2017 lowmu data (mu=2) dataset - m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_lowmu_v0/alphaZee_errStat"))); m_zeeNom->SetDirectory(nullptr); - m_zeeNom_data2017.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_lowmu_v0/alphaZee_errStat_5TeV"))); m_zeeNom_data2017->SetDirectory(nullptr); + m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_lowmu_v0/alphaZee_errStat"))); m_zeeNom->SetDirectory(nullptr); + m_zeeNom_data2017.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_lowmu_v0/alphaZee_errStat_5TeV"))); m_zeeNom_data2017->SetDirectory(nullptr); m_zeeFwdk.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalk"))); m_zeeFwdk->SetDirectory(nullptr); m_zeeFwdb.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalb"))); m_zeeFwdb->SetDirectory(nullptr); } - else if (m_esmodel == egEnergyCorr::es2018_R21_v0){ - - m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v0/alphaZee_errStat_period_2018"))); m_zeeNom->SetDirectory(nullptr); + else if (m_esmodel == egEnergyCorr::es2018_R21_v0) { + m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v0/alphaZee_errStat_period_2018"))); m_zeeNom->SetDirectory(nullptr); m_zeeNom_data2017.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v0/alphaZee_errStat_period_2017"))); m_zeeNom_data2017->SetDirectory(nullptr); m_zeeNom_data2016.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v0/alphaZee_errStat_period_2016"))); m_zeeNom_data2016->SetDirectory(nullptr); m_zeeNom_data2015.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v0/alphaZee_errStat_period_2015"))); m_zeeNom_data2015->SetDirectory(nullptr); m_zeeFwdk.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalk"))); m_zeeFwdk->SetDirectory(nullptr); m_zeeFwdb.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalb"))); m_zeeFwdb->SetDirectory(nullptr); } - else if (m_esmodel == egEnergyCorr::es2018_R21_v1 ) { - m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v1/alphaZee_errStat_period_2018"))); m_zeeNom->SetDirectory(nullptr); + else if (m_esmodel == egEnergyCorr::es2018_R21_v1) { + m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v1/alphaZee_errStat_period_2018"))); m_zeeNom->SetDirectory(nullptr); m_zeeNom_data2017.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v1/alphaZee_errStat_period_2017"))); m_zeeNom_data2017->SetDirectory(nullptr); m_zeeNom_data2016.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v1/alphaZee_errStat_period_2016"))); m_zeeNom_data2016->SetDirectory(nullptr); m_zeeNom_data2015.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v1/alphaZee_errStat_period_2015"))); m_zeeNom_data2015->SetDirectory(nullptr); @@ -758,7 +768,7 @@ namespace AtlasRoot { m_zeeFwdb.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalb"))); m_zeeFwdb->SetDirectory(nullptr); } else if (m_esmodel == egEnergyCorr::es2022_R21_Precision) { - m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2022_R21_Precision/alphaZee_errStat_period_2018"))); m_zeeNom->SetDirectory(nullptr); + m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2022_R21_Precision/alphaZee_errStat_period_2018"))); m_zeeNom->SetDirectory(nullptr); m_zeeNom_data2017.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2022_R21_Precision/alphaZee_errStat_period_2017"))); m_zeeNom_data2017->SetDirectory(nullptr); m_zeeNom_data2016.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2022_R21_Precision/alphaZee_errStat_period_2016"))); m_zeeNom_data2016->SetDirectory(nullptr); m_zeeNom_data2015.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2022_R21_Precision/alphaZee_errStat_period_2015"))); m_zeeNom_data2015->SetDirectory(nullptr); @@ -766,122 +776,131 @@ namespace AtlasRoot { m_zeeFwdk.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalk"))); m_zeeFwdk->SetDirectory(nullptr); m_zeeFwdb.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalb"))); m_zeeFwdb->SetDirectory(nullptr); } - - - else{ - m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_PRE/alphaZee_errStat_period_2016"))); m_zeeNom->SetDirectory(nullptr); + else { + m_zeeNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_PRE/alphaZee_errStat_period_2016"))); m_zeeNom->SetDirectory(nullptr); //SAME HISTO FOR 2015 FOR NOW m_zeeNom_data2015.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_PRE/alphaZee_errStat_period_2016"))); m_zeeNom_data2015->SetDirectory(nullptr); } - if(m_esmodel == egEnergyCorr::es2017){ - m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); + + if(m_esmodel == egEnergyCorr::es2017) { + m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); } - else if(m_esmodel == egEnergyCorr::es2017_summer_final){ + else if (m_esmodel == egEnergyCorr::es2017_summer_final) { m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); } - else if(m_esmodel == egEnergyCorr::es2015_5TeV){ - m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2015_5TeV/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); + else if (m_esmodel == egEnergyCorr::es2015_5TeV) { + m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2015_5TeV/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); } else if (m_esmodel == egEnergyCorr::es2017_R21_v0) { m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer_final/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); } else if (m_esmodel == egEnergyCorr::es2017_R21_v1) { - m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_v1/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); + m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_v1/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); } else if (m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1) { m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_R21_ofc0_v1/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); } - else if (m_esmodel == egEnergyCorr::es2018_R21_v0 or m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0) { - m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v0/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); + else if (m_esmodel == egEnergyCorr::es2018_R21_v0 or + m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0) { + m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v0/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); } - else if (m_esmodel == egEnergyCorr::es2018_R21_v1 or m_esmodel == egEnergyCorr::es2022_R21_Precision) { - m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v1/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); + else if (m_esmodel == egEnergyCorr::es2018_R21_v1 or + m_esmodel == egEnergyCorr::es2022_R21_Precision) { + m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2018_R21_v1/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); } - else{ - m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); + else { + m_zeeSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Scales/es2017_summer/alphaZee_errSyst"))); m_zeeSyst->SetDirectory(nullptr); } m_uA2MeV_2015_first2weeks_correction = nullptr; if(m_esmodel == egEnergyCorr::es2017){ m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017/ctZee_errStat"))); m_resNom->SetDirectory(nullptr);} - else if(m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2015_5TeV){ + else if(m_esmodel == egEnergyCorr::es2017_summer or + m_esmodel == egEnergyCorr::es2017_summer_improved or + m_esmodel == egEnergyCorr::es2015_5TeV) { m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_summer/ctZee_errStat"))); m_resNom->SetDirectory(nullptr);} else if(m_esmodel == egEnergyCorr::es2017_summer_final) { - m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_summer_final/ctZee_errStat"))); m_resNom->SetDirectory(nullptr);} + m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_summer_final/ctZee_errStat"))); m_resNom->SetDirectory(nullptr);} else if (m_esmodel==egEnergyCorr::es2017_R21_v0) { - m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_R21_v0/ctZee_errStat"))); m_resNom->SetDirectory(nullptr);} + m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_R21_v0/ctZee_errStat"))); m_resNom->SetDirectory(nullptr);} else if (m_esmodel==egEnergyCorr::es2017_R21_v1) { m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_R21_v1/ctZee_errStat"))); m_resNom->SetDirectory(nullptr);} else if (m_esmodel==egEnergyCorr::es2017_R21_ofc0_v1) { - m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_R21_ofc0_v1/ctZee_errStat"))); m_resNom->SetDirectory(nullptr);} + m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_R21_ofc0_v1/ctZee_errStat"))); m_resNom->SetDirectory(nullptr);} else if (m_esmodel==egEnergyCorr::es2018_R21_v0) { m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2018_R21_v0/ctZee_errStat"))); m_resNom->SetDirectory(nullptr);} else if (m_esmodel==egEnergyCorr::es2018_R21_lowmu_v0) { - m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2018_R21_lowmu_v0/ctZee_errStat"))); m_resNom->SetDirectory(nullptr); + m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2018_R21_lowmu_v0/ctZee_errStat"))); m_resNom->SetDirectory(nullptr); m_resNom_datalowmu.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2018_R21_lowmu_v0/ctZee_errStat_5TeV"))); m_resNom_datalowmu->SetDirectory(nullptr);} else if (m_esmodel==egEnergyCorr::es2018_R21_v1) { m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2018_R21_v1/ctZee_errStat"))); m_resNom->SetDirectory(nullptr); } else if (m_esmodel == egEnergyCorr::es2022_R21_Precision) { - m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2022_R21_Precision/ctZee_errStat"))); m_resNom->SetDirectory(nullptr); } + m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2022_R21_Precision/ctZee_errStat"))); m_resNom->SetDirectory(nullptr); } else{ - m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_R21_PRE/ctZee_errStat"))); m_resNom->SetDirectory(nullptr); + m_resNom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_R21_PRE/ctZee_errStat"))); m_resNom->SetDirectory(nullptr); } - if(m_esmodel == egEnergyCorr::es2017){ - m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); + if (m_esmodel == egEnergyCorr::es2017) { + m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); } - else if(m_esmodel == egEnergyCorr::es2017_summer_final){ - m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_summer_final/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); + else if (m_esmodel == egEnergyCorr::es2017_summer_final) { + m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_summer_final/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); } - else if(m_esmodel == egEnergyCorr::es2015_5TeV){ - m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2015_5TeV/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); + else if (m_esmodel == egEnergyCorr::es2015_5TeV) { + m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2015_5TeV/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); } else if (m_esmodel == egEnergyCorr::es2017_R21_v0) { - m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_summer_final/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); + m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_summer_final/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); } else if (m_esmodel == egEnergyCorr::es2017_R21_v1) { m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_R21_v1/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); } else if (m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1) { - m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_R21_ofc0_v1/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); + m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_R21_ofc0_v1/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); } - else if (m_esmodel == egEnergyCorr::es2018_R21_v0 or m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 ) { + else if (m_esmodel == egEnergyCorr::es2018_R21_v0 or + m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 ) { m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2018_R21_v0/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); } - else if (m_esmodel == egEnergyCorr::es2018_R21_v1 or m_esmodel == egEnergyCorr::es2022_R21_Precision) { + else if (m_esmodel == egEnergyCorr::es2018_R21_v1 or + m_esmodel == egEnergyCorr::es2022_R21_Precision) { m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2018_R21_v1/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); } - else{ + else { m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_summer/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); } //else{ //m_resSyst.reset( dynamic_cast< TH1* >( m_rootFile->Get("Resolution/es2017_summer_improved/ctZee_errSyst"))); m_resSyst->SetDirectory(nullptr); //} - m_pedestals_es2017.reset( dynamic_cast< TH1* >(m_rootFile->Get("Pedestals/es2017/pedestals"))); m_pedestals_es2017->SetDirectory(nullptr); + m_pedestals_es2017.reset( dynamic_cast< TH1* >(m_rootFile->Get("Pedestals/es2017/pedestals"))); m_pedestals_es2017->SetDirectory(nullptr); - m_dX_ID_Nom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Material/DX0_ConfigA"))); m_dX_ID_Nom->SetDirectory(nullptr); + m_dX_ID_Nom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Material/DX0_ConfigA"))); m_dX_ID_Nom->SetDirectory(nullptr); m_dX_IPPS_Nom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errUncor"))); m_dX_IPPS_Nom->SetDirectory(nullptr); m_dX_IPPS_LAr.reset( dynamic_cast< TH1* >( m_rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errLAr"))); m_dX_IPPS_LAr->SetDirectory(nullptr); m_dX_IPAcc_Nom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errUncor"))); m_dX_IPAcc_Nom->SetDirectory(nullptr); m_dX_IPAcc_LAr.reset( dynamic_cast< TH1* >( m_rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errLAr"))); m_dX_IPAcc_LAr->SetDirectory(nullptr); - m_dX_IPAcc_G4.reset( dynamic_cast< TH1* >( m_rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errG4"))); m_dX_IPAcc_G4->SetDirectory(nullptr); + m_dX_IPAcc_G4.reset( dynamic_cast< TH1* >( m_rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errG4"))); m_dX_IPAcc_G4->SetDirectory(nullptr); m_dX_IPAcc_GL1.reset( dynamic_cast< TH1* >( m_rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errGL1"))); m_dX_IPAcc_GL1->SetDirectory(nullptr); m_dX_PSAcc_Nom.reset( dynamic_cast< TH1* >( m_rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errUncor"))); m_dX_PSAcc_Nom->SetDirectory(nullptr); m_dX_PSAcc_LAr.reset( dynamic_cast< TH1* >( m_rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errLAr"))); m_dX_PSAcc_LAr->SetDirectory(nullptr); - m_dX_PSAcc_G4.reset( dynamic_cast< TH1* >( m_rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errG4"))); m_dX_PSAcc_G4->SetDirectory(nullptr); + m_dX_PSAcc_G4.reset( dynamic_cast< TH1* >( m_rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errG4"))); m_dX_PSAcc_G4->SetDirectory(nullptr); - m_convRadius.reset( dynamic_cast< TH1* >( m_rootFile->Get("Conversions/es2012c/convRadiusMigrations"))); m_convRadius->SetDirectory(nullptr); - if(m_esmodel == egEnergyCorr::es2017){ - m_convFakeRate.reset( dynamic_cast< TH1* >( m_rootFile->Get("Conversions/es2012c/convFakeRate"))); m_convFakeRate->SetDirectory(nullptr); - m_convRecoEfficiency.reset( dynamic_cast< TH1* >( m_rootFile->Get("Conversions/es2012c/convRecoEfficiency"))); m_convRecoEfficiency->SetDirectory(nullptr); + m_convRadius.reset( dynamic_cast< TH1* >( m_rootFile->Get("Conversions/es2012c/convRadiusMigrations"))); m_convRadius->SetDirectory(nullptr); + if (m_esmodel == egEnergyCorr::es2017) { + m_convFakeRate.reset( dynamic_cast< TH1* >( m_rootFile->Get("Conversions/es2012c/convFakeRate"))); m_convFakeRate->SetDirectory(nullptr); + m_convRecoEfficiency.reset( dynamic_cast< TH1* >( m_rootFile->Get("Conversions/es2012c/convRecoEfficiency"))); m_convRecoEfficiency->SetDirectory(nullptr); } - else{ - m_convFakeRate.reset( dynamic_cast< TH1* >( m_rootFile->Get("Conversions/es2017_summer/convFakeRate"))); m_convFakeRate->SetDirectory(nullptr); - m_convRecoEfficiency.reset( dynamic_cast< TH1* >( m_rootFile->Get("Conversions/es2017_summer/convRecoEfficiency"))); m_convRecoEfficiency->SetDirectory(nullptr); + else if (m_esmodel == egEnergyCorr::es2022_R21_Precision) { + m_convFakeRate.reset( dynamic_cast< TH1* >( m_rootFile->Get("Conversions/es2022_R21_Precision/convFakeRate"))); m_convFakeRate->SetDirectory(nullptr); + m_convRecoEfficiency.reset( dynamic_cast< TH1* >( m_rootFile->Get("Conversions/es2022_R21_Precision/convRecoEfficiency"))); m_convRecoEfficiency->SetDirectory(nullptr); + } + else { + m_convFakeRate.reset( dynamic_cast< TH1* >( m_rootFile->Get("Conversions/es2017_summer/convFakeRate"))); m_convFakeRate->SetDirectory(nullptr); + m_convRecoEfficiency.reset( dynamic_cast< TH1* >( m_rootFile->Get("Conversions/es2017_summer/convRecoEfficiency"))); m_convRecoEfficiency->SetDirectory(nullptr); } // TODO: change path when moving to calibarea @@ -901,7 +920,6 @@ namespace AtlasRoot { //similar case for wtots1 const std::string filename_wstot = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/wstot_related_syst.root"); - TFile file_wstot(filename_wstot.c_str()); m_wstot_slope_A_data.reset( dynamic_cast< TH1* >( file_wstot.Get("A_data"))); m_wstot_slope_A_data->SetDirectory(nullptr); m_wstot_slope_B_MC.reset( dynamic_cast< TH1* >( file_wstot.Get("B_mc"))); m_wstot_slope_B_MC->SetDirectory(nullptr); @@ -921,8 +939,12 @@ namespace AtlasRoot { m_begRunNumber = 252604; m_endRunNumber = 314199; - if (m_esmodel == egEnergyCorr::es2017_R21_v1 || m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 || - m_esmodel == egEnergyCorr::es2018_R21_v0 || m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || m_esmodel == egEnergyCorr::es2018_R21_v1 || m_esmodel == egEnergyCorr::es2022_R21_Precision) { + if (m_esmodel == egEnergyCorr::es2017_R21_v1 || + m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 || + m_esmodel == egEnergyCorr::es2018_R21_v0 || + m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || + m_esmodel == egEnergyCorr::es2018_R21_v1 || + m_esmodel == egEnergyCorr::es2022_R21_Precision) { m_G4OverAFII_resolution_electron.reset( dynamic_cast< TH2* >( m_rootFile->Get("FastSim/es2017_v1/resol_Af2ToG4_elec_rel21"))); m_G4OverAFII_resolution_unconverted.reset( dynamic_cast< TH2* >( m_rootFile->Get("FastSim/es2017_v1/resol_Af2ToG4_unco_rel21"))); m_G4OverAFII_resolution_converted.reset( dynamic_cast< TH2* >( m_rootFile->Get("FastSim/es2017_v1/resol_Af2ToG4_conv_rel21"))); @@ -945,8 +967,10 @@ namespace AtlasRoot { m_gain_tool = nullptr; std::string gain_tool_run_2_filename; - if (m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or - m_esmodel == egEnergyCorr::es2017_R21_PRE or m_esmodel == egEnergyCorr::es2015_5TeV ){ + if (m_esmodel == egEnergyCorr::es2017 or + m_esmodel == egEnergyCorr::es2017_summer or + m_esmodel == egEnergyCorr::es2017_R21_PRE or + m_esmodel == egEnergyCorr::es2015_5TeV) { gain_tool_run_2_filename = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v11/gain_uncertainty_specialRun.root"); } else if (m_esmodel == egEnergyCorr::es2022_R21_Precision) { @@ -963,9 +987,9 @@ namespace AtlasRoot { m_use_temp_correction201215 = false; m_use_temp_correction201516 = false; - } + } // end rel21 settings - else if ( m_esmodel==egEnergyCorr::es2015_day0_3percent ) { + else if (m_esmodel==egEnergyCorr::es2015_day0_3percent ) { m_use_new_resolution_model = true; m_resolution_tool.reset(new eg_resolution("run2_pre")); @@ -1026,11 +1050,23 @@ namespace AtlasRoot { } - if (m_esmodel == egEnergyCorr::es2015cPRE or m_esmodel == egEnergyCorr::es2015cPRE_res_improved or - m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE or m_esmodel == egEnergyCorr::es2017 - or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_summer_final - or m_esmodel == egEnergyCorr::es2017_R21_v0 or m_esmodel == egEnergyCorr::es2017_R21_v1 or m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 - or m_esmodel == egEnergyCorr::es2017_R21_PRE or m_esmodel == egEnergyCorr::es2015_5TeV or m_esmodel == egEnergyCorr::es2018_R21_v0 or m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 or m_esmodel == egEnergyCorr::es2018_R21_v1 or m_esmodel == egEnergyCorr::es2022_R21_Precision) + if (m_esmodel == egEnergyCorr::es2015cPRE or + m_esmodel == egEnergyCorr::es2015cPRE_res_improved or + m_esmodel == egEnergyCorr::es2015c_summer or + m_esmodel == egEnergyCorr::es2016PRE or + m_esmodel == egEnergyCorr::es2017 or + m_esmodel == egEnergyCorr::es2017_summer or + m_esmodel == egEnergyCorr::es2017_summer_improved or + m_esmodel == egEnergyCorr::es2017_summer_final or + m_esmodel == egEnergyCorr::es2017_R21_v0 or + m_esmodel == egEnergyCorr::es2017_R21_v1 or + m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 or + m_esmodel == egEnergyCorr::es2017_R21_PRE or + m_esmodel == egEnergyCorr::es2015_5TeV or + m_esmodel == egEnergyCorr::es2018_R21_v0 or + m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 or + m_esmodel == egEnergyCorr::es2018_R21_v1 or + m_esmodel == egEnergyCorr::es2022_R21_Precision) { // E4 systematics m_E4ElectronEtaBins.reset( dynamic_cast< TAxis* >( m_rootFile->Get("E4Recalibration/v4/electron_eta_axis"))); @@ -1043,15 +1079,24 @@ namespace AtlasRoot { } // ... PS and S12 recalibration curves - if (m_esmodel == egEnergyCorr::es2015PRE or m_esmodel == egEnergyCorr::es2015PRE_res_improved or - m_esmodel == egEnergyCorr::es2015cPRE or m_esmodel == egEnergyCorr::es2015cPRE_res_improved or - m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE or - m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or - m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_summer_final or - m_esmodel == egEnergyCorr::es2017_R21_v0 or m_esmodel == egEnergyCorr::es2017_R21_v1 or - m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 or m_esmodel == egEnergyCorr::es2017_R21_PRE or - m_esmodel == egEnergyCorr::es2015_5TeV or m_esmodel == egEnergyCorr::es2018_R21_v0 or - m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 or m_esmodel == egEnergyCorr::es2018_R21_v1) { + if (m_esmodel == egEnergyCorr::es2015PRE or + m_esmodel == egEnergyCorr::es2015PRE_res_improved or + m_esmodel == egEnergyCorr::es2015cPRE or + m_esmodel == egEnergyCorr::es2015cPRE_res_improved or + m_esmodel == egEnergyCorr::es2015c_summer or + m_esmodel == egEnergyCorr::es2016PRE or + m_esmodel == egEnergyCorr::es2017 or + m_esmodel == egEnergyCorr::es2017_summer or + m_esmodel == egEnergyCorr::es2017_summer_improved or + m_esmodel == egEnergyCorr::es2017_summer_final or + m_esmodel == egEnergyCorr::es2017_R21_v0 or + m_esmodel == egEnergyCorr::es2017_R21_v1 or + m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 or + m_esmodel == egEnergyCorr::es2017_R21_PRE or + m_esmodel == egEnergyCorr::es2015_5TeV or + m_esmodel == egEnergyCorr::es2018_R21_v0 or + m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 or + m_esmodel == egEnergyCorr::es2018_R21_v1) { m_psElectronEtaBins.reset( dynamic_cast< TAxis* >( m_rootFile->Get("PSRecalibration/es2015PRE/ElectronAxis"))); m_psElectronGraphs.reset( dynamic_cast< TList* >( m_rootFile->Get("PSRecalibration/es2015PRE/ElectronBiasPS")));m_psElectronGraphs->SetOwner(); @@ -1137,9 +1182,12 @@ namespace AtlasRoot { m_matElectronCstTerm.emplace_back(std::unique_ptr<TH1>( (TH1*) m_rootFile->Get("Material/electronCstTerm_ConfigGp") )); m_matElectronCstTerm.back()->SetDirectory(nullptr); - if (m_esmodel==egEnergyCorr::es2017_R21_v1 || m_esmodel==egEnergyCorr::es2017_R21_ofc0_v1 || - m_esmodel == egEnergyCorr::es2018_R21_v0 || m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || - m_esmodel == egEnergyCorr::es2018_R21_v1 or m_esmodel == egEnergyCorr::es2022_R21_Precision) { + if (m_esmodel == egEnergyCorr::es2017_R21_v1 or + m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 or + m_esmodel == egEnergyCorr::es2018_R21_v0 or + m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 or + m_esmodel == egEnergyCorr::es2018_R21_v1 or + m_esmodel == egEnergyCorr::es2022_R21_Precision) { // update dX0 plots for distorted geometry for case A, EL, FMX and N m_matX0Additions.emplace_back(std::unique_ptr<TH1>( (TH1*) m_rootFile->Get("Material_rel21/DX0_ConfigA") )); m_matX0Additions.back()->SetDirectory(nullptr); @@ -1180,12 +1228,14 @@ namespace AtlasRoot { mat->SetOwner(); } - // ... new material distortions from release 21 parameterizations - if (m_esmodel==egEnergyCorr::es2017_R21_v1 || m_esmodel==egEnergyCorr::es2017_R21_ofc0_v1 || - m_esmodel == egEnergyCorr::es2018_R21_v0 || m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || - m_esmodel == egEnergyCorr::es2018_R21_v1 || m_esmodel == egEnergyCorr::es2022_R21_Precision ) { + if (m_esmodel == egEnergyCorr::es2017_R21_v1 || + m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 || + m_esmodel == egEnergyCorr::es2018_R21_v0 || + m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || + m_esmodel == egEnergyCorr::es2018_R21_v1 || + m_esmodel == egEnergyCorr::es2022_R21_Precision) { m_electronBias_ConfigA.reset( dynamic_cast< TH2* >( m_rootFile->Get("Material_rel21/electronBias_ConfigA"))); m_electronBias_ConfigA->SetDirectory(nullptr); m_electronBias_ConfigEpLp.reset( dynamic_cast< TH2* >( m_rootFile->Get("Material_rel21/electronBias_ConfigEpLp"))); m_electronBias_ConfigEpLp->SetDirectory(nullptr); m_electronBias_ConfigFpMX.reset( dynamic_cast< TH2* >( m_rootFile->Get("Material_rel21/electronBias_ConfigFpMX"))); m_electronBias_ConfigFpMX->SetDirectory(nullptr); @@ -1206,28 +1256,35 @@ namespace AtlasRoot { m_convertedBias_ConfigPP0.reset( dynamic_cast< TH2* >( m_rootFile->Get("Material_rel21/convertedBias_ConfigPP0"))); m_convertedBias_ConfigPP0->SetDirectory(nullptr); } - - // ... Fastsim to Fullsim corrections - if (m_esmodel == egEnergyCorr::es2015PRE or m_esmodel == egEnergyCorr::es2015PRE_res_improved or - m_esmodel == egEnergyCorr::es2015cPRE or m_esmodel == egEnergyCorr::es2015cPRE_res_improved or - m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE) { + if (m_esmodel == egEnergyCorr::es2015PRE or + m_esmodel == egEnergyCorr::es2015PRE_res_improved or + m_esmodel == egEnergyCorr::es2015cPRE or + m_esmodel == egEnergyCorr::es2015cPRE_res_improved or + m_esmodel == egEnergyCorr::es2015c_summer or + m_esmodel == egEnergyCorr::es2016PRE) { m_G4OverAFII_electron.reset( dynamic_cast< TH1* >( m_rootFile->Get("FastSim/es2015/el_scale_full_fast_peak_gaussian"))); m_G4OverAFII_electron->SetDirectory(nullptr); m_G4OverAFII_unconverted.reset( dynamic_cast< TH1* >( m_rootFile->Get("FastSim/es2015/ph_unconv_scale_full_fast_peak_gaussian"))); m_G4OverAFII_unconverted->SetDirectory(nullptr); m_G4OverAFII_converted.reset( dynamic_cast< TH1* >( m_rootFile->Get("FastSim/es2015/ph_conv_scale_full_fast_peak_gaussian"))); m_G4OverAFII_converted->SetDirectory(nullptr); } - else if (m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or - m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_summer_final or - m_esmodel == egEnergyCorr::es2017_R21_PRE or m_esmodel == egEnergyCorr::es2015_5TeV or + else if (m_esmodel == egEnergyCorr::es2017 or + m_esmodel == egEnergyCorr::es2017_summer or + m_esmodel == egEnergyCorr::es2017_summer_improved or + m_esmodel == egEnergyCorr::es2017_summer_final or + m_esmodel == egEnergyCorr::es2017_R21_PRE or + m_esmodel == egEnergyCorr::es2015_5TeV or m_esmodel == egEnergyCorr::es2017_R21_v0) { m_G4OverAFII_electron.reset( dynamic_cast< TH1* >( m_rootFile->Get("FastSim/es2017/el_scale_full_fast_peak_gaussian"))); m_G4OverAFII_electron->SetDirectory(nullptr); m_G4OverAFII_unconverted.reset( dynamic_cast< TH1* >( m_rootFile->Get("FastSim/es2017/ph_unconv_scale_full_fast_peak_gaussian"))); m_G4OverAFII_unconverted->SetDirectory(nullptr); m_G4OverAFII_converted.reset( dynamic_cast< TH1* >( m_rootFile->Get("FastSim/es2017/ph_conv_scale_full_fast_peak_gaussian"))); m_G4OverAFII_converted->SetDirectory(nullptr); } - else if (m_esmodel == egEnergyCorr::es2017_R21_v1 || m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 || - m_esmodel == egEnergyCorr::es2018_R21_v0 || m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || - m_esmodel == egEnergyCorr::es2018_R21_v1 || m_esmodel == egEnergyCorr::es2022_R21_Precision) { + else if (m_esmodel == egEnergyCorr::es2017_R21_v1 || + m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 || + m_esmodel == egEnergyCorr::es2018_R21_v0 || + m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || + m_esmodel == egEnergyCorr::es2018_R21_v1 || + m_esmodel == egEnergyCorr::es2022_R21_Precision) { m_G4OverAFII_electron_2D.reset( dynamic_cast< TH2* >( m_rootFile->Get("FastSim/es2017_v1/scale_Af2ToG4_elec_rel21"))); m_G4OverAFII_electron_2D->SetDirectory(nullptr); m_G4OverAFII_unconverted_2D.reset( dynamic_cast< TH2* >( m_rootFile->Get("FastSim/es2017_v1/scale_Af2ToG4_unco_rel21"))); m_G4OverAFII_unconverted_2D->SetDirectory(nullptr); m_G4OverAFII_converted_2D.reset( dynamic_cast< TH2* >( m_rootFile->Get("FastSim/es2017_v1/scale_Af2ToG4_conv_rel21"))); m_G4OverAFII_converted_2D->SetDirectory(nullptr); @@ -1235,17 +1292,22 @@ namespace AtlasRoot { else { // run 1 m_G4OverAFII_electron.reset( dynamic_cast< TH1* >( m_rootFile->Get("FastSim/hG4OverAF"))); m_G4OverAFII_electron->SetDirectory(nullptr); } - m_G4OverFrSh.reset( dynamic_cast< TH1* >( m_rootFile->Get("FastSim/hG4OverFS"))); m_G4OverFrSh->SetDirectory(nullptr); // ... Leakage systematics - if(m_esmodel != egEnergyCorr::es2017_summer and m_esmodel != egEnergyCorr::es2017_summer_improved and - m_esmodel != egEnergyCorr::es2017_summer_final and m_esmodel != egEnergyCorr::es2017_R21_PRE and - m_esmodel != egEnergyCorr::es2015_5TeV and m_esmodel != egEnergyCorr::es2017_R21_v0 and - m_esmodel != egEnergyCorr::es2017_R21_v1 and m_esmodel != egEnergyCorr::es2017_R21_ofc0_v1 and - m_esmodel != egEnergyCorr::es2018_R21_v0 and m_esmodel != egEnergyCorr::es2018_R21_lowmu_v0 and - m_esmodel != egEnergyCorr::es2018_R21_v1 and m_esmodel != egEnergyCorr::es2022_R21_Precision) { + if (m_esmodel != egEnergyCorr::es2017_summer and + m_esmodel != egEnergyCorr::es2017_summer_improved and + m_esmodel != egEnergyCorr::es2017_summer_final and + m_esmodel != egEnergyCorr::es2017_R21_PRE and + m_esmodel != egEnergyCorr::es2015_5TeV and + m_esmodel != egEnergyCorr::es2017_R21_v0 and + m_esmodel != egEnergyCorr::es2017_R21_v1 and + m_esmodel != egEnergyCorr::es2017_R21_ofc0_v1 and + m_esmodel != egEnergyCorr::es2018_R21_v0 and + m_esmodel != egEnergyCorr::es2018_R21_lowmu_v0 and + m_esmodel != egEnergyCorr::es2018_R21_v1 and + m_esmodel != egEnergyCorr::es2022_R21_Precision) { m_leakageConverted.reset( dynamic_cast< TH1* >( m_rootFile->Get("Leakage/LeakageDiffConverted"))); m_leakageUnconverted.reset( dynamic_cast< TH1* >( m_rootFile->Get("Leakage/LeakageDiffUnconverted"))); } @@ -1276,16 +1338,15 @@ namespace AtlasRoot { } - // User interface // universal compact interface to getCorrectedEnergy(...) - double egammaEnergyCorrectionTool::getCorrectedMomentum( PATCore::ParticleDataType::DataType dataType, - PATCore::ParticleType::Type ptype, - double momentum, - double trk_eta, - egEnergyCorr::Scale::Variation scaleVar, - double varSF ) const { + double egammaEnergyCorrectionTool::getCorrectedMomentum(PATCore::ParticleDataType::DataType dataType, + PATCore::ParticleType::Type ptype, + double momentum, + double trk_eta, + egEnergyCorr::Scale::Variation scaleVar, + double varSF) const { double correctedMomentum = momentum; double aeta = fabs(trk_eta); @@ -1305,18 +1366,18 @@ namespace AtlasRoot { // This method handles the main switches between data and the various MC flavours. // Called internally by getCorrectedEnergy(...) - double egammaEnergyCorrectionTool::getCorrectedEnergy( unsigned int runnumber, - PATCore::ParticleDataType::DataType dataType, - PATCore::ParticleType::Type ptype, - double cl_eta, - double cl_etaCalo, - double energy, - double energyS2, - double eraw, - egEnergyCorr::Scale::Variation scaleVar, - egEnergyCorr::Resolution::Variation resVar, - egEnergyCorr::Resolution::resolutionType resType, - double varSF ) const { + double egammaEnergyCorrectionTool::getCorrectedEnergy(unsigned int runnumber, + PATCore::ParticleDataType::DataType dataType, + PATCore::ParticleType::Type ptype, + double cl_eta, + double cl_etaCalo, + double energy, + double energyS2, + double eraw, + egEnergyCorr::Scale::Variation scaleVar, + egEnergyCorr::Resolution::Variation resVar, + egEnergyCorr::Resolution::resolutionType resType, + double varSF) const { double fullyCorrectedEnergy = energy; // Correct fast sim flavours @@ -1366,21 +1427,27 @@ namespace AtlasRoot { // AF2 systematics (this will not be in the sum of all other NP in the 1 NP model) if (dataType == PATCore::ParticleDataType::Fast && - (m_esmodel== egEnergyCorr::es2017_R21_v0 || m_esmodel== egEnergyCorr::es2017_R21_v1 || - m_esmodel== egEnergyCorr::es2017_R21_ofc0_v1 || m_esmodel == egEnergyCorr::es2018_R21_v0 || - m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || m_esmodel == egEnergyCorr::es2018_R21_v1 || + (m_esmodel == egEnergyCorr::es2017_R21_v0 || + m_esmodel == egEnergyCorr::es2017_R21_v1 || + m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 || + m_esmodel == egEnergyCorr::es2018_R21_v0 || + m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || + m_esmodel == egEnergyCorr::es2018_R21_v1 || m_esmodel == egEnergyCorr::es2022_R21_Precision) ) { if (scaleVar==egEnergyCorr::Scale::af2Up or scaleVar==egEnergyCorr::Scale::af2Down) { double daAF2=0.; - if (m_esmodel== egEnergyCorr::es2017_R21_v0) { - if (scaleVar==egEnergyCorr::Scale::af2Up) daAF2 = 0.005; - if (scaleVar==egEnergyCorr::Scale::af2Down) daAF2 = -0.005; + if (m_esmodel == egEnergyCorr::es2017_R21_v0) { + if (scaleVar == egEnergyCorr::Scale::af2Up) daAF2 = 0.005; + if (scaleVar == egEnergyCorr::Scale::af2Down) daAF2 = -0.005; } - if (m_esmodel== egEnergyCorr::es2017_R21_v1 || m_esmodel== egEnergyCorr::es2017_R21_ofc0_v1 || - m_esmodel == egEnergyCorr::es2018_R21_v0 || m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || - m_esmodel == egEnergyCorr::es2018_R21_v1 || m_esmodel == egEnergyCorr::es2022_R21_Precision) { - if (scaleVar==egEnergyCorr::Scale::af2Up) daAF2 = 0.001; - if (scaleVar==egEnergyCorr::Scale::af2Down) daAF2 = -0.001; + if (m_esmodel == egEnergyCorr::es2017_R21_v1 || + m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 || + m_esmodel == egEnergyCorr::es2018_R21_v0 || + m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || + m_esmodel == egEnergyCorr::es2018_R21_v1 || + m_esmodel == egEnergyCorr::es2022_R21_Precision) { + if (scaleVar == egEnergyCorr::Scale::af2Up) daAF2 = 0.001; + if (scaleVar == egEnergyCorr::Scale::af2Down) daAF2 = -0.001; } fullyCorrectedEnergy *= ( 1 + daAF2); } @@ -1448,7 +1515,7 @@ namespace AtlasRoot { //wtots1 contribution double daWtots1 = 0.; - if ((m_esmodel==egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or + if ((m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_summer_final or m_esmodel == egEnergyCorr::es2017_R21_PRE or m_esmodel == egEnergyCorr::es2015_5TeV or m_esmodel == egEnergyCorr::es2017_R21_v0 or m_esmodel == egEnergyCorr::es2017_R21_v1 or @@ -1462,9 +1529,9 @@ namespace AtlasRoot { } // ... Presampler contribution - if( var==egEnergyCorr::Scale::PSUp || var==egEnergyCorr::Scale::PSDown || - var==egEnergyCorr::Scale::PSb12Up || var==egEnergyCorr::Scale::PSb12Down || - var==egEnergyCorr::Scale::LArElecUnconvUp || var==egEnergyCorr::Scale::LArElecUnconvDown ) { + if( var == egEnergyCorr::Scale::PSUp || var == egEnergyCorr::Scale::PSDown || + var == egEnergyCorr::Scale::PSb12Up || var == egEnergyCorr::Scale::PSb12Down || + var == egEnergyCorr::Scale::LArElecUnconvUp || var == egEnergyCorr::Scale::LArElecUnconvDown ) { daPS = getLayerUncertainty( 0, cl_eta, var, varSF ); linPS = getLayerNonLinearity( 0, cl_eta, energy, ptype ) @@ -1473,9 +1540,9 @@ namespace AtlasRoot { } // ... S1 / S2 contribution - if (var == egEnergyCorr::Scale::S12Up or var==egEnergyCorr::Scale::S12Down or - var == egEnergyCorr::Scale::LArCalibUp or var==egEnergyCorr::Scale::LArCalibDown or - var == egEnergyCorr::Scale::LArCalibExtra2015PreUp or var == egEnergyCorr::Scale::LArCalibExtra2015PreDown or + if (var == egEnergyCorr::Scale::S12Up or var == egEnergyCorr::Scale::S12Down or + var == egEnergyCorr::Scale::LArCalibUp or var == egEnergyCorr::Scale::LArCalibDown or + var == egEnergyCorr::Scale::LArCalibExtra2015PreUp or var == egEnergyCorr::Scale::LArCalibExtra2015PreDown or var == egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Up or var == egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Down) { daS12 = getLayerUncertainty(1, cl_eta, var, varSF); @@ -1524,7 +1591,7 @@ namespace AtlasRoot { // L1 Gain switch contribution double daL1GainSwitch = 0.; - if ( var==egEnergyCorr::Scale::L1GainUp || var==egEnergyCorr::Scale::L1GainDown ) { + if (var == egEnergyCorr::Scale::L1GainUp || var == egEnergyCorr::Scale::L1GainDown) { int eg_e1hg_ptype; if( ptype==PATCore::ParticleType::Electron ) @@ -1537,24 +1604,23 @@ namespace AtlasRoot { return -1; daL1GainSwitch = m_e1hg_tool->getAlpha(eg_e1hg_ptype, energy, cl_eta, true); - if( var==egEnergyCorr::Scale::L1GainDown ) + if( var == egEnergyCorr::Scale::L1GainDown ) daL1GainSwitch = -daL1GainSwitch; } - // L2 Gain switch contribution double daL2GainSwitch = 0.; - if ( var==egEnergyCorr::Scale::L2GainUp || var==egEnergyCorr::Scale::L2GainDown ) { + if (var == egEnergyCorr::Scale::L2GainUp || var == egEnergyCorr::Scale::L2GainDown) { if (m_gain_tool) { // recipe for run1 if (!(fabs(cl_eta) < 1.52 and fabs(cl_eta) > 1.37) and fabs(cl_eta) < 2.4) { - double evar = m_gain_tool->CorrectionGainTool(cl_eta, energy/GeV, energyS2/GeV, ptype); - double meanES2 = m_zeeES2Profile->GetBinContent(m_zeeES2Profile->FindBin(cl_eta)); // in GeV already - double eref = m_gain_tool->CorrectionGainTool(cl_eta, meanE/GeV, meanES2, PATCore::ParticleType::Electron ); - daL2GainSwitch = evar/energy - eref/meanE; - if( var==egEnergyCorr::Scale::L2GainDown ) - daL2GainSwitch = -daL2GainSwitch; + double evar = m_gain_tool->CorrectionGainTool(cl_eta, energy/GeV, energyS2/GeV, ptype); + double meanES2 = m_zeeES2Profile->GetBinContent(m_zeeES2Profile->FindBin(cl_eta)); // in GeV already + double eref = m_gain_tool->CorrectionGainTool(cl_eta, meanE/GeV, meanES2, PATCore::ParticleType::Electron ); + daL2GainSwitch = evar/energy - eref/meanE; + if( var==egEnergyCorr::Scale::L2GainDown ) + daL2GainSwitch = -daL2GainSwitch; } } else if (m_gain_tool_run2) { // recipe for run 2, see ATLASEG-44 @@ -1611,16 +1677,19 @@ namespace AtlasRoot { double daConvSyst = getAlphaConvSyst(cl_eta, energy, ptype, var, varSF); // topo cluster threshold systematics for release 21 - double daTopoCluster=0; - if ((var==egEnergyCorr::Scale::topoClusterThresUp || var==egEnergyCorr::Scale::topoClusterThresDown) && - (m_esmodel== egEnergyCorr::es2017_R21_v0 || m_esmodel== egEnergyCorr::es2017_R21_v1 || - m_esmodel== egEnergyCorr::es2017_R21_ofc0_v1 || m_esmodel == egEnergyCorr::es2018_R21_v0 || - m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || m_esmodel == egEnergyCorr::es2018_R21_v1 || - m_esmodel == egEnergyCorr::es2022_R21_Precision)) { - static const double Et0 = 10000.; - // Effect taken as 10**-3/(Et/10GeV) - order of magniture from https://indico.cern.ch/event/669895/contributions/2745266/attachments/1535612/2405452/slides.pdf - if (var==egEnergyCorr::Scale::topoClusterThresUp) daTopoCluster = 1e-3*(1./(Et/Et0)-1./(meanET/Et0)); - if (var==egEnergyCorr::Scale::topoClusterThresDown) daTopoCluster = -1e-3*(1./(Et/Et0)-1./(meanET/Et0)); + double daTopoCluster = 0; + if ((var == egEnergyCorr::Scale::topoClusterThresUp || var == egEnergyCorr::Scale::topoClusterThresDown) && + (m_esmodel == egEnergyCorr::es2017_R21_v0 || + m_esmodel == egEnergyCorr::es2017_R21_v1 || + m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 || + m_esmodel == egEnergyCorr::es2018_R21_v0 || + m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || + m_esmodel == egEnergyCorr::es2018_R21_v1 || + m_esmodel == egEnergyCorr::es2022_R21_Precision)) { + static const double Et0 = 10000.; + // Effect taken as 10**-3/(Et/10GeV) - order of magniture from https://indico.cern.ch/event/669895/contributions/2745266/attachments/1535612/2405452/slides.pdf + if (var == egEnergyCorr::Scale::topoClusterThresUp) daTopoCluster = 1e-3*(1./(Et/Et0)-1./(meanET/Et0)); + if (var == egEnergyCorr::Scale::topoClusterThresDown) daTopoCluster = -1e-3*(1./(Et/Et0)-1./(meanET/Et0)); } // ADC non linearity correction. 30% of the effect from https://indico.cern.ch/event/1001455/contributions/4205636/attachments/2179584/3681315/ADC-linearity-28jan2021.pdf ? @@ -1634,7 +1703,7 @@ namespace AtlasRoot { ATH_MSG_ERROR("trying to compute ADC correction systematic, but no tool for doing it has been instantiated, setting sys to 0"); daADCLin = 0.; } - if (var==egEnergyCorr::Scale::ADCLinDown) + if (var == egEnergyCorr::Scale::ADCLinDown) daADCLin *= -1; } @@ -1660,7 +1729,6 @@ namespace AtlasRoot { } - // returns alpha_var - alpha_nom, for systematic variations. double egammaEnergyCorrectionTool::getAlphaUncertainty(long int runnumber, @@ -1947,7 +2015,7 @@ namespace AtlasRoot { } double sign = 1.; - if (value==egEnergyCorr::Resolution::AllDown || value==egEnergyCorr::Resolution::ZSmearingDown || + if (value==egEnergyCorr::Resolution::AllDown || value==egEnergyCorr::Resolution::ZSmearingDown || value==egEnergyCorr::Resolution::SamplingTermDown || value==egEnergyCorr::Resolution::MaterialIDDown || value==egEnergyCorr::Resolution::MaterialGapDown || value==egEnergyCorr::Resolution::MaterialCaloDown || value==egEnergyCorr::Resolution::MaterialCryoDown || value==egEnergyCorr::Resolution::PileUpDown || @@ -1959,12 +2027,11 @@ namespace AtlasRoot { double resolution_error_up; double resolution_error_down; - getResolution_systematics(eg_resolution_ptype, energy, eta, etaCalo, isys, resolution, resolution_error, resolution_error_up, resolution_error_down, resType, dataType == PATCore::ParticleDataType::Fast); // total resolution uncertainty - if (value==egEnergyCorr::Resolution::AllUp || value==egEnergyCorr::Resolution::AllDown) { + if (value == egEnergyCorr::Resolution::AllUp || value == egEnergyCorr::Resolution::AllDown) { resolution_error = resolution_error / resolution * sign; } else { if (sign==1) resolution_error= resolution_error_up/resolution; @@ -2018,9 +2085,9 @@ namespace AtlasRoot { egEnergyCorr::Resolution::resolutionType resType) const { int eg_resolution_ptype; - if (ptype == PATCore::ParticleType::Electron) eg_resolution_ptype = 0; - else if (ptype==PATCore::ParticleType::UnconvertedPhoton) eg_resolution_ptype = 1; - else if (ptype==PATCore::ParticleType::ConvertedPhoton) eg_resolution_ptype = 2; + if (ptype == PATCore::ParticleType::Electron) eg_resolution_ptype = 0; + else if (ptype == PATCore::ParticleType::UnconvertedPhoton) eg_resolution_ptype = 1; + else if (ptype == PATCore::ParticleType::ConvertedPhoton) eg_resolution_ptype = 2; else { ATH_MSG_FATAL("cannot understand particle type"); return -1; @@ -2062,21 +2129,21 @@ namespace AtlasRoot { double ratio_IQR_full_fast = 1.; const double ptGeV = energy / cosh(cl_eta) / 1E3; - if ( m_esmodel == egEnergyCorr::es2017_R21_v1 || m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 || - m_esmodel == egEnergyCorr::es2018_R21_v0 || m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || - m_esmodel == egEnergyCorr::es2018_R21_v1 || m_esmodel == egEnergyCorr::es2022_R21_Precision) { + if (m_esmodel == egEnergyCorr::es2017_R21_v1 || m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 || + m_esmodel == egEnergyCorr::es2018_R21_v0 || m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 || + m_esmodel == egEnergyCorr::es2018_R21_v1 || m_esmodel == egEnergyCorr::es2022_R21_Precision) { // // for es2017_R21_v1, histograms contain directly values of deltaSigma**2 of relative energy resolution (FastSIm-FulSim) so need to subtract this value to get the sigma**2 of FastSim - if(ptype == PATCore::ParticleType::Electron) sig2 -= getValueHistAt(*m_G4OverAFII_resolution_electron,cl_eta,ptGeV,true,true,true,true); - if (ptype == PATCore::ParticleType::UnconvertedPhoton) sig2 -= getValueHistAt(*m_G4OverAFII_resolution_unconverted,cl_eta,ptGeV,true,true,true,true); - if (ptype == PATCore::ParticleType::ConvertedPhoton) sig2 -= getValueHistAt(*m_G4OverAFII_resolution_converted,cl_eta,ptGeV,true,true,true,true); + if (ptype == PATCore::ParticleType::Electron) sig2 -= getValueHistAt(*m_G4OverAFII_resolution_electron,cl_eta,ptGeV,true,true,true,true); + if (ptype == PATCore::ParticleType::UnconvertedPhoton) sig2 -= getValueHistAt(*m_G4OverAFII_resolution_unconverted,cl_eta,ptGeV,true,true,true,true); + if (ptype == PATCore::ParticleType::ConvertedPhoton) sig2 -= getValueHistAt(*m_G4OverAFII_resolution_converted,cl_eta,ptGeV,true,true,true,true); if (sig2<0.) sig2=0.; } else { - if (ptype == PATCore::ParticleType::Electron) { ratio_IQR_full_fast = getValueHistAt(*m_G4OverAFII_resolution_electron, ptGeV, cl_eta, true, false); } + if (ptype == PATCore::ParticleType::Electron) { ratio_IQR_full_fast = getValueHistAt(*m_G4OverAFII_resolution_electron, ptGeV, cl_eta, true, false); } else if (ptype == PATCore::ParticleType::UnconvertedPhoton) { ratio_IQR_full_fast = getValueHistAt(*m_G4OverAFII_resolution_unconverted, ptGeV, cl_eta, true, false); } - else if (ptype == PATCore::ParticleType::ConvertedPhoton) { ratio_IQR_full_fast = getValueHistAt(*m_G4OverAFII_resolution_converted, ptGeV, cl_eta, true, false); } + else if (ptype == PATCore::ParticleType::ConvertedPhoton) { ratio_IQR_full_fast = getValueHistAt(*m_G4OverAFII_resolution_converted, ptGeV, cl_eta, true, false); } sig2 /= ratio_IQR_full_fast * ratio_IQR_full_fast; } @@ -2220,14 +2287,14 @@ namespace AtlasRoot { m_esmodel == egEnergyCorr::es2018_R21_v1 || m_esmodel == egEnergyCorr::es2022_R21_Precision) { // // in es02017_R21_v1 : AF2 to FullSim correction is in a 2D eta-Pt histogram - if (ptype == PATCore::ParticleType::Electron) { return (1.+getValueHistAt(*m_G4OverAFII_electron_2D, aeta,ptGeV,true,true,true,true)); } - else if (ptype == PATCore::ParticleType::ConvertedPhoton) { return (1.+getValueHistAt(*m_G4OverAFII_converted_2D, aeta,ptGeV,true,true,true,true)); } + if (ptype == PATCore::ParticleType::Electron) { return (1.+getValueHistAt(*m_G4OverAFII_electron_2D, aeta,ptGeV,true,true,true,true)); } + else if (ptype == PATCore::ParticleType::ConvertedPhoton) { return (1.+getValueHistAt(*m_G4OverAFII_converted_2D, aeta,ptGeV,true,true,true,true)); } else if (ptype == PATCore::ParticleType::UnconvertedPhoton) { return (1.+getValueHistAt(*m_G4OverAFII_unconverted_2D, aeta,ptGeV,true,true,true,true)); } else { throw std::runtime_error("particle not valid"); } } else { - if (ptype == PATCore::ParticleType::Electron) { return getValueHistoAt(*m_G4OverAFII_electron, aeta); } - else if (ptype == PATCore::ParticleType::ConvertedPhoton) { return getValueHistoAt(*m_G4OverAFII_converted, aeta); } + if (ptype == PATCore::ParticleType::Electron) { return getValueHistoAt(*m_G4OverAFII_electron, aeta); } + else if (ptype == PATCore::ParticleType::ConvertedPhoton) { return getValueHistoAt(*m_G4OverAFII_converted, aeta); } else if (ptype == PATCore::ParticleType::UnconvertedPhoton) { return getValueHistoAt(*m_G4OverAFII_unconverted, aeta); } else { throw std::runtime_error("particle not valid"); } } @@ -2274,7 +2341,8 @@ namespace AtlasRoot { // low mu data 2017 5TeV differnet scale if (m_esmodel == egEnergyCorr::es2018_R21_lowmu_v0 && runnumber<=341184 && runnumber>=340634) { - int ieta = m_zeeNom_data2017->GetXaxis()->FindBin(eta); value = m_zeeNom_data2017->GetBinContent(ieta); + int ieta = m_zeeNom_data2017->GetXaxis()->FindBin(eta); + value = m_zeeNom_data2017->GetBinContent(ieta); } // for es2017_R21_v0 different set of scales for 2017, 2016 and 2015 data @@ -2305,7 +2373,7 @@ namespace AtlasRoot { value = m_zeeNom_data2018->GetBinContent(ieta); } - if ((m_esmodel==egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or + if ((m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_summer_final or m_esmodel == egEnergyCorr::es2015_5TeV or m_esmodel == egEnergyCorr::es2017_R21_v0 or m_esmodel == egEnergyCorr::es2017_R21_v1 or m_esmodel == egEnergyCorr::es2018_R21_v0 or @@ -2385,8 +2453,8 @@ namespace AtlasRoot { runnumber < 297000){ h=((TH1*) m_zeeNom_data2015.get()); // special for 2015 with es2017 } - if ( (m_esmodel== egEnergyCorr::es2017_R21_v0 || m_esmodel== egEnergyCorr::es2017_R21_v1 || - m_esmodel== egEnergyCorr::es2017_R21_ofc0_v1 || m_esmodel == egEnergyCorr::es2018_R21_v0 || + if ( (m_esmodel == egEnergyCorr::es2017_R21_v0 || m_esmodel== egEnergyCorr::es2017_R21_v1 || + m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 || m_esmodel == egEnergyCorr::es2018_R21_v0 || m_esmodel == egEnergyCorr::es2018_R21_v1 || m_esmodel == egEnergyCorr::es2022_R21_Precision ) && runnumber>=297000 && runnumber<322817){ h = m_zeeNom_data2016.get(); // 2016 data @@ -2458,7 +2526,8 @@ namespace AtlasRoot { // special case for es2016PRE (extrapolation from 2015) const double sign = (var == egEnergyCorr::Scale::LArTemperature2016PreUp) ? 1 : -1; // temp + pileup - value += qsum(0.05E-2, 0.02E-2) * sign; // Guillaume email 23/05/2016 + 26/5/2016 + static constexpr double ivalue = std::hypot(0.05E-2, 0.02E-2); + value += ivalue * sign; // Guillaume email 23/05/2016 + 26/5/2016 } @@ -2610,16 +2679,22 @@ namespace AtlasRoot { else if( iLayer==1 ) { // use cl_eta - if (var == egEnergyCorr::Scale::S12Up && m_aS12Nom) { value = m_aS12Nom->GetBinError(m_aS12Nom->FindBin(cl_eta)); } - else if (var == egEnergyCorr::Scale::S12Down && m_aS12Nom) { value = -m_aS12Nom->GetBinError(m_aS12Nom->FindBin(cl_eta)); } - else if (var == egEnergyCorr::Scale::LArCalibUp && m_daS12Cor) { value = m_daS12Cor->GetBinContent(m_daS12Cor->FindBin(cl_eta)); } + if (var == egEnergyCorr::Scale::S12Up && m_aS12Nom) { value = m_aS12Nom->GetBinError(m_aS12Nom->FindBin(cl_eta)); } + else if (var == egEnergyCorr::Scale::S12Down && m_aS12Nom) { value = -m_aS12Nom->GetBinError(m_aS12Nom->FindBin(cl_eta)); } + else if (var == egEnergyCorr::Scale::LArCalibUp && m_daS12Cor) { value = m_daS12Cor->GetBinContent(m_daS12Cor->FindBin(cl_eta)); } else if (var == egEnergyCorr::Scale::LArCalibDown && m_daS12Cor) { value = -m_daS12Cor->GetBinContent( m_daS12Cor->FindBin(cl_eta)); } else if (var == egEnergyCorr::Scale::LArCalibExtra2015PreUp and - (m_esmodel == egEnergyCorr::es2015PRE or m_esmodel == egEnergyCorr::es2015PRE_res_improved or - m_esmodel == egEnergyCorr::es2015cPRE or m_esmodel == egEnergyCorr::es2015cPRE_res_improved or - m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE or m_esmodel == egEnergyCorr::es2017 - or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE - or m_esmodel == egEnergyCorr::es2015_5TeV)) { + (m_esmodel == egEnergyCorr::es2015PRE or + m_esmodel == egEnergyCorr::es2015PRE_res_improved or + m_esmodel == egEnergyCorr::es2015cPRE or + m_esmodel == egEnergyCorr::es2015cPRE_res_improved or + m_esmodel == egEnergyCorr::es2015c_summer or + m_esmodel == egEnergyCorr::es2016PRE or + m_esmodel == egEnergyCorr::es2017 or + m_esmodel == egEnergyCorr::es2017_summer or + m_esmodel == egEnergyCorr::es2017_summer_improved or + m_esmodel == egEnergyCorr::es2017_R21_PRE or + m_esmodel == egEnergyCorr::es2015_5TeV)) { // special case for es2015PRE and also for es2015c_summer and also for es2017 // numbers from Lydia and Christophe, // https://indico.cern.ch/event/395345/contribution/2/material/slides/0.pdf @@ -2628,8 +2703,10 @@ namespace AtlasRoot { const double aeta = std::abs(cl_eta); //endcap if ( aeta >= 1.37 and aeta < 2.5){ - if ( m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or - m_esmodel == egEnergyCorr::es2017_R21_PRE or m_esmodel == egEnergyCorr::es2015_5TeV) value = 5.0E-2; + if ( m_esmodel == egEnergyCorr::es2017_summer or + m_esmodel == egEnergyCorr::es2017_summer_improved or + m_esmodel == egEnergyCorr::es2017_R21_PRE or + m_esmodel == egEnergyCorr::es2015_5TeV) value = 5.0E-2; else value = 1.5E-2; } else{//barrel @@ -2638,29 +2715,39 @@ namespace AtlasRoot { } } else if (var == egEnergyCorr::Scale::LArCalibExtra2015PreDown and - (m_esmodel == egEnergyCorr::es2015PRE or m_esmodel == egEnergyCorr::es2015PRE_res_improved or - m_esmodel == egEnergyCorr::es2015cPRE or m_esmodel == egEnergyCorr::es2015cPRE_res_improved or - m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE or - m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or - m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE or + (m_esmodel == egEnergyCorr::es2015PRE or + m_esmodel == egEnergyCorr::es2015PRE_res_improved or + m_esmodel == egEnergyCorr::es2015cPRE or + m_esmodel == egEnergyCorr::es2015cPRE_res_improved or + m_esmodel == egEnergyCorr::es2015c_summer or + m_esmodel == egEnergyCorr::es2016PRE or + m_esmodel == egEnergyCorr::es2017 or + m_esmodel == egEnergyCorr::es2017_summer or + m_esmodel == egEnergyCorr::es2017_summer_improved or + m_esmodel == egEnergyCorr::es2017_R21_PRE or m_esmodel == egEnergyCorr::es2015_5TeV)) { const double aeta = std::abs(cl_eta); //endcap if ( aeta >= 1.37 and aeta < 2.5){ - if ( m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or - m_esmodel == egEnergyCorr::es2017_R21_PRE or m_esmodel == egEnergyCorr::es2015_5TeV) value = -5.0E-2; + if ( m_esmodel == egEnergyCorr::es2017_summer or + m_esmodel == egEnergyCorr::es2017_summer_improved or + m_esmodel == egEnergyCorr::es2017_R21_PRE or + m_esmodel == egEnergyCorr::es2015_5TeV) value = -5.0E-2; else value = -1.5E-2; } else{//barrel - if (m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2015_5TeV) value = -2.5E-2; + if (m_esmodel == egEnergyCorr::es2017_summer_improved or + m_esmodel == egEnergyCorr::es2015_5TeV) value = -2.5E-2; else value = -1.5E-2; } } else if (var == egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Up or var == egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Down) { // special large sys for run2 in the last eta-bin in es2017, see ATLASEG-42 - if (m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or - m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE or + if (m_esmodel == egEnergyCorr::es2017 or + m_esmodel == egEnergyCorr::es2017_summer or + m_esmodel == egEnergyCorr::es2017_summer_improved or + m_esmodel == egEnergyCorr::es2017_R21_PRE or m_esmodel == egEnergyCorr::es2015_5TeV) { const double aeta = std::abs(cl_eta); if (aeta >= 2.4 and aeta < 2.5) { @@ -2672,7 +2759,6 @@ namespace AtlasRoot { } - return value * varSF; } @@ -3073,7 +3159,7 @@ double egammaEnergyCorrectionTool::getMaterialEffect(egEnergyCorr::Geometry geo, if( (ptype!=PATCore::ParticleType::Electron && (m_esmodel != egEnergyCorr::es2017_R21_v1 && m_esmodel != egEnergyCorr::es2017_R21_ofc0_v1 && m_esmodel != egEnergyCorr::es2018_R21_v0 && m_esmodel != egEnergyCorr::es2018_R21_lowmu_v0 && - m_esmodel !=egEnergyCorr::es2018_R21_v1 && m_esmodel != egEnergyCorr::es2022_R21_Precision) ) || + m_esmodel != egEnergyCorr::es2018_R21_v1 && m_esmodel != egEnergyCorr::es2022_R21_Precision) ) || var==egEnergyCorr::Scale::Nominal ) return value; @@ -3326,33 +3412,46 @@ double egammaEnergyCorrectionTool::getMaterialEffect(egEnergyCorr::Geometry geo, return std::make_pair(alpha,dalpha); } - double egammaEnergyCorrectionTool::getAlphaConvSyst(double cl_eta, double energy, PATCore::ParticleType::Type ptype, - egEnergyCorr::Scale::Variation var, double varSF) const { + double egammaEnergyCorrectionTool::getAlphaConvSyst(double cl_eta, double energy, + PATCore::ParticleType::Type ptype, + egEnergyCorr::Scale::Variation var, + double varSF) const { double alpha = 0.; - double aeta = fabs(cl_eta); - double ET = energy/cosh(cl_eta)/GeV; + double aeta = fabs(cl_eta); + // If the acceptance cut is on etaS2, cluster eta might be above... + if (aeta > 2.37) + aeta = 2.36; + double ET = energy/cosh(cl_eta); - if( var==egEnergyCorr::Scale::Nominal || ptype==PATCore::ParticleType::Electron ) + if (var == egEnergyCorr::Scale::Nominal || ptype == PATCore::ParticleType::Electron) return alpha; - if( ptype==PATCore::ParticleType::UnconvertedPhoton ) { + if (ptype == PATCore::ParticleType::UnconvertedPhoton) { - if( var==egEnergyCorr::Scale::ConvEfficiencyUp ) + if (var == egEnergyCorr::Scale::ConvEfficiencyUp) alpha = m_convRecoEfficiency->GetBinContent( m_convRecoEfficiency->FindBin(aeta) ); - else if( var==egEnergyCorr::Scale::ConvEfficiencyDown ) + else if (var == egEnergyCorr::Scale::ConvEfficiencyDown) alpha = -m_convRecoEfficiency->GetBinContent( m_convRecoEfficiency->FindBin(aeta) ); + else if (var == egEnergyCorr::Scale::ConvRecoUp) + alpha = m_convRecoEfficiency->GetBinContent( m_convRecoEfficiency->FindBin(aeta,ET) ); + else if (var == egEnergyCorr::Scale::ConvRecoDown) + alpha = -m_convRecoEfficiency->GetBinContent( m_convRecoEfficiency->FindBin(aeta,ET) ); - } else if( ptype==PATCore::ParticleType::ConvertedPhoton ) { + } else if (ptype==PATCore::ParticleType::ConvertedPhoton) { - if( var==egEnergyCorr::Scale::ConvFakeRateUp ) + if (var == egEnergyCorr::Scale::ConvFakeRateUp) alpha = m_convFakeRate->GetBinContent( m_convFakeRate->FindBin(aeta) ); - else if( var==egEnergyCorr::Scale::ConvFakeRateDown ) + else if (var == egEnergyCorr::Scale::ConvFakeRateDown) alpha = -m_convFakeRate->GetBinContent( m_convFakeRate->FindBin(aeta) ); - else if( var==egEnergyCorr::Scale::ConvRadiusUp ) - alpha = m_convRadius->GetBinContent( m_convRadius->FindBin(aeta, ET) ); - else if( var==egEnergyCorr::Scale::ConvRadiusDown ) - alpha = -m_convRadius->GetBinContent( m_convRadius->FindBin(aeta, ET) ); + else if (var == egEnergyCorr::Scale::ConvRecoUp) + alpha = m_convFakeRate->GetBinContent( m_convFakeRate->FindBin(aeta,ET) ); + else if (var == egEnergyCorr::Scale::ConvRecoDown) + alpha = -m_convFakeRate->GetBinContent( m_convFakeRate->FindBin(aeta,ET) ); + else if (var == egEnergyCorr::Scale::ConvRadiusUp) + alpha = m_convRadius->GetBinContent( m_convRadius->FindBin(aeta, ET/GeV) ); + else if (var == egEnergyCorr::Scale::ConvRadiusDown) + alpha = -m_convRadius->GetBinContent( m_convRadius->FindBin(aeta, ET/GeV) ); } @@ -3360,8 +3459,11 @@ double egammaEnergyCorrectionTool::getMaterialEffect(egEnergyCorr::Geometry geo, } - double egammaEnergyCorrectionTool::getAlphaPedestal(double cl_eta, double energy, double eraw, PATCore::ParticleType::Type ptype, bool isRef, - egEnergyCorr::Scale::Variation var, double varSF) const { + double egammaEnergyCorrectionTool::getAlphaPedestal(double cl_eta, double energy, double eraw, + PATCore::ParticleType::Type ptype, + bool isRef, + egEnergyCorr::Scale::Variation var, + double varSF) const { double alpha = 0.; if (var == egEnergyCorr::Scale::PedestalUp || var == egEnergyCorr::Scale::PedestalDown) { if (m_esmodel == egEnergyCorr::es2017) { @@ -3383,14 +3485,11 @@ double egammaEnergyCorrectionTool::getMaterialEffect(egEnergyCorr::Geometry geo, // observed pedestal corrected as a systematic on MC for now. // TODO : correct for it in the data - - double pedestal = getLayerPedestal(cl_eta, ptype, 0, var, varSF) + getLayerPedestal(cl_eta, ptype, 1, var, varSF) + getLayerPedestal(cl_eta, ptype, 2, var, varSF) + getLayerPedestal(cl_eta, ptype, 3, var, varSF); - if( isRef ) alpha = pedestal/energy*1.06; // approximate average ratio between calibrated and raw else @@ -3626,7 +3725,7 @@ double egammaEnergyCorrectionTool::getMaterialEffect(egEnergyCorr::Geometry geo, // systematics from material in IBL+PP0 for barrel if (isys==7 && fabs(eta)<1.5 && - (m_esmodel==egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or + (m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_summer_final or m_esmodel == egEnergyCorr::es2015_5TeV or m_esmodel == egEnergyCorr::es2017_R21_v0 or m_esmodel == egEnergyCorr::es2017_R21_v1 or m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 or @@ -3641,7 +3740,7 @@ double egammaEnergyCorrectionTool::getMaterialEffect(egEnergyCorr::Geometry geo, // systematics from material in IBL+PP0 for end-cap if (isys==8 && fabs(eta)>1.5 && - (m_esmodel==egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or + (m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_summer_final or m_esmodel == egEnergyCorr::es2015_5TeV or m_esmodel == egEnergyCorr::es2017_R21_v0 or m_esmodel == egEnergyCorr::es2017_R21_v1 or m_esmodel == egEnergyCorr::es2017_R21_ofc0_v1 or @@ -3779,6 +3878,8 @@ double egammaEnergyCorrectionTool::getMaterialEffect(egEnergyCorr::Geometry geo, case egEnergyCorr::Scale::ConvEfficiencyDown: return "ConvEfficiencyDown"; case egEnergyCorr::Scale::ConvFakeRateUp: return "ConvFakeRateUp"; case egEnergyCorr::Scale::ConvFakeRateDown: return "ConvFakeRateDown"; + case egEnergyCorr::Scale::ConvRecoUp: return "ConvRecoUp"; + case egEnergyCorr::Scale::ConvRecoDown: return "ConvRecoDown"; case egEnergyCorr::Scale::ConvRadiusUp: return "ConvRadiusUp"; case egEnergyCorr::Scale::ConvRadiusDown: return "ConvRadiusDown"; case egEnergyCorr::Scale::PedestalUp: return "PedestalUp"; @@ -3833,13 +3934,11 @@ double egammaEnergyCorrectionTool::getMaterialEffect(egEnergyCorr::Geometry geo, } } - double egammaEnergyCorrectionTool::get_ZeeSyst(double eta) const { - const auto ieta = m_zeeSyst->GetXaxis()->FindFixBin(eta); - auto value_histo = m_zeeSyst->GetBinContent(ieta); - - return value_histo; + const int ieta = m_zeeSyst->GetXaxis()->FindFixBin(eta); + + return m_zeeSyst->GetBinContent(ieta); } const TAxis& egammaEnergyCorrectionTool::get_ZeeStat_eta_axis() const @@ -3847,6 +3946,4 @@ double egammaEnergyCorrectionTool::getMaterialEffect(egEnergyCorr::Geometry geo, return *m_zeeNom->GetXaxis(); } - - } // egRescaler diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/egammaEnergyCorrectionData.root b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/egammaEnergyCorrectionData.root index d974c5d1e96b442efab6a3a6c6e480689971bb4a..eeb578eb5ef1ba3922a385d81b5258a2525bb75b 100644 Binary files a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/egammaEnergyCorrectionData.root and b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/egammaEnergyCorrectionData.root differ