From 9fb4d74f5d2e0e9f0c023120e73ecb92edc4d9e6 Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Mon, 4 Oct 2021 16:01:03 +0200
Subject: [PATCH 01/30] Extend .gitignore list

---
 .gitignore | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.gitignore b/.gitignore
index 65e280a5088..b980654d2e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,3 +31,7 @@ doc/_env*
 doc/_build
 doc/graphviz
 doc/selection/thor_functors_reference.generated.rst
+
+# Environment files (VSCode)
+**/.vscode
+.env
\ No newline at end of file
-- 
GitLab


From 2016873f4259b5b86b45f5fb48a3f98ccafba8a7 Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Mon, 4 Oct 2021 16:36:10 +0200
Subject: [PATCH 02/30] First draft of tauonic Lb line

---
 .../semileptonic/HbToHcTauNu_TauToMuNuNu.py   | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
index a324e3fb41e..26726f24111 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
@@ -123,3 +123,23 @@ def bstodstaunu_dstokkpi_fakemuon_line(
         ],
         prescale=prescale,
     )
+
+@register_line_builder(all_lines)
+def lbtolctaunu_lctopkpi_tautomunuline(
+        name="Hlt2SLB_LbToLcTauNu_LcToPKPi_TauToMuNuNuLine", prescale=1):
+    """
+    Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu, and combinatorial (same sign).
+    """
+    kaons = make_kaons()
+    pions = make_pions()
+    tauons = make_tauons_muonic_decay()
+    lcs = make_lambdacs(protons, kaons, pions)
+    lbs = make_b2xlnu(
+        particles=[lcs, muons], 
+        descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc")
+
+    return HltLine(
+        name=name,
+        algs=sl_line_prefilter() + [lbs],
+        prescale=prescale,
+    )
\ No newline at end of file
-- 
GitLab


From 80a9b67601eabbd3e641a1cce7a25c36ebd35957 Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Mon, 4 Oct 2021 14:38:01 +0000
Subject: [PATCH 03/30] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/16692110
---
 .../Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
index 26726f24111..39f22ac3f31 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
@@ -124,6 +124,7 @@ def bstodstaunu_dstokkpi_fakemuon_line(
         prescale=prescale,
     )
 
+
 @register_line_builder(all_lines)
 def lbtolctaunu_lctopkpi_tautomunuline(
         name="Hlt2SLB_LbToLcTauNu_LcToPKPi_TauToMuNuNuLine", prescale=1):
@@ -135,11 +136,10 @@ def lbtolctaunu_lctopkpi_tautomunuline(
     tauons = make_tauons_muonic_decay()
     lcs = make_lambdacs(protons, kaons, pions)
     lbs = make_b2xlnu(
-        particles=[lcs, muons], 
-        descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc")
+        particles=[lcs, muons], descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc")
 
     return HltLine(
         name=name,
         algs=sl_line_prefilter() + [lbs],
         prescale=prescale,
-    )
\ No newline at end of file
+    )
-- 
GitLab


From 14c75f29a24ce3f8386283f1c694d2b9dbeeb7bc Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Mon, 4 Oct 2021 16:41:11 +0200
Subject: [PATCH 04/30] update docstrings

---
 .../Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
index 39f22ac3f31..48ed39793df 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
@@ -129,7 +129,7 @@ def bstodstaunu_dstokkpi_fakemuon_line(
 def lbtolctaunu_lctopkpi_tautomunuline(
         name="Hlt2SLB_LbToLcTauNu_LcToPKPi_TauToMuNuNuLine", prescale=1):
     """
-    Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu, and combinatorial (same sign).
+    Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu.
     """
     kaons = make_kaons()
     pions = make_pions()
-- 
GitLab


From e41637bef05a905bc7c8b077440dbd1f55c51dd1 Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Mon, 4 Oct 2021 21:45:58 +0200
Subject: [PATCH 05/30] WIP: Semi-tauonic Lb line

---
 .../semileptonic/HbToHcTauNu_TauToMuNuNu.py   | 28 +++++++++++++------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
index 48ed39793df..8f0d9a5886b 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
@@ -27,8 +27,10 @@ from Moore.config import HltLine, register_line_builder
 from Hlt2Conf.algorithms import ParticleContainersMerger
 from PyConf import configurable
 
-from .builders.base_builder import make_tauons_muonic_decay, make_fake_tauons_muonic_decay, make_pions, make_kaons
-from .builders.charm_hadron_builder import make_dplus_tokpipi, make_ds_tokkpi
+from RecoConf.reconstruction_objects import make_pvs
+
+from .builders.base_builder import make_tauons_muonic_decay, make_fake_tauons_muonic_decay, make_pions, make_kaons, make_protons
+from .builders.charm_hadron_builder import make_dplus_tokpipi, make_ds_tokkpi, make_lambdacs
 from .builders.b_builder import make_b2xtaunu
 
 from .builders import sl_line_prefilter
@@ -127,16 +129,24 @@ def bstodstaunu_dstokkpi_fakemuon_line(
 
 @register_line_builder(all_lines)
 def lbtolctaunu_lctopkpi_tautomunuline(
-        name="Hlt2SLB_LbToLcTauNu_LcToPKPi_TauToMuNuNuLine", prescale=1):
+        name="Hlt2SLB_LbToLcTauNu_LcToPKPi_TauToMuNuNuLine", 
+        prescale=1):
     """
     Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu.
     """
-    kaons = make_kaons()
-    pions = make_pions()
-    tauons = make_tauons_muonic_decay()
-    lcs = make_lambdacs(protons, kaons, pions)
-    lbs = make_b2xlnu(
-        particles=[lcs, muons], descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc")
+
+    pvs     = make_pvs()
+    protons = make_protons()
+    kaons   = make_kaons()
+    pions   = make_pions()
+    tauons  = make_tauons_muonic_decay()
+    lcs     = make_lambdacs(protons=protons,
+                            kaons=kaons, 
+                            pions=pions, 
+                            make_pvs=pvs)
+    lbs     = make_b2xtaunu( 
+        particles=[lcs, tauons], 
+        descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc")
 
     return HltLine(
         name=name,
-- 
GitLab


From 7341b8458af4eab67fed45392923516ef7ff4108 Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Mon, 4 Oct 2021 19:46:26 +0000
Subject: [PATCH 06/30] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/16699187
---
 .../semileptonic/HbToHcTauNu_TauToMuNuNu.py   | 22 ++++++++-----------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
index 8f0d9a5886b..df3309907d2 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
@@ -129,24 +129,20 @@ def bstodstaunu_dstokkpi_fakemuon_line(
 
 @register_line_builder(all_lines)
 def lbtolctaunu_lctopkpi_tautomunuline(
-        name="Hlt2SLB_LbToLcTauNu_LcToPKPi_TauToMuNuNuLine", 
-        prescale=1):
+        name="Hlt2SLB_LbToLcTauNu_LcToPKPi_TauToMuNuNuLine", prescale=1):
     """
     Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu.
     """
 
-    pvs     = make_pvs()
+    pvs = make_pvs()
     protons = make_protons()
-    kaons   = make_kaons()
-    pions   = make_pions()
-    tauons  = make_tauons_muonic_decay()
-    lcs     = make_lambdacs(protons=protons,
-                            kaons=kaons, 
-                            pions=pions, 
-                            make_pvs=pvs)
-    lbs     = make_b2xtaunu( 
-        particles=[lcs, tauons], 
-        descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc")
+    kaons = make_kaons()
+    pions = make_pions()
+    tauons = make_tauons_muonic_decay()
+    lcs = make_lambdacs(
+        protons=protons, kaons=kaons, pions=pions, make_pvs=pvs)
+    lbs = make_b2xtaunu(
+        particles=[lcs, tauons], descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc")
 
     return HltLine(
         name=name,
-- 
GitLab


From 1eac6d38e68b2ebe5fda5108716fa50725382405 Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Wed, 6 Oct 2021 11:06:15 +0200
Subject: [PATCH 07/30] WIP Lc2Lctaunu line

---
 .../semileptonic/HbToHcTauNu_TauToMuNuNu.py   | 54 +++++++++++++++----
 1 file changed, 43 insertions(+), 11 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
index df3309907d2..7348e1d31e9 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
@@ -27,14 +27,17 @@ from Moore.config import HltLine, register_line_builder
 from Hlt2Conf.algorithms import ParticleContainersMerger
 from PyConf import configurable
 
-from RecoConf.reconstruction_objects import make_pvs
+import Functors as F
 
-from .builders.base_builder import make_tauons_muonic_decay, make_fake_tauons_muonic_decay, make_pions, make_kaons, make_protons
-from .builders.charm_hadron_builder import make_dplus_tokpipi, make_ds_tokkpi, make_lambdacs
+from .builders.base_builder import make_tauons_muonic_decay, make_fake_tauons_muonic_decay
+from .builders.base_builder import make_pions, make_kaons, make_muons_from_b, make_candidate
+from .builders.charm_hadron_builder import make_dplus_tokpipi, make_ds_tokkpi, make_Hc_to_nbody
 from .builders.b_builder import make_b2xtaunu
 
 from .builders import sl_line_prefilter
 
+from GaudiKernel.SystemOfUnits import MeV, m
+
 all_lines = {}
 
 
@@ -134,15 +137,44 @@ def lbtolctaunu_lctopkpi_tautomunuline(
     Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu.
     """
 
-    pvs = make_pvs()
-    protons = make_protons()
-    kaons = make_kaons()
-    pions = make_pions()
-    tauons = make_tauons_muonic_decay()
-    lcs = make_lambdacs(
-        protons=protons, kaons=kaons, pions=pions, make_pvs=pvs)
+    protons = make_candidate( # what should be a conservative trchi2todof_max?
+        pt_min=300. * MeV,
+        trghostprob_max=0.5,
+        mipchi2_min=9.,
+        pid=(F.PID_P > 0)
+    )
+    kaons = make_candidate(
+        pt_min=300. * MeV,
+        trghostprob_max=0.5,
+        mipchi2_min=9.,
+        pid=(F.PID_K > 4.)
+    )
+    pions = make_candidate(
+        pt_min=300. * MeV,
+        trghostprob_max=0.5,
+        mipchi2_min=9.,
+        pid=(F.PID_K < 2.)        
+    )
+    tauons = make_muons_from_b( # need trghostprob in the builder, workaround for now
+       require_ismuon=0,
+       p_min=3 * GeV,
+       pt_min=0 * GeV,
+       mipchi2_min=16,
+       pid=((F.PID_MU > -200) & (F.GHOSTPROB < 0.5))
+    )
+    lcs = make_Hc_to_nbody( # missing ADMASS functor
+        particles=[protons, kaons, pions],
+        descriptor="[Lc+ -> p+ K- pi+]cc",
+        comb_pt_min=2500 * MeV,
+        comb_doca_max=None,
+        vchi2pdof_max=4
+        )
     lbs = make_b2xtaunu(
-        particles=[lcs, tauons], descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc")
+        particles=[lcs, tauons], 
+        descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc",
+        comb_m_max=10200 * MeV,
+        vchi2pdof_max=6.0
+        )
 
     return HltLine(
         name=name,
-- 
GitLab


From e90a6e126328911b0f922d4820f402f977f8e889 Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Wed, 6 Oct 2021 09:06:52 +0000
Subject: [PATCH 08/30] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/16740315
---
 .../semileptonic/HbToHcTauNu_TauToMuNuNu.py   | 34 ++++++++-----------
 1 file changed, 14 insertions(+), 20 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
index 7348e1d31e9..2684b39f4e8 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
@@ -137,44 +137,38 @@ def lbtolctaunu_lctopkpi_tautomunuline(
     Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu.
     """
 
-    protons = make_candidate( # what should be a conservative trchi2todof_max?
+    protons = make_candidate(  # what should be a conservative trchi2todof_max?
         pt_min=300. * MeV,
         trghostprob_max=0.5,
         mipchi2_min=9.,
-        pid=(F.PID_P > 0)
-    )
+        pid=(F.PID_P > 0))
     kaons = make_candidate(
         pt_min=300. * MeV,
         trghostprob_max=0.5,
         mipchi2_min=9.,
-        pid=(F.PID_K > 4.)
-    )
+        pid=(F.PID_K > 4.))
     pions = make_candidate(
         pt_min=300. * MeV,
         trghostprob_max=0.5,
         mipchi2_min=9.,
-        pid=(F.PID_K < 2.)        
-    )
-    tauons = make_muons_from_b( # need trghostprob in the builder, workaround for now
-       require_ismuon=0,
-       p_min=3 * GeV,
-       pt_min=0 * GeV,
-       mipchi2_min=16,
-       pid=((F.PID_MU > -200) & (F.GHOSTPROB < 0.5))
-    )
-    lcs = make_Hc_to_nbody( # missing ADMASS functor
+        pid=(F.PID_K < 2.))
+    tauons = make_muons_from_b(  # need trghostprob in the builder, workaround for now
+        require_ismuon=0,
+        p_min=3 * GeV,
+        pt_min=0 * GeV,
+        mipchi2_min=16,
+        pid=((F.PID_MU > -200) & (F.GHOSTPROB < 0.5)))
+    lcs = make_Hc_to_nbody(  # missing ADMASS functor
         particles=[protons, kaons, pions],
         descriptor="[Lc+ -> p+ K- pi+]cc",
         comb_pt_min=2500 * MeV,
         comb_doca_max=None,
-        vchi2pdof_max=4
-        )
+        vchi2pdof_max=4)
     lbs = make_b2xtaunu(
-        particles=[lcs, tauons], 
+        particles=[lcs, tauons],
         descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc",
         comb_m_max=10200 * MeV,
-        vchi2pdof_max=6.0
-        )
+        vchi2pdof_max=6.0)
 
     return HltLine(
         name=name,
-- 
GitLab


From 82edfaa0e97542662f345b147f49bedbf1d21bae Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Wed, 6 Oct 2021 11:09:42 +0200
Subject: [PATCH 09/30] minor fix

---
 .../Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
index 2684b39f4e8..a77a7541422 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
@@ -36,7 +36,7 @@ from .builders.b_builder import make_b2xtaunu
 
 from .builders import sl_line_prefilter
 
-from GaudiKernel.SystemOfUnits import MeV, m
+from GaudiKernel.SystemOfUnits import MeV, GeV
 
 all_lines = {}
 
-- 
GitLab


From 933a036314d8b83e2a43f9a58bd90818aa61d7e5 Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Wed, 6 Oct 2021 17:23:04 +0200
Subject: [PATCH 10/30] Testing Lv2Lctaunuline

---
 .../Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py | 90 +++++++++++++++++++
 1 file changed, 90 insertions(+)
 create mode 100644 Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
new file mode 100644
index 00000000000..1de8f00712e
--- /dev/null
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
@@ -0,0 +1,90 @@
+###############################################################################
+# (c) Copyright 2021 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 semileptonic selections for the Hb -> Hc tau nu topology,
+with tau -> mu nu nu
+
+Non trivial imports:
+basic builders, prefilters
+
+Returns:
+every function returns a line_alg
+
+To note:
+all_lines = {} will be removed once the full module will be converted to
+the new hlt2 lines booking scheme
+
+"""
+
+from Moore.config import HltLine, register_line_builder
+from Hlt2Conf.algorithms import ParticleContainersMerger
+from PyConf import configurable
+
+import Functors as F
+
+from .builders.base_builder import make_tauons_muonic_decay, make_fake_tauons_muonic_decay
+from .builders.base_builder import make_pions, make_kaons, make_muons_from_b, make_candidate
+from .builders.charm_hadron_builder import make_dplus_tokpipi, make_ds_tokkpi, make_Hc_to_nbody
+from .builders.b_builder import make_b2xtaunu
+
+from .builders import sl_line_prefilter
+
+from GaudiKernel.SystemOfUnits import MeV, GeV
+
+all_lines = {}
+
+
+@register_line_builder(all_lines)
+def lbtolctaunu_lctopkpi_tautomunuline(
+        name="Hlt2SLB_LbToLcTauNu_LcToPKPi_TauToMuNuNuLine", prescale=1):
+    """
+    Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu.
+    """
+
+    protons = make_candidate(  # what should be a conservative trchi2todof_max?
+        pt_min=300. * MeV,
+        trghostprob_max=0.5,
+        mipchi2_min=9.,
+        pid=(F.PID_P > 0))
+    kaons = make_candidate(
+        pt_min=300. * MeV,
+        trghostprob_max=0.5,
+        mipchi2_min=9.,
+        pid=(F.PID_K > 4.))
+    pions = make_candidate(
+        pt_min=300. * MeV,
+        trghostprob_max=0.5,
+        mipchi2_min=9.,
+        pid=(F.PID_K < 2.))
+    tauons = make_muons_from_b(  # need trghostprob in the builder, workaround for now
+        require_ismuon=0,
+        p_min=3 * GeV,
+        pt_min=0 * GeV,
+        mipchi2_min=16,
+        pid=((F.PID_MU > -200) & (F.GHOSTPROB < 0.5)))
+    lcs = make_Hc_to_nbody(  # missing ADMASS functor
+        particles=[protons, kaons, pions],
+        descriptor="[Lambda_c+ -> p+ K- pi+]cc",
+        comb_m_min=2276.46 * MeV, #extra
+        comb_m_max=2296.46 * MeV, #extra
+        comb_pt_min=2500 * MeV,
+        comb_doca_max=None,
+        vchi2pdof_max=4)
+    lbs = make_b2xtaunu(
+        particles=[lcs, tauons],
+        descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc",
+        comb_m_max=10200 * MeV,
+        vchi2pdof_max=6.0)
+
+    return HltLine(
+        name=name,
+        algs=sl_line_prefilter() + [lbs],
+        prescale=prescale,
+    )
-- 
GitLab


From 02e27afb5ac53197d313452c29019d8afef1517a Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Wed, 6 Oct 2021 15:24:20 +0000
Subject: [PATCH 11/30] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/16752403
---
 Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
index 1de8f00712e..daef9e84559 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
@@ -72,8 +72,8 @@ def lbtolctaunu_lctopkpi_tautomunuline(
     lcs = make_Hc_to_nbody(  # missing ADMASS functor
         particles=[protons, kaons, pions],
         descriptor="[Lambda_c+ -> p+ K- pi+]cc",
-        comb_m_min=2276.46 * MeV, #extra
-        comb_m_max=2296.46 * MeV, #extra
+        comb_m_min=2276.46 * MeV,  #extra
+        comb_m_max=2296.46 * MeV,  #extra
         comb_pt_min=2500 * MeV,
         comb_doca_max=None,
         vchi2pdof_max=4)
-- 
GitLab


From fc9faf9159aa9795538160b5d4ee7a131974f4bb Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Thu, 7 Oct 2021 15:29:51 +0200
Subject: [PATCH 12/30] Stable version of Lb2LcTauNu line

---
 .../semileptonic/HbToHcTauNu_TauToMuNuNu.py   | 54 +------------------
 .../Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py | 10 ++--
 2 files changed, 5 insertions(+), 59 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
index a77a7541422..27a724dd219 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
@@ -27,17 +27,13 @@ from Moore.config import HltLine, register_line_builder
 from Hlt2Conf.algorithms import ParticleContainersMerger
 from PyConf import configurable
 
-import Functors as F
-
 from .builders.base_builder import make_tauons_muonic_decay, make_fake_tauons_muonic_decay
-from .builders.base_builder import make_pions, make_kaons, make_muons_from_b, make_candidate
-from .builders.charm_hadron_builder import make_dplus_tokpipi, make_ds_tokkpi, make_Hc_to_nbody
+from .builders.base_builder import make_pions, make_kaons
+from .builders.charm_hadron_builder import make_dplus_tokpipi, make_ds_tokkpi
 from .builders.b_builder import make_b2xtaunu
 
 from .builders import sl_line_prefilter
 
-from GaudiKernel.SystemOfUnits import MeV, GeV
-
 all_lines = {}
 
 
@@ -129,49 +125,3 @@ def bstodstaunu_dstokkpi_fakemuon_line(
         prescale=prescale,
     )
 
-
-@register_line_builder(all_lines)
-def lbtolctaunu_lctopkpi_tautomunuline(
-        name="Hlt2SLB_LbToLcTauNu_LcToPKPi_TauToMuNuNuLine", prescale=1):
-    """
-    Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu.
-    """
-
-    protons = make_candidate(  # what should be a conservative trchi2todof_max?
-        pt_min=300. * MeV,
-        trghostprob_max=0.5,
-        mipchi2_min=9.,
-        pid=(F.PID_P > 0))
-    kaons = make_candidate(
-        pt_min=300. * MeV,
-        trghostprob_max=0.5,
-        mipchi2_min=9.,
-        pid=(F.PID_K > 4.))
-    pions = make_candidate(
-        pt_min=300. * MeV,
-        trghostprob_max=0.5,
-        mipchi2_min=9.,
-        pid=(F.PID_K < 2.))
-    tauons = make_muons_from_b(  # need trghostprob in the builder, workaround for now
-        require_ismuon=0,
-        p_min=3 * GeV,
-        pt_min=0 * GeV,
-        mipchi2_min=16,
-        pid=((F.PID_MU > -200) & (F.GHOSTPROB < 0.5)))
-    lcs = make_Hc_to_nbody(  # missing ADMASS functor
-        particles=[protons, kaons, pions],
-        descriptor="[Lc+ -> p+ K- pi+]cc",
-        comb_pt_min=2500 * MeV,
-        comb_doca_max=None,
-        vchi2pdof_max=4)
-    lbs = make_b2xtaunu(
-        particles=[lcs, tauons],
-        descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc",
-        comb_m_max=10200 * MeV,
-        vchi2pdof_max=6.0)
-
-    return HltLine(
-        name=name,
-        algs=sl_line_prefilter() + [lbs],
-        prescale=prescale,
-    )
diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
index daef9e84559..5b7ff02f6eb 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
@@ -24,14 +24,10 @@ the new hlt2 lines booking scheme
 """
 
 from Moore.config import HltLine, register_line_builder
-from Hlt2Conf.algorithms import ParticleContainersMerger
-from PyConf import configurable
-
 import Functors as F
 
-from .builders.base_builder import make_tauons_muonic_decay, make_fake_tauons_muonic_decay
-from .builders.base_builder import make_pions, make_kaons, make_muons_from_b, make_candidate
-from .builders.charm_hadron_builder import make_dplus_tokpipi, make_ds_tokkpi, make_Hc_to_nbody
+from .builders.base_builder import make_muons_from_b, make_candidate
+from .builders.charm_hadron_builder import make_Hc_to_nbody
 from .builders.b_builder import make_b2xtaunu
 
 from .builders import sl_line_prefilter
@@ -69,7 +65,7 @@ def lbtolctaunu_lctopkpi_tautomunuline(
         pt_min=0 * GeV,
         mipchi2_min=16,
         pid=((F.PID_MU > -200) & (F.GHOSTPROB < 0.5)))
-    lcs = make_Hc_to_nbody(  # missing ADMASS functor
+    lcs = make_Hc_to_nbody(  # missing ADMASS functor, 
         particles=[protons, kaons, pions],
         descriptor="[Lambda_c+ -> p+ K- pi+]cc",
         comb_m_min=2276.46 * MeV,  #extra
-- 
GitLab


From d4c48b8167e86e0116762a51a652aa99e80bb184 Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Thu, 7 Oct 2021 13:30:37 +0000
Subject: [PATCH 13/30] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/16772569
---
 .../Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py      | 1 -
 Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py   | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
index 27a724dd219..4fc18534e87 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/HbToHcTauNu_TauToMuNuNu.py
@@ -124,4 +124,3 @@ def bstodstaunu_dstokkpi_fakemuon_line(
         ],
         prescale=prescale,
     )
-
diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
index 5b7ff02f6eb..84486b89dc3 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
@@ -65,7 +65,7 @@ def lbtolctaunu_lctopkpi_tautomunuline(
         pt_min=0 * GeV,
         mipchi2_min=16,
         pid=((F.PID_MU > -200) & (F.GHOSTPROB < 0.5)))
-    lcs = make_Hc_to_nbody(  # missing ADMASS functor, 
+    lcs = make_Hc_to_nbody(  # missing ADMASS functor,
         particles=[protons, kaons, pions],
         descriptor="[Lambda_c+ -> p+ K- pi+]cc",
         comb_m_min=2276.46 * MeV,  #extra
-- 
GitLab


From e17c98961b70206dc38366572062f75da8188fe4 Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Tue, 12 Oct 2021 12:26:05 +0200
Subject: [PATCH 14/30] Fix taus builder

---
 Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
index 84486b89dc3..431e7b6f499 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
@@ -60,7 +60,7 @@ def lbtolctaunu_lctopkpi_tautomunuline(
         mipchi2_min=9.,
         pid=(F.PID_K < 2.))
     tauons = make_muons_from_b(  # need trghostprob in the builder, workaround for now
-        require_ismuon=0,
+        require_ismuon=1,
         p_min=3 * GeV,
         pt_min=0 * GeV,
         mipchi2_min=16,
-- 
GitLab


From be5b14c9c4cddf49aad0246b21984d426c1eb8f3 Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Tue, 12 Oct 2021 14:47:25 +0200
Subject: [PATCH 15/30] Tuning Lb2Lctaunu line

---
 .../Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py  | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
index 431e7b6f499..f664a491bb1 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
@@ -43,41 +43,49 @@ def lbtolctaunu_lctopkpi_tautomunuline(
     """
     Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu.
     """
-
-    protons = make_candidate(  # what should be a conservative trchi2todof_max?
+    Lc_mass = 2286.46    # units MeV
+    delta_Lc_mass = 10.0 # units MeV
+    
+    protons = make_candidate( # trchi2todof_max ?
         pt_min=300. * MeV,
         trghostprob_max=0.5,
         mipchi2_min=9.,
         pid=(F.PID_P > 0))
+
     kaons = make_candidate(
         pt_min=300. * MeV,
         trghostprob_max=0.5,
         mipchi2_min=9.,
         pid=(F.PID_K > 4.))
+
     pions = make_candidate(
         pt_min=300. * MeV,
         trghostprob_max=0.5,
         mipchi2_min=9.,
         pid=(F.PID_K < 2.))
+
     tauons = make_muons_from_b(  # need trghostprob in the builder, workaround for now
         require_ismuon=1,
         p_min=3 * GeV,
         pt_min=0 * GeV,
         mipchi2_min=16,
         pid=((F.PID_MU > -200) & (F.GHOSTPROB < 0.5)))
+
     lcs = make_Hc_to_nbody(  # missing ADMASS functor,
         particles=[protons, kaons, pions],
         descriptor="[Lambda_c+ -> p+ K- pi+]cc",
-        comb_m_min=2276.46 * MeV,  #extra
-        comb_m_max=2296.46 * MeV,  #extra
+        comb_m_min=(Lc_mass - delta_Lc_mass) * MeV,  #extra
+        comb_m_max=(Lc_mass + delta_Lc_mass) * MeV,  #extra
         comb_pt_min=2500 * MeV,
         comb_doca_max=None,
         vchi2pdof_max=4)
+
     lbs = make_b2xtaunu(
         particles=[lcs, tauons],
         descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc",
         comb_m_max=10200 * MeV,
-        vchi2pdof_max=6.0)
+        vchi2pdof_max=6.0,
+        bpvfdchi2_min=25)
 
     return HltLine(
         name=name,
-- 
GitLab


From f4393f73be862918f06c8b017c5970d8a5d1a075 Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Tue, 12 Oct 2021 12:47:59 +0000
Subject: [PATCH 16/30] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/16861234
---
 .../python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py      | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
index f664a491bb1..62351ecb8ae 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
@@ -43,10 +43,10 @@ def lbtolctaunu_lctopkpi_tautomunuline(
     """
     Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu.
     """
-    Lc_mass = 2286.46    # units MeV
-    delta_Lc_mass = 10.0 # units MeV
-    
-    protons = make_candidate( # trchi2todof_max ?
+    Lc_mass = 2286.46  # units MeV
+    delta_Lc_mass = 10.0  # units MeV
+
+    protons = make_candidate(  # trchi2todof_max ?
         pt_min=300. * MeV,
         trghostprob_max=0.5,
         mipchi2_min=9.,
-- 
GitLab


From 56c73f1b226664138be1199c9d0689f689659a45 Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Tue, 12 Oct 2021 17:38:08 +0200
Subject: [PATCH 17/30] Fix Lb2Lctaunu line

---
 .../Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py | 21 ++++++++-----------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
index 62351ecb8ae..6610ee49a23 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
@@ -26,7 +26,7 @@ the new hlt2 lines booking scheme
 from Moore.config import HltLine, register_line_builder
 import Functors as F
 
-from .builders.base_builder import make_muons_from_b, make_candidate
+from .builders.base_builder import make_candidate, make_tauons_muonic_decay
 from .builders.charm_hadron_builder import make_Hc_to_nbody
 from .builders.b_builder import make_b2xtaunu
 
@@ -44,12 +44,13 @@ def lbtolctaunu_lctopkpi_tautomunuline(
     Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu.
     """
     Lc_mass = 2286.46  # units MeV
-    delta_Lc_mass = 10.0  # units MeV
+    delta_Lc_mass = 100.0  # units MeV
 
-    protons = make_candidate(  # trchi2todof_max ?
+    protons = make_candidate(
         pt_min=300. * MeV,
         trghostprob_max=0.5,
         mipchi2_min=9.,
+        trchi2todof_max=30.,
         pid=(F.PID_P > 0))
 
     kaons = make_candidate(
@@ -64,19 +65,15 @@ def lbtolctaunu_lctopkpi_tautomunuline(
         mipchi2_min=9.,
         pid=(F.PID_K < 2.))
 
-    tauons = make_muons_from_b(  # need trghostprob in the builder, workaround for now
-        require_ismuon=1,
-        p_min=3 * GeV,
-        pt_min=0 * GeV,
-        mipchi2_min=16,
-        pid=((F.PID_MU > -200) & (F.GHOSTPROB < 0.5)))
+    tauons = make_tauons_muonic_decay()
 
-    lcs = make_Hc_to_nbody(  # missing ADMASS functor,
+    lcs = make_Hc_to_nbody( # missing mother mass cut
         particles=[protons, kaons, pions],
         descriptor="[Lambda_c+ -> p+ K- pi+]cc",
-        comb_m_min=(Lc_mass - delta_Lc_mass) * MeV,  #extra
-        comb_m_max=(Lc_mass + delta_Lc_mass) * MeV,  #extra
+        comb_m_min=(Lc_mass - delta_Lc_mass) * MeV,
+        comb_m_max=(Lc_mass + delta_Lc_mass) * MeV,
         comb_pt_min=2500 * MeV,
+        comb_pt_sum_min=2500 * MeV,
         comb_doca_max=None,
         vchi2pdof_max=4)
 
-- 
GitLab


From 09131dfecce6b980c35d8633aeb8e0f27e58ea71 Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Tue, 12 Oct 2021 17:39:59 +0200
Subject: [PATCH 18/30] fix python linting

---
 Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
index 6610ee49a23..5ab6a205b1b 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
@@ -32,7 +32,7 @@ from .builders.b_builder import make_b2xtaunu
 
 from .builders import sl_line_prefilter
 
-from GaudiKernel.SystemOfUnits import MeV, GeV
+from GaudiKernel.SystemOfUnits import MeV
 
 all_lines = {}
 
-- 
GitLab


From e4397aaa12cc403b882e22468f73fc62feb94abc Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Tue, 12 Oct 2021 15:40:29 +0000
Subject: [PATCH 19/30] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/16867341
---
 Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
index 5ab6a205b1b..b2f6f13681a 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
@@ -67,7 +67,7 @@ def lbtolctaunu_lctopkpi_tautomunuline(
 
     tauons = make_tauons_muonic_decay()
 
-    lcs = make_Hc_to_nbody( # missing mother mass cut
+    lcs = make_Hc_to_nbody(  # missing mother mass cut
         particles=[protons, kaons, pions],
         descriptor="[Lambda_c+ -> p+ K- pi+]cc",
         comb_m_min=(Lc_mass - delta_Lc_mass) * MeV,
-- 
GitLab


From 7b278185e7c44f7944bc8ca59ec8af9cfa3012b2 Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Fri, 15 Oct 2021 16:21:01 +0200
Subject: [PATCH 20/30] Test version of Lb2Lctaunu line

---
 .../Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py | 50 ++++++---------
 .../builders/charm_hadron_builder.py          | 61 ++++++++++++++++++-
 2 files changed, 80 insertions(+), 31 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
index b2f6f13681a..59bc245acc5 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
@@ -26,8 +26,8 @@ the new hlt2 lines booking scheme
 from Moore.config import HltLine, register_line_builder
 import Functors as F
 
-from .builders.base_builder import make_candidate, make_tauons_muonic_decay
-from .builders.charm_hadron_builder import make_Hc_to_nbody
+from .builders.base_builder import make_tauons_muonic_decay
+from .builders.charm_hadron_builder import make_lambdac_topkpi
 from .builders.b_builder import make_b2xtaunu
 
 from .builders import sl_line_prefilter
@@ -44,38 +44,28 @@ def lbtolctaunu_lctopkpi_tautomunuline(
     Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu.
     """
     Lc_mass = 2286.46  # units MeV
-    delta_Lc_mass = 100.0  # units MeV
-
-    protons = make_candidate(
-        pt_min=300. * MeV,
-        trghostprob_max=0.5,
-        mipchi2_min=9.,
-        trchi2todof_max=30.,
-        pid=(F.PID_P > 0))
-
-    kaons = make_candidate(
-        pt_min=300. * MeV,
-        trghostprob_max=0.5,
-        mipchi2_min=9.,
-        pid=(F.PID_K > 4.))
-
-    pions = make_candidate(
-        pt_min=300. * MeV,
-        trghostprob_max=0.5,
-        mipchi2_min=9.,
-        pid=(F.PID_K < 2.))
+    delta_Lc_comb = 100.0  # units MeV, Delta combination
+    delta_Lc_comp = 80.0   # units MeV, Delta composite
 
     tauons = make_tauons_muonic_decay()
 
-    lcs = make_Hc_to_nbody(  # missing mother mass cut
-        particles=[protons, kaons, pions],
-        descriptor="[Lambda_c+ -> p+ K- pi+]cc",
-        comb_m_min=(Lc_mass - delta_Lc_mass) * MeV,
-        comb_m_max=(Lc_mass + delta_Lc_mass) * MeV,
-        comb_pt_min=2500 * MeV,
+    lcs = make_lambdac_topkpi(
+        mother_m_min=(Lc_mass - delta_Lc_comp) * MeV,
+        mother_m_max=(Lc_mass + delta_Lc_comp) * MeV ,
+        mother_pt_min=2500 * MeV,
+        comb_m_min=(Lc_mass - delta_Lc_comb) * MeV,
+        comb_m_max=(Lc_mass + delta_Lc_comb) * MeV,
+        comb_pt_min=None,
+        comb_pt_any_min=None,
         comb_pt_sum_min=2500 * MeV,
-        comb_doca_max=None,
-        vchi2pdof_max=4)
+        daughter_p_min=2000 * MeV,
+        daughter_pt_min=300 * MeV,
+        daughter_trghostprob_max=0.5,
+        daughter_mipchi2_min=9,
+        kaon_pid=(F.PID_K > 4.),
+        pion_pid=(F.PID_K < 2.),
+        proton_pid=(F.PID_P > 0)
+    )
 
     lbs = make_b2xtaunu(
         particles=[lcs, tauons],
diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py
index 88b9a857c20..d2c983689be 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py
@@ -62,6 +62,9 @@ def make_Hc_to_nbody(particles,
                      descriptor,
                      comb_m_min,
                      comb_m_max,
+                     mother_m_min=None,
+                     mother_m_max=None,
+                     mother_pt_min=None,
                      name="HcToNBodyBuilder",
                      make_pvs=make_pvs,
                      comb_pt_min=2000 * MeV,
@@ -111,10 +114,16 @@ def make_Hc_to_nbody(particles,
     if comb_docachi2_max is not None:
         combination_code = require_all(combination_code,
                                        F.MAXDOCACHI2CUT(comb_docachi2_max))
-
+    
     mother_code = require_all(F.CHI2DOF < vchi2pdof_max,
                               F.BPVDIRA(pvs) > bpvdira_min,
                               F.BPVFDCHI2(pvs) > bpvfdchi2_min)
+    
+    if (mother_m_min is not None) and (mother_m_max is not None):
+        mother_code = require_all(mother_code, 
+                                  in_range(mother_m_min, F.MASS, mother_m_max))
+    if mother_pt_min is not None:
+        mother_code = require_all(mother_code, F.PT > mother_pt_min)
 
     return ParticleCombiner(
         particles,
@@ -263,3 +272,53 @@ def make_ds_tokkpi(name="DsToKKPiBuilder",
         name=name,
         comb_pt_any_min=comb_pt_any_min,
         comb_pt_sum_min=comb_pt_sum_min)
+
+@configurable
+def make_lambdac_topkpi(name="LcTopKPiBuilder",
+                        mother_m_min=None,
+                        mother_m_max=None,
+                        mother_pt_min=None,
+                        comb_m_min=2256 * MeV,
+                        comb_m_max=2317 * MeV,
+                        comb_pt_min=2500 * MeV,
+                        comb_pt_any_min=800 * MeV,
+                        comb_pt_sum_min=1500 * MeV,
+                        comb_doca_max=None,
+                        daughter_p_min=150 * MeV,
+                        daughter_pt_min=150 * MeV,
+                        daughter_trghostprob_max=0.4,
+                        daughter_mipchi2_min=10.,
+                        kaon_pid=(F.PID_K > 5.),
+                        pion_pid=(F.PID_K < 50.),
+                        proton_pid=(F.PID_P > 5.)):
+    """
+     Builder for the decay Lambda_c+ -> p+ K- pi+.
+    """
+
+    with base_builder.make_candidate.bind(
+            p_min=daughter_p_min,
+            pt_min=daughter_pt_min,
+            trghostprob_max=daughter_trghostprob_max,
+            mipchi2_min=daughter_mipchi2_min):
+        particles = [
+            base_builder.make_protons(pid=proton_pid),
+            base_builder.make_kaons(pid=kaon_pid),
+            base_builder.make_pions(pid=pion_pid)
+        ]
+
+    descriptor = "[Lambda_c+ -> p+ K- pi+]cc"
+
+    return make_Hc_to_nbody(
+        particles=particles,
+        descriptor=descriptor,
+        mother_m_min=mother_m_min,
+        mother_m_max=mother_m_max,
+        mother_pt_min=mother_pt_min, 
+        comb_m_min=comb_m_min,
+        comb_m_max=comb_m_max,
+        name=name,
+        comb_pt_min=comb_pt_min,
+        comb_pt_any_min=comb_pt_any_min,
+        comb_pt_sum_min=comb_pt_sum_min,
+        comb_doca_max=comb_doca_max
+        )
\ No newline at end of file
-- 
GitLab


From 925220b1f9ad3499230f617506f7546eebda105d Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Fri, 15 Oct 2021 15:09:52 +0000
Subject: [PATCH 21/30] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/16942954
---
 .../python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py |  7 +++----
 .../semileptonic/builders/charm_hadron_builder.py    | 12 ++++++------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
index 59bc245acc5..07b1a944cbe 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
@@ -45,13 +45,13 @@ def lbtolctaunu_lctopkpi_tautomunuline(
     """
     Lc_mass = 2286.46  # units MeV
     delta_Lc_comb = 100.0  # units MeV, Delta combination
-    delta_Lc_comp = 80.0   # units MeV, Delta composite
+    delta_Lc_comp = 80.0  # units MeV, Delta composite
 
     tauons = make_tauons_muonic_decay()
 
     lcs = make_lambdac_topkpi(
         mother_m_min=(Lc_mass - delta_Lc_comp) * MeV,
-        mother_m_max=(Lc_mass + delta_Lc_comp) * MeV ,
+        mother_m_max=(Lc_mass + delta_Lc_comp) * MeV,
         mother_pt_min=2500 * MeV,
         comb_m_min=(Lc_mass - delta_Lc_comb) * MeV,
         comb_m_max=(Lc_mass + delta_Lc_comb) * MeV,
@@ -64,8 +64,7 @@ def lbtolctaunu_lctopkpi_tautomunuline(
         daughter_mipchi2_min=9,
         kaon_pid=(F.PID_K > 4.),
         pion_pid=(F.PID_K < 2.),
-        proton_pid=(F.PID_P > 0)
-    )
+        proton_pid=(F.PID_P > 0))
 
     lbs = make_b2xtaunu(
         particles=[lcs, tauons],
diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py
index d2c983689be..342cf039b82 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py
@@ -114,13 +114,13 @@ def make_Hc_to_nbody(particles,
     if comb_docachi2_max is not None:
         combination_code = require_all(combination_code,
                                        F.MAXDOCACHI2CUT(comb_docachi2_max))
-    
+
     mother_code = require_all(F.CHI2DOF < vchi2pdof_max,
                               F.BPVDIRA(pvs) > bpvdira_min,
                               F.BPVFDCHI2(pvs) > bpvfdchi2_min)
-    
+
     if (mother_m_min is not None) and (mother_m_max is not None):
-        mother_code = require_all(mother_code, 
+        mother_code = require_all(mother_code,
                                   in_range(mother_m_min, F.MASS, mother_m_max))
     if mother_pt_min is not None:
         mother_code = require_all(mother_code, F.PT > mother_pt_min)
@@ -273,6 +273,7 @@ def make_ds_tokkpi(name="DsToKKPiBuilder",
         comb_pt_any_min=comb_pt_any_min,
         comb_pt_sum_min=comb_pt_sum_min)
 
+
 @configurable
 def make_lambdac_topkpi(name="LcTopKPiBuilder",
                         mother_m_min=None,
@@ -313,12 +314,11 @@ def make_lambdac_topkpi(name="LcTopKPiBuilder",
         descriptor=descriptor,
         mother_m_min=mother_m_min,
         mother_m_max=mother_m_max,
-        mother_pt_min=mother_pt_min, 
+        mother_pt_min=mother_pt_min,
         comb_m_min=comb_m_min,
         comb_m_max=comb_m_max,
         name=name,
         comb_pt_min=comb_pt_min,
         comb_pt_any_min=comb_pt_any_min,
         comb_pt_sum_min=comb_pt_sum_min,
-        comb_doca_max=comb_doca_max
-        )
\ No newline at end of file
+        comb_doca_max=comb_doca_max)
-- 
GitLab


From ba655188819fbbf28128a7a2d0da9bad82417937 Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Thu, 21 Oct 2021 14:34:13 +0200
Subject: [PATCH 22/30] remove comb_doca_max cut from Lb builder

---
 .../python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py       | 2 +-
 .../Hlt2Conf/lines/semileptonic/builders/b_builder.py      | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
index 07b1a944cbe..52d668e1ad9 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
@@ -70,7 +70,7 @@ def lbtolctaunu_lctopkpi_tautomunuline(
         particles=[lcs, tauons],
         descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc",
         comb_m_max=10200 * MeV,
-        vchi2pdof_max=6.0,
+        comb_doca_max=None,
         bpvfdchi2_min=25)
 
     return HltLine(
diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/b_builder.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/b_builder.py
index d911819a675..a13343d9d75 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/b_builder.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/b_builder.py
@@ -103,8 +103,11 @@ def make_b2xtaunu(particles,
     SL b-hadron decay builder specialized in semi-tauonic decays.
     '''
     pvs = make_pvs()
-    combination_code = require_all(
-        in_range(comb_m_min, F.MASS, comb_m_max), F.MAXDOCACUT(comb_doca_max))
+    combination_code = require_all(in_range(comb_m_min, F.MASS, comb_m_max))
+
+    if comb_doca_max is not None:
+        combination_code = require_all(combination_code, F.MAXDOCACUT(comb_doca_max))
+    
     vertex_code = require_all(
         in_range(m_min, F.MASS, m_max), F.CHI2DOF < vchi2pdof_max,
         F.BPVDIRA(pvs) > bpvdira_min,
-- 
GitLab


From 5a1106cf491b4fd05ff52d21b0c93f007a79f870 Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Thu, 21 Oct 2021 12:34:46 +0000
Subject: [PATCH 23/30] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/17056038
---
 .../python/Hlt2Conf/lines/semileptonic/builders/b_builder.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/b_builder.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/b_builder.py
index a13343d9d75..2daa6d13cd0 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/b_builder.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/b_builder.py
@@ -106,8 +106,9 @@ def make_b2xtaunu(particles,
     combination_code = require_all(in_range(comb_m_min, F.MASS, comb_m_max))
 
     if comb_doca_max is not None:
-        combination_code = require_all(combination_code, F.MAXDOCACUT(comb_doca_max))
-    
+        combination_code = require_all(combination_code,
+                                       F.MAXDOCACUT(comb_doca_max))
+
     vertex_code = require_all(
         in_range(m_min, F.MASS, m_max), F.CHI2DOF < vchi2pdof_max,
         F.BPVDIRA(pvs) > bpvdira_min,
-- 
GitLab


From d735b23b5c30e29b5e67542896a570e366dd7aa9 Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Thu, 21 Oct 2021 18:06:50 +0200
Subject: [PATCH 24/30] Adapt naming convention and add line to SLB sprucing
 list

---
 .../lines/semileptonic/{Lb2Lctaunu.py => LbToLcTauNu.py}       | 0
 Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/__init__.py    | 3 ++-
 2 files changed, 2 insertions(+), 1 deletion(-)
 rename Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/{Lb2Lctaunu.py => LbToLcTauNu.py} (100%)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py
similarity index 100%
rename from Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/Lb2Lctaunu.py
rename to Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py
diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/__init__.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/__init__.py
index f3091a6fa88..f7d0f43682e 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/__init__.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/__init__.py
@@ -12,7 +12,7 @@
 Submodule that defines all the SL selection lines.
 """
 
-from . import LbToPMuNu_all, BsToKMuNu_all, LbToLcMuNu, BuToD0MuNu_D0ToKPi, BcToD0MuNu_D0ToKPi
+from . import LbToPMuNu_all, BsToKMuNu_all, LbToLcMuNu, BuToD0MuNu_D0ToKPi, BcToD0MuNu_D0ToKPi, LbToLcTauNu
 from . import hlt2_semileptonic
 from . import spruce_semileptonic
 
@@ -20,6 +20,7 @@ all_lines = {}
 all_lines.update(LbToPMuNu_all.all_lines)
 all_lines.update(BsToKMuNu_all.all_lines)
 all_lines.update(LbToLcMuNu.all_lines)
+all_lines.update(LbToLcTauNu.all_lines)
 all_lines.update(BuToD0MuNu_D0ToKPi.all_lines)
 all_lines.update(BcToD0MuNu_D0ToKPi.all_lines)
 all_lines.update(hlt2_semileptonic.hlt2_lines)
-- 
GitLab


From f5affcbfcb86bfc39d3dda69415df0f77c078e9b Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Fri, 22 Oct 2021 09:24:59 +0200
Subject: [PATCH 25/30] fix typo and add checks

---
 .../Hlt2Conf/lines/semileptonic/LbToLcTauNu.py      | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py
index 52d668e1ad9..eba1b5a6a79 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py
@@ -43,6 +43,9 @@ def lbtolctaunu_lctopkpi_tautomunuline(
     """
     Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu.
     """
+    assert process in ['hlt2', 'spruce'
+                       ], 'Line must be defined as Hlt2 or Sprucing line!'
+
     Lc_mass = 2286.46  # units MeV
     delta_Lc_comb = 100.0  # units MeV, Delta combination
     delta_Lc_comp = 80.0  # units MeV, Delta composite
@@ -64,17 +67,23 @@ def lbtolctaunu_lctopkpi_tautomunuline(
         daughter_mipchi2_min=9,
         kaon_pid=(F.PID_K > 4.),
         pion_pid=(F.PID_K < 2.),
-        proton_pid=(F.PID_P > 0))
+        proton_pid=(F.PID_P > 0)
+        )
 
     lbs = make_b2xtaunu(
         particles=[lcs, tauons],
         descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc",
         comb_m_max=10200 * MeV,
         comb_doca_max=None,
-        bpvfdchi2_min=25)
+        bpvfdchi2_min=25
+        )
 
     return HltLine(
         name=name,
         algs=sl_line_prefilter() + [lbs],
         prescale=prescale,
+        extra_outputs=[
+            ("Lc", lcs),
+            ("Tau", tauons)
+        ]
     )
-- 
GitLab


From 407a6f62302e8f2673c7e06b6b8c65b055509ee4 Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Wed, 27 Oct 2021 10:07:39 +0200
Subject: [PATCH 26/30] fix decay descriptor

---
 .../python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py       | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py
index eba1b5a6a79..049f5d602c0 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py
@@ -43,9 +43,7 @@ def lbtolctaunu_lctopkpi_tautomunuline(
     """
     Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu.
     """
-    assert process in ['hlt2', 'spruce'
-                       ], 'Line must be defined as Hlt2 or Sprucing line!'
-
+    
     Lc_mass = 2286.46  # units MeV
     delta_Lc_comb = 100.0  # units MeV, Delta combination
     delta_Lc_comp = 80.0  # units MeV, Delta composite
@@ -72,7 +70,7 @@ def lbtolctaunu_lctopkpi_tautomunuline(
 
     lbs = make_b2xtaunu(
         particles=[lcs, tauons],
-        descriptor="[Lambda_b0 -> Lambda_c+ tau-]cc",
+        descriptor="[Lambda_b0 -> Lambda_c+ mu-]cc",
         comb_m_max=10200 * MeV,
         comb_doca_max=None,
         bpvfdchi2_min=25
-- 
GitLab


From b111ccf0a28ac6274e60dbcf782b2196b6c5a37b Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Wed, 27 Oct 2021 08:08:10 +0000
Subject: [PATCH 27/30] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/17178064
---
 .../Hlt2Conf/lines/semileptonic/LbToLcTauNu.py     | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py
index 049f5d602c0..e545c7b1dda 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py
@@ -43,7 +43,7 @@ def lbtolctaunu_lctopkpi_tautomunuline(
     """
     Selection for the decay Lb0 -> Lc+(-> p K pi) tau-(-> mu nu nu) nu.
     """
-    
+
     Lc_mass = 2286.46  # units MeV
     delta_Lc_comb = 100.0  # units MeV, Delta combination
     delta_Lc_comp = 80.0  # units MeV, Delta composite
@@ -65,23 +65,17 @@ def lbtolctaunu_lctopkpi_tautomunuline(
         daughter_mipchi2_min=9,
         kaon_pid=(F.PID_K > 4.),
         pion_pid=(F.PID_K < 2.),
-        proton_pid=(F.PID_P > 0)
-        )
+        proton_pid=(F.PID_P > 0))
 
     lbs = make_b2xtaunu(
         particles=[lcs, tauons],
         descriptor="[Lambda_b0 -> Lambda_c+ mu-]cc",
         comb_m_max=10200 * MeV,
         comb_doca_max=None,
-        bpvfdchi2_min=25
-        )
+        bpvfdchi2_min=25)
 
     return HltLine(
         name=name,
         algs=sl_line_prefilter() + [lbs],
         prescale=prescale,
-        extra_outputs=[
-            ("Lc", lcs),
-            ("Tau", tauons)
-        ]
-    )
+        extra_outputs=[("Lc", lcs), ("Tau", tauons)])
-- 
GitLab


From cbc663ee0eec956b32110a3611d815d9bad0ebcc Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Wed, 27 Oct 2021 16:59:13 +0200
Subject: [PATCH 28/30] code cleanup

---
 .../Hlt2Conf/lines/semileptonic/LbToLcTauNu.py    | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py
index e545c7b1dda..8e4d1ce645d 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/LbToLcTauNu.py
@@ -8,21 +8,6 @@
 # granted to it by virtue of its status as an Intergovernmental Organization  #
 # or submit itself to any jurisdiction.                                       #
 ###############################################################################
-""" Definition of semileptonic selections for the Hb -> Hc tau nu topology,
-with tau -> mu nu nu
-
-Non trivial imports:
-basic builders, prefilters
-
-Returns:
-every function returns a line_alg
-
-To note:
-all_lines = {} will be removed once the full module will be converted to
-the new hlt2 lines booking scheme
-
-"""
-
 from Moore.config import HltLine, register_line_builder
 import Functors as F
 
-- 
GitLab


From 3dc72faeb39970e6bdb9dd8bd9656cbdc84d01a4 Mon Sep 17 00:00:00 2001
From: mferrill <martina.ferrillo@cern.ch>
Date: Thu, 28 Oct 2021 09:52:23 +0200
Subject: [PATCH 29/30] Resolve conflicts MR SLB_ThOr_migration

---
 .../Hlt2Conf/lines/semileptonic/__init__.py   |   3 +-
 .../builders/charm_hadron_builder.py          | 116 +++++++++++++++++-
 2 files changed, 117 insertions(+), 2 deletions(-)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/__init__.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/__init__.py
index f7d0f43682e..7d81cd1ead5 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/__init__.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/__init__.py
@@ -12,7 +12,7 @@
 Submodule that defines all the SL selection lines.
 """
 
-from . import LbToPMuNu_all, BsToKMuNu_all, LbToLcMuNu, BuToD0MuNu_D0ToKPi, BcToD0MuNu_D0ToKPi, LbToLcTauNu
+from . import LbToPMuNu_all, BsToKMuNu_all, LbToLcMuNu, BuToD0MuNu_D0ToKPi, BcToD0MuNu_D0ToKPi, BToPPBarMuNu_all, LbToLcTauNu
 from . import hlt2_semileptonic
 from . import spruce_semileptonic
 
@@ -23,6 +23,7 @@ all_lines.update(LbToLcMuNu.all_lines)
 all_lines.update(LbToLcTauNu.all_lines)
 all_lines.update(BuToD0MuNu_D0ToKPi.all_lines)
 all_lines.update(BcToD0MuNu_D0ToKPi.all_lines)
+all_lines.update(BToPPBarMuNu_all.all_lines)
 all_lines.update(hlt2_semileptonic.hlt2_lines)
 
 sprucing_lines = {}
diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py
index 342cf039b82..00e4f73613e 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py
@@ -74,7 +74,8 @@ def make_Hc_to_nbody(particles,
                      comb_docachi2_max=None,
                      vchi2pdof_max=4,
                      bpvdira_min=0.999,
-                     bpvfdchi2_min=25):
+                     bpvfdchi2_min=25,
+                     bpvvdz_min=None):
     """
     Base builder for a generic Hc hadron decaying to an arbitrary number of particles.
 
@@ -124,6 +125,8 @@ def make_Hc_to_nbody(particles,
                                   in_range(mother_m_min, F.MASS, mother_m_max))
     if mother_pt_min is not None:
         mother_code = require_all(mother_code, F.PT > mother_pt_min)
+    if bpvvdz_min is not None:
+        mother_code = require_all(mother_code, F.BPVVDZ > bpvvdz_min)
 
     return ParticleCombiner(
         particles,
@@ -273,6 +276,117 @@ def make_ds_tokkpi(name="DsToKKPiBuilder",
         comb_pt_any_min=comb_pt_any_min,
         comb_pt_sum_min=comb_pt_sum_min)
 
+def make_jpsi_tomumu(name="JpsiToMuMuBuilder",
+                     comb_m_min=3047 * MeV,
+                     comb_m_max=3147 * MeV,
+                     comb_pt_any_min=1200 * MeV,
+                     comb_pt_sum_min=3500 * MeV,
+                     comb_docachi2_max=20.,
+                     vchi2pdof_max=10,
+                     bpvfdchi2_min=25,
+                     bpvdira_min=0.999):
+    """
+    Builder for the decay J/psi -> mu+ mu-.
+    """
+
+    muons = base_builder.make_inmuon_long_muon()
+    particles = [muons, muons]
+
+    descriptor = "J/psi(1S) -> mu+ mu-"
+
+    return make_Hc_to_nbody(
+        particles,
+        descriptor,
+        comb_m_min,
+        comb_m_max,
+        name=name,
+        comb_docachi2_max=comb_docachi2_max,
+        vchi2pdof_max=vchi2pdof_max,
+        bpvfdchi2_min=bpvfdchi2_min,
+        bpvdira_min=bpvdira_min,
+        comb_pt_min=None,
+        comb_pt_any_min=comb_pt_any_min,
+        comb_pt_sum_min=comb_pt_sum_min,
+        comb_doca_max=None)
+
+
+@configurable
+def make_dst_tod0pi(name="DstToD0Pi",
+                    comb_m_min=1960 * MeV,
+                    comb_m_max=2060 * MeV,
+                    comb_pt_min=1250 * MeV,
+                    daughter_pt_min=150 * MeV,
+                    daughter_trghostprob_max=0.4,
+                    daughter_mipchi2_min=10.,
+                    vchi2pdof_max=25):
+    """
+    Builder for a D* hadron decaying to D0 pi.
+    """
+
+    dzeros = make_d0_tokpi()
+
+    with base_builder.make_candidate.bind(
+            pt_min=daughter_pt_min,
+            trghostprob_max=daughter_trghostprob_max,
+            mipchi2_min=daughter_mipchi2_min):
+        pions = base_builder.make_pions()
+
+    combination_code = require_all(
+        in_range(comb_m_min, F.MASS, comb_m_max), F.PT > comb_pt_min)
+
+    vertex_code = require_all(F.CHI2DOF < vchi2pdof_max)
+
+    return ParticleCombiner(
+        [dzeros, pions],
+        DecayDescriptor="[D*(2010)+ -> D0 pi+, D*(2010)- -> D0 pi-]",
+        CombinationCut=combination_code,
+        CompositeCut=vertex_code)
+
+
+@configurable
+def make_dst0_tod0pi0(name="Dst0ToD0Pi0",
+                      comb_am_min=1907 * MeV,
+                      comb_am_max=2107 * MeV,
+                      comb_m_min=1907 * MeV,
+                      comb_m_max=2107 * MeV):
+    """
+    Builder for a D*0 hadron decaying to D0 pi0.
+    """
+
+    dzeros = make_d0_tokpi()
+    pizs = base_builder.make_pizs()
+
+    combination_code = require_all(in_range(comb_am_min, F.MASS, comb_am_max))
+
+    vertex_code = require_all(in_range(comb_m_min, F.MASS, comb_m_max))
+
+    return ParticleCombiner([dzeros, pizs],
+                            DecayDescriptor="D*(2007)0 -> D0 pi0",
+                            CombinationCut=combination_code,
+                            CompositeCut=vertex_code)
+
+
+@configurable
+def make_dst0_tod0gamma(name="Dst0ToD0Gamma",
+                        comb_am_min=1807 * MeV,
+                        comb_am_max=2207 * MeV,
+                        comb_m_min=1807 * MeV,
+                        comb_m_max=2207 * MeV):
+    """
+    Builder for a D*0 hadron decaying to D0 gamma.
+    """
+
+    dzeros = make_d0_tokpi()
+    gammas = base_builder.make_gammas()
+
+    combination_code = require_all(in_range(comb_am_min, F.MASS, comb_am_max))
+
+    vertex_code = require_all(in_range(comb_m_min, F.MASS, comb_m_max))
+
+    return ParticleCombiner([dzeros, gammas],
+                            DecayDescriptor="D*(2007)0 -> D0 gamma",
+                            CombinationCut=combination_code,
+                            CompositeCut=vertex_code)
 
 @configurable
 def make_lambdac_topkpi(name="LcTopKPiBuilder",
-- 
GitLab


From f94dda13e96bb1bcf8cdb6ed28427b7c3d95ad8e Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Thu, 28 Oct 2021 07:53:00 +0000
Subject: [PATCH 30/30] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/17204852
---
 .../lines/semileptonic/builders/charm_hadron_builder.py         | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py
index 00e4f73613e..a15dd357bef 100644
--- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py
+++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/semileptonic/builders/charm_hadron_builder.py
@@ -276,6 +276,7 @@ def make_ds_tokkpi(name="DsToKKPiBuilder",
         comb_pt_any_min=comb_pt_any_min,
         comb_pt_sum_min=comb_pt_sum_min)
 
+
 def make_jpsi_tomumu(name="JpsiToMuMuBuilder",
                      comb_m_min=3047 * MeV,
                      comb_m_max=3147 * MeV,
@@ -388,6 +389,7 @@ def make_dst0_tod0gamma(name="Dst0ToD0Gamma",
                             CombinationCut=combination_code,
                             CompositeCut=vertex_code)
 
+
 @configurable
 def make_lambdac_topkpi(name="LcTopKPiBuilder",
                         mother_m_min=None,
-- 
GitLab