Skip to content
Snippets Groups Projects

RD common builders in the ThOr framework

Closed Vitalii Lisovskyi requested to merge vlisovsk_rd_builders_to_thor into master
@@ -24,15 +24,24 @@ from Hlt2Conf.algorithms_thor import require_all, ParticleCombiner, ParticleFilt
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,
make_has_rich_long_pions,
make_has_rich_long_kaons,
make_has_rich_long_protons,
make_long_pions,
make_long_kaons,
make_long_protons,
#make_has_rich_down_pions, make_has_rich_down_kaons, make_has_rich_down_protons, # we don't usually need RICH info in fact for D tracks
make_down_pions, make_down_kaons, make_down_protons,
make_down_pions,
make_down_kaons,
make_down_protons,
#make_KsLL, make_KsDD, make_LambdaLL, make_LambdaDD, # we build our own versions below
make_long_muons, make_long_electrons_no_brem,
make_photons, make_resolved_pi0s, make_merged_pi0s,
make_detached_mumu, make_detached_dielectron_with_brem
)
make_long_muons,
make_long_electrons_no_brem,
make_photons,
make_resolved_pi0s,
make_merged_pi0s,
make_detached_mumu,
make_detached_dielectron_with_brem)
####################################
# Charged hadron selections #
@@ -55,7 +64,8 @@ def make_filter_tracks(
pid=None):
pvs = make_pvs()
code = require_all(F.PT > pt_min, F.P > p_min, F.CHI2DOF < trchi2dof_max, F.GHOSTPROB < trghostprob_max)
code = require_all(F.PT > pt_min, F.P > p_min, F.CHI2DOF < trchi2dof_max,
F.GHOSTPROB < trghostprob_max)
return ParticleFilter(make_particles(), F.FILTER(code))
if pid is not None:
@@ -67,7 +77,6 @@ def make_filter_tracks(
return ParticleFilter(make_particles(), name=name, Cut=F.FILTER(code))
####################################
# Detached #
####################################
@@ -211,7 +220,8 @@ def make_prompt_protons(name="rd_prompt_protons",
####################################
# Downstream tracks #
####################################
def make_down_tracks(name="rd_down_tracks", pid=None): #do we really need this one?
def make_down_tracks(name="rd_down_tracks",
pid=None): #do we really need this one?
"""
Return RD down hadrons with pion mass hypothesis.
"""
@@ -236,6 +246,7 @@ def make_detached_down_pions(
p_min=pt_min,
pid=pid)
def make_detached_down_kaons(
name="rd_detached_down_kaons",
mipchi2dvprimary_min=3., #TBC
@@ -253,6 +264,7 @@ def make_detached_down_kaons(
p_min=pt_min,
pid=pid)
def make_detached_down_protons(
name="rd_detached_down_protons",
mipchi2dvprimary_min=3., #TBC
@@ -276,6 +288,7 @@ def make_detached_down_protons(
####################################
# builders to be updated once the CL functor is implemented in ThOr.
@configurable
def make_rd_photons(name="rd_photons",
make_particles=make_photons,
@@ -330,31 +343,36 @@ def make_rd_merged_pi0s(name="rd_merged_pi0s",
# V0 particles and alike #
####################################
@configurable
def make_rd_ks0_lls(name="rd_ks0_lls",
make_pions=make_detached_pions,
make_pvs=make_pvs,
am_min=460 * MeV, # ~40 MeV window
am_max=540 * MeV,
pi_p_min=2 * GeV,
pi_pt_min=0 * GeV, # has to be 0 !!!
pi_ipchi2_min=9,
adocachi2cut=30.,
bpvvdchi2_min=4.,
vchi2pdof_max=30.):
def make_rd_ks0_lls(
name="rd_ks0_lls",
make_pions=make_detached_pions,
make_pvs=make_pvs,
am_min=460 * MeV, # ~40 MeV window
am_max=540 * MeV,
pi_p_min=2 * GeV,
pi_pt_min=0 * GeV, # has to be 0 !!!
pi_ipchi2_min=9,
adocachi2cut=30.,
bpvvdchi2_min=4.,
vchi2pdof_max=30.):
'''
Build Long-Long KS0 candidates. Approximately corresponding to the Run2
"StdVeryLooseKsLL" cuts.
'''
pions = make_pions(p_min=pi_p_min, pt_min=pi_pt_min, mipchi2dvprimary_min=pi_ipchi2_min, pid=None) # important to get rid of any PID cuts!
pions = make_pions(
p_min=pi_p_min,
pt_min=pi_pt_min,
mipchi2dvprimary_min=pi_ipchi2_min,
pid=None) # important to get rid of any PID cuts!
descriptor = 'KS0 -> pi+ pi-'
combination_code = require_all(
in_range(am_min, F.MASS, am_max),
F.MAXDOCACHI2CUT(adocachi2cut))
in_range(am_min, F.MASS, am_max), F.MAXDOCACHI2CUT(adocachi2cut))
pvs = make_pvs()
vertex_code = require_all(F.CHI2DOF < vchi2pdof_max, F.BPVFDCHI2(pvs) > bpvvdchi2_min
)
vertex_code = require_all(F.CHI2DOF < vchi2pdof_max,
F.BPVFDCHI2(pvs) > bpvvdchi2_min)
return ParticleCombiner([pions, pions],
name=name,
DecayDescriptor=descriptor,
@@ -363,30 +381,34 @@ def make_rd_ks0_lls(name="rd_ks0_lls",
@configurable
def make_rd_ks0_dds(name="rd_ks0_dds",
make_pions=make_detached_down_pions,
make_pvs=make_pvs,
am_min=420 * MeV, # ~75 MeV window
am_max=570 * MeV,
pi_p_min=2 * GeV,
pi_pt_min=0, # has to be 0 !!!
pi_ipchi2_min=4,
adocachi2cut=30.,
bpvvdchi2_min=4.,
vchi2pdof_max=25.):
def make_rd_ks0_dds(
name="rd_ks0_dds",
make_pions=make_detached_down_pions,
make_pvs=make_pvs,
am_min=420 * MeV, # ~75 MeV window
am_max=570 * MeV,
pi_p_min=2 * GeV,
pi_pt_min=0, # has to be 0 !!!
pi_ipchi2_min=4,
adocachi2cut=30.,
bpvvdchi2_min=4.,
vchi2pdof_max=25.):
'''
Build Long-Long KS0 candidates. Approximately corresponding to the Run2
"StdVeryLooseKsLL" cuts.
'''
pions = make_pions(p_min=pi_p_min, pt_min=pi_pt_min, mipchi2dvprimary_min=pi_ipchi2_min, pid=None)
pions = make_pions(
p_min=pi_p_min,
pt_min=pi_pt_min,
mipchi2dvprimary_min=pi_ipchi2_min,
pid=None)
descriptor = 'KS0 -> pi+ pi-'
combination_code = require_all(
in_range(am_min, F.MASS, am_max),
F.MAXDOCACHI2CUT(adocachi2cut))
in_range(am_min, F.MASS, am_max), F.MAXDOCACHI2CUT(adocachi2cut))
pvs = make_pvs()
vertex_code = require_all(F.CHI2DOF < vchi2pdof_max, F.BPVFDCHI2(pvs) > bpvvdchi2_min
)
vertex_code = require_all(F.CHI2DOF < vchi2pdof_max,
F.BPVFDCHI2(pvs) > bpvvdchi2_min)
return ParticleCombiner([pions, pions],
name=name,
DecayDescriptor=descriptor,
@@ -395,71 +417,88 @@ def make_rd_ks0_dds(name="rd_ks0_dds",
@configurable
def make_rd_lambda_lls(name="rd_lambda_lls",
make_protons=make_detached_protons,
make_pions=make_detached_pions,
make_pvs=make_pvs,
am_min=1076 * MeV, # ~40 MeV window
am_max=1156 * MeV,
pi_p_min=2 * GeV,
p_p_min=2 * GeV,
p_pt_min=0, # recommended to be 0
pi_pt_min=0, # has to be 0 !!!
pi_ipchi2_min=6,
p_ipchi2_min=9,
adocachi2cut=30.,
bpvvdchi2_min=4.,
vchi2pdof_max=30.):
def make_rd_lambda_lls(
name="rd_lambda_lls",
make_protons=make_detached_protons,
make_pions=make_detached_pions,
make_pvs=make_pvs,
am_min=1076 * MeV, # ~40 MeV window
am_max=1156 * MeV,
pi_p_min=2 * GeV,
p_p_min=2 * GeV,
p_pt_min=0, # recommended to be 0
pi_pt_min=0, # has to be 0 !!!
pi_ipchi2_min=6,
p_ipchi2_min=9,
adocachi2cut=30.,
bpvvdchi2_min=4.,
vchi2pdof_max=30.):
'''
Build Long-Long Lambda candidates. Approximately corresponding to the Run2
"StdVeryLooseLambdaLL" cuts.
'''
protons = make_protons(p_min=p_p_min, pt_min=p_pt_min, mipchi2dvprimary_min=p_ipchi2_min, pid=None) # important to get rid of any PID cuts!
pions = make_pions(p_min=pi_p_min, pt_min=pi_pt_min, mipchi2dvprimary_min=pi_ipchi2_min, pid=None)
protons = make_protons(
p_min=p_p_min,
pt_min=p_pt_min,
mipchi2dvprimary_min=p_ipchi2_min,
pid=None) # important to get rid of any PID cuts!
pions = make_pions(
p_min=pi_p_min,
pt_min=pi_pt_min,
mipchi2dvprimary_min=pi_ipchi2_min,
pid=None)
descriptor = '[Lambda0 -> p+ pi-]cc'
combination_code = require_all(
in_range(am_min, F.MASS, am_max),
F.MAXDOCACHI2CUT(adocachi2cut))
in_range(am_min, F.MASS, am_max), F.MAXDOCACHI2CUT(adocachi2cut))
pvs = make_pvs()
vertex_code = require_all(F.CHI2DOF < vchi2pdof_max, F.BPVFDCHI2(pvs) > bpvvdchi2_min
)
vertex_code = require_all(F.CHI2DOF < vchi2pdof_max,
F.BPVFDCHI2(pvs) > bpvvdchi2_min)
return ParticleCombiner([protons, pions],
name=name,
DecayDescriptor=descriptor,
CombinationCut=combination_code,
CompositeCut=vertex_code)
@configurable
def make_rd_lambda_dds(name="rd_lambda_dds",
make_protons=make_detached_down_protons,
make_pions=make_detached_down_pions,
make_pvs=make_pvs,
am_min=1050 * MeV, # ~65 MeV window
am_max=1180 * MeV,
pi_p_min=2 * GeV,
p_p_min=2 * GeV,
p_pt_min=0, # recommended to be 0
pi_pt_min=0, # has to be 0 !!!
pi_ipchi2_min=6,
p_ipchi2_min=9,
adocachi2cut=30.,
bpvvdchi2_min=4.,
vchi2pdof_max=25.):
def make_rd_lambda_dds(
name="rd_lambda_dds",
make_protons=make_detached_down_protons,
make_pions=make_detached_down_pions,
make_pvs=make_pvs,
am_min=1050 * MeV, # ~65 MeV window
am_max=1180 * MeV,
pi_p_min=2 * GeV,
p_p_min=2 * GeV,
p_pt_min=0, # recommended to be 0
pi_pt_min=0, # has to be 0 !!!
pi_ipchi2_min=6,
p_ipchi2_min=9,
adocachi2cut=30.,
bpvvdchi2_min=4.,
vchi2pdof_max=25.):
'''
Build Down-Down Lambda candidates. Approximately corresponding to the Run2
"StdVeryLooseLambdaLL" cuts.
'''
protons = make_protons(p_min=p_p_min, pt_min=p_pt_min, mipchi2dvprimary_min=p_ipchi2_min, pid=None) # important to get rid of any PID cuts!
pions = make_pions(p_min=pi_p_min, pt_min=pi_pt_min, mipchi2dvprimary_min=pi_ipchi2_min, pid=None)
protons = make_protons(
p_min=p_p_min,
pt_min=p_pt_min,
mipchi2dvprimary_min=p_ipchi2_min,
pid=None) # important to get rid of any PID cuts!
pions = make_pions(
p_min=pi_p_min,
pt_min=pi_pt_min,
mipchi2dvprimary_min=pi_ipchi2_min,
pid=None)
descriptor = '[Lambda0 -> p+ pi-]cc'
combination_code = require_all(
in_range(am_min, F.MASS, am_max),
F.MAXDOCACHI2CUT(adocachi2cut))
in_range(am_min, F.MASS, am_max), F.MAXDOCACHI2CUT(adocachi2cut))
pvs = make_pvs()
vertex_code = require_all(F.CHI2DOF < vchi2pdof_max, F.BPVFDCHI2(pvs) > bpvvdchi2_min
)
vertex_code = require_all(F.CHI2DOF < vchi2pdof_max,
F.BPVFDCHI2(pvs) > bpvvdchi2_min)
return ParticleCombiner([protons, pions],
name=name,
DecayDescriptor=descriptor,
@@ -474,32 +513,30 @@ def make_rd_lambda_dds(name="rd_lambda_dds",
@configurable
def make_rd_detached_kstar0s(name="rd_detached_kstar0s",
make_detached_pions=make_detached_pions,
make_detached_kaons=make_detached_kaons,
make_pvs=make_pvs,
am_min=592 * MeV,
am_max=1192 * MeV,
pi_p_min=2 * GeV,
pi_pt_min=100 * MeV,
k_p_min=2 * GeV,
k_pt_min=100 * MeV,
kstar0_pt_min=400 * MeV,
adocachi2cut=30.,
vchi2pdof_max=25):
make_detached_pions=make_detached_pions,
make_detached_kaons=make_detached_kaons,
make_pvs=make_pvs,
am_min=592 * MeV,
am_max=1192 * MeV,
pi_p_min=2 * GeV,
pi_pt_min=100 * MeV,
k_p_min=2 * GeV,
k_pt_min=100 * MeV,
kstar0_pt_min=400 * MeV,
adocachi2cut=30.,
vchi2pdof_max=25):
'''
Build Kstar0 candidates. Approximately corresponding to the Run2
"StdVeryLooseDetachedKstar" cuts.
'''
pions = make_detached_pions(p_min=pi_p_min, pt_min=pi_pt_min)
kaons = make_detached_kaons(p_min=k_p_min, pt_min=k_pt_min )
kaons = make_detached_kaons(p_min=k_p_min, pt_min=k_pt_min)
descriptor = '[K*(892)0 -> pi- K+]cc'
combination_code = require_all(
in_range(am_min, F.MASS, am_max),
F.MAXDOCACHI2CUT(adocachi2cut))
in_range(am_min, F.MASS, am_max), F.MAXDOCACHI2CUT(adocachi2cut))
#pvs = make_pvs()
vertex_code = require_all(F.CHI2DOF < vchi2pdof_max, F.PT > kstar0_pt_min
)
vertex_code = require_all(F.CHI2DOF < vchi2pdof_max, F.PT > kstar0_pt_min)
return ParticleCombiner([pions, kaons],
name=name,
DecayDescriptor=descriptor,
@@ -508,15 +545,16 @@ def make_rd_detached_kstar0s(name="rd_detached_kstar0s",
@configurable
def make_rd_detached_phis(name="rd_detached_phis",
make_detached_kaons=make_detached_kaons,
make_pvs=make_pvs,
am_max=1100 * MeV, #min is the di-kaon threshold anyway
k_p_min=2 * GeV,
k_pt_min=100 * MeV,
phi_pt_min=400 * MeV,
adocachi2cut=30.,
vchi2pdof_max=25):
def make_rd_detached_phis(
name="rd_detached_phis",
make_detached_kaons=make_detached_kaons,
make_pvs=make_pvs,
am_max=1100 * MeV, #min is the di-kaon threshold anyway
k_p_min=2 * GeV,
k_pt_min=100 * MeV,
phi_pt_min=400 * MeV,
adocachi2cut=30.,
vchi2pdof_max=25):
'''
Build phi(1020) candidates. Approximately corresponding to the Run2
"StdLooseDetachedPhi2KK" cuts.
@@ -524,22 +562,22 @@ def make_rd_detached_phis(name="rd_detached_phis",
kaons = make_detached_kaons(p_min=k_p_min, pt_min=k_pt_min)
descriptor = 'phi(1020) -> K+ K-'
combination_code = require_all(
F.MASS < am_max,
F.MAXDOCACHI2CUT(adocachi2cut))
combination_code = require_all(F.MASS < am_max,
F.MAXDOCACHI2CUT(adocachi2cut))
#pvs = make_pvs()
vertex_code = require_all(F.CHI2DOF < vchi2pdof_max, F.PT > phi_pt_min
)
vertex_code = require_all(F.CHI2DOF < vchi2pdof_max, F.PT > phi_pt_min)
return ParticleCombiner([kaons, kaons],
name=name,
DecayDescriptor=descriptor,
CombinationCut=combination_code,
CompositeCut=vertex_code)
####################################
# Dileptons #
####################################
#Take the standard detached dileptons, filter with an MVA and save the necessary related tracks
@configurable
def filter_dimuon_noMVA(max_dimuon_mass=6000 * MeV):
@@ -552,7 +590,8 @@ def filter_dimuon_noMVA(max_dimuon_mass=6000 * MeV):
@configurable
def filter_dielectron_noMVA(max_dielectron_mass=6000 * MeV):
dielectrons = make_detached_dielectron_with_brem(probnn_e=0.05, m_diE_max = max_dielectron_mass)
dielectrons = make_detached_dielectron_with_brem(
probnn_e=0.05, m_diE_max=max_dielectron_mass)
code = require_all(F.MASS < max_dielectron_mass)
return ParticleFilter(dielectrons, F.FILTER(code))
Loading