From dd51888ca7a75c279c81b27b0f965432ec9da0af Mon Sep 17 00:00:00 2001 From: Edward Date: Fri, 21 Feb 2020 16:15:08 +0100 Subject: [PATCH 01/21] added Hlt from Moore (Moore/master) --- Hlt/RecoConf/python/RecoConf/mc_cuts.py | 156 ++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 Hlt/RecoConf/python/RecoConf/mc_cuts.py diff --git a/Hlt/RecoConf/python/RecoConf/mc_cuts.py b/Hlt/RecoConf/python/RecoConf/mc_cuts.py new file mode 100644 index 00000000000..961e9293c0a --- /dev/null +++ b/Hlt/RecoConf/python/RecoConf/mc_cuts.py @@ -0,0 +1,156 @@ +############################################################################### +# (c) Copyright 2019 CERN for the benefit of the LHCb Collaboration # +# # +# This software is distributed under the terms of the GNU General Public # +# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # +# # +# In applying this licence, CERN does not waive the privileges and immunities # +# granted to it by virtue of its status as an Intergovernmental Organization # +# or submit itself to any jurisdiction. # +############################################################################### +from GaudiKernel.SystemOfUnits import mm, GeV +MCCuts = { + "Velo": { + "01_velo": "isVelo", + "02_long": "isLong", + "03_long>5GeV": "isLong & over5", + "04_long_strange": "isLong & strange", + "05_long_strange>5GeV": "isLong & strange & over5", + "06_long_fromB": "isLong & fromB", + "07_long_fromB>5GeV": "isLong & fromB & over5", + "08_long_electrons": "isLong & isElectron", + "09_long_fromB_electrons": "isLong & isElectron & fromB", + "10_long_fromB_electrons_P>5GeV": "isLong & isElectron & over5 & fromB" + }, + "Forward": { + "01_long": "isLong", + "02_long>5GeV": "isLong & over5", + "03_long_strange": "isLong & strange", + "04_long_strange>5GeV": "isLong & strange & over5", + "05_long_fromB": "isLong & fromB", + "06_long_fromB>5GeV": "isLong & fromB & over5", + "07_long_electrons": "isLong & isElectron", + "08_long_fromB_electrons": "isLong & isElectron & fromB", + "09_long_fromB_electrons_P>5GeV": "isLong & isElectron & over5 & fromB" + }, + "Up": { + "01_velo": "isVelo", + "02_velo+UT": "isVelo & isUT", + "03_velo+UT>5GeV": "isVelo & isUT & over5", + "04_velo+notLong": "isNotLong & isVelo ", + "05_velo+UT+notLong": "isNotLong & isVelo & isUT", + "06_velo+UT+notLong>5GeV": "isNotLong & isVelo & isUT & over5", + "07_long": "isLong", + "08_long>5GeV": "isLong & over5 ", + "09_long_fromB": "isLong & fromB", + "10_long_fromB>5GeV": "isLong & fromB & over5", + "11_long_electrons": "isLong & isElectron", + "12_long_fromB_electrons": "isLong & isElectron & fromB", + "13_long_fromB_electrons_P>5GeV": "isLong & isElectron & over5 & fromB" + }, + "T": { + "01_hasT": + "isSeed ", + "02_long": + "isLong", + "03_long>5GeV": + "isLong & over5", + "04_long_fromB": + "isLong & fromB", + "05_long_fromB>5GeV": + "isLong & fromB & over5", + "06_UT+T_strange": + "strange & isDown", + "07_UT+T_strange>5GeV": + "strange & isDown & over5", + "08_noVelo+UT+T_strange": + "strange & isDown & isNotVelo", + "09_noVelo+UT+T_strange>5GeV": + "strange & isDown & over5 & isNotVelo", + "10_UT+T_SfromDB": + "strange & isDown & ( fromB | fromD )", + "11_UT+T_SfromDB>5GeV": + "strange & isDown & over5 & ( fromB | fromD )", + "12_noVelo+UT+T_SfromDB>5GeV": + "strange & isDown & isNotVelo & over5 & ( fromB | fromD )" + }, + "Down": { + "01_UT+T": + "isDown ", + "02_UT+T>5GeV": + "isDown & over5", + "03_UT+T_strange": + " strange & isDown", + "04_UT+T_strange>5GeV": + " strange & isDown & over5", + "05_noVelo+UT+T_strange": + " strange & isDown & isNotVelo", + "06_noVelo+UT+T_strange>5GeV": + " strange & isDown & over5 & isNotVelo", + "07_UT+T_fromB": + "isDown & fromB", + "08_UT+T_fromB>5GeV": + "isDown & fromB & over5", + "09_noVelo+UT+T_fromB": + "isDown & fromB & isNotVelo", + "10_noVelo+UT+T_fromB>5GeV": + "isDown & fromB & over5 & isNotVelo", + "11_UT+T_SfromDB": + " strange & isDown & ( fromB | fromD )", + "12_UT+T_SfromDB>5GeV": + " strange & isDown & over5 & ( fromB | fromD )", + "13_noVelo+UT+T_SfromDB": + " strange & isDown & isNotVelo & ( fromB | fromD )", + "14_noVelo+UT+T_SfromDB>5GeV": + " strange & isDown & isNotVelo & over5 & ( fromB | fromD ) " + }, + "UTForward": { + "01_long": "isLong", + "02_long>5GeV": "isLong & over5" + }, + "UTDown": { + "01_has seed": "isSeed", + "02_has seed +noVelo, T+UT": "isSeed & isNotVelo & isDown", + "03_down+strange": "strange & isDown", + "04_down+strange+>5GeV": "strange & isDown & over5", + "05_pi<-Ks<-B": "fromKsFromB", + "06_pi<-Ks<-B+> 5 GeV": "fromKsFromB & over5" + }, +} +TriggerMCCuts = { + "Velo": { + "11_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger", + "12_UT_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger & isUT" + }, + "Forward": { + "10_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger", + "11_UT_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger & isUT" + }, + "Up": { + "14_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger", + "15_UT_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger & isUT" + }, + "New": { + "long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger", + "UT_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger & isUT" + }, + "UTForward": { + "03_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger", + "04_UT_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger & isUT" + }, + "UTDown": { + "07_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger", + "08_UT_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger & isUT" + }, + "UTNew": { + "long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger", + "UT_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger & isUT" + }, +} + + +def get_mc_cuts(key, triggerNumbers=False): + cuts = MCCuts[key] if key in MCCuts else {} + if triggerNumbers and key in TriggerMCCuts: + cuts.update(TriggerMCCuts[key]) + return cuts -- GitLab From 768fe69075a99017fe8d57fd78947b6312d681ae Mon Sep 17 00:00:00 2001 From: Edward Date: Fri, 21 Feb 2020 16:20:46 +0100 Subject: [PATCH 02/21] Added new D02HHKS HLT2 line --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 506 ++++++++++++++++++ .../python/Hlt2Conf/lines/__init__.py | 2 + 2 files changed, 508 insertions(+) create mode 100644 Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py new file mode 100644 index 00000000000..23966624159 --- /dev/null +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -0,0 +1,506 @@ +############################################################################### +# (c) Copyright 2019 CERN for the benefit of the LHCb Collaboration # +# # +# This software is distributed under the terms of the GNU General Public # +# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # +# # +# In applying this licence, CERN does not waive the privileges and immunities # +# granted to it by virtue of its status as an Intergovernmental Organization # +# or submit itself to any jurisdiction. # +############################################################################### +""" +Definition of D0 -> Ks h+ h- HLT2 lines. + + + + +""" + +from Moore.config import HltLine, register_line_builder + +from GaudiKernel.SystemOfUnits import GeV, MeV, picosecond, mm, mrad, rad + +from RecoConf.hlt1_tracking import require_pvs, require_gec + +from RecoConf.reco_objects_from_file import make_pvs, upfront_reconstruction + +from ..algorithms import (require_all, ParticleCombinerWithPVs, ParticleFilter) +from ..framework import configurable +from ..standard_particles import (make_long_pions, make_has_rich_long_kaons, + make_has_rich_long_pions, make_KsDD, + make_KsLL) + +all_lines = {} + + +@configurable +def make_selected_particles(make_particles=make_has_rich_long_kaons, + make_pvs=make_pvs, + trchi2dof_max=3, + trghost_max=0.4, + mipchi2_min=None, + pt_min=200 * MeV, + p_min=1000 * MeV, + pid_cut="PIDK > 5"): + + code = require_all("TRCHI2DOF < {trchi2dof_max}", + "TRHOSTPROB < {trghist_max}", "PT > {pt_min}", + "P > {p_min}").format( + trchi2dof_max=trchi2dof_max, + trghost_max=trghost_max, + mipchi2_min=mipchi2_min, + pt_min=pt_min, + p_min=p_min, + ) + + code += " & ({})".format(pid_cut) + if mipchi2_min is not None: + code += " & MIPCHI2DV(PRIMARY) > {mipchi2_min}".format(mipchi2_min) + + return ParticleFilterWithPVs(make_particles(), make_pvs(), Code=code) + + +@configurable +def make_charm_pions(pid_cut="PIDK < 5"): + + return make_selected_particles( + make_particles=make_has_rich_long_pions, pid_cut=pid_cut) + + +@configurable +def make_charm_kaons(mipchi2_min=4, pid_cut="PIDK > 5"): + + return make_selected_particles( + make_particles=make_has_rich_long_kaons, pid_cut=pid_cut) + + +@configurable +def make_charm_pions_ltunb(pid_cut="PIDK < 0"): + + return make_selected_particles( + make_particles=make_has_rich_long_pions, pid_cut=pid_cut) + + +@configurable +def make_charm_kaons_ltunb(pt_min=500 * MeV, pid_cut="PIDK > 10"): + + return make_selected_particles( + make_particles=make_has_rich_long_kaons, + pt_min=pt_min, + pid_cut=pid_cut) + + +@configurable +def make_kshortLL(make_particles=make_KsLL, + bpvltime_min=0.0005, + vfaspf_min=-100, + vfaspf_max=500): + + code = require_all( + "BPVLTIME() > {bpvltime_min}", + "in_range({vfaspf_min}, VFASPF(VZ), {vfaspf_max})").format( + bpvltime_min=bpvltime_min, + vfaspf_min=vfaspf_min, + vfaspf_max=vfaspf_max) + + return ParticleFilter(make_particles(), Code=code) + + +@configurable +def make_kshortDD(make_particles=make_KsDD, + bpvltime_min=0.0005, + vfaspf_min=300, + vfaspf_max=2275): + + code = require_all( + "BPVLTIME() > {bpvltime_min}", + "in_range({vfaspf_min}, VFASPF(VZ), {vfaspf_max})").format( + bpvltime_min=bpvltime_min, + vfaspf_min=vfaspf_min, + vfaspf_max=vfaspf_max) + + return ParticleFilter(make_particles(), Code=code) + + +@configurable +def make_charm_soft_pions(make_particles=make_long_pions, + pt_min=200 * MeV, + p_min=1 * GeV, + trchi2dof_max=3.0, + trghostprob_max=0.25): + + code = require_all("TRCHI2DOF < {trchi2dof_max}", + "TRGHOSTPROB < {trghost_max}", "PT > {pt_min}", + "P > {p_min}").format( + trchi2dof_max=trchi2dof_max, + trghostprob_max=trghostprob_max, + pt_min=pt_min, + p_min=p_min) + + return ParticleFilter(make_particles(), Code=code) + + +@configurable +def make_dzeros(particles, + descriptors, + pvs, + am_min=1740 * MeV, + am_max=1990 * MeV, + achildsum_pt_min=1500 * MeV, + pt_min=1800 * MeV, + vchi2pdof_max=5, + bpvdira_min=math.cos(0.0346) * rad, + bpvvdchi2_min=20, + bpvltime_min=0.0001, + d2dvvdchi2_min=math.exp(5.0), + m_min=1765 * MeV, + m_max=1965 * MeV): + + combination_code = require_all( + "in_range({am_min}, AM, {am_max})", + "(APT1+APT2+APT3) > {achildsum_pt_min}").format( + am_min=am_min, am_max=am_max) + + vertex_code = require_all( + "PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof}", "BPVDIRA > {bpvdira_min}", + "BPVVDCHI2 > {bpvvdchi2_min}", "BPVLTIME() > {bpvltime_min}", + "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( + pt_min=pt_min, + vchi2pdof_max=vchi22pdof_max, + bpvdira_min=bpvdira_min, + bpvvdchi2_min=bpvvdchi2_min, + bpvltime_min=bpvltime_min, + d2dvvdchi2_min=d2dvvdchi2_min) + + dzeros = ParticleCombinerWithPVs( + particles=particles, + pvs=pvs, + DecayDescriptors=descriptors, + CombinationCut=combination_code, + MotherCut=vertex_code) + + code = require_all("in_range({m_min} < M < {m_max})").format( + m_min=m_min, m_max=m_max) + + return ParticleFilter(dzeros, Code=code) + + +@configurable +def make_dzeros_ltunb(particles, + descriptors, + pvs, + am_min=1740 * MeV, + am_max=1990 * MeV, + achildsum_pt_min=1500 * MeV, + pt_min=1800 * MeV, + vchi2pdof_max=5, + bpvdira_min=math.cos(0.01415) * rad, + bpvltime_min=0.00025, + d2dvvdchi2_min=math.exp(5.0), + m_min=1765 * MeV, + m_max=1965 * MeV): + + combination_code = require_all( + "in_range({am_min}, AM, {am_max})", + "(APT1+APT2+APT3) > {achildsum_pt_min}").format( + am_min=am_min, am_max=am_max) + + vertex_code = require_all( + "PT > {pt_min}", "VFASPF(VCHI2PDOF) < {vchi2pdof}", + "BPVDIRA > {bpvdira_min}", "BPVLTIME() > {bpvltime_min}", + "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( + pt_min=pt_min, + vchi2pdof_max=vchi22pdof_max, + bpvdira_min=bpvdira_min, + bpvvdchi2_min=bpvvdchi2_min, + bpvltime_min=bpvltime_min, + d2dvvdchi2_min=d2dvvdchi2_min) + + dzeros = ParticleCombinerWithPVs( + particles=particles, + pvs=pvs, + DecayDescriptors=descriptors, + CombinationCut=combination_code, + MotherCut=vertex_code) + + code = require_all("in_range({m_min} < M < {m_max})").format( + m_min=m_min, m_max=m_max) + + return ParticleFilter(dzeros, Code=code) + + +@configurable +def make_dstars(dzeros, + soft_pions, + descriptors, + pvs, + q_am_min=-4.57018 * MeV, + q_am_max=35.42982 * MeV, + q_m_min=-4.57018 * MeV, + q_m_max=25.42982 * MeV, + vchi2pdof_max=10.0): + + combination_code = require_all( + "in_range({q_am_min}, (AM - AM1 - AM2), {q_am_max})").format( + q_am_min=q_am_min, q_am_max=q_am_max) + + vertex_code = require_all( + "VFASPF(VCHI2PDOF) < {vchi2pdof_max}", + "in_range({q_m_min}, (M - M1 - M2), {q_m_max})").format( + q_m_min=q_m_min, q_m_max=q_m_max, vchi2pdof_max=vchi2pdof_max) + + return ParticleCombinerWithPVs( + particles=[dzeros, soft_pions], + pvs=pvs, + DecayDescriptors=descriptors, + CombinationCut=combination_code, + MotherCut=vertex_code) + + +def charm_prefilters(): + """Return a list of prefilters common to charm HLT2 lines.""" + return [require_gec(), require_pvs(make_pvs())] + + +""" +D* -> (D0 -> Ks K+ K-) pi+ +""" + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2kpkmksLL_line( + name='Hlt2CharmDstpToD0Pip_D0ToKpKmKsLLLine', prescale=1): + + kaons = make_charm_kaons() + Ks = make_kshortLL() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[kaons, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2kpkmksDD_line( + name='Hlt2CharmDstpToD0Pip_D0ToKpKmKsDDLine', prescale=1): + + kaons = make_charm_kaons() + Ks = make_kshortDD() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[kaons, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) + + +""" +D* -> (D0 -> Ks K+ K-) pi+ LTUNB +""" + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2kpkmksLL_ltunb_line( + name='Hlt2CharmDstpToD0Pip_D0ToKpKmKsLL_LTUNBLine', prescale=1): + + kaons = make_charm_kaons_ltunb() + Ks = make_kshortDD() + pvs = make_pvs() + + dzeros = make_dzeros_ltunb( + particles=[kaons, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2kpkmksDD_ltunb_line( + name='Hlt2CharmDstpToD0Pip_D0ToKpKmKsDD_LTUNBLine', prescale=1): + + kaons = make_charm_kaons_ltunb() + Ks = make_kshortDD() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[kaons, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) + + +""" +D*+ -> (D0 -> Ks pi- pi+) pi+ +""" + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2kpippimksLL_line( + name='Hlt2CharmDstpToD0Pip_D0ToPipPimKsLLLine', prescale=1): + + pions = make_charm_pions() + Ks = make_kshortLL() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[pions, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2pippimksDD_line( + name='Hlt2CharmDstpToD0Pip_D0ToPipPimKsDDLine', prescale=1): + + pions = make_charm_pions() + Ks = make_kshortDD() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[pions, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) + + +""" +D* -> (D0 -> Ks pi- pi+) pi+ LTUNB +""" + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2pippimksLL_ltunb_line( + name='Hlt2CharmDstpToD0Pip_D0ToPipPimKsLL_LTUNBLine', prescale=1): + + pions = make_charm_pions_ltunb() + Ks = make_kshortDD() + pvs = make_pvs() + + dzeros = make_dzeros_ltunb( + particles=[kaons, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2pippimksDD_ltunb_line( + name='Hlt2CharmDstpToD0Pip_D0ToPipPimKsDD_LTUNBLine', prescale=1): + + pions = make_charm_pions_ltunb() + Ks = make_kshortDD() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[kaons, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py index ff66e2d8bfa..6c8ab366945 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py @@ -22,6 +22,7 @@ from . import ( D02HH, D2HHH, D02HHHH, + D02HHKS, b_to_open_charm, RareCharmLines, dimuon, @@ -60,6 +61,7 @@ modules = [ D02HH, D2HHH, D02HHHH, + D02HHKS, b_to_open_charm, RareCharmLines, dimuon, -- GitLab From 3d48f67321607e7533ba7aba5562f55bef578b7d Mon Sep 17 00:00:00 2001 From: Edward Date: Wed, 26 Feb 2020 19:13:32 +0100 Subject: [PATCH 03/21] imported math needed in file --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index 23966624159..a94cacd6cae 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -15,6 +15,7 @@ Definition of D0 -> Ks h+ h- HLT2 lines. """ +import math from Moore.config import HltLine, register_line_builder -- GitLab From 83314d90ee6e31e4f7fa0efec6143125997acecb Mon Sep 17 00:00:00 2001 From: Edward Date: Mon, 2 Mar 2020 14:26:02 +0100 Subject: [PATCH 04/21] Fixed bug in cuts and decay descriptor (Ks to KS0) --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index a94cacd6cae..1691e193a53 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -25,7 +25,7 @@ from RecoConf.hlt1_tracking import require_pvs, require_gec from RecoConf.reco_objects_from_file import make_pvs, upfront_reconstruction -from ..algorithms import (require_all, ParticleCombinerWithPVs, ParticleFilter) +from ..algorithms import (require_all, ParticleCombinerWithPVs, ParticleFilter, ParticleFilterWithPVs) from ..framework import configurable from ..standard_particles import (make_long_pions, make_has_rich_long_kaons, make_has_rich_long_pions, make_KsDD, @@ -45,7 +45,7 @@ def make_selected_particles(make_particles=make_has_rich_long_kaons, pid_cut="PIDK > 5"): code = require_all("TRCHI2DOF < {trchi2dof_max}", - "TRHOSTPROB < {trghist_max}", "PT > {pt_min}", + "TRGHOSTPROB < {trghost_max}", "PT > {pt_min}", "P > {p_min}").format( trchi2dof_max=trchi2dof_max, trghost_max=trghost_max, @@ -131,7 +131,7 @@ def make_charm_soft_pions(make_particles=make_long_pions, trghostprob_max=0.25): code = require_all("TRCHI2DOF < {trchi2dof_max}", - "TRGHOSTPROB < {trghost_max}", "PT > {pt_min}", + "TRGHOSTPROB < {trghostprob_max}", "PT > {pt_min}", "P > {p_min}").format( trchi2dof_max=trchi2dof_max, trghostprob_max=trghostprob_max, @@ -160,14 +160,16 @@ def make_dzeros(particles, combination_code = require_all( "in_range({am_min}, AM, {am_max})", "(APT1+APT2+APT3) > {achildsum_pt_min}").format( - am_min=am_min, am_max=am_max) + am_min=am_min, + am_max=am_max, + achildsum_pt_min=achildsum_pt_min) vertex_code = require_all( - "PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof}", "BPVDIRA > {bpvdira_min}", - "BPVVDCHI2 > {bpvvdchi2_min}", "BPVLTIME() > {bpvltime_min}", + "PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof_max}", "BPVDIRA() > {bpvdira_min}", + "BPVVDCHI2() > {bpvvdchi2_min}", "BPVLTIME() > {bpvltime_min}", "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( pt_min=pt_min, - vchi2pdof_max=vchi22pdof_max, + vchi2pdof_max=vchi2pdof_max, bpvdira_min=bpvdira_min, bpvvdchi2_min=bpvvdchi2_min, bpvltime_min=bpvltime_min, @@ -180,7 +182,7 @@ def make_dzeros(particles, CombinationCut=combination_code, MotherCut=vertex_code) - code = require_all("in_range({m_min} < M < {m_max})").format( + code = require_all("in_range({m_min}, M, {m_max})").format( m_min=m_min, m_max=m_max) return ParticleFilter(dzeros, Code=code) @@ -224,7 +226,7 @@ def make_dzeros_ltunb(particles, CombinationCut=combination_code, MotherCut=vertex_code) - code = require_all("in_range({m_min} < M < {m_max})").format( + code = require_all("in_range({m_min}, M, {m_max})").format( m_min=m_min, m_max=m_max) return ParticleFilter(dzeros, Code=code) @@ -279,7 +281,7 @@ def dstarp2dzeropip_dzero2kpkmksLL_line( dzeros = make_dzeros( particles=[kaons, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -307,7 +309,7 @@ def dstarp2dzeropip_dzero2kpkmksDD_line( dzeros = make_dzeros( particles=[kaons, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -340,7 +342,7 @@ def dstarp2dzeropip_dzero2kpkmksLL_ltunb_line( dzeros = make_dzeros_ltunb( particles=[kaons, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -368,7 +370,7 @@ def dstarp2dzeropip_dzero2kpkmksDD_ltunb_line( dzeros = make_dzeros( particles=[kaons, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -401,7 +403,7 @@ def dstarp2dzeropip_dzero2kpippimksLL_line( dzeros = make_dzeros( particles=[pions, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -429,7 +431,7 @@ def dstarp2dzeropip_dzero2pippimksDD_line( dzeros = make_dzeros( particles=[pions, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -462,7 +464,7 @@ def dstarp2dzeropip_dzero2pippimksLL_ltunb_line( dzeros = make_dzeros_ltunb( particles=[kaons, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -490,7 +492,7 @@ def dstarp2dzeropip_dzero2pippimksDD_ltunb_line( dzeros = make_dzeros( particles=[kaons, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() -- GitLab From 0b3dca9abd7698ef8b569f77391e6c34505163f9 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Mon, 2 Mar 2020 13:26:51 +0000 Subject: [PATCH 05/21] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/7406241 --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index 1691e193a53..95e72bbcd1a 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -25,7 +25,8 @@ from RecoConf.hlt1_tracking import require_pvs, require_gec from RecoConf.reco_objects_from_file import make_pvs, upfront_reconstruction -from ..algorithms import (require_all, ParticleCombinerWithPVs, ParticleFilter, ParticleFilterWithPVs) +from ..algorithms import (require_all, ParticleCombinerWithPVs, ParticleFilter, + ParticleFilterWithPVs) from ..framework import configurable from ..standard_particles import (make_long_pions, make_has_rich_long_kaons, make_has_rich_long_pions, make_KsDD, @@ -160,20 +161,19 @@ def make_dzeros(particles, combination_code = require_all( "in_range({am_min}, AM, {am_max})", "(APT1+APT2+APT3) > {achildsum_pt_min}").format( - am_min=am_min, - am_max=am_max, - achildsum_pt_min=achildsum_pt_min) - - vertex_code = require_all( - "PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof_max}", "BPVDIRA() > {bpvdira_min}", - "BPVVDCHI2() > {bpvvdchi2_min}", "BPVLTIME() > {bpvltime_min}", - "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( - pt_min=pt_min, - vchi2pdof_max=vchi2pdof_max, - bpvdira_min=bpvdira_min, - bpvvdchi2_min=bpvvdchi2_min, - bpvltime_min=bpvltime_min, - d2dvvdchi2_min=d2dvvdchi2_min) + am_min=am_min, am_max=am_max, achildsum_pt_min=achildsum_pt_min) + + vertex_code = require_all("PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof_max}", + "BPVDIRA() > {bpvdira_min}", + "BPVVDCHI2() > {bpvvdchi2_min}", + "BPVLTIME() > {bpvltime_min}", + "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( + pt_min=pt_min, + vchi2pdof_max=vchi2pdof_max, + bpvdira_min=bpvdira_min, + bpvvdchi2_min=bpvvdchi2_min, + bpvltime_min=bpvltime_min, + d2dvvdchi2_min=d2dvvdchi2_min) dzeros = ParticleCombinerWithPVs( particles=particles, -- GitLab From 4f86da85e269e13405e38449a9cc44f45553f53e Mon Sep 17 00:00:00 2001 From: Edward Date: Wed, 4 Mar 2020 11:22:57 +0100 Subject: [PATCH 06/21] Changed combiner algorithm to 3 body in D02HHKS --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index 95e72bbcd1a..c38789d5bfd 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -175,7 +175,7 @@ def make_dzeros(particles, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) - dzeros = ParticleCombinerWithPVs( + dzeros = N3ParticleCombinerWithPVs( particles=particles, pvs=pvs, DecayDescriptors=descriptors, @@ -206,19 +206,20 @@ def make_dzeros_ltunb(particles, combination_code = require_all( "in_range({am_min}, AM, {am_max})", "(APT1+APT2+APT3) > {achildsum_pt_min}").format( - am_min=am_min, am_max=am_max) - + am_min=am_min, am_max=am_max, + achildsum_pt_min=achildsum_pt_min) + vertex_code = require_all( - "PT > {pt_min}", "VFASPF(VCHI2PDOF) < {vchi2pdof}", - "BPVDIRA > {bpvdira_min}", "BPVLTIME() > {bpvltime_min}", + # "PT > {pt_min}", "VFASPF(VCHI2PDOF) < {vchi2pdof_max}", + "BPVDIRA() > {bpvdira_min}", "BPVLTIME() > {bpvltime_min}", "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( - pt_min=pt_min, - vchi2pdof_max=vchi22pdof_max, + # pt_min=pt_min, + # vchi2pdof_max=vchi2pdof_max, bpvdira_min=bpvdira_min, - bpvvdchi2_min=bpvvdchi2_min, + #bpvvdchi2_min=bpvvdchi2_min, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) - + dzeros = ParticleCombinerWithPVs( particles=particles, pvs=pvs, @@ -248,9 +249,8 @@ def make_dstars(dzeros, q_am_min=q_am_min, q_am_max=q_am_max) vertex_code = require_all( - "VFASPF(VCHI2PDOF) < {vchi2pdof_max}", "in_range({q_m_min}, (M - M1 - M2), {q_m_max})").format( - q_m_min=q_m_min, q_m_max=q_m_max, vchi2pdof_max=vchi2pdof_max) + q_m_min=q_m_min, q_m_max=q_m_max) return ParticleCombinerWithPVs( particles=[dzeros, soft_pions], @@ -293,7 +293,7 @@ def dstarp2dzeropip_dzero2kpkmksLL_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) @@ -321,7 +321,7 @@ def dstarp2dzeropip_dzero2kpkmksDD_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) @@ -354,7 +354,7 @@ def dstarp2dzeropip_dzero2kpkmksLL_ltunb_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) @@ -382,7 +382,7 @@ def dstarp2dzeropip_dzero2kpkmksDD_ltunb_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) -- GitLab From 1e3a5e33b5e2338ee89d3b982aa969e4a130507f Mon Sep 17 00:00:00 2001 From: Edward Date: Mon, 16 Mar 2020 20:01:37 +0100 Subject: [PATCH 07/21] Added untagged D02HHKS lines --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 99 ++++++++++++++----- 1 file changed, 75 insertions(+), 24 deletions(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index c38789d5bfd..9b46c34b80b 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -10,10 +10,10 @@ ############################################################################### """ Definition of D0 -> Ks h+ h- HLT2 lines. - - - - +Dst+ -> (D0 -> K+ K- (KS -> pi+ pi-))pi+; it's charge conjugate; LTUNB; and LL and DD lines +Dst+ -> (D0 -> pi+ pi- (KS -> pi+ pi-))pi+, it's charge conjugate; LTUNB; and LL and DD lines +Dst+ -> (D0 -> pi+ K- (KS -> pi+ pi-))pi+, it's charge conjugate; LTUNB; and LL and DD lines +Untagged D0 -> K+ K- (KS -> pi+ pi-), and it's charge conjugate """ import math @@ -26,7 +26,7 @@ from RecoConf.hlt1_tracking import require_pvs, require_gec from RecoConf.reco_objects_from_file import make_pvs, upfront_reconstruction from ..algorithms import (require_all, ParticleCombinerWithPVs, ParticleFilter, - ParticleFilterWithPVs) + ParticleFilterWithPVs, N3BodyCombinerWithPVs) from ..framework import configurable from ..standard_particles import (make_long_pions, make_has_rich_long_kaons, make_has_rich_long_pions, make_KsDD, @@ -163,7 +163,8 @@ def make_dzeros(particles, "(APT1+APT2+APT3) > {achildsum_pt_min}").format( am_min=am_min, am_max=am_max, achildsum_pt_min=achildsum_pt_min) - vertex_code = require_all("PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof_max}", + vertex_code = require_all("PT > {pt_min}", + "CHI2VXNDOF < {vchi2pdof_max}", "BPVDIRA() > {bpvdira_min}", "BPVVDCHI2() > {bpvvdchi2_min}", "BPVLTIME() > {bpvltime_min}", @@ -174,18 +175,20 @@ def make_dzeros(particles, bpvvdchi2_min=bpvvdchi2_min, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) + - dzeros = N3ParticleCombinerWithPVs( + return ParticleCombinerWithPVs( particles=particles, pvs=pvs, DecayDescriptors=descriptors, CombinationCut=combination_code, MotherCut=vertex_code) - + ''' code = require_all("in_range({m_min}, M, {m_max})").format( m_min=m_min, m_max=m_max) return ParticleFilter(dzeros, Code=code) + ''' @configurable @@ -210,27 +213,28 @@ def make_dzeros_ltunb(particles, achildsum_pt_min=achildsum_pt_min) vertex_code = require_all( - # "PT > {pt_min}", "VFASPF(VCHI2PDOF) < {vchi2pdof_max}", + "PT > {pt_min}", "VFASPF(VCHI2PDOF) < {vchi2pdof_max}", "BPVDIRA() > {bpvdira_min}", "BPVLTIME() > {bpvltime_min}", "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( - # pt_min=pt_min, - # vchi2pdof_max=vchi2pdof_max, + pt_min=pt_min, + vchi2pdof_max=vchi2pdof_max, bpvdira_min=bpvdira_min, #bpvvdchi2_min=bpvvdchi2_min, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) - dzeros = ParticleCombinerWithPVs( + return N3BodyCombinerWithPVs( particles=particles, pvs=pvs, DecayDescriptors=descriptors, CombinationCut=combination_code, MotherCut=vertex_code) - + ''' code = require_all("in_range({m_min}, M, {m_max})").format( m_min=m_min, m_max=m_max) return ParticleFilter(dzeros, Code=code) + ''' @configurable @@ -327,7 +331,7 @@ def dstarp2dzeropip_dzero2kpkmksDD_line( """ -D* -> (D0 -> Ks K+ K-) pi+ LTUNB +Dst+ -> (D0 -> K+ K- (KS -> pi+ pi-)) pi+ LTUNB """ @@ -403,7 +407,7 @@ def dstarp2dzeropip_dzero2kpippimksLL_line( dzeros = make_dzeros( particles=[pions, Ks], - descriptors=['[D0 -> KS0 K+ K-]cc'], + descriptors=['[D0 -> KS0 pi+ pi-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -415,7 +419,7 @@ def dstarp2dzeropip_dzero2kpippimksLL_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) @@ -431,7 +435,7 @@ def dstarp2dzeropip_dzero2pippimksDD_line( dzeros = make_dzeros( particles=[pions, Ks], - descriptors=['[D0 -> KS0 K+ K-]cc'], + descriptors=['[D0 -> KS0 pi+ pi-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -443,7 +447,7 @@ def dstarp2dzeropip_dzero2pippimksDD_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) @@ -463,8 +467,8 @@ def dstarp2dzeropip_dzero2pippimksLL_ltunb_line( pvs = make_pvs() dzeros = make_dzeros_ltunb( - particles=[kaons, Ks], - descriptors=['[D0 -> KS0 K+ K-]cc'], + particles=[pions, Ks], + descriptors=['[D0 -> KS0 pi+ pi-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -476,7 +480,7 @@ def dstarp2dzeropip_dzero2pippimksLL_ltunb_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) @@ -491,8 +495,8 @@ def dstarp2dzeropip_dzero2pippimksDD_ltunb_line( pvs = make_pvs() dzeros = make_dzeros( - particles=[kaons, Ks], - descriptors=['[D0 -> KS0 K+ K-]cc'], + particles=[pions, Ks], + descriptors=['[D0 -> KS0 pi+ pi-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -504,6 +508,53 @@ def dstarp2dzeropip_dzero2pippimksDD_ltunb_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) + + + +""" +D0 -> K+ K- (KS -> pi+ pi-) +""" +@register_line_builder(all_lines) +@configurable +def dzero2kpkmksLL_line( + name='Hlt2CharmD0ToKpKmKsLL_Line', prescale=1): + + kaons = make_charm_kaons() + Ks = make_kshortLL() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[kaons, Ks], + descriptors=['[D0 -> KS0 K+ K-]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale + ) + + +@register_line_builder(all_lines) +@configurable +def dzero2kpkmksDD_line( + name='Hlt2CharmD0ToKpKmKsDD_Line', prescale=1): + + kaons = make_charm_kaons() + Ks = make_kshortDD() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[kaons, Ks], + descriptors=['[D0 -> KS0 K+ K-]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale + ) + -- GitLab From 5bee65758a6890ad9d8a5b399df94118736a31cd Mon Sep 17 00:00:00 2001 From: Edward Date: Mon, 16 Mar 2020 20:05:07 +0100 Subject: [PATCH 08/21] Fixed formatting --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index 9b46c34b80b..4bc6652cd2b 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -219,7 +219,6 @@ def make_dzeros_ltunb(particles, pt_min=pt_min, vchi2pdof_max=vchi2pdof_max, bpvdira_min=bpvdira_min, - #bpvvdchi2_min=bpvvdchi2_min, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) -- GitLab From f491ac680f7c60e9b61cbe47ccc234434b90da51 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Mon, 16 Mar 2020 19:05:53 +0000 Subject: [PATCH 09/21] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/7606144 --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 41 +++++++------------ 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index 4bc6652cd2b..c35a289f3f2 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -10,7 +10,7 @@ ############################################################################### """ Definition of D0 -> Ks h+ h- HLT2 lines. -Dst+ -> (D0 -> K+ K- (KS -> pi+ pi-))pi+; it's charge conjugate; LTUNB; and LL and DD lines +Dst+ -> (D0 -> K+ K- (KS -> pi+ pi-))pi+; it's charge conjugate; LTUNB; and LL and DD lines Dst+ -> (D0 -> pi+ pi- (KS -> pi+ pi-))pi+, it's charge conjugate; LTUNB; and LL and DD lines Dst+ -> (D0 -> pi+ K- (KS -> pi+ pi-))pi+, it's charge conjugate; LTUNB; and LL and DD lines Untagged D0 -> K+ K- (KS -> pi+ pi-), and it's charge conjugate @@ -163,8 +163,7 @@ def make_dzeros(particles, "(APT1+APT2+APT3) > {achildsum_pt_min}").format( am_min=am_min, am_max=am_max, achildsum_pt_min=achildsum_pt_min) - vertex_code = require_all("PT > {pt_min}", - "CHI2VXNDOF < {vchi2pdof_max}", + vertex_code = require_all("PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof_max}", "BPVDIRA() > {bpvdira_min}", "BPVVDCHI2() > {bpvvdchi2_min}", "BPVLTIME() > {bpvltime_min}", @@ -175,7 +174,6 @@ def make_dzeros(particles, bpvvdchi2_min=bpvvdchi2_min, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) - return ParticleCombinerWithPVs( particles=particles, @@ -209,9 +207,8 @@ def make_dzeros_ltunb(particles, combination_code = require_all( "in_range({am_min}, AM, {am_max})", "(APT1+APT2+APT3) > {achildsum_pt_min}").format( - am_min=am_min, am_max=am_max, - achildsum_pt_min=achildsum_pt_min) - + am_min=am_min, am_max=am_max, achildsum_pt_min=achildsum_pt_min) + vertex_code = require_all( "PT > {pt_min}", "VFASPF(VCHI2PDOF) < {vchi2pdof_max}", "BPVDIRA() > {bpvdira_min}", "BPVLTIME() > {bpvltime_min}", @@ -221,7 +218,7 @@ def make_dzeros_ltunb(particles, bpvdira_min=bpvdira_min, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) - + return N3BodyCombinerWithPVs( particles=particles, pvs=pvs, @@ -512,48 +509,40 @@ def dstarp2dzeropip_dzero2pippimksDD_ltunb_line( ) - """ D0 -> K+ K- (KS -> pi+ pi-) """ + + @register_line_builder(all_lines) @configurable -def dzero2kpkmksLL_line( - name='Hlt2CharmD0ToKpKmKsLL_Line', prescale=1): +def dzero2kpkmksLL_line(name='Hlt2CharmD0ToKpKmKsLL_Line', prescale=1): kaons = make_charm_kaons() Ks = make_kshortLL() - pvs = make_pvs() + pvs = make_pvs() dzeros = make_dzeros( - particles=[kaons, Ks], - descriptors=['[D0 -> KS0 K+ K-]cc'], - pvs=pvs) + particles=[kaons, Ks], descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=pvs) return HltLine( name=name, algs=upfront_reconstruction() + charm_prefilters() + [dzeros], - prescale=prescale - ) + prescale=prescale) @register_line_builder(all_lines) @configurable -def dzero2kpkmksDD_line( - name='Hlt2CharmD0ToKpKmKsDD_Line', prescale=1): +def dzero2kpkmksDD_line(name='Hlt2CharmD0ToKpKmKsDD_Line', prescale=1): kaons = make_charm_kaons() Ks = make_kshortDD() - pvs = make_pvs() + pvs = make_pvs() dzeros = make_dzeros( - particles=[kaons, Ks], - descriptors=['[D0 -> KS0 K+ K-]cc'], - pvs=pvs) + particles=[kaons, Ks], descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=pvs) return HltLine( name=name, algs=upfront_reconstruction() + charm_prefilters() + [dzeros], - prescale=prescale - ) - + prescale=prescale) -- GitLab From 17c04301719ec6ca16bfa8c06f0d133a1fa3d48f Mon Sep 17 00:00:00 2001 From: Edward Date: Wed, 18 Mar 2020 13:19:36 +0100 Subject: [PATCH 10/21] Changed dzero algorithm to ParticleCombinerWithPVs --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index c35a289f3f2..74eff06426d 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -219,7 +219,7 @@ def make_dzeros_ltunb(particles, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) - return N3BodyCombinerWithPVs( + return ParticleCombinerWithPVs( particles=particles, pvs=pvs, DecayDescriptors=descriptors, -- GitLab From bbdee0e0a6e66404205c5fa091a63ef6a819535b Mon Sep 17 00:00:00 2001 From: Edward Date: Fri, 21 Feb 2020 16:15:08 +0100 Subject: [PATCH 11/21] added Hlt from Moore (Moore/master) --- Hlt/RecoConf/python/RecoConf/mc_cuts.py | 156 ++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 Hlt/RecoConf/python/RecoConf/mc_cuts.py diff --git a/Hlt/RecoConf/python/RecoConf/mc_cuts.py b/Hlt/RecoConf/python/RecoConf/mc_cuts.py new file mode 100644 index 00000000000..961e9293c0a --- /dev/null +++ b/Hlt/RecoConf/python/RecoConf/mc_cuts.py @@ -0,0 +1,156 @@ +############################################################################### +# (c) Copyright 2019 CERN for the benefit of the LHCb Collaboration # +# # +# This software is distributed under the terms of the GNU General Public # +# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # +# # +# In applying this licence, CERN does not waive the privileges and immunities # +# granted to it by virtue of its status as an Intergovernmental Organization # +# or submit itself to any jurisdiction. # +############################################################################### +from GaudiKernel.SystemOfUnits import mm, GeV +MCCuts = { + "Velo": { + "01_velo": "isVelo", + "02_long": "isLong", + "03_long>5GeV": "isLong & over5", + "04_long_strange": "isLong & strange", + "05_long_strange>5GeV": "isLong & strange & over5", + "06_long_fromB": "isLong & fromB", + "07_long_fromB>5GeV": "isLong & fromB & over5", + "08_long_electrons": "isLong & isElectron", + "09_long_fromB_electrons": "isLong & isElectron & fromB", + "10_long_fromB_electrons_P>5GeV": "isLong & isElectron & over5 & fromB" + }, + "Forward": { + "01_long": "isLong", + "02_long>5GeV": "isLong & over5", + "03_long_strange": "isLong & strange", + "04_long_strange>5GeV": "isLong & strange & over5", + "05_long_fromB": "isLong & fromB", + "06_long_fromB>5GeV": "isLong & fromB & over5", + "07_long_electrons": "isLong & isElectron", + "08_long_fromB_electrons": "isLong & isElectron & fromB", + "09_long_fromB_electrons_P>5GeV": "isLong & isElectron & over5 & fromB" + }, + "Up": { + "01_velo": "isVelo", + "02_velo+UT": "isVelo & isUT", + "03_velo+UT>5GeV": "isVelo & isUT & over5", + "04_velo+notLong": "isNotLong & isVelo ", + "05_velo+UT+notLong": "isNotLong & isVelo & isUT", + "06_velo+UT+notLong>5GeV": "isNotLong & isVelo & isUT & over5", + "07_long": "isLong", + "08_long>5GeV": "isLong & over5 ", + "09_long_fromB": "isLong & fromB", + "10_long_fromB>5GeV": "isLong & fromB & over5", + "11_long_electrons": "isLong & isElectron", + "12_long_fromB_electrons": "isLong & isElectron & fromB", + "13_long_fromB_electrons_P>5GeV": "isLong & isElectron & over5 & fromB" + }, + "T": { + "01_hasT": + "isSeed ", + "02_long": + "isLong", + "03_long>5GeV": + "isLong & over5", + "04_long_fromB": + "isLong & fromB", + "05_long_fromB>5GeV": + "isLong & fromB & over5", + "06_UT+T_strange": + "strange & isDown", + "07_UT+T_strange>5GeV": + "strange & isDown & over5", + "08_noVelo+UT+T_strange": + "strange & isDown & isNotVelo", + "09_noVelo+UT+T_strange>5GeV": + "strange & isDown & over5 & isNotVelo", + "10_UT+T_SfromDB": + "strange & isDown & ( fromB | fromD )", + "11_UT+T_SfromDB>5GeV": + "strange & isDown & over5 & ( fromB | fromD )", + "12_noVelo+UT+T_SfromDB>5GeV": + "strange & isDown & isNotVelo & over5 & ( fromB | fromD )" + }, + "Down": { + "01_UT+T": + "isDown ", + "02_UT+T>5GeV": + "isDown & over5", + "03_UT+T_strange": + " strange & isDown", + "04_UT+T_strange>5GeV": + " strange & isDown & over5", + "05_noVelo+UT+T_strange": + " strange & isDown & isNotVelo", + "06_noVelo+UT+T_strange>5GeV": + " strange & isDown & over5 & isNotVelo", + "07_UT+T_fromB": + "isDown & fromB", + "08_UT+T_fromB>5GeV": + "isDown & fromB & over5", + "09_noVelo+UT+T_fromB": + "isDown & fromB & isNotVelo", + "10_noVelo+UT+T_fromB>5GeV": + "isDown & fromB & over5 & isNotVelo", + "11_UT+T_SfromDB": + " strange & isDown & ( fromB | fromD )", + "12_UT+T_SfromDB>5GeV": + " strange & isDown & over5 & ( fromB | fromD )", + "13_noVelo+UT+T_SfromDB": + " strange & isDown & isNotVelo & ( fromB | fromD )", + "14_noVelo+UT+T_SfromDB>5GeV": + " strange & isDown & isNotVelo & over5 & ( fromB | fromD ) " + }, + "UTForward": { + "01_long": "isLong", + "02_long>5GeV": "isLong & over5" + }, + "UTDown": { + "01_has seed": "isSeed", + "02_has seed +noVelo, T+UT": "isSeed & isNotVelo & isDown", + "03_down+strange": "strange & isDown", + "04_down+strange+>5GeV": "strange & isDown & over5", + "05_pi<-Ks<-B": "fromKsFromB", + "06_pi<-Ks<-B+> 5 GeV": "fromKsFromB & over5" + }, +} +TriggerMCCuts = { + "Velo": { + "11_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger", + "12_UT_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger & isUT" + }, + "Forward": { + "10_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger", + "11_UT_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger & isUT" + }, + "Up": { + "14_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger", + "15_UT_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger & isUT" + }, + "New": { + "long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger", + "UT_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger & isUT" + }, + "UTForward": { + "03_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger", + "04_UT_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger & isUT" + }, + "UTDown": { + "07_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger", + "08_UT_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger & isUT" + }, + "UTNew": { + "long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger", + "UT_long_fromB_P>3GeV_Pt>0.5GeV": "isLong & fromB & trigger & isUT" + }, +} + + +def get_mc_cuts(key, triggerNumbers=False): + cuts = MCCuts[key] if key in MCCuts else {} + if triggerNumbers and key in TriggerMCCuts: + cuts.update(TriggerMCCuts[key]) + return cuts -- GitLab From dbbbad2be01bdf2784c55b327f50c01ea3695fa6 Mon Sep 17 00:00:00 2001 From: Edward Date: Fri, 21 Feb 2020 16:20:46 +0100 Subject: [PATCH 12/21] Added new D02HHKS HLT2 line --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 506 ++++++++++++++++++ .../python/Hlt2Conf/lines/__init__.py | 2 + 2 files changed, 508 insertions(+) create mode 100644 Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py new file mode 100644 index 00000000000..23966624159 --- /dev/null +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -0,0 +1,506 @@ +############################################################################### +# (c) Copyright 2019 CERN for the benefit of the LHCb Collaboration # +# # +# This software is distributed under the terms of the GNU General Public # +# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # +# # +# In applying this licence, CERN does not waive the privileges and immunities # +# granted to it by virtue of its status as an Intergovernmental Organization # +# or submit itself to any jurisdiction. # +############################################################################### +""" +Definition of D0 -> Ks h+ h- HLT2 lines. + + + + +""" + +from Moore.config import HltLine, register_line_builder + +from GaudiKernel.SystemOfUnits import GeV, MeV, picosecond, mm, mrad, rad + +from RecoConf.hlt1_tracking import require_pvs, require_gec + +from RecoConf.reco_objects_from_file import make_pvs, upfront_reconstruction + +from ..algorithms import (require_all, ParticleCombinerWithPVs, ParticleFilter) +from ..framework import configurable +from ..standard_particles import (make_long_pions, make_has_rich_long_kaons, + make_has_rich_long_pions, make_KsDD, + make_KsLL) + +all_lines = {} + + +@configurable +def make_selected_particles(make_particles=make_has_rich_long_kaons, + make_pvs=make_pvs, + trchi2dof_max=3, + trghost_max=0.4, + mipchi2_min=None, + pt_min=200 * MeV, + p_min=1000 * MeV, + pid_cut="PIDK > 5"): + + code = require_all("TRCHI2DOF < {trchi2dof_max}", + "TRHOSTPROB < {trghist_max}", "PT > {pt_min}", + "P > {p_min}").format( + trchi2dof_max=trchi2dof_max, + trghost_max=trghost_max, + mipchi2_min=mipchi2_min, + pt_min=pt_min, + p_min=p_min, + ) + + code += " & ({})".format(pid_cut) + if mipchi2_min is not None: + code += " & MIPCHI2DV(PRIMARY) > {mipchi2_min}".format(mipchi2_min) + + return ParticleFilterWithPVs(make_particles(), make_pvs(), Code=code) + + +@configurable +def make_charm_pions(pid_cut="PIDK < 5"): + + return make_selected_particles( + make_particles=make_has_rich_long_pions, pid_cut=pid_cut) + + +@configurable +def make_charm_kaons(mipchi2_min=4, pid_cut="PIDK > 5"): + + return make_selected_particles( + make_particles=make_has_rich_long_kaons, pid_cut=pid_cut) + + +@configurable +def make_charm_pions_ltunb(pid_cut="PIDK < 0"): + + return make_selected_particles( + make_particles=make_has_rich_long_pions, pid_cut=pid_cut) + + +@configurable +def make_charm_kaons_ltunb(pt_min=500 * MeV, pid_cut="PIDK > 10"): + + return make_selected_particles( + make_particles=make_has_rich_long_kaons, + pt_min=pt_min, + pid_cut=pid_cut) + + +@configurable +def make_kshortLL(make_particles=make_KsLL, + bpvltime_min=0.0005, + vfaspf_min=-100, + vfaspf_max=500): + + code = require_all( + "BPVLTIME() > {bpvltime_min}", + "in_range({vfaspf_min}, VFASPF(VZ), {vfaspf_max})").format( + bpvltime_min=bpvltime_min, + vfaspf_min=vfaspf_min, + vfaspf_max=vfaspf_max) + + return ParticleFilter(make_particles(), Code=code) + + +@configurable +def make_kshortDD(make_particles=make_KsDD, + bpvltime_min=0.0005, + vfaspf_min=300, + vfaspf_max=2275): + + code = require_all( + "BPVLTIME() > {bpvltime_min}", + "in_range({vfaspf_min}, VFASPF(VZ), {vfaspf_max})").format( + bpvltime_min=bpvltime_min, + vfaspf_min=vfaspf_min, + vfaspf_max=vfaspf_max) + + return ParticleFilter(make_particles(), Code=code) + + +@configurable +def make_charm_soft_pions(make_particles=make_long_pions, + pt_min=200 * MeV, + p_min=1 * GeV, + trchi2dof_max=3.0, + trghostprob_max=0.25): + + code = require_all("TRCHI2DOF < {trchi2dof_max}", + "TRGHOSTPROB < {trghost_max}", "PT > {pt_min}", + "P > {p_min}").format( + trchi2dof_max=trchi2dof_max, + trghostprob_max=trghostprob_max, + pt_min=pt_min, + p_min=p_min) + + return ParticleFilter(make_particles(), Code=code) + + +@configurable +def make_dzeros(particles, + descriptors, + pvs, + am_min=1740 * MeV, + am_max=1990 * MeV, + achildsum_pt_min=1500 * MeV, + pt_min=1800 * MeV, + vchi2pdof_max=5, + bpvdira_min=math.cos(0.0346) * rad, + bpvvdchi2_min=20, + bpvltime_min=0.0001, + d2dvvdchi2_min=math.exp(5.0), + m_min=1765 * MeV, + m_max=1965 * MeV): + + combination_code = require_all( + "in_range({am_min}, AM, {am_max})", + "(APT1+APT2+APT3) > {achildsum_pt_min}").format( + am_min=am_min, am_max=am_max) + + vertex_code = require_all( + "PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof}", "BPVDIRA > {bpvdira_min}", + "BPVVDCHI2 > {bpvvdchi2_min}", "BPVLTIME() > {bpvltime_min}", + "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( + pt_min=pt_min, + vchi2pdof_max=vchi22pdof_max, + bpvdira_min=bpvdira_min, + bpvvdchi2_min=bpvvdchi2_min, + bpvltime_min=bpvltime_min, + d2dvvdchi2_min=d2dvvdchi2_min) + + dzeros = ParticleCombinerWithPVs( + particles=particles, + pvs=pvs, + DecayDescriptors=descriptors, + CombinationCut=combination_code, + MotherCut=vertex_code) + + code = require_all("in_range({m_min} < M < {m_max})").format( + m_min=m_min, m_max=m_max) + + return ParticleFilter(dzeros, Code=code) + + +@configurable +def make_dzeros_ltunb(particles, + descriptors, + pvs, + am_min=1740 * MeV, + am_max=1990 * MeV, + achildsum_pt_min=1500 * MeV, + pt_min=1800 * MeV, + vchi2pdof_max=5, + bpvdira_min=math.cos(0.01415) * rad, + bpvltime_min=0.00025, + d2dvvdchi2_min=math.exp(5.0), + m_min=1765 * MeV, + m_max=1965 * MeV): + + combination_code = require_all( + "in_range({am_min}, AM, {am_max})", + "(APT1+APT2+APT3) > {achildsum_pt_min}").format( + am_min=am_min, am_max=am_max) + + vertex_code = require_all( + "PT > {pt_min}", "VFASPF(VCHI2PDOF) < {vchi2pdof}", + "BPVDIRA > {bpvdira_min}", "BPVLTIME() > {bpvltime_min}", + "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( + pt_min=pt_min, + vchi2pdof_max=vchi22pdof_max, + bpvdira_min=bpvdira_min, + bpvvdchi2_min=bpvvdchi2_min, + bpvltime_min=bpvltime_min, + d2dvvdchi2_min=d2dvvdchi2_min) + + dzeros = ParticleCombinerWithPVs( + particles=particles, + pvs=pvs, + DecayDescriptors=descriptors, + CombinationCut=combination_code, + MotherCut=vertex_code) + + code = require_all("in_range({m_min} < M < {m_max})").format( + m_min=m_min, m_max=m_max) + + return ParticleFilter(dzeros, Code=code) + + +@configurable +def make_dstars(dzeros, + soft_pions, + descriptors, + pvs, + q_am_min=-4.57018 * MeV, + q_am_max=35.42982 * MeV, + q_m_min=-4.57018 * MeV, + q_m_max=25.42982 * MeV, + vchi2pdof_max=10.0): + + combination_code = require_all( + "in_range({q_am_min}, (AM - AM1 - AM2), {q_am_max})").format( + q_am_min=q_am_min, q_am_max=q_am_max) + + vertex_code = require_all( + "VFASPF(VCHI2PDOF) < {vchi2pdof_max}", + "in_range({q_m_min}, (M - M1 - M2), {q_m_max})").format( + q_m_min=q_m_min, q_m_max=q_m_max, vchi2pdof_max=vchi2pdof_max) + + return ParticleCombinerWithPVs( + particles=[dzeros, soft_pions], + pvs=pvs, + DecayDescriptors=descriptors, + CombinationCut=combination_code, + MotherCut=vertex_code) + + +def charm_prefilters(): + """Return a list of prefilters common to charm HLT2 lines.""" + return [require_gec(), require_pvs(make_pvs())] + + +""" +D* -> (D0 -> Ks K+ K-) pi+ +""" + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2kpkmksLL_line( + name='Hlt2CharmDstpToD0Pip_D0ToKpKmKsLLLine', prescale=1): + + kaons = make_charm_kaons() + Ks = make_kshortLL() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[kaons, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2kpkmksDD_line( + name='Hlt2CharmDstpToD0Pip_D0ToKpKmKsDDLine', prescale=1): + + kaons = make_charm_kaons() + Ks = make_kshortDD() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[kaons, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) + + +""" +D* -> (D0 -> Ks K+ K-) pi+ LTUNB +""" + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2kpkmksLL_ltunb_line( + name='Hlt2CharmDstpToD0Pip_D0ToKpKmKsLL_LTUNBLine', prescale=1): + + kaons = make_charm_kaons_ltunb() + Ks = make_kshortDD() + pvs = make_pvs() + + dzeros = make_dzeros_ltunb( + particles=[kaons, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2kpkmksDD_ltunb_line( + name='Hlt2CharmDstpToD0Pip_D0ToKpKmKsDD_LTUNBLine', prescale=1): + + kaons = make_charm_kaons_ltunb() + Ks = make_kshortDD() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[kaons, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) + + +""" +D*+ -> (D0 -> Ks pi- pi+) pi+ +""" + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2kpippimksLL_line( + name='Hlt2CharmDstpToD0Pip_D0ToPipPimKsLLLine', prescale=1): + + pions = make_charm_pions() + Ks = make_kshortLL() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[pions, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2pippimksDD_line( + name='Hlt2CharmDstpToD0Pip_D0ToPipPimKsDDLine', prescale=1): + + pions = make_charm_pions() + Ks = make_kshortDD() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[pions, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) + + +""" +D* -> (D0 -> Ks pi- pi+) pi+ LTUNB +""" + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2pippimksLL_ltunb_line( + name='Hlt2CharmDstpToD0Pip_D0ToPipPimKsLL_LTUNBLine', prescale=1): + + pions = make_charm_pions_ltunb() + Ks = make_kshortDD() + pvs = make_pvs() + + dzeros = make_dzeros_ltunb( + particles=[kaons, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) + + +@register_line_builder(all_lines) +@configurable +def dstarp2dzeropip_dzero2pippimksDD_ltunb_line( + name='Hlt2CharmDstpToD0Pip_D0ToPipPimKsDD_LTUNBLine', prescale=1): + + pions = make_charm_pions_ltunb() + Ks = make_kshortDD() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[kaons, Ks], + descriptors=['[D0 -> Ks K+ K-]cc'], + pvs=make_pvs()) + soft_pions = make_charm_soft_pions() + + dstars = make_dstars( + dzeros=dzeros, + soft_pions=soft_pions, + descriptors=['[D*(2010)+ -> D0 pi+]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale, + ) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py index ff66e2d8bfa..6c8ab366945 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py @@ -22,6 +22,7 @@ from . import ( D02HH, D2HHH, D02HHHH, + D02HHKS, b_to_open_charm, RareCharmLines, dimuon, @@ -60,6 +61,7 @@ modules = [ D02HH, D2HHH, D02HHHH, + D02HHKS, b_to_open_charm, RareCharmLines, dimuon, -- GitLab From 1ef6fe0a81ae81b3d577dee896807948307869e6 Mon Sep 17 00:00:00 2001 From: Edward Date: Wed, 26 Feb 2020 19:13:32 +0100 Subject: [PATCH 13/21] imported math needed in file --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index 23966624159..a94cacd6cae 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -15,6 +15,7 @@ Definition of D0 -> Ks h+ h- HLT2 lines. """ +import math from Moore.config import HltLine, register_line_builder -- GitLab From 51f35f29b6e85b54b4ea296cc181d2f53cb8e8de Mon Sep 17 00:00:00 2001 From: Edward Date: Mon, 2 Mar 2020 14:26:02 +0100 Subject: [PATCH 14/21] Fixed bug in cuts and decay descriptor (Ks to KS0) --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index a94cacd6cae..1691e193a53 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -25,7 +25,7 @@ from RecoConf.hlt1_tracking import require_pvs, require_gec from RecoConf.reco_objects_from_file import make_pvs, upfront_reconstruction -from ..algorithms import (require_all, ParticleCombinerWithPVs, ParticleFilter) +from ..algorithms import (require_all, ParticleCombinerWithPVs, ParticleFilter, ParticleFilterWithPVs) from ..framework import configurable from ..standard_particles import (make_long_pions, make_has_rich_long_kaons, make_has_rich_long_pions, make_KsDD, @@ -45,7 +45,7 @@ def make_selected_particles(make_particles=make_has_rich_long_kaons, pid_cut="PIDK > 5"): code = require_all("TRCHI2DOF < {trchi2dof_max}", - "TRHOSTPROB < {trghist_max}", "PT > {pt_min}", + "TRGHOSTPROB < {trghost_max}", "PT > {pt_min}", "P > {p_min}").format( trchi2dof_max=trchi2dof_max, trghost_max=trghost_max, @@ -131,7 +131,7 @@ def make_charm_soft_pions(make_particles=make_long_pions, trghostprob_max=0.25): code = require_all("TRCHI2DOF < {trchi2dof_max}", - "TRGHOSTPROB < {trghost_max}", "PT > {pt_min}", + "TRGHOSTPROB < {trghostprob_max}", "PT > {pt_min}", "P > {p_min}").format( trchi2dof_max=trchi2dof_max, trghostprob_max=trghostprob_max, @@ -160,14 +160,16 @@ def make_dzeros(particles, combination_code = require_all( "in_range({am_min}, AM, {am_max})", "(APT1+APT2+APT3) > {achildsum_pt_min}").format( - am_min=am_min, am_max=am_max) + am_min=am_min, + am_max=am_max, + achildsum_pt_min=achildsum_pt_min) vertex_code = require_all( - "PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof}", "BPVDIRA > {bpvdira_min}", - "BPVVDCHI2 > {bpvvdchi2_min}", "BPVLTIME() > {bpvltime_min}", + "PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof_max}", "BPVDIRA() > {bpvdira_min}", + "BPVVDCHI2() > {bpvvdchi2_min}", "BPVLTIME() > {bpvltime_min}", "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( pt_min=pt_min, - vchi2pdof_max=vchi22pdof_max, + vchi2pdof_max=vchi2pdof_max, bpvdira_min=bpvdira_min, bpvvdchi2_min=bpvvdchi2_min, bpvltime_min=bpvltime_min, @@ -180,7 +182,7 @@ def make_dzeros(particles, CombinationCut=combination_code, MotherCut=vertex_code) - code = require_all("in_range({m_min} < M < {m_max})").format( + code = require_all("in_range({m_min}, M, {m_max})").format( m_min=m_min, m_max=m_max) return ParticleFilter(dzeros, Code=code) @@ -224,7 +226,7 @@ def make_dzeros_ltunb(particles, CombinationCut=combination_code, MotherCut=vertex_code) - code = require_all("in_range({m_min} < M < {m_max})").format( + code = require_all("in_range({m_min}, M, {m_max})").format( m_min=m_min, m_max=m_max) return ParticleFilter(dzeros, Code=code) @@ -279,7 +281,7 @@ def dstarp2dzeropip_dzero2kpkmksLL_line( dzeros = make_dzeros( particles=[kaons, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -307,7 +309,7 @@ def dstarp2dzeropip_dzero2kpkmksDD_line( dzeros = make_dzeros( particles=[kaons, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -340,7 +342,7 @@ def dstarp2dzeropip_dzero2kpkmksLL_ltunb_line( dzeros = make_dzeros_ltunb( particles=[kaons, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -368,7 +370,7 @@ def dstarp2dzeropip_dzero2kpkmksDD_ltunb_line( dzeros = make_dzeros( particles=[kaons, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -401,7 +403,7 @@ def dstarp2dzeropip_dzero2kpippimksLL_line( dzeros = make_dzeros( particles=[pions, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -429,7 +431,7 @@ def dstarp2dzeropip_dzero2pippimksDD_line( dzeros = make_dzeros( particles=[pions, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -462,7 +464,7 @@ def dstarp2dzeropip_dzero2pippimksLL_ltunb_line( dzeros = make_dzeros_ltunb( particles=[kaons, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -490,7 +492,7 @@ def dstarp2dzeropip_dzero2pippimksDD_ltunb_line( dzeros = make_dzeros( particles=[kaons, Ks], - descriptors=['[D0 -> Ks K+ K-]cc'], + descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() -- GitLab From 61fda8dfd6afb9399567e4b0c2d036b3b35de1a9 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Mon, 2 Mar 2020 13:26:51 +0000 Subject: [PATCH 15/21] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/7406241 --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index 1691e193a53..95e72bbcd1a 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -25,7 +25,8 @@ from RecoConf.hlt1_tracking import require_pvs, require_gec from RecoConf.reco_objects_from_file import make_pvs, upfront_reconstruction -from ..algorithms import (require_all, ParticleCombinerWithPVs, ParticleFilter, ParticleFilterWithPVs) +from ..algorithms import (require_all, ParticleCombinerWithPVs, ParticleFilter, + ParticleFilterWithPVs) from ..framework import configurable from ..standard_particles import (make_long_pions, make_has_rich_long_kaons, make_has_rich_long_pions, make_KsDD, @@ -160,20 +161,19 @@ def make_dzeros(particles, combination_code = require_all( "in_range({am_min}, AM, {am_max})", "(APT1+APT2+APT3) > {achildsum_pt_min}").format( - am_min=am_min, - am_max=am_max, - achildsum_pt_min=achildsum_pt_min) - - vertex_code = require_all( - "PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof_max}", "BPVDIRA() > {bpvdira_min}", - "BPVVDCHI2() > {bpvvdchi2_min}", "BPVLTIME() > {bpvltime_min}", - "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( - pt_min=pt_min, - vchi2pdof_max=vchi2pdof_max, - bpvdira_min=bpvdira_min, - bpvvdchi2_min=bpvvdchi2_min, - bpvltime_min=bpvltime_min, - d2dvvdchi2_min=d2dvvdchi2_min) + am_min=am_min, am_max=am_max, achildsum_pt_min=achildsum_pt_min) + + vertex_code = require_all("PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof_max}", + "BPVDIRA() > {bpvdira_min}", + "BPVVDCHI2() > {bpvvdchi2_min}", + "BPVLTIME() > {bpvltime_min}", + "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( + pt_min=pt_min, + vchi2pdof_max=vchi2pdof_max, + bpvdira_min=bpvdira_min, + bpvvdchi2_min=bpvvdchi2_min, + bpvltime_min=bpvltime_min, + d2dvvdchi2_min=d2dvvdchi2_min) dzeros = ParticleCombinerWithPVs( particles=particles, -- GitLab From 5e2c78097898f670000e13bcb93861a40985fe8c Mon Sep 17 00:00:00 2001 From: Edward Date: Wed, 4 Mar 2020 11:22:57 +0100 Subject: [PATCH 16/21] Changed combiner algorithm to 3 body in D02HHKS --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index 95e72bbcd1a..c38789d5bfd 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -175,7 +175,7 @@ def make_dzeros(particles, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) - dzeros = ParticleCombinerWithPVs( + dzeros = N3ParticleCombinerWithPVs( particles=particles, pvs=pvs, DecayDescriptors=descriptors, @@ -206,19 +206,20 @@ def make_dzeros_ltunb(particles, combination_code = require_all( "in_range({am_min}, AM, {am_max})", "(APT1+APT2+APT3) > {achildsum_pt_min}").format( - am_min=am_min, am_max=am_max) - + am_min=am_min, am_max=am_max, + achildsum_pt_min=achildsum_pt_min) + vertex_code = require_all( - "PT > {pt_min}", "VFASPF(VCHI2PDOF) < {vchi2pdof}", - "BPVDIRA > {bpvdira_min}", "BPVLTIME() > {bpvltime_min}", + # "PT > {pt_min}", "VFASPF(VCHI2PDOF) < {vchi2pdof_max}", + "BPVDIRA() > {bpvdira_min}", "BPVLTIME() > {bpvltime_min}", "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( - pt_min=pt_min, - vchi2pdof_max=vchi22pdof_max, + # pt_min=pt_min, + # vchi2pdof_max=vchi2pdof_max, bpvdira_min=bpvdira_min, - bpvvdchi2_min=bpvvdchi2_min, + #bpvvdchi2_min=bpvvdchi2_min, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) - + dzeros = ParticleCombinerWithPVs( particles=particles, pvs=pvs, @@ -248,9 +249,8 @@ def make_dstars(dzeros, q_am_min=q_am_min, q_am_max=q_am_max) vertex_code = require_all( - "VFASPF(VCHI2PDOF) < {vchi2pdof_max}", "in_range({q_m_min}, (M - M1 - M2), {q_m_max})").format( - q_m_min=q_m_min, q_m_max=q_m_max, vchi2pdof_max=vchi2pdof_max) + q_m_min=q_m_min, q_m_max=q_m_max) return ParticleCombinerWithPVs( particles=[dzeros, soft_pions], @@ -293,7 +293,7 @@ def dstarp2dzeropip_dzero2kpkmksLL_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) @@ -321,7 +321,7 @@ def dstarp2dzeropip_dzero2kpkmksDD_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) @@ -354,7 +354,7 @@ def dstarp2dzeropip_dzero2kpkmksLL_ltunb_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) @@ -382,7 +382,7 @@ def dstarp2dzeropip_dzero2kpkmksDD_ltunb_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) -- GitLab From 212acdd14a278d13b66131f07626946af14d3ff6 Mon Sep 17 00:00:00 2001 From: Edward Date: Mon, 16 Mar 2020 20:01:37 +0100 Subject: [PATCH 17/21] Added untagged D02HHKS lines --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 99 ++++++++++++++----- 1 file changed, 75 insertions(+), 24 deletions(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index c38789d5bfd..9b46c34b80b 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -10,10 +10,10 @@ ############################################################################### """ Definition of D0 -> Ks h+ h- HLT2 lines. - - - - +Dst+ -> (D0 -> K+ K- (KS -> pi+ pi-))pi+; it's charge conjugate; LTUNB; and LL and DD lines +Dst+ -> (D0 -> pi+ pi- (KS -> pi+ pi-))pi+, it's charge conjugate; LTUNB; and LL and DD lines +Dst+ -> (D0 -> pi+ K- (KS -> pi+ pi-))pi+, it's charge conjugate; LTUNB; and LL and DD lines +Untagged D0 -> K+ K- (KS -> pi+ pi-), and it's charge conjugate """ import math @@ -26,7 +26,7 @@ from RecoConf.hlt1_tracking import require_pvs, require_gec from RecoConf.reco_objects_from_file import make_pvs, upfront_reconstruction from ..algorithms import (require_all, ParticleCombinerWithPVs, ParticleFilter, - ParticleFilterWithPVs) + ParticleFilterWithPVs, N3BodyCombinerWithPVs) from ..framework import configurable from ..standard_particles import (make_long_pions, make_has_rich_long_kaons, make_has_rich_long_pions, make_KsDD, @@ -163,7 +163,8 @@ def make_dzeros(particles, "(APT1+APT2+APT3) > {achildsum_pt_min}").format( am_min=am_min, am_max=am_max, achildsum_pt_min=achildsum_pt_min) - vertex_code = require_all("PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof_max}", + vertex_code = require_all("PT > {pt_min}", + "CHI2VXNDOF < {vchi2pdof_max}", "BPVDIRA() > {bpvdira_min}", "BPVVDCHI2() > {bpvvdchi2_min}", "BPVLTIME() > {bpvltime_min}", @@ -174,18 +175,20 @@ def make_dzeros(particles, bpvvdchi2_min=bpvvdchi2_min, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) + - dzeros = N3ParticleCombinerWithPVs( + return ParticleCombinerWithPVs( particles=particles, pvs=pvs, DecayDescriptors=descriptors, CombinationCut=combination_code, MotherCut=vertex_code) - + ''' code = require_all("in_range({m_min}, M, {m_max})").format( m_min=m_min, m_max=m_max) return ParticleFilter(dzeros, Code=code) + ''' @configurable @@ -210,27 +213,28 @@ def make_dzeros_ltunb(particles, achildsum_pt_min=achildsum_pt_min) vertex_code = require_all( - # "PT > {pt_min}", "VFASPF(VCHI2PDOF) < {vchi2pdof_max}", + "PT > {pt_min}", "VFASPF(VCHI2PDOF) < {vchi2pdof_max}", "BPVDIRA() > {bpvdira_min}", "BPVLTIME() > {bpvltime_min}", "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( - # pt_min=pt_min, - # vchi2pdof_max=vchi2pdof_max, + pt_min=pt_min, + vchi2pdof_max=vchi2pdof_max, bpvdira_min=bpvdira_min, #bpvvdchi2_min=bpvvdchi2_min, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) - dzeros = ParticleCombinerWithPVs( + return N3BodyCombinerWithPVs( particles=particles, pvs=pvs, DecayDescriptors=descriptors, CombinationCut=combination_code, MotherCut=vertex_code) - + ''' code = require_all("in_range({m_min}, M, {m_max})").format( m_min=m_min, m_max=m_max) return ParticleFilter(dzeros, Code=code) + ''' @configurable @@ -327,7 +331,7 @@ def dstarp2dzeropip_dzero2kpkmksDD_line( """ -D* -> (D0 -> Ks K+ K-) pi+ LTUNB +Dst+ -> (D0 -> K+ K- (KS -> pi+ pi-)) pi+ LTUNB """ @@ -403,7 +407,7 @@ def dstarp2dzeropip_dzero2kpippimksLL_line( dzeros = make_dzeros( particles=[pions, Ks], - descriptors=['[D0 -> KS0 K+ K-]cc'], + descriptors=['[D0 -> KS0 pi+ pi-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -415,7 +419,7 @@ def dstarp2dzeropip_dzero2kpippimksLL_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) @@ -431,7 +435,7 @@ def dstarp2dzeropip_dzero2pippimksDD_line( dzeros = make_dzeros( particles=[pions, Ks], - descriptors=['[D0 -> KS0 K+ K-]cc'], + descriptors=['[D0 -> KS0 pi+ pi-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -443,7 +447,7 @@ def dstarp2dzeropip_dzero2pippimksDD_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) @@ -463,8 +467,8 @@ def dstarp2dzeropip_dzero2pippimksLL_ltunb_line( pvs = make_pvs() dzeros = make_dzeros_ltunb( - particles=[kaons, Ks], - descriptors=['[D0 -> KS0 K+ K-]cc'], + particles=[pions, Ks], + descriptors=['[D0 -> KS0 pi+ pi-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -476,7 +480,7 @@ def dstarp2dzeropip_dzero2pippimksLL_ltunb_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) @@ -491,8 +495,8 @@ def dstarp2dzeropip_dzero2pippimksDD_ltunb_line( pvs = make_pvs() dzeros = make_dzeros( - particles=[kaons, Ks], - descriptors=['[D0 -> KS0 K+ K-]cc'], + particles=[pions, Ks], + descriptors=['[D0 -> KS0 pi+ pi-]cc'], pvs=make_pvs()) soft_pions = make_charm_soft_pions() @@ -504,6 +508,53 @@ def dstarp2dzeropip_dzero2pippimksDD_ltunb_line( return HltLine( name=name, - algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + algs=upfront_reconstruction() + charm_prefilters() + [dstars], prescale=prescale, ) + + + +""" +D0 -> K+ K- (KS -> pi+ pi-) +""" +@register_line_builder(all_lines) +@configurable +def dzero2kpkmksLL_line( + name='Hlt2CharmD0ToKpKmKsLL_Line', prescale=1): + + kaons = make_charm_kaons() + Ks = make_kshortLL() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[kaons, Ks], + descriptors=['[D0 -> KS0 K+ K-]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale + ) + + +@register_line_builder(all_lines) +@configurable +def dzero2kpkmksDD_line( + name='Hlt2CharmD0ToKpKmKsDD_Line', prescale=1): + + kaons = make_charm_kaons() + Ks = make_kshortDD() + pvs = make_pvs() + + dzeros = make_dzeros( + particles=[kaons, Ks], + descriptors=['[D0 -> KS0 K+ K-]cc'], + pvs=pvs) + + return HltLine( + name=name, + algs=upfront_reconstruction() + charm_prefilters() + [dzeros], + prescale=prescale + ) + -- GitLab From 3956e7c50a0a9332142a40da9e29f2545b5bda21 Mon Sep 17 00:00:00 2001 From: Edward Date: Mon, 16 Mar 2020 20:05:07 +0100 Subject: [PATCH 18/21] Fixed formatting --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index 9b46c34b80b..4bc6652cd2b 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -219,7 +219,6 @@ def make_dzeros_ltunb(particles, pt_min=pt_min, vchi2pdof_max=vchi2pdof_max, bpvdira_min=bpvdira_min, - #bpvvdchi2_min=bpvvdchi2_min, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) -- GitLab From b3a52616011b1c33da5bc292fbd8801adb49484e Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Mon, 16 Mar 2020 19:05:53 +0000 Subject: [PATCH 19/21] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/7606144 --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 41 +++++++------------ 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index 4bc6652cd2b..c35a289f3f2 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -10,7 +10,7 @@ ############################################################################### """ Definition of D0 -> Ks h+ h- HLT2 lines. -Dst+ -> (D0 -> K+ K- (KS -> pi+ pi-))pi+; it's charge conjugate; LTUNB; and LL and DD lines +Dst+ -> (D0 -> K+ K- (KS -> pi+ pi-))pi+; it's charge conjugate; LTUNB; and LL and DD lines Dst+ -> (D0 -> pi+ pi- (KS -> pi+ pi-))pi+, it's charge conjugate; LTUNB; and LL and DD lines Dst+ -> (D0 -> pi+ K- (KS -> pi+ pi-))pi+, it's charge conjugate; LTUNB; and LL and DD lines Untagged D0 -> K+ K- (KS -> pi+ pi-), and it's charge conjugate @@ -163,8 +163,7 @@ def make_dzeros(particles, "(APT1+APT2+APT3) > {achildsum_pt_min}").format( am_min=am_min, am_max=am_max, achildsum_pt_min=achildsum_pt_min) - vertex_code = require_all("PT > {pt_min}", - "CHI2VXNDOF < {vchi2pdof_max}", + vertex_code = require_all("PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof_max}", "BPVDIRA() > {bpvdira_min}", "BPVVDCHI2() > {bpvvdchi2_min}", "BPVLTIME() > {bpvltime_min}", @@ -175,7 +174,6 @@ def make_dzeros(particles, bpvvdchi2_min=bpvvdchi2_min, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) - return ParticleCombinerWithPVs( particles=particles, @@ -209,9 +207,8 @@ def make_dzeros_ltunb(particles, combination_code = require_all( "in_range({am_min}, AM, {am_max})", "(APT1+APT2+APT3) > {achildsum_pt_min}").format( - am_min=am_min, am_max=am_max, - achildsum_pt_min=achildsum_pt_min) - + am_min=am_min, am_max=am_max, achildsum_pt_min=achildsum_pt_min) + vertex_code = require_all( "PT > {pt_min}", "VFASPF(VCHI2PDOF) < {vchi2pdof_max}", "BPVDIRA() > {bpvdira_min}", "BPVLTIME() > {bpvltime_min}", @@ -221,7 +218,7 @@ def make_dzeros_ltunb(particles, bpvdira_min=bpvdira_min, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) - + return N3BodyCombinerWithPVs( particles=particles, pvs=pvs, @@ -512,48 +509,40 @@ def dstarp2dzeropip_dzero2pippimksDD_ltunb_line( ) - """ D0 -> K+ K- (KS -> pi+ pi-) """ + + @register_line_builder(all_lines) @configurable -def dzero2kpkmksLL_line( - name='Hlt2CharmD0ToKpKmKsLL_Line', prescale=1): +def dzero2kpkmksLL_line(name='Hlt2CharmD0ToKpKmKsLL_Line', prescale=1): kaons = make_charm_kaons() Ks = make_kshortLL() - pvs = make_pvs() + pvs = make_pvs() dzeros = make_dzeros( - particles=[kaons, Ks], - descriptors=['[D0 -> KS0 K+ K-]cc'], - pvs=pvs) + particles=[kaons, Ks], descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=pvs) return HltLine( name=name, algs=upfront_reconstruction() + charm_prefilters() + [dzeros], - prescale=prescale - ) + prescale=prescale) @register_line_builder(all_lines) @configurable -def dzero2kpkmksDD_line( - name='Hlt2CharmD0ToKpKmKsDD_Line', prescale=1): +def dzero2kpkmksDD_line(name='Hlt2CharmD0ToKpKmKsDD_Line', prescale=1): kaons = make_charm_kaons() Ks = make_kshortDD() - pvs = make_pvs() + pvs = make_pvs() dzeros = make_dzeros( - particles=[kaons, Ks], - descriptors=['[D0 -> KS0 K+ K-]cc'], - pvs=pvs) + particles=[kaons, Ks], descriptors=['[D0 -> KS0 K+ K-]cc'], pvs=pvs) return HltLine( name=name, algs=upfront_reconstruction() + charm_prefilters() + [dzeros], - prescale=prescale - ) - + prescale=prescale) -- GitLab From fcf803db01d04ff2518a2d6909aed7e91133d094 Mon Sep 17 00:00:00 2001 From: Edward Date: Wed, 18 Mar 2020 13:19:36 +0100 Subject: [PATCH 20/21] Changed dzero algorithm to ParticleCombinerWithPVs --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index c35a289f3f2..74eff06426d 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -219,7 +219,7 @@ def make_dzeros_ltunb(particles, bpvltime_min=bpvltime_min, d2dvvdchi2_min=d2dvvdchi2_min) - return N3BodyCombinerWithPVs( + return ParticleCombinerWithPVs( particles=particles, pvs=pvs, DecayDescriptors=descriptors, -- GitLab From 4a9d016ea26a89b6f3578b8f861ab3e392951e44 Mon Sep 17 00:00:00 2001 From: Edward Date: Mon, 25 May 2020 12:19:48 +0200 Subject: [PATCH 21/21] Added ParticleCombiner algorithm for D0 reconstruction --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py index 74eff06426d..f862bb59afe 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/D02HHKS.py @@ -25,7 +25,7 @@ from RecoConf.hlt1_tracking import require_pvs, require_gec from RecoConf.reco_objects_from_file import make_pvs, upfront_reconstruction -from ..algorithms import (require_all, ParticleCombinerWithPVs, ParticleFilter, +from ..algorithms import (require_all, ParticleCombiner, ParticleCombinerWithPVs, ParticleFilter, ParticleFilterWithPVs, N3BodyCombinerWithPVs) from ..framework import configurable from ..standard_particles import (make_long_pions, make_has_rich_long_kaons, @@ -163,17 +163,19 @@ def make_dzeros(particles, "(APT1+APT2+APT3) > {achildsum_pt_min}").format( am_min=am_min, am_max=am_max, achildsum_pt_min=achildsum_pt_min) - vertex_code = require_all("PT > {pt_min}", "CHI2VXNDOF < {vchi2pdof_max}", - "BPVDIRA() > {bpvdira_min}", - "BPVVDCHI2() > {bpvvdchi2_min}", - "BPVLTIME() > {bpvltime_min}", - "D2DVVDCHI2(3) > {d2dvvdchi2_min}").format( - pt_min=pt_min, - vchi2pdof_max=vchi2pdof_max, - bpvdira_min=bpvdira_min, - bpvvdchi2_min=bpvvdchi2_min, - bpvltime_min=bpvltime_min, - d2dvvdchi2_min=d2dvvdchi2_min) + vertex_code = require_all("PT > {pt_min}", + #"CHI2VXNDOF < {vchi2pdof_max}", + #"BPVDIRA() > {bpvdira_min}", + #"BPVVDCHI2() > {bpvvdchi2_min}", + #"BPVLTIME() > {bpvltime_min}", + #"D2DVVDCHI2(3) > {d2dvvdchi2_min}" + ).format( + pt_min=pt_min,) + #vchi2pdof_max=vchi2pdof_max, + #bpvdira_min=bpvdira_min, + #bpvvdchi2_min=bpvvdchi2_min, + #bpvltime_min=bpvltime_min, + #d2dvvdchi2_min=d2dvvdchi2_min) return ParticleCombinerWithPVs( particles=particles, -- GitLab