Skip to content
Snippets Groups Projects

NOPID configuration flags for selection

Merged Ivan Polyakov requested to merge bandq_ipolyako_nopid into master
Files
6
@@ -22,20 +22,22 @@ from Hlt2Conf.algorithms_thor import ParticleFilter, ParticleCombiner
from Functors import require_all
from PyConf import configurable
from Hlt2Conf.standard_particles import (make_has_rich_long_pions,
make_has_rich_long_kaons,
make_has_rich_long_protons)
from Hlt2Conf.standard_particles import make_has_rich_long_pions as make_pions, \
make_has_rich_long_kaons as make_kaons, \
make_has_rich_long_protons as make_protons
import Functors as F
from Functors.math import in_range
from Hlt2Conf.lines.config_pid import nopid_hadrons
####################################
# Charged hadron selections #
####################################
@configurable
def make_charged_hadrons(make_particles=make_has_rich_long_pions,
def make_charged_hadrons(make_particles=make_pions,
name="bandq_charged_hadrons",
pt_min=200. * MeV,
p_min=2.5 * GeV,
@@ -51,7 +53,7 @@ def make_charged_hadrons(make_particles=make_has_rich_long_pions,
in_range(eta_min, F.ETA, eta_max),
F.MINIPCHI2(pvs) > mipchi2dvprimary_min)
if pid is not None:
if (pid is not None) and (not nopid_hadrons()):
code &= pid
return ParticleFilter(make_particles(), name=name, Cut=F.FILTER(code))
@@ -73,7 +75,7 @@ def make_detached_pions(name="bandq_detached_pions",
"""
return make_charged_hadrons(
name=name,
make_particles=make_has_rich_long_pions,
make_particles=make_pions,
mipchi2dvprimary_min=mipchi2dvprimary_min,
pt_min=pt_min,
p_min=p_min,
@@ -87,9 +89,12 @@ def make_detached_pions_tightpid(name="bandq_detached_pions_tightpid",
Return B&Q detached pions with tight pid cut.
"""
code = (pid)
if nopid_hadrons():
cut_pid = None
else:
cut_pid = F.FILTER(pid)
return ParticleFilter(make_detached_pions(), name=name, Cut=F.FILTER(code))
return ParticleFilter(make_detached_pions(), name=name, Cut=cut_pid)
@configurable
@@ -102,7 +107,7 @@ def make_detached_kaons(name="bandq_detached_kaons",
Return B&Q detached kaons.
"""
return make_charged_hadrons(
make_particles=make_has_rich_long_kaons,
make_particles=make_kaons,
name=name,
mipchi2dvprimary_min=mipchi2dvprimary_min,
pt_min=pt_min,
@@ -117,9 +122,12 @@ def make_detached_kaons_tightpid(name="bandq_detached_kaons_tightpid",
Return B&Q detached kaons with tight pid cut.
"""
code = pid
if nopid_hadrons():
cut_pid = None
else:
cut_pid = F.FILTER(pid)
return ParticleFilter(make_detached_kaons(), name=name, Cut=F.FILTER(code))
return ParticleFilter(make_detached_kaons(), name=name, Cut=cut_pid)
@configurable
@@ -132,7 +140,7 @@ def make_detached_protons(name="bandq_detached_protons",
Return B&Q detached protons.
"""
return make_charged_hadrons(
make_particles=make_has_rich_long_protons,
make_particles=make_protons,
name=name,
p_min=p_min,
pt_min=pt_min,
@@ -147,10 +155,12 @@ def make_detached_protons_tightpid(name="bandq_detached_protons_tightpid",
Return B&Q detached protons with tight pid cut.
"""
code = (pid)
if nopid_hadrons():
cut_pid = None
else:
cut_pid = F.FILTER(pid)
return ParticleFilter(
make_detached_protons(), name=name, Cut=F.FILTER(code))
return ParticleFilter(make_detached_protons(), name=name, Cut=cut_pid)
####################################
@@ -166,8 +176,7 @@ def make_prompt_pions(name="onia_prompt_pions",
"""
Return B&Q prompt pions.
"""
return make_charged_hadrons(
make_particles=make_has_rich_long_pions, name=name, pid=pid)
return make_charged_hadrons(make_particles=make_pions, name=name, pid=pid)
@configurable
@@ -178,8 +187,7 @@ def make_prompt_kaons(name="onia_prompt_kaons",
"""
Return B&Q prompt kaons.
"""
return make_charged_hadrons(
make_particles=make_has_rich_long_kaons, name=name, pid=pid)
return make_charged_hadrons(make_particles=make_kaons, name=name, pid=pid)
@configurable
@@ -191,7 +199,7 @@ def make_prompt_protons(name="bandq_prompt_protons",
Return B&Q prompt protons.
"""
return make_charged_hadrons(
make_particles=make_has_rich_long_protons,
make_particles=make_protons,
name=name,
p_min=p_min,
pt_min=pt_min,
Loading