diff --git a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/FTagAnalysisAlgorithms/BTaggingEfficiencyAlg.h b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/FTagAnalysisAlgorithms/BTaggingEfficiencyAlg.h index 889badd8b9c789feb581decce07b7012ea1f0c3c..c2ff0c44fe0057ff15842c78a9cbabf6efa81a75 100644 --- a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/FTagAnalysisAlgorithms/BTaggingEfficiencyAlg.h +++ b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/FTagAnalysisAlgorithms/BTaggingEfficiencyAlg.h @@ -71,6 +71,10 @@ namespace CP SysReadSelectionHandle m_selectionHandle { this, "selectionDecoration", "", "the decoration for the asg selection"}; + /// \brief only run the efficency for all jets + private: + bool m_onlyEfficiency {false}; + /// \brief only run the inefficency for all jets private: bool m_onlyInefficiency {false}; diff --git a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/Root/BTaggingEfficiencyAlg.cxx b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/Root/BTaggingEfficiencyAlg.cxx index e612ca296324e9fcba553f6fa2d2629c528628c4..78a8acd88263189fba95384c83fddde3e0e03ade 100644 --- a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/Root/BTaggingEfficiencyAlg.cxx +++ b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/Root/BTaggingEfficiencyAlg.cxx @@ -25,6 +25,7 @@ namespace CP , m_efficiencyTool ("BTaggingEfficiencyTool", this) { declareProperty ("efficiencyTool", m_efficiencyTool, "the calibration and smearing tool we apply"); + declareProperty ("onlyEfficiency", m_onlyEfficiency, "whether only to calculate efficiencies"); declareProperty ("onlyInefficiency", m_onlyInefficiency, "whether only to calculate inefficiencies"); } @@ -33,9 +34,9 @@ namespace CP StatusCode BTaggingEfficiencyAlg :: initialize () { - if (m_onlyInefficiency && m_selectionHandle) + if (m_onlyEfficiency && m_onlyInefficiency) { - ANA_MSG_ERROR ("can't specify both onlyInefficiency and selectionDecoration"); + ANA_MSG_ERROR ("can't specify both onlyEfficiency and onlyInefficiency"); return StatusCode::FAILURE; } @@ -83,7 +84,7 @@ namespace CP // this selection accessor/decoration has nothing to do with // it. You do the pre-selection via a view container like // for all the other CP algorithms. - if (!m_onlyInefficiency && m_selectionHandle.getBool (*jet, sys)) + if (m_onlyEfficiency || (!m_onlyInefficiency && m_selectionHandle.getBool (*jet, sys))) { ANA_CHECK_CORRECTION (m_outOfValidity, *jet, m_efficiencyTool->getScaleFactor (*jet, sf)); } else diff --git a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/python/FTagAnalysisSequence.py b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/python/FTagAnalysisSequence.py index 142fa51fcfeac42a7f78815b04d2150a3d5524f5..65dbe2daa1896f512e7f2ba83a1748ee0bd30ca4 100644 --- a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/python/FTagAnalysisSequence.py +++ b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/python/FTagAnalysisSequence.py @@ -144,6 +144,7 @@ def makeFTagAnalysisSequence( seq, dataType, jetCollection, alg.efficiencyTool.EfficiencyLightCalibrations = DSID alg.scaleFactorDecoration = 'ftag_effSF_' + btagger + '_' + btagWP + '_%SYS%' alg.selectionDecoration = 'ftag_select_' + btagger + '_' + btagWP + ',as_char' + alg.onlyEfficiency = btagWP == 'Continuous' alg.outOfValidity = 2 alg.outOfValidityDeco = 'no_ftag_' + btagger + '_' + btagWP if preselection is not None: