diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/util/top-xaod.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/util/top-xaod.cxx index 8489873cba17fb7463e5bc48469cec21c935ad22..a46aa4e7e6b245da6e560db53ad57e554ea19fd4 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/util/top-xaod.cxx +++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/util/top-xaod.cxx @@ -658,6 +658,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 eeb4491ef467f20d632b80d71726af0ae681403f..c110cc4c1021bb1f1ab626f64f71643bc2ff7e14 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()) { @@ -138,7 +143,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 a1623edc12c28a108f02a1b72586a4864a901f35..a38e8c8a654db0396cc2eb56178ef9844d857192 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 5b6b88676a03f0a3546f1b4d8c86e74a6f9bbbfb..4b5a04157f40753b607e4baf0be9a635a2ab86db 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/ConfigurationSettings.cxx +++ b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/ConfigurationSettings.cxx @@ -544,6 +544,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 e12343053ea996d338d6a27c1943abeed8f74012..6400067bca551ab2aa1c8216c9d9a0615c6ddb8b 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/TopConfig.cxx +++ b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/TopConfig.cxx @@ -1553,6 +1553,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 3e31989abb488bf2c7c789cc209b47df150a47de..87a680948a2e9c42d3afba5ec04854e330fab601 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/TopConfiguration/TopConfig.h +++ b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/TopConfiguration/TopConfig.h @@ -1782,6 +1782,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;} @@ -2504,6 +2512,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)