Skip to content
Snippets Groups Projects

NOPID configuration flags for selection

Merged Ivan Polyakov requested to merge bandq_ipolyako_nopid into master
3 files
+ 76
16
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -24,18 +24,32 @@ 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_has_rich_long_protons,
make_long_pions,
make_long_kaons,
make_long_protons)
import Functors as F
from Functors.math import in_range
from config_bandq import config
if config["NOPIDHADRONS"] :
make_pions = make_long_pions
make_kaons = make_long_kaons
make_protons = make_long_protons
else :
make_pions = make_has_rich_long_pions
make_kaons = make_has_rich_long_kaons
make_protons = make_has_rich_long_protons
####################################
# 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 +65,10 @@ 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 config["NOPIDHADRONS"] :
pid = None
if pid is not None :
code &= pid
return ParticleFilter(make_particles(), name=name, Cut=F.FILTER(code))
@@ -73,7 +90,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,6 +104,9 @@ def make_detached_pions_tightpid(name="bandq_detached_pions_tightpid",
Return B&Q detached pions with tight pid cut.
"""
if config["NOPIDHADRONS"] :
pid = None
code = (pid)
return ParticleFilter(make_detached_pions(), name=name, Cut=F.FILTER(code))
@@ -102,7 +122,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,6 +137,9 @@ def make_detached_kaons_tightpid(name="bandq_detached_kaons_tightpid",
Return B&Q detached kaons with tight pid cut.
"""
if config["NOPIDHADRONS"] :
pid = None
code = pid
return ParticleFilter(make_detached_kaons(), name=name, Cut=F.FILTER(code))
@@ -132,7 +155,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,6 +170,9 @@ def make_detached_protons_tightpid(name="bandq_detached_protons_tightpid",
Return B&Q detached protons with tight pid cut.
"""
if config["NOPIDHADRONS"] :
pid = None
code = (pid)
return ParticleFilter(
@@ -167,7 +193,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)
make_particles=make_pions, name=name, pid=pid)
@configurable
@@ -179,7 +205,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)
make_particles=make_kaons, name=name, pid=pid)
@configurable
@@ -191,7 +217,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