Skip to content
Snippets Groups Projects

Update tests to ThOr functors and decouple from production

Merged Felipe Luan Souza De Almeida requested to merge felipe-update-tests into master
Files
4
@@ -19,7 +19,7 @@ from __future__ import absolute_import, division, print_function
from Moore import options, run_moore
from Moore.tcks import dump_hlt2_configuration
from RecoConf.global_tools import stateProvider_with_simplified_geom
from Moore.config import HltLine
from Moore.lines import Hlt2Line
from pprint import pprint
options.set_input_and_conds_from_testfiledb('upgrade_minbias_hlt1_filtered')
@@ -33,26 +33,79 @@ from RecoConf.hlt1_tracking import default_ft_decoding_version
ft_decoding_version = 2 #4,6
default_ft_decoding_version.global_bind(value=ft_decoding_version)
from RecoConf.reconstruction_objects import reconstruction, make_pvs, upfront_reconstruction
from Hlt2Conf.lines.charm.d0_to_hh import make_dzeros, make_charm_kaons
from RecoConf.reconstruction_objects import reconstruction
from RecoConf.reconstruction_objects import upfront_reconstruction, make_pvs_v2 as make_pvs
from RecoConf.hlt1_tracking import require_pvs
from Hlt2Conf.standard_particles import make_has_rich_long_kaons
from GaudiKernel.SystemOfUnits import GeV, MeV, mm, micrometer as um
import Functors as F
from Hlt2Conf.algorithms_thor import ParticleCombiner, ParticleFilter, require_all
def make_charm_kaons(pidk_cut):
"""Return kaons maker for D0 decay selection.
"""
pvs = make_pvs()
code = require_all(
F.MINIPCUT(IPCut=60 * um, Vertices=pvs), F.PT > 800 * MeV,
F.P > 5 * GeV, pidk_cut)
return ParticleFilter(make_has_rich_long_kaons(), F.FILTER(code))
def make_dzeros(particle1, particle2, name, descriptor):
"""Return D0 maker with selection tailored for two-body hadronic final
states.
Args:
particles (list of DataHandles): Input particles used in the
combination.
name (string): Combiner name for identification.
descriptor (string): Decay descriptor to be reconstructed.
"""
pvs = make_pvs()
combination_cut = require_all(F.MASS > 1685 * MeV, F.MASS < 2045 * MeV,
F.PT > 2 * GeV,
F.MAX(F.PT) > 1000 * MeV,
F.MAXDOCACUT(0.1 * mm))
vertex_cut = require_all(F.MASS > 1715 * MeV, F.MASS < 2015 * MeV,
F.CHI2DOF < 10.,
F.BPVFDCHI2(pvs) > 25.,
F.BPVDIRA(pvs) > 0.99985)
return ParticleCombiner([particle1, particle2],
name=name,
DecayDescriptor=descriptor,
CombinationCut=combination_cut,
CompositeCut=vertex_cut)
def test_A_line(name='Hlt2_test_stream_A_line', prescale=1):
kaons = make_charm_kaons(pid_cut='PIDK > 15')
kaons = make_charm_kaons(pidk_cut=F.PID_K > 15)
dzeros = make_dzeros(
particles=kaons, descriptors=['D0 -> K- K+'], pvs=make_pvs())
return HltLine(
name=name, algs=upfront_reconstruction() + [dzeros], prescale=prescale)
particle1=kaons,
particle2=kaons,
name='Charm_D0ToHH_D0ToKmKp_stream_A',
descriptor='D0 -> K- K+')
return Hlt2Line(
name=name,
algs=upfront_reconstruction() + [require_pvs(make_pvs())] + [dzeros],
prescale=prescale)
def test_B_line(name='Hlt2_test_stream_B_line', prescale=1):
# intentionally have some overlap with the other line in order to test
# the routing bits in events going to both streams.
kaons = make_charm_kaons(pid_cut='PIDK > 0')
kaons = make_charm_kaons(pidk_cut=F.PID_K > 0)
dzeros = make_dzeros(
particles=kaons, descriptors=['D0 -> K- K+'], pvs=make_pvs())
return HltLine(
name=name, algs=upfront_reconstruction() + [dzeros], prescale=prescale)
particle1=kaons,
particle2=kaons,
name='Charm_D0ToHH_D0ToKmKp_stream_B',
descriptor='D0 -> K- K+')
return Hlt2Line(
name=name,
algs=upfront_reconstruction() + [require_pvs(make_pvs())] + [dzeros],
prescale=prescale)
def make_streams():
Loading