Skip to content
Snippets Groups Projects
Commit fbc77686 authored by Rosen Matev's avatar Rosen Matev :sunny:
Browse files

Merge branch 'gtuci/remove_lines' into 'master'

Remove V0 monitoring lines and adjust prescale of updated Ks lines

Closes #466

See merge request !1770
parents 5fda63c3 9afe1c08
No related branches found
No related tags found
1 merge request!1770Remove V0 monitoring lines and adjust prescale of updated Ks lines
Pipeline #5211496 passed
......@@ -11,10 +11,9 @@
from __future__ import absolute_import, division, print_function
from . import v0_monitoring, hlt1_ks_line_monitoring, pi0_line
from . import hlt1_ks_line_monitoring, pi0_line
all_lines = {}
all_lines.update(v0_monitoring.all_lines)
all_lines.update(hlt1_ks_line_monitoring.all_lines)
all_lines.update(pi0_line.all_lines)
......@@ -91,9 +91,9 @@ def dptopimpippip_line(name="Hlt2Monitoring_DpToPimPipPip_PR_Hlt1Monitoring",
name=name,
algs=charm_prefilters() + [dplus],
prescale=prescale,
persistreco=persistreco,
# hlt1_filter_code=
# "HLT_PASS_RE('Hlt1TrackMVADecision|Hlt1TwoTrackMVADecision|Hlt1TwoTrackKsDecision')"
persistreco=persistreco
#hlt1_filter_code=
#"Hlt1TrackMVADecision|Hlt1TwoTrackMVADecision|Hlt1TwoTrackKsDecision" # TODO
)
......@@ -136,9 +136,9 @@ def dptokspip_line(name="Hlt2Monitoring_DpToKsPip_PR_Hlt1Monitoring",
name=name,
algs=charm_prefilters() + [dplus],
prescale=prescale,
persistreco=persistreco,
# hlt1_filter_code=
# "HLT_PASS_RE('Hlt1TrackMVADecision|Hlt1TwoTrackMVADecision|Hlt1TwoTrackKsDecision')"
persistreco=persistreco
#hlt1_filter_code=
#"Hlt1TrackMVADecision|Hlt1TwoTrackMVADecision|Hlt1TwoTrackKsDecision" # TODO
)
......@@ -178,15 +178,15 @@ def passthrough_ks_line(name="Hlt2Monitoring_PassthroughKs_PR_Hlt1Monitoring",
name=name,
algs=charm_prefilters() + [ks0],
prescale=prescale,
persistreco=persistreco,
# hlt1_filter_code=
# "HLT_PASS_RE('Hlt1TrackMVADecision|Hlt1TwoTrackMVADecision|Hlt1TwoTrackKsDecision')"
persistreco=persistreco
#hlt1_filter_code=
#"Hlt1TrackMVADecision|Hlt1TwoTrackMVADecision|Hlt1TwoTrackKsDecision|Hlt1TwoKsDecision" # TODO
)
@register_line_builder(all_lines)
def inclksks_line(name="Hlt2Monitoring_InclKsKs_PR_Hlt1Monitoring",
prescale=1e-2,
prescale=1e-4,
persistreco=True):
ks0 = ParticleCombiner(
......@@ -224,10 +224,9 @@ def inclksks_line(name="Hlt2Monitoring_InclKsKs_PR_Hlt1Monitoring",
name=name,
algs=charm_prefilters() + [x0],
prescale=prescale,
persistreco=persistreco,
# hlt1_filter_code=
# "HLT_PASS_RE('Hlt1TrackMVADecision|Hlt1TwoTrackMVADecision|Hlt1TwoTrackKsDecision')"
# TODO: Add also KsKs HLT1 line when merged
persistreco=persistreco
#hlt1_filter_code=
#"Hlt1TrackMVADecision|Hlt1TwoTrackMVADecision|Hlt1TwoTrackKsDecision|Hlt1TwoKsDecision" # TODO
)
......@@ -263,6 +262,6 @@ def passthrough_v0_downstream_line(
name=name,
algs=charm_prefilters() + [v0],
prescale=prescale,
persistreco=persistreco,
# hlt1_filter_code="HLT_PASS_RE('Hlt1PassthroughDecision')"
)
persistreco=persistreco)
#hlt1_filter_code="Hlt1PassthroughDecision")
# TODO: add filter once Hlt1PassthroughDecision prescale is defined
###############################################################################
# (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
from Moore.lines import Hlt2Line
from PyConf import configurable
from Moore.config import register_line_builder
from Hlt2Conf.standard_particles import (
make_long_protons,
make_long_pions,
)
import Functors as F
from Functors.math import in_range
from RecoConf.reconstruction_objects import upfront_reconstruction
from RecoConf.reconstruction_objects import make_pvs
from RecoConf.event_filters import require_pvs
from GaudiKernel.SystemOfUnits import MeV
from Hlt2Conf.algorithms_thor import ParticleFilter, ParticleCombiner
from PyConf.Algorithms import Monitor__ParticleRange
all_lines = {}
def filter_protons(particles, pvs, ipchi2=16):
code = F.require_all(F.MINIPCHI2(pvs) > ipchi2)
return ParticleFilter(particles, F.FILTER(code))
def filter_pions(particles, pvs, ipchi2=16):
code = F.require_all(F.MINIPCHI2(pvs) > ipchi2)
return ParticleFilter(particles, F.FILTER(code))
@configurable
@register_line_builder(all_lines)
def lambda_to_ppi_monitoring_line(name="Hlt2L0ToPPiLLMonitoring",
prescale=0.5):
pvs = make_pvs()
protons = filter_protons(make_long_protons(), pvs)
pions = filter_pions(make_long_pions(), pvs)
Lambda = make_lambda(protons, pions, pvs)
# mass monitor
checkLambda_M = Monitor__ParticleRange(
name=name + "LambdaLLMonitor",
HistogramName="LambdaMass",
Input=Lambda,
Variable=F.MASS,
Bins=50,
Range=((1115.7 - 5 * 4.0) * MeV, (1115.7 + 5 * 4.0) * MeV))
return Hlt2Line(
name=name,
algs=upfront_reconstruction() +
[require_pvs(pvs), Lambda, checkLambda_M],
prescale=prescale,
)
@configurable
@register_line_builder(all_lines)
def ks0_to_pipi_monitoring_line(
name="Hlt2Ks0ToPiPiLLMonitoring",
prescale=0.25,
# FIXME the following flag used for testing online, to be removed
persistreco=False):
pvs = make_pvs()
pions = filter_pions(make_long_pions(), pvs)
Ks0 = make_ks0(pions, pvs)
checkKs0_M = Monitor__ParticleRange(
name=name + "KsLLMonitor",
HistogramName="KsMass",
Input=Ks0,
Variable=F.MASS,
Bins=50,
Range=((497.6 - 5 * 8.0) * MeV, (497.6 + 5 * 8.0) * MeV))
return Hlt2Line(
name=name,
algs=upfront_reconstruction() + [require_pvs(pvs), Ks0, checkKs0_M],
prescale=prescale,
persistreco=persistreco,
)
@configurable
def make_lambda(protons,
pions,
pvs,
am_min=1065.683 * MeV,
am_max=1165.683 * MeV,
vertex_chi2=16,
max_ipchi2=16):
combination_code = F.require_all(in_range(am_min, F.MASS, am_max))
vertex_code = F.require_all(F.CHI2DOF < vertex_chi2,
F.BPVIPCHI2(pvs) < max_ipchi2)
return ParticleCombiner([protons, pions],
DecayDescriptor="[Lambda0 -> p+ pi-]cc",
CombinationCut=combination_code,
CompositeCut=vertex_code)
@configurable
def make_ks0(pions,
pvs,
am_min=447.611 * MeV,
am_max=547.611 * MeV,
vertex_chi2=16,
max_ipchi2=16):
combination_code = F.require_all(in_range(am_min, F.MASS, am_max))
vertex_code = F.require_all(F.CHI2DOF < vertex_chi2,
F.BPVIPCHI2(pvs) < max_ipchi2)
return ParticleCombiner([pions, pions],
DecayDescriptor="KS0 -> pi+ pi-",
CombinationCut=combination_code,
CompositeCut=vertex_code)
......@@ -19,10 +19,8 @@ from RecoConf.global_tools import stateProvider_with_simplified_geom
from RecoConf.reconstruction_objects import reconstruction
##Make dummy Hlt2Line
from Moore.lines import Hlt2Line
from Hlt2Conf.lines.monitoring.v0_monitoring import make_ks0, filter_pions
from RecoConf.reconstruction_objects import upfront_reconstruction
from RecoConf.reconstruction_objects import make_pvs
from Hlt2Conf.standard_particles import make_long_pions
from Hlt2Conf.standard_particles import make_long_pions_for_V0, make_KsLL
from RecoConf.hlt1_tracking import (
make_SPmixed_raw_event,
......@@ -59,11 +57,10 @@ options.output_manifest_file = "hlt_filterstest_realtime.tck.json"
## Make 2 identical lines except for a Hlt1 filter in `Hlt2Test1`
def make_line1():
pvs = make_pvs()
pions = filter_pions(make_long_pions(), pvs)
pions = make_long_pions_for_V0()
return Hlt2Line(
name="Hlt2Test1",
algs=upfront_reconstruction() + [make_ks0(pions, pvs, vertex_chi2=4)],
algs=upfront_reconstruction() + [make_KsLL(pions)],
persistreco=True,
hlt1_filter_code=[
"Hlt1GECPassthroughDecision", "Hlt1.*fakeDecisions",
......@@ -72,11 +69,10 @@ def make_line1():
def make_line2():
pvs = make_pvs()
pions = filter_pions(make_long_pions(), pvs)
pions = make_long_pions_for_V0()
return Hlt2Line(
name="Hlt2Test2",
algs=upfront_reconstruction() + [make_ks0(pions, pvs, vertex_chi2=4)],
algs=upfront_reconstruction() + [make_KsLL(pions)],
persistreco=True)
......
......@@ -22,9 +22,7 @@ from RecoConf.global_tools import stateProvider_with_simplified_geom
from RecoConf.reconstruction_objects import reconstruction, upfront_reconstruction
##Make dummy SpruceLine
from Moore.lines import SpruceLine
from Hlt2Conf.lines.monitoring.v0_monitoring import make_ks0, filter_pions
from RecoConf.reconstruction_objects import make_pvs
from Hlt2Conf.standard_particles import make_long_pions
from Hlt2Conf.standard_particles import make_long_pions_for_V0, make_KsLL
# Run over output of
# ./run gaudirun.py Hlt/Hlt2Conf/tests/options/hlt_filters_test.py
......@@ -48,20 +46,18 @@ options.output_manifest_file = "spruce_filterstest.tck.json"
## Make 2 identical lines except for filters
def make_line1(name='SpruceTest1'):
pvs = make_pvs()
pions = filter_pions(make_long_pions(), pvs)
pions = make_long_pions_for_V0()
return SpruceLine(
name=name,
algs=upfront_reconstruction() + [make_ks0(pions, pvs, vertex_chi2=2)],
algs=upfront_reconstruction() + [make_KsLL(pions)],
hlt2_filter_code='Hlt2Test1Decision')
def make_line2(name='SpruceTest2'):
pvs = make_pvs()
pions = filter_pions(make_long_pions(), pvs)
pions = make_long_pions_for_V0()
return SpruceLine(
name=name,
algs=upfront_reconstruction() + [make_ks0(pions, pvs, vertex_chi2=2)],
algs=upfront_reconstruction() + [make_KsLL(pions)],
hlt1_filter_code='Hlt1GECPassthroughDecision',
hlt2_filter_code='Hlt2Test2Decision')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment