Skip to content
Snippets Groups Projects

QEE: Migrate the single muon HLT2 lines to ThOr

Merged Ross John Hunter requested to merge rjhunter-thor-muon-lines into qee_upgrade
Files
2
@@ -14,12 +14,15 @@ Definition of the HLT2 single high-PT muon line.
from GaudiKernel.SystemOfUnits import GeV
from PyConf import configurable
from PyConf.Algorithms import WeightedRelTableAlg
from Moore.config import register_line_builder
from Moore.lines import Hlt2Line
from Hlt2Conf.algorithms import require_all, ParticleFilter
from Hlt2Conf.algorithms_thor import require_all, ParticleFilter
from Hlt2Conf.standard_particles import make_ismuon_long_muon, make_long_muons
from RecoConf.reconstruction_objects import upfront_reconstruction
from Hlt2Conf.standard_jets import make_onlytrack_particleflow
import Functors as F
from Functors.math import in_range
all_lines = {}
@@ -29,9 +32,8 @@ def make_highpt_muons(name='HighPtMuonMaker',
muons=make_ismuon_long_muon,
min_muon_pt=15. * GeV):
code = require_all('PT > {min_pt}').format(min_pt=min_muon_pt)
return ParticleFilter(particles=muons(), name=name, Code=code)
code = require_all(F.PT > min_muon_pt)
return ParticleFilter(muons(), F.FILTER(code), name=name)
@configurable
@@ -39,17 +41,22 @@ def make_highpt_isolated_muons(name='HighPtIsolatedMuonMaker',
muons=make_ismuon_long_muon,
min_muon_pt=12.5 * GeV,
max_cone_pt=10.0 * GeV,
pflow_output="HltParticleFlow/Particles"):
pflow_output=make_onlytrack_particleflow()):
ftAlg = WeightedRelTableAlg(
ReferenceParticles=muons(),
InputCandidates=pflow_output,
Cut=(F.DR2 < (0.5**2)))
ftAlg_Rels = ftAlg.OutputRelations
code = require_all(
'PT > {min_muon_pt}',
'SUMCONE(0.5, PT, TESDATA("{pflow_location}")) < {max_cone_pt}',
).format(
min_muon_pt=min_muon_pt,
max_cone_pt=max_cone_pt,
pflow_location=pflow_output)
# FIXME Signal is (for now) manually removed from cone with - F.PT.
code = require_all(F.PT > min_muon_pt, (in_range(
0,
F.VALUE_OR(0) @ F.SUMCONE(Functor=F.PT, Relations=ftAlg_Rels) - F.PT,
max_cone_pt)))
return ParticleFilter(particles=muons(), name=name, Code=code)
return ParticleFilter(muons(), F.FILTER(code), name=name)
@register_line_builder(all_lines)
@@ -75,7 +82,6 @@ def single_muon_highpt_prescale_line(name='Hlt2SingleHighPtMuonPrescale',
persistreco=True):
"""High PT single muon line with lower pT threshold, prescaled to reduce the rate."""
# pflow algo populates the HltParticleFlow/Particles path for SUMCONE
high_pt_muons = make_highpt_muons(min_muon_pt=10. * GeV)
return Hlt2Line(
@@ -92,10 +98,9 @@ def single_muon_highpt_iso_line(name='Hlt2SingleHighPtMuonIso',
persistreco=True):
"""High PT single muon line with lower pT threshold, and isolation to keep the rate down."""
# pflow algo populates the HltParticleFlow/Particles path for SUMCONE
pflow = make_onlytrack_particleflow()
high_pt_isolated_muons = make_highpt_isolated_muons(
min_muon_pt=12.5 * GeV, pflow_output=pflow.location)
min_muon_pt=12.5 * GeV, pflow_output=pflow)
return Hlt2Line(
name=name,
Loading