diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/Jets.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/Jets.py index 343ef5771e722023961aba250494180a49555f79..31b0a1d5cea33fdc0344cc20b2a53598ce20a33b 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/Jets.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/Jets.py @@ -41,12 +41,15 @@ all_lines = {} @configurable -def make_jets(pflow, - pt_min=10 * GeV, - JetsByVtx=False, - tags=None, - useflightdirectionfortag=False): - jets = build_jets(pflow, JetsByVtx) +def make_jets( + pflow, + pt_min=10 * GeV, + JetsByVtx=False, + tags=None, + applyJEC=False, # Jet energy correction, JEC config in ..standard_jets.build_jets + useflightdirectionfortag=False, + name=""): + jets = build_jets(pflow, JetsByVtx, applyJEC, name='JetBuilder' + name) if tags is not None: taggedjets = tag_jets( @@ -108,6 +111,49 @@ def jetpt10_func_line(name='Hlt2JetsPt10Line', prescale=1): ) +@register_line_builder(all_lines) +@configurable +def jetpt10JEC_func_line(name='Hlt2JetsPt10JECLine', prescale=1): + pflow = make_particleflow() + jets = make_jets( + pflow=pflow, pt_min=10 * GeV, applyJEC=True, name="Pt10_JEC") + return HltLine( + name=name, + algs=upfront_reconstruction() + [jets], + prescale=prescale, + ) + + +@register_line_builder(all_lines) +@configurable +def jetpt10byPVs_func_line(name='Hlt2JetsPt10byPVsLine', prescale=1): + pflow = make_particleflow() + jets = make_jets( + pflow=pflow, pt_min=10 * GeV, JetsByVtx=True, name="Pt10_byPVs") + return HltLine( + name=name, + algs=upfront_reconstruction() + [jets], + prescale=prescale, + ) + + +@register_line_builder(all_lines) +@configurable +def jetpt10byPVsJEC_func_line(name='Hlt2JetsPt10byPVsJECLine', prescale=1): + pflow = make_particleflow() + jets = make_jets( + pflow=pflow, + pt_min=10 * GeV, + JetsByVtx=True, + applyJEC=True, + name="Pt10_byPVs_JEC") + return HltLine( + name=name, + algs=upfront_reconstruction() + [jets], + prescale=prescale, + ) + + @register_line_builder(all_lines) @configurable def onlytrack_jetpt10_func_line(name='Hlt2TrackJetsPt10Line', prescale=1): diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/standard_jets.py b/Hlt/Hlt2Conf/python/Hlt2Conf/standard_jets.py index f52678451520538304537c1c5e64ee39ff631512..5f59a34bf47944e9ba6744de56cd056b1db3d07b 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/standard_jets.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/standard_jets.py @@ -12,6 +12,8 @@ """ from __future__ import absolute_import, division, print_function +from math import pi as M_PI + from GaudiKernel.SystemOfUnits import GeV from PyConf.Algorithms import (ParticleMakerForParticleFlow, FastJetBuilder, @@ -54,7 +56,10 @@ def tag_jets(jets, tags, useflightdirection=False, name="TagJets"): @configurable -def build_jets(pflow, JetsByVtx=False, name='JetBuilder'): +def build_jets(pflow, JetsByVtx=False, applyJEC=False, name='JetBuilder'): + jetEcFilePath = "" # Null jetEcFilePath: Don't apply JEC + if applyJEC: + jetEcFilePath = "paramfile://data/JetEnergyCorrections_R05_hlt_Run2.root" return FastJetBuilder( Input=pflow, PVLocation=_make_pvs(), @@ -66,6 +71,13 @@ def build_jets(pflow, JetsByVtx=False, name='JetBuilder'): Recombination='E_scheme', # FastJet: RecombinationScheme JetID=98, # LHCb: Jet PID number JetsByVtx=JetsByVtx, + jetEcFilePath=jetEcFilePath, + jecLimNPvs=[0, 1], + jecLimEta=[2.0, 2.2, 2.3, 2.4, 2.6, 2.8, 3.0, 3.2, 3.6, 4.2, 4.5], + jecLimCpf=[0.06, 0.3, 0.4, 0.5, 0.6, 0.8, 1.0001], + jecLimPhi=[0, 1.0 / 6.0 * M_PI, 1.0 / 3.0 * M_PI, 0.5 * M_PI], + jecLimPt=[5, 298], + jetEcShift=0., name=name).Output