diff --git a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetForwardJvtTool.h b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetForwardJvtTool.h index d66554f8d7a2ba27880a3153ac32eaddc81ae88b..7c47ae4992dfd104bf0445b4b14fac466a74d860 100644 --- a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetForwardJvtTool.h +++ b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetForwardJvtTool.h @@ -81,6 +81,7 @@ Gaudi::Property<double> m_jetScaleFactor{this, "JetScaleFactor", 0.4, "Jet scale factor"}; Gaudi::Property<double> m_fjvtThresh{this, "FjvtThresh", 15e3, "FJVT threshold"}; //15GeV->92%,11GeV->85% Gaudi::Property<bool> m_tightOP{this, "UseTightOP", false, "Use tight (true) or loose (false)"}; + Gaudi::Property<bool> m_recalculateFjvt{this, "RecalculateFjvt", true, "Recalculate Fjvt or use stored value"}; mutable std::vector<TVector2> m_pileupMomenta; mutable size_t m_pvind = 0UL; void getPV() const; diff --git a/Reconstruction/Jet/JetMomentTools/Root/JetForwardJvtTool.cxx b/Reconstruction/Jet/JetMomentTools/Root/JetForwardJvtTool.cxx index f2015c7e57ee2b357d7f815a073a361d322a6f97..0e86ea3fd4212b92d11f3fd181f1e875f832d5e5 100644 --- a/Reconstruction/Jet/JetMomentTools/Root/JetForwardJvtTool.cxx +++ b/Reconstruction/Jet/JetMomentTools/Root/JetForwardJvtTool.cxx @@ -74,10 +74,10 @@ SG::WriteDecorHandle<xAOD::JetContainer, float> fjvtDecHandle(m_fjvtDecKey); getPV(); - if (jetCont.size() > 0) calculateVertexMomenta(&jetCont); + if (m_recalculateFjvt && jetCont.size() > 0) calculateVertexMomenta(&jetCont); for(const auto jetF : jetCont) { outHandle(*jetF) = 1; - fjvtDecHandle(*jetF) = 0; + if(m_recalculateFjvt) fjvtDecHandle(*jetF) = 0; if (!forwardJet(jetF)) continue; double fjvt = getFJVT(jetF)/jetF->pt(); if (fjvt>m_fjvtThresh) outHandle(*jetF) = 0; @@ -87,6 +87,11 @@ } float JetForwardJvtTool::getFJVT(const xAOD::Jet *jet) const { + if(!m_recalculateFjvt){ + SG::WriteDecorHandle<xAOD::JetContainer, float> fjvtDecHandle(m_fjvtDecKey); + return fjvtDecHandle(*jet); + } + TVector2 fjet(-jet->pt()*cos(jet->phi()),-jet->pt()*sin(jet->phi())); double fjvt = 0; for (size_t pui = 0; pui < m_pileupMomenta.size(); pui++) {