diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/Root/TopJetMETCPTools.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/Root/TopJetMETCPTools.cxx index 5cb14b32ad9a8e517fb9cac3d29f86cdf915b57b..95003bdf2ab3433fd5f6ce8cb0f6a377db901b4c 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/Root/TopJetMETCPTools.cxx +++ b/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/Root/TopJetMETCPTools.cxx @@ -280,7 +280,7 @@ namespace top { // experimental! Jet response MC-to-MC corrections // see https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/ApplyJetCalibrationR21#MC_to_MC_calibrations_this_is_cu - if (m_config->jetMCtoMCCalibration() != "None" && m_config->isMC()) { + if (m_config->jetMCtoMCCalibration() != "None" && m_config->jetMCtoMCCalibration() != "pythia" && m_config->isMC()) { ATH_MSG_INFO("JES Calibration MC-to-MC : " << m_config->jetMCtoMCCalibration()); top::check(asg::setProperty(jetCalibrationTool, "ShowerModel", m_config->jetMCtoMCCalibration()), "Failed to set ShowerModel " + m_config->jetMCtoMCCalibration()); @@ -344,8 +344,21 @@ namespace top { // Moriond2018 - AF2 JES // Summer2019 - JES/JER update + std::string conference = "Summer2019"; + if (m_config->useJESPrecisionFlavourUncertainties()) { + // JES precision flavour uncertainties are stored in Summer2022 directory + // These don't invalidate the recommendations stored in the Summer2019 directory + // additionally the MC-to-MC corrections also have to be applied when the JES precision flavour uncertaitnies are used + // see https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/JetUncertaintiesRel21Summer2018SmallR + if (m_config->jetMCtoMCCalibration() == "None" && m_config->isMC()) { + ATH_MSG_ERROR("useJESPrecisionFlavourUncertainties option provided but jetMCtoMCCalibration option is None! You have to provide a valid jetMCtoMCCalibration option."); + return StatusCode::FAILURE; + } + ATH_MSG_INFO("useJESPrecisionFlavourUncertainties option provided. JES precision flavour uncertainties are used."); + conference = "Summer2022"; + } // By setting calib_area to "None" we pick up the default from the JES group std::string calib_area = "None"; diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/ConfigurationSettings.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/ConfigurationSettings.cxx index c3b51a5f7d43e31a3522231612429e91bfe43763..46dee2acc91019a1b440e2819140fe67340b6ada 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/ConfigurationSettings.cxx +++ b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/ConfigurationSettings.cxx @@ -283,7 +283,8 @@ namespace top { "If set to True, produce additional JER smearing systematics treating MC as pseudo-data, provided FullJER or AllJER is specified with LargeRJetUncertainties_JESJERJMS_NPModel.", "True",{"True", "False"}); registerParameter("JetCalibSequence", "Jet calibaration sequence.", "GSC", {"GSC", "JMS"}); - registerParameter("JetMCtoMCCalibration","MC-to-MC calibration of the jet response, to be applied to non-Pythia8 samples. EXPERIMENTAL!" , "None", {"H713", "H716", "H716dip", "H721", "Sh221", "Sh222", "Sh225", "Sh225Lund", "Sh2211", "Sh2211tun", "None"}); + registerParameter("JetMCtoMCCalibration","MC-to-MC calibration of the jet response, to be applied to non-Pythia8 samples. EXPERIMENTAL!" , "None", {"H713", "H716", "H716dip", "H721", "Sh221", "Sh222", "Sh225", "Sh225Lund", "Sh2211", "Sh2211tun", "pythia", "None"}); + registerParameter("useJESPrecisionFlavourUncertainties","Enable JES precision flavour uncertainties. If set to 'True' the corresponding calibration files are used." , "False", {"True", "False"}); registerParameter("AllowJMSforAFII", "Enable use of UNSUPPORTED small-R jet JMS calibration use on AFII samples.", "False", {"True", "False"}); registerParameter("StoreJetTruthLabels", "Flag to store truth labels for jets - True (default) or False", "True"); diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/TopConfig.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/TopConfig.cxx index 276b258fbeec4577e17c15e7030e53d906b125e1..259f8472cc4a2cd122030a6c7caf1642199ee5b2 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/TopConfig.cxx +++ b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/TopConfig.cxx @@ -296,6 +296,7 @@ namespace top { m_doLargeRPseudodataJER(false), m_jetCalibSequence("GSC"), m_jetMCtoMCCalibration("None"), + m_useJESPrecisionFlavourUncertainties(false), m_allowSmallRJMSforAFII(false), m_jetStoreTruthLabels("True"), m_doJVTInMETCalculation(true), @@ -1450,6 +1451,7 @@ namespace top { } this->jetCalibSequence(settings->value("JetCalibSequence")); this->jetMCtoMCCalibration(settings->value("JetMCtoMCCalibration")); + this->useJESPrecisionFlavourUncertainties(settings->value("useJESPrecisionFlavourUncertainties") == "True"); this->allowSmallRJMSforAFII(settings->value("AllowJMSforAFII") == "True"); this->doJVTinMET(settings->retrieve("JVTinMETCalculation")); this->saveFailJVTJets(settings->retrieve("SaveFailJVTJets")); diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/TopConfiguration/TopConfig.h b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/TopConfiguration/TopConfig.h index 9e1eb8deae62116645dd3faa3c97ba041845c130..ab2aa8f00f41529bc3a70396ac5319770fa1e35f 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/TopConfiguration/TopConfig.h +++ b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/TopConfiguration/TopConfig.h @@ -1615,9 +1615,17 @@ namespace top { m_jetMCtoMCCalibration = s; } } - + inline virtual const std::string& jetMCtoMCCalibration() const {return m_jetMCtoMCCalibration;} + inline virtual void useJESPrecisionFlavourUncertainties(const bool& b) { + if (!m_configFixed) { + m_useJESPrecisionFlavourUncertainties = b; + } + } + + inline virtual bool useJESPrecisionFlavourUncertainties() const {return m_useJESPrecisionFlavourUncertainties;} + inline virtual void allowSmallRJMSforAFII(const bool setting) { if (!m_configFixed) { m_allowSmallRJMSforAFII = setting; @@ -2659,6 +2667,7 @@ namespace top { bool m_doLargeRPseudodataJER; // True or False std::string m_jetCalibSequence; // GCC or JMS std::string m_jetMCtoMCCalibration; // None or MC-to-MC jet response calibration + bool m_useJESPrecisionFlavourUncertainties; // True or False, to determine whether reduced JES flavour uncertainties should be used bool m_allowSmallRJMSforAFII; // JMS is not supported on AFII so we crash, unless people override this option bool m_jetStoreTruthLabels; // True or False bool m_doJVTInMETCalculation;