Skip to content
Snippets Groups Projects

NOPID configuration flags for selection

Merged Ivan Polyakov requested to merge bandq_ipolyako_nopid into master
4 files
+ 29
27
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -22,23 +22,21 @@ 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,
make_long_pions,
make_long_kaons,
make_long_protons)
from Hlt2Conf.standard_particles import (
make_has_rich_long_pions, make_has_rich_long_kaons,
make_has_rich_long_protons, make_long_pions, make_long_kaons,
make_long_protons)
import Functors as F
from Functors.math import in_range
from Hlt2Conf.lines.config_pid import config
if config["NOPIDHADRONS"] :
if config["NOPIDHADRONS"]:
make_pions = make_long_pions
make_kaons = make_long_kaons
make_protons = make_long_protons
else :
else:
make_pions = make_has_rich_long_pions
make_kaons = make_has_rich_long_kaons
make_protons = make_has_rich_long_protons
@@ -47,6 +45,7 @@ else :
# Charged hadron selections #
####################################
@configurable
def make_charged_hadrons(make_particles=make_pions,
name="bandq_charged_hadrons",
@@ -64,10 +63,10 @@ def make_charged_hadrons(make_particles=make_pions,
in_range(eta_min, F.ETA, eta_max),
F.MINIPCHI2(pvs) > mipchi2dvprimary_min)
if config["NOPIDHADRONS"] :
if config["NOPIDHADRONS"]:
pid = None
if pid is not None :
if pid is not None:
code &= pid
return ParticleFilter(make_particles(), name=name, Cut=F.FILTER(code))
@@ -103,7 +102,7 @@ def make_detached_pions_tightpid(name="bandq_detached_pions_tightpid",
Return B&Q detached pions with tight pid cut.
"""
if config["NOPIDHADRONS"] :
if config["NOPIDHADRONS"]:
pid = None
code = (pid)
@@ -136,10 +135,10 @@ def make_detached_kaons_tightpid(name="bandq_detached_kaons_tightpid",
Return B&Q detached kaons with tight pid cut.
"""
if config["NOPIDHADRONS"] :
if config["NOPIDHADRONS"]:
pid = None
code = pid
code = (pid)
return ParticleFilter(make_detached_kaons(), name=name, Cut=F.FILTER(code))
@@ -169,7 +168,7 @@ def make_detached_protons_tightpid(name="bandq_detached_protons_tightpid",
Return B&Q detached protons with tight pid cut.
"""
if config["NOPIDHADRONS"] :
if config["NOPIDHADRONS"]:
pid = None
code = (pid)
@@ -191,8 +190,7 @@ def make_prompt_pions(name="onia_prompt_pions",
"""
Return B&Q prompt pions.
"""
return make_charged_hadrons(
make_particles=make_pions, name=name, pid=pid)
return make_charged_hadrons(make_particles=make_pions, name=name, pid=pid)
@configurable
@@ -203,8 +201,7 @@ def make_prompt_kaons(name="onia_prompt_kaons",
"""
Return B&Q prompt kaons.
"""
return make_charged_hadrons(
make_particles=make_kaons, name=name, pid=pid)
return make_charged_hadrons(make_particles=make_kaons, name=name, pid=pid)
@configurable
Loading