Commit 1e151d3a authored by Alex Pearce's avatar Alex Pearce
Browse files

Merge branch 'lohenry_trackSelector' into 'master'

Change default track selectors

See merge request lhcb/Moore!212
parents 18ae04fa 4c1acfe3
......@@ -28,7 +28,7 @@ from RecoConf.reco_objects_from_file import make_pvs as get_pvs_from_file
from ..algorithms import require_all, ParticleCombinerWithPVs, ParticleFilterWithPVs
from ..framework import configurable
from ..standard_particles import make_has_rich_pions, make_has_rich_kaons
from ..standard_particles import make_has_rich_long_pions, make_has_rich_long_kaons
from . import hlt2_line_builder
# Charged pion mass in MeV
......@@ -38,7 +38,7 @@ _PION_M = 139.57061 # +/- 0.00024
# TODO(AP): implement shared decorator
# @shared
@configurable
def make_selected_particles(make_particles=make_has_rich_pions,
def make_selected_particles(make_particles=make_has_rich_long_pions,
make_pvs=get_pvs_from_file,
trchi2_max=3,
mipchi2_min=8,
......@@ -70,12 +70,14 @@ def make_selected_particles(make_particles=make_has_rich_pions,
@configurable
def make_charm_pions(pid='PIDK < 3'):
return make_selected_particles(make_particles=make_has_rich_pions, pid=pid)
return make_selected_particles(
make_particles=make_has_rich_long_pions, pid=pid)
@configurable
def make_charm_kaons(pid='PIDK > 3'):
return make_selected_particles(make_particles=make_has_rich_kaons, pid=pid)
return make_selected_particles(
make_particles=make_has_rich_long_kaons, pid=pid)
@configurable
......@@ -174,7 +176,7 @@ def dstar2dzeropi_dzero2Kpi_line():
pions = make_charm_pions()
dzeros = make_dzeros(
particles=[kaons, pions], descriptors=['[D0 -> K- pi+]cc'])
soft_pions = make_has_rich_pions()
soft_pions = make_has_rich_long_pions()
dstars = make_dstars(
dzeros=dzeros,
soft_pions=soft_pions,
......
......@@ -32,22 +32,36 @@ from RecoConf.reco_objects_from_file import make_protoparticles
@configurable
def standard_particle_track_selector(Code='TrALL', **kwargs):
return TrackSelector(Code=Code, **kwargs)
def long_track_selector(Code='TrALL', **kwargs):
return TrackSelector(Code=require_all('TrLONG', Code), **kwargs)
@configurable
def standard_particle_protoparticle_filter(Code='PP_ALL', **kwargs):
def down_track_selector(Code='TrALL', **kwargs):
return TrackSelector(Code=require_all('TrDOWNSTREAM', Code), **kwargs)
@configurable
def upstream_track_selector(Code='TrALL', **kwargs):
return TrackSelector(Code=require_all('TrUPSTREAM', Code), **kwargs)
@configurable
def ttrack_track_selector(Code='TrALL', **kwargs):
return TrackSelector(Code=require_all('TrTTRACK', Code), **kwargs)
@configurable
def standard_protoparticle_filter(Code='PP_ALL', **kwargs):
return ProtoParticleFilter(
Code=Code, Factory=patched_hybrid_tool('PPFactory'), **kwargs)
@configurable
def make_particles(
species='pion',
make_protoparticles=make_protoparticles,
make_track_selector=standard_particle_track_selector,
make_protoparticle_filter=standard_particle_protoparticle_filter):
def make_particles(species='pion',
make_protoparticles=make_protoparticles,
make_track_selector=long_track_selector,
make_protoparticle_filter=standard_protoparticle_filter):
particles = FunctionalParticleMaker(
InputProtoParticles=make_protoparticles(),
ParticleID=species,
......@@ -56,16 +70,63 @@ def make_particles(
return particles
def make_pions():
return make_particles(species='pion')
#Long particles
def make_long_pions():
return make_particles(
species="pion",
make_track_selector=long_track_selector,
make_protoparticle_filter=standard_protoparticle_filter)
def make_long_kaons():
return make_particles(
species="kaon",
make_track_selector=long_track_selector,
make_protoparticle_filter=standard_protoparticle_filter)
def make_kaons():
return make_particles(species='kaon')
def make_long_protons():
return make_particles(
species="proton",
make_track_selector=long_track_selector,
make_protoparticle_filter=standard_protoparticle_filter)
def make_muons():
return make_particles(species='muon')
def make_long_muons():
return make_particles(
species="muon",
make_track_selector=long_track_selector,
make_protoparticle_filter=standard_protoparticle_filter)
#Down particles
def make_down_pions():
return make_particles(
species="pion",
make_track_selector=down_track_selector,
make_protoparticle_filter=standard_protoparticle_filter)
def make_down_protons():
return make_particles(
species="proton",
make_track_selector=down_track_selector,
make_protoparticle_filter=standard_protoparticle_filter)
#T particles
def make_ttrack_pions():
return make_particles(
species="pion",
make_track_selector=ttrack_track_selector,
make_protoparticle_filter=standard_protoparticle_filter)
def make_ttrack_protons():
return make_particles(
species="proton",
make_track_selector=ttrack_track_selector,
make_protoparticle_filter=standard_protoparticle_filter)
@configurable
......@@ -109,13 +170,65 @@ def make_mass_constrained_jpsi2mumu(pid_mu=0,
MotherCut=vertex_code)
# Make pions
@configurable
def make_has_rich_long_pions():
with standard_protoparticle_filter.bind(Code='PP_HASRICH'):
return make_long_pions()
@configurable
def make_has_rich_down_pions():
with standard_protoparticle_filter.bind(Code='PP_HASRICH'):
return make_down_pions()
@configurable
def make_has_rich_ttrack_pions():
with standard_protoparticle_filter.bind(Code='PP_HASRICH'):
return make_ttrack_pions()
# Make kaons
@configurable
def make_has_rich_long_kaons():
with standard_protoparticle_filter.bind(Code='PP_HASRICH'):
return make_long_kaons()
@configurable
def make_has_rich_down_kaons():
with standard_protoparticle_filter.bind(Code='PP_HASRICH'):
return make_down_kaons()
@configurable
def make_has_rich_ttrack_kaons():
with standard_protoparticle_filter.bind(Code='PP_HASRICH'):
return make_ttrack_kaons()
# Make protons
@configurable
def make_has_rich_long_protons():
with standard_protoparticle_filter.bind(Code='PP_HASRICH'):
return make_long_protons()
@configurable
def make_has_rich_down_protons():
with standard_protoparticle_filter.bind(Code='PP_HASRICH'):
return make_down_protons()
@configurable
def make_has_rich_pions():
with standard_particle_protoparticle_filter.bind(Code='PP_HASRICH'):
return make_pions()
def make_has_rich_ttrack_protons():
with standard_protoparticle_filter.bind(Code='PP_HASRICH'):
return make_ttrack_protons()
# Make muons
@configurable
def make_has_rich_kaons():
with standard_particle_protoparticle_filter.bind(Code='PP_HASRICH'):
return make_kaons()
def make_ismuon_long_muon():
with standard_protoparticle_filter.bind(Code='PP_ISMUON'):
return make_long_muons()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment