Commit 7d1f32d6 authored by Buddhadeb Mondal's avatar Buddhadeb Mondal Committed by Nils Erik Krumnack
Browse files

Setting for overriding hardcoded egamma calibration model in TopEgammaCPTools

parent b9550aca
......@@ -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;
......
......@@ -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",
......
......@@ -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;
......
......@@ -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",
" ");
......
......@@ -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;
......
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment