diff --git a/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/MuonEfficiencyCorrections/HistHandler.h b/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/MuonEfficiencyCorrections/HistHandler.h index 6dc6b68e0c2ca48e2910c9c964bcb67bbc3f44ef..c560816f4361ca8afe6c369701655411ed63e333 100644 --- a/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/MuonEfficiencyCorrections/HistHandler.h +++ b/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/MuonEfficiencyCorrections/HistHandler.h @@ -245,18 +245,30 @@ namespace CP { public: CorrectionCode GetBinningParameter(const xAOD::Muon & mu, float & value) const override { static const SG::AuxElement::ConstAccessor<float> dRJet("dRJet"); - value = dRJet.isAvailable(mu) ? dRJet(mu) : -2; - // We want these warnings to be printed few times per job, so that they're visible, then stop before log file's size blows up - static std::atomic<unsigned int> warned = {0}; - if (warned<5 && !dRJet.isAvailable(mu)){ - using namespace msgMuonEfficiency; - ANA_MSG_WARNING("The dRJet decoration has not been found for the Muon. Isolation scale-factors are now also binned in #Delta R(jet,#mu)"); - ANA_MSG_WARNING("using the closest calibrated AntiKt4EMTopo jet with p_{T}>20~GeV and surving the standard OR criteria."); - ANA_MSG_WARNING("You should decorate your muon appropiately before passing to the tool, and use dRJet = -1 in case there is no jet in an event."); - ANA_MSG_WARNING("For the time being the inclusive scale-factor is going to be returned."); + static const SG::AuxElement::ConstAccessor<float> dRJet_DxAOD("DFCommonJetDr"); + using namespace msgMuonEfficiency; + if( dRJet_DxAOD.isAvailable(mu) ) { + // decoration available in DxAOD + value = dRJet_DxAOD(mu); + ANA_MSG_VERBOSE("Taking #Delta R(jet,#mu) decoration from MuonsAuxDyn.DFCommonJetDr for retrieving the muon isolation scale factors."); + } else if( dRJet.isAvailable(mu) ) { + // decoration manually provided by analyzers + value = dRJet.isAvailable(mu); + ANA_MSG_INFO("MuonsAuxDyn.DFCommonJetDr is not available in this DxAOD, but you've decorated the muon with dRJet. Using it for retrieving the isolation scale factors."); + } else { + // decoration not available + value = -2.; + // We want these warnings to be printed few times per job, so that they're visible, then stop before log file's size blows up + static std::atomic<unsigned int> warned = {0}; + if (warned<5){ + ANA_MSG_WARNING("The dRJet decoration has not been found for the Muon. Isolation scale-factors are now also binned in #Delta R(jet,#mu)"); + ANA_MSG_WARNING("using the closest calibrated AntiKt4EMTopo jet with p_{T}>20~GeV and surving the standard OR criteria."); + ANA_MSG_WARNING("You should decorate your muon appropiately before passing to the tool, and use dRJet = -1 in case there is no jet in an event."); + ANA_MSG_WARNING("For the time being the inclusive scale-factor is going to be returned."); ANA_MSG_WARNING("In future derivations, muons will also be decorated centrally with dRJet, for your benefit."); warned++; - } + } + } return CorrectionCode::Ok; } virtual ~dRJetAxisHandler() = default; diff --git a/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/Root/MuonEfficiencyScaleFactors.cxx b/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/Root/MuonEfficiencyScaleFactors.cxx index 64a9af1bdd88f86db91e2621c940e4c1bf4df36f..a0734953d393a65a271c76a52777bdae51f6dbb2 100644 --- a/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/Root/MuonEfficiencyScaleFactors.cxx +++ b/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/Root/MuonEfficiencyScaleFactors.cxx @@ -31,7 +31,7 @@ namespace CP { m_efficiency_decoration_name_data(), m_efficiency_decoration_name_mc(), m_sf_decoration_name(), - m_calibration_version("200202_Precision_r21"), + m_calibration_version("200513_Precision_r21"), m_lowpt_threshold(15.e3), m_affectingSys(), m_filtered_sys_sets(), diff --git a/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/util/MuonEfficiencyScaleFactorsTest.cxx b/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/util/MuonEfficiencyScaleFactorsTest.cxx index c15814b8c1441f2d1981e572cc8ef54656a795b6..104a54d90197f73321a4c50a4005e74235dad2cd 100644 --- a/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/util/MuonEfficiencyScaleFactorsTest.cxx +++ b/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/util/MuonEfficiencyScaleFactorsTest.cxx @@ -148,14 +148,15 @@ int main(int argc, char* argv[]) { const std::vector<std::string> WPs { // reconstruction WPs - "Loose", "Medium", "Tight", "HighPt", + "Loose", "Medium", "Tight", "HighPt", "LowPt", "LowPtMVA", // track-to-vertex-association WPs "TTVA", // BadMuon veto SFs "BadMuonVeto_HighPt", // isolation WPs - "FixedCutLooseIso", "LooseTrackOnlyIso", "LooseIso", "GradientIso", "GradientLooseIso", - "FixedCutTightTrackOnlyIso", "FixedCutHighPtTrackOnlyIso", "FixedCutTightIso" + "PLVLooseIso", "PLVTightIso", "HighPtTrackOnlyIso", + "Loose_FixedRadIso", "Tight_FixedRadIso", "PflowLoose_FixedRadIso", "PflowTight_FixedRadIso", "TightTrackOnly_FixedRadIso", + "Loose_VarRadIso", "Tight_VarRadIso", "PflowLoose_VarRadIso", "PflowTight_VarRadIso", "TightTrackOnly_VarRadIso" }; std::vector<EffiToolInstance> EffiTools;