Commit 740da7cf authored by Anthony Morley's avatar Anthony Morley Committed by Vakhtang Tsulaia
Browse files

JetForwardJvtTool: Add flag to read in instead of calculate fJVT

parent 9120668a
......@@ -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;
......
......@@ -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++) {
......
Markdown is supported
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