diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/util/top-xaod.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/util/top-xaod.cxx index 9b7f3fa265963f18ca5fbd92b5c0e9c2f04fd077..bb1a330976413293ea9d0e48148d9494aade9129 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/util/top-xaod.cxx +++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/util/top-xaod.cxx @@ -675,6 +675,13 @@ int main(int argc, char** argv) { << " YOU MANY NOT BE USING THE LATEST BTAGGING RECOMMENDATIONS \n" << "*************************************************************************\n\n"); } + if (topConfig->printEgammaCalibModelWarning()) { + ATH_MSG_WARNING( + "\n*************************************************************************\n" + << " YOU HAVE CHANGED DEFAULT EGAMMA CALIBRATION MODEL \n" + << " TO USE DEFAULT MODEL, REMOVE 'EGammaCalibrationModel' FROM CONFIG FILE \n" + << "*************************************************************************\n\n"); + } const unsigned int entries = xaodEvent.getEntries(); totalEventsInFiles += entries; diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/Root/TopEgammaCPTools.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/Root/TopEgammaCPTools.cxx index fbd48d6ebc940c394903423d49b4370405a21d7a..70a97b3b39284b6a6a7ea6cd012c7cf5046236d6 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/Root/TopEgammaCPTools.cxx +++ b/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/Root/TopEgammaCPTools.cxx @@ -27,6 +27,7 @@ namespace top { EgammaCPTools::EgammaCPTools(const std::string& name) : asg::AsgTool(name), + m_egammaCalibrationModel("es2018_R21_v0"), m_electronEffTriggerFile("SetMe"), m_electronEffTriggerLooseFile("SetMe"), m_electronEffSFTriggerFile("SetMe"), @@ -87,6 +88,10 @@ namespace top { if (m_config->usePhotons() || m_config->useElectrons() || m_config->useFwdElectrons()) { if (m_config->makeAllCPTools()) {// skiping calibrations on mini-xAODs + if(m_config->egammaCalibration() != m_egammaCalibrationModel){ + m_config->setPrintEgammaCalibModelWarning(true); + m_egammaCalibrationModel = m_config->egammaCalibration(); + } top::check(setupCalibration(), "Failed to setup Egamma calibration tools"); } if (m_config->useFwdElectrons() && m_config->makeAllCPTools()) { @@ -147,7 +152,7 @@ namespace top { } else { IEgammaCalibTool* egammaCalibrationAndSmearingTool = new CP::EgammaCalibrationAndSmearingTool(egamma_calib_name); top::check(asg::setProperty(egammaCalibrationAndSmearingTool, - "ESModel", "es2018_R21_v0"), + "ESModel", m_egammaCalibrationModel), "Failed to set ESModel for " + egamma_calib_name); top::check(asg::setProperty(egammaCalibrationAndSmearingTool, "decorrelationModel", diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/TopCPTools/TopEgammaCPTools.h b/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/TopCPTools/TopEgammaCPTools.h index 02fea4b86028f0d5e33964b9e3981d2005e240e8..54895701ab5c63ddc43a0e30f205e1023b1f4e56 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/TopCPTools/TopEgammaCPTools.h +++ b/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/TopCPTools/TopEgammaCPTools.h @@ -38,6 +38,7 @@ namespace top { private: std::shared_ptr<top::TopConfig> m_config; + std::string m_egammaCalibrationModel; std::string m_electronEffTriggerFile; std::string m_electronEffTriggerLooseFile; std::string m_electronEffSFTriggerFile; diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/ConfigurationSettings.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/ConfigurationSettings.cxx index 9df37052df4bad8d04b6766320087dc17e8b72fa..774d69f9ab22ad916542ec5bc0670cfd9ec7b3c4 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/ConfigurationSettings.cxx +++ b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/ConfigurationSettings.cxx @@ -591,6 +591,8 @@ namespace top { " Default 'default'", "default"); + registerParameter("EGammaCalibrationModel", "To override default EGammaCalibration model, Default 'es2018_R21_v0'", "es2018_R21_v0"); + registerParameter("PRWConfigFiles", "List of PU config files, seperated by spaces (nothing by default) - Not compatible with FS/AF options", " "); diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/TopConfig.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/TopConfig.cxx index 215bc0580f38103beea3c5e3de3640499224a46f..8248ee4e2cdfa7a1711d74ff75e3110a0216db05 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/TopConfig.cxx +++ b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/TopConfig.cxx @@ -1634,6 +1634,9 @@ namespace top { m_btagging_calibration_Light = settings->value("BTaggingCalibrationLight"); m_bTagSystsExcludedFromEV = settings->value("BTaggingSystExcludedFromEV"); + // egamma calibration model + m_egamma_calibration_model = settings->value("EGammaCalibrationModel"); + // Set translatio ndictionary for MCMC maps if (settings->value("RedefineMCMCMap") != " ") { std::vector<std::string> tmp; diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/TopConfiguration/TopConfig.h b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/TopConfiguration/TopConfig.h index f75f51ce890309ac0ac5d4f6609a4b8bf820621d..bc25ece50ab01d4bc26a69d5755abc27091c8fa3 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/TopConfiguration/TopConfig.h +++ b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/TopConfiguration/TopConfig.h @@ -1838,6 +1838,14 @@ namespace top { const std::string& bTaggingCalibration_Light() const {return m_btagging_calibration_Light;}; + // egamma calibration + bool printEgammaCalibModelWarning() const + {return m_egamma_calibmodel_warning;} + void setPrintEgammaCalibModelWarning(bool flag) + {m_egamma_calibmodel_warning = flag;} + const std::string& egammaCalibration() const + {return m_egamma_calibration_model;}; + // LHAPDF settings inline virtual std::vector<std::string> LHAPDFSets() {return m_lhapdf_options.pdf_set_names;} @@ -2566,6 +2574,10 @@ namespace top { std::string m_btagging_calibration_C = "default"; std::string m_btagging_calibration_Light = "default"; + // EGamma calibration to be used + bool m_egamma_calibmodel_warning = false; + std::string m_egamma_calibration_model = "es2018_R21_v0"; + // b-tag SF helpers - one of each per WP // will be set in the BTagScaleFactorCalculator // These are the base names of the SF systematics (without __up/__down)