From 225112d096025da1057f6faaf005aedf5b5aa315 Mon Sep 17 00:00:00 2001
From: Yunxuan Song <yunxuan.song@cern.ch>
Date: Tue, 20 Jun 2023 15:24:59 +0200
Subject: [PATCH 1/9] Lb2pKTauX lines

---
 .../StrippingRD/StrippingLb2pKTauX.py         | 361 ++++++++++++++++++
 1 file changed, 361 insertions(+)
 create mode 100644 Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py

diff --git a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
new file mode 100644
index 000000000..e08064ca5
--- /dev/null
+++ b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
@@ -0,0 +1,361 @@
+###############################################################################
+# (c) Copyright 2000-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.                                       #
+###############################################################################
+__author__ = [' Y. Song']
+__date__ = '15/06/2023'
+__version__ = '$Revision: 0.1$'
+
+# Stripping line for B->Htautau
+
+from GaudiKernel.SystemOfUnits import MeV
+from GaudiKernel.SystemOfUnits import mm
+"""
+  Lb->pKTauTau_3pi_3pi
+  Lb->pKTauTau_3pi_pi
+  Lb->pKTauTau_3pi_mu
+  Lb->pKTauTau_3pi_e
+"""
+__all__ = ('Lb2pKTauXConf', 'getRelInfoLb2pKTauX', 'default_config')
+
+default_config = {
+    'NAME': 'Lb2pKTauX',
+    'BUILDERTYPE': 'Lb2pKTauXConf',
+    'WGs': ['RD'],
+    'CONFIG': {
+        'SpdMult': '600',
+        #
+        'FD_B_Max': 100,
+        'PT_B': 5000 * MeV,
+        'P_B': 10000 * MeV,
+        'FDCHI2_B': 16,
+        'MASS_LOW_B': 3000 * MeV,
+        'MASS_HIGH_B': 7000 * MeV,
+        'DLSForLongLived': 5.,
+        #
+        'VCHI2_pK': 9,
+        'PT_kaon': 250 * MeV,
+        'PT_pion': 250 * MeV,
+        'PT_muon': 250 * MeV,
+        'PT_elec': 250 * MeV,
+        'PT_proton': 500 * MeV,
+        'PT_Ls': 1000 * MeV,
+        'P_kaon': 3000 * MeV,
+        'P_pion': 3000 * MeV,
+        'P_muon': 3000 * MeV,
+        'P_elec': 3000 * MeV,
+        'P_proton': 3000 * MeV,
+        'IPCHI2_Tr': 16,
+        'TRACKCHI2_Tr': 4,
+        'TRGHOPROB_Tr': 0.4,
+        'MASS_LOW_pK': 1400 * MeV,
+        'MASS_HIGH_pK': 2400 * MeV,
+        'MASS_HIGH_Tau': 1800 * MeV,
+        #
+        'B2HTauTau_LinePrescale': 1,
+        'B2HTauTau_LinePostscale': 1,
+    },
+    'STREAMS': ['Bhadron']
+}
+
+from Gaudi.Configuration import *
+from GaudiConfUtils.ConfigurableGenerators import FilterDesktop, CombineParticles, OfflineVertexFitter, DaVinci__N3BodyDecays
+from PhysSelPython.Wrappers import Selection, DataOnDemand, SimpleSelection, MergedSelection
+from StrippingConf.StrippingLine import StrippingLine
+from StrippingUtils.Utils import LineBuilder
+from StandardParticles import StdNoPIDsPions
+from StandardParticles import StdNoPIDsKaons
+from StandardParticles import StdNoPIDsMuons
+from StandardParticles import StdNoPIDsElectrons
+from StandardParticles import StdNoPIDsProtons
+
+
+class Lb2pKTauXConf(LineBuilder):
+    """
+      Builder for Lb->pKTauTau_3pi_pi
+    """
+
+    __configuration_keys__ = default_config['CONFIG'].keys()
+
+    def __init__(self, name, config):
+
+        LineBuilder.__init__(self, name, config)
+
+        trackCuts = "(MIPCHI2DV(PRIMARY) > %(IPCHI2_Tr)s) & (TRCHI2DOF < %(TRACKCHI2_Tr)s) & (TRGHOSTPROB < %(TRGHOPROB_Tr)s)" % config
+        KaonCuts = trackCuts + " & (PT > %(PT_kaon)s) & (P > %(P_kaon)s) & ((PIDK-PIDpi)>0)" % config
+        PionCuts = trackCuts + " & (PT > %(PT_pion)s) & (P > %(P_pion)s) & ((PIDpi-PIDK)>0) & ((PIDpi-PIDmu)>0)" % config
+        MuonCuts = trackCuts + " & (PT > %(PT_muon)s) & (P > %(P_muon)s) & ((PIDmu-PIDpi)>0)" % config
+        ElecCuts = trackCuts + " & (PT > %(PT_elec)s) & (P > %(P_elec)s) & ((PIDe-PIDpi)>0)" % config
+        ProtonCuts = trackCuts + " & (PT > %(PT_proton)s) & (P > %(P_proton)s) & ((PIDp-PIDK)>0) & ((PIDp-PIDpi)>0)" % config
+
+        TauCuts = "(M < %(MASS_HIGH_Tau)s)" % config
+
+        self.FilterSPD = {
+            'Code':
+            " ( recSummary(LHCb.RecSummary.nSPDhits,'Raw/Spd/Digits') < %(SpdMult)s )"
+            % config,
+            'Preambulo': [
+                "from LoKiNumbers.decorators import *",
+                "from LoKiCore.basic import LHCb"
+            ]
+        }
+
+        self.rawTau = DataOnDemand("Phys/StdTightDetachedTau3pi/Particles")
+        self.selTau = SimpleSelection("Tau" + name, FilterDesktop, [self.rawTau], Code=TauCuts)
+
+        self.LambdaListLoose = MergedSelection(
+            "StdLooseLambdaMergedFor" + name, 
+            RequiredSelections=[
+                DataOnDemand(Location="Phys/StdLooseLambdaDD/Particles"),
+                DataOnDemand(Location="Phys/StdLooseLambdaLL/Particles")
+            ])
+        self.LambdaList =  self.createSubSel(OutputList = "LambdaFor" + name,
+                                             InputList = self.LambdaListLoose ,
+                                             Cuts = "(MAXTREE('p+'==ABSID, PT) > 250.*MeV) "\
+                                             "& (MAXTREE('pi-'==ABSID, PT) > 250.*MeV) " \
+                                             "& (ADMASS('Lambda0') < 15.*MeV) & (VFASPF(VCHI2) < 20 )  & (BPVDLS> %(DLSForLongLived)s ) " % config)
+
+        self.selKaon = SimpleSelection("Kaon" + name, FilterDesktop, [StdNoPIDsKaons], Code=KaonCuts)
+        self.selPion = SimpleSelection("Pion" + name, FilterDesktop, [StdNoPIDsPions], Code=PionCuts)
+        self.selMuon = SimpleSelection("Muon" + name, FilterDesktop, [StdNoPIDsMuons], Code=MuonCuts)
+        self.selElec = SimpleSelection("Elec" + name, FilterDesktop, [StdNoPIDsElectrons], Code=ElecCuts)
+        self.selProton = SimpleSelection("Proton" + name, FilterDesktop, [StdNoPIDsProtons], Code=ProtonCuts)
+
+        self.selpK = self._makepK("pK" + name, ProtonCuts, KaonCuts, config)
+        
+        self.selB2LsTauTau_3pi_3pi  = self._makeLb2LsTauTau_3pi_3pi(name + "_Ls3pi3pi", self.selTau, self.LambdaList, config)
+        self.selB2LsTauTauSS_3pi_3pi= self._makeLb2LsTauTau_3pi_3pi(name + "_Ls3pi3pi", self.selTau, self.LambdaList, config, SS=True)
+        
+        self.selB2pKTauTau_3pi_3pi  = self._makeLb2pKTauTau_3pi_3pi(name + "_pK3pi3pi", self.selTau, self.selpK, config)
+        self.selB2pKTauTauSS_3pi_3pi= self._makeLb2pKTauTau_3pi_3pi(name + "_pK3pi3pi", self.selTau, self.selpK, config, SS=True)
+
+        self.selB2pKTauTau_3pi_pi   = self._makeLb2pKTauTau_3pi_pi(name + "_pK3pipi", self.selTau, self.selpK, self.selPion, config)
+        self.selB2pKTauTauSS_3pi_pi = self._makeLb2pKTauTau_3pi_pi(name + "_pK3pipi", self.selTau, self.selpK, self.selPion, config, SS=True)
+        
+        self.selB2pKTauTau_3pi_mu   = self._makeLb2pKTauTau_3pi_mu(name + "_pK3pimu", self.selTau, self.selpK, self.selMuon, config)
+        self.selB2pKTauTauSS_3pi_mu = self._makeLb2pKTauTau_3pi_mu(name + "_pK3pimu", self.selTau, self.selpK, self.selMuon, config, SS=True)
+        
+        self.selB2pKTauTau_3pi_e    = self._makeLb2pKTauTau_3pi_e(name + "_pK3pie", self.selTau, self.selpK, self.selElec, config)
+        self.selB2pKTauTauSS_3pi_e  = self._makeLb2pKTauTau_3pi_e(name + "_pK3pie", self.selTau, self.selpK, self.selElec, config, SS=True)
+
+        ## Finished making selections build and register lines
+        self.LsTauTau3pi3pi_Line   = self._makeLine("B2LsTauTau3pi3piLine"  , self.selB2LsTauTau_3pi_3pi  , config)
+        self.LsTauTau3pi3piSS_Line = self._makeLine("B2LsTauTau3pi3piSSLine", self.selB2LsTauTauSS_3pi_3pi, config)
+        
+        self.pKTauTau3pi3pi_Line   = self._makeLine("B2pKTauTau3pi3piLine"  , self.selB2pKTauTau_3pi_3pi  , config)
+        self.pKTauTau3pi3piSS_Line = self._makeLine("B2pKTauTau3pi3piSSLine", self.selB2pKTauTauSS_3pi_3pi, config)
+
+        self.pKTauTau3pipi_Line   = self._makeLine("B2pKTauTau3pipiLine"  , self.selB2pKTauTau_3pi_pi  , config)
+        self.pKTauTau3pipiSS_Line = self._makeLine("B2pKTauTau3pipiSSLine", self.selB2pKTauTauSS_3pi_pi, config)
+
+        self.pKTauTau3pimu_Line   = self._makeLine("B2pKTauTau3pimuLine"  , self.selB2pKTauTau_3pi_mu  , config)
+        self.pKTauTau3pimuSS_Line = self._makeLine("B2pKTauTau3pimuSSLine", self.selB2pKTauTauSS_3pi_mu, config)
+
+        self.pKTauTau3pie_Line    = self._makeLine("B2pKTauTau3pieLine"  , self.selB2pKTauTau_3pi_e  , config)
+        self.pKTauTau3pieSS_Line  = self._makeLine("B2pKTauTau3pieSSLine", self.selB2pKTauTauSS_3pi_e, config)
+
+    def createSubSel(self, OutputList, InputList, Cuts):
+        '''create a selection using a FilterDesktop'''
+        filter = FilterDesktop(Code=Cuts)
+        return Selection(
+            OutputList, Algorithm=filter, RequiredSelections=[InputList])
+
+
+#### Make resonances ###################################################
+
+    def _makepK(self, name, protonSel, kaonSel, config):
+
+        combcut = "in_range ( %(MASS_LOW_pK)s, AM, %(MASS_HIGH_pK)s )" % config
+        mothercut = " (PT > %(PT_Ls)s) & (VFASPF(VCHI2) < %(VCHI2_pK)s)" % config
+
+        daucut = {'p+': protonSel, 'K-': kaonSel}
+
+        return SimpleSelection(
+            name + "_pK",
+            CombineParticles, [StdNoPIDsProtons, StdNoPIDsKaons],
+            DecayDescriptors=["[Lambda(1520)0 -> p+ K-]cc"],
+            CombinationCut=combcut,
+            MotherCut=mothercut,
+            DaughtersCuts=daucut)
+
+#### Make B ###################################################
+
+    def _makeLb2LsTauTau_3pi_3pi(self, name, tauSel, pKSel, config, SS=False):
+
+        combcut = "in_range ( %(MASS_LOW_B)s, AM, %(MASS_HIGH_B)s )" % config
+        mothercut = "( BPVVDCHI2 > %(FDCHI2_B)s ) & ( BPVVD < %(FD_B_Max)s ) " % config
+        mothercut += " & (PT > %(PT_B)s) & (P > %(P_B)s) " % config
+
+        n = name + "TauTau"
+
+        descriptors = ["[Lambda_b0 -> Lambda0 tau+ tau-]cc"]
+
+        if SS:
+            n += "SS"
+            descriptors = [
+                "[Lambda_b0 -> Lambda0 tau+ tau+]cc",
+                "[Lambda_b0 -> Lambda0 tau- tau-]cc"
+            ]
+
+        Combine = CombineParticles(
+            DecayDescriptors=descriptors,
+            CombinationCut=combcut,
+            MotherCut=mothercut)
+
+        return Selection(
+            n, Algorithm=Combine, RequiredSelections=[tauSel, pKSel])
+
+    def _makeLb2pKTauTau_3pi_3pi(self, name, tauSel, pKSel, config, SS=False):
+
+        combcut = "in_range ( %(MASS_LOW_B)s, AM, %(MASS_HIGH_B)s )" % config
+        mothercut = "( BPVVDCHI2 > %(FDCHI2_B)s ) & ( BPVVD < %(FD_B_Max)s ) " % config
+        mothercut += " & (PT > %(PT_B)s) & (P > %(P_B)s) " % config
+
+        n = name + "TauTau"
+
+        descriptors = ["[Lambda_b0 -> Lambda(1520)0 tau+ tau-]cc"]
+
+        if SS:
+            n += "SS"
+            descriptors = [
+                "[Lambda_b0 -> Lambda(1520)0 tau+ tau+]cc",
+                "[Lambda_b0 -> Lambda(1520)0 tau- tau-]cc"
+            ]
+
+        Combine = CombineParticles(
+            DecayDescriptors=descriptors,
+            CombinationCut=combcut,
+            MotherCut=mothercut)
+
+        return Selection(
+            n, Algorithm=Combine, RequiredSelections=[tauSel, pKSel])
+
+    def _makeLb2pKTauTau_3pi_pi(self, name, tauSel, pKSel, XSel, config, SS=False):
+
+        combcut = "in_range ( %(MASS_LOW_B)s, AM, %(MASS_HIGH_B)s )" % config
+        mothercut = "( BPVVDCHI2 > %(FDCHI2_B)s ) & ( BPVVD < %(FD_B_Max)s ) " % config
+        mothercut += " & (PT > %(PT_B)s) & (P > %(P_B)s) " % config
+
+        n = name + "TauTau"
+
+        descriptors = ["[Lambda_b0 -> Lambda(1520)0 tau+ pi-]cc"]
+
+        if SS:
+            n += "SS"
+            descriptors = [
+                "[Lambda_b0 -> Lambda(1520)0 tau+ pi+]cc",
+                "[Lambda_b0 -> Lambda(1520)0 tau- pi-]cc"
+            ]
+
+        Combine = CombineParticles(
+            DecayDescriptors=descriptors,
+            CombinationCut=combcut,
+            MotherCut=mothercut)
+
+        return Selection(
+            n, Algorithm=Combine, RequiredSelections=[tauSel, pKSel, XSel])
+
+    def _makeLb2pKTauTau_3pi_mu(self, name, tauSel, pKSel, XSel, config, SS=False):
+
+        combcut = "in_range ( %(MASS_LOW_B)s, AM, %(MASS_HIGH_B)s )" % config
+        mothercut = "( BPVVDCHI2 > %(FDCHI2_B)s ) & ( BPVVD < %(FD_B_Max)s ) " % config
+        mothercut += " & (PT > %(PT_B)s) & (P > %(P_B)s) " % config
+
+        n = name + "TauTau"
+
+        descriptors = ["[Lambda_b0 -> Lambda(1520)0 tau+ mu-]cc"]
+
+        if SS:
+            n += "SS"
+            descriptors = [
+                "[Lambda_b0 -> Lambda(1520)0 tau+ mu+]cc",
+                "[Lambda_b0 -> Lambda(1520)0 tau- mu-]cc"
+            ]
+
+        Combine = CombineParticles(
+            DecayDescriptors=descriptors,
+            CombinationCut=combcut,
+            MotherCut=mothercut)
+
+        return Selection(
+            n, Algorithm=Combine, RequiredSelections=[tauSel, pKSel, XSel])
+
+    def _makeLb2pKTauTau_3pi_e(self, name, tauSel, pKSel, XSel, config, SS=False):
+
+        combcut = "in_range ( %(MASS_LOW_B)s, AM, %(MASS_HIGH_B)s )" % config
+        mothercut = "( BPVVDCHI2 > %(FDCHI2_B)s ) & ( BPVVD < %(FD_B_Max)s ) " % config
+        mothercut += " & (PT > %(PT_B)s) & (P > %(P_B)s) " % config
+
+        n = name + "TauTau"
+
+        descriptors = ["[Lambda_b0 -> Lambda(1520)0 tau+ e-]cc"]
+
+        if SS:
+            n += "SS"
+            descriptors = [
+                "[Lambda_b0 -> Lambda(1520)0 tau+ e+]cc",
+                "[Lambda_b0 -> Lambda(1520)0 tau- e-]cc"
+            ]
+
+        Combine = CombineParticles(
+            DecayDescriptors=descriptors,
+            CombinationCut=combcut,
+            MotherCut=mothercut)
+
+        return Selection(
+            n, Algorithm=Combine, RequiredSelections=[tauSel, pKSel, XSel])
+
+#### Helpers to make lines
+
+    def _makeLine(self, name, sel, config):
+
+        line = StrippingLine(
+            name,
+            prescale=config['B2HTauTau_LinePrescale'],
+            postscale=config['B2HTauTau_LinePostscale'],
+            #MDSTFlag = False,
+            FILTER=self.FilterSPD,
+            RelatedInfoTools=getRelInfoLb2pKTauX(),
+            selection=sel,
+            MaxCandidates=50)
+        self.registerLine(line)
+        return line
+
+
+#### Related Info
+def getRelInfoLb2pKTauX():
+#def getRelInfoB2XTauTau():
+    relInfo = []
+    for coneAngle in [0.5, 0.8, 1.0, 1.3, 1.5]:
+        conestr = str(coneAngle).replace('.', '')
+        relInfo += [{
+            "Type":
+            "RelInfoConeVariables",
+            "IgnoreUnmatchedDescriptors":
+            True,
+            "ConeAngle":
+            coneAngle,
+            "Location":
+            "VertexConeInfo",
+            "Variables": [
+                'CONEANGLE', 'CONEMULT', 'CONEPASYM', 'CONEPTASYM',
+                'CONEDELTAETA'
+            ],
+            "DaughterLocations": {
+                "^[Beauty -> Hadron  l  l]CC": 'P2ConeVar%s_B' % conestr,
+                "[Beauty -> ^Hadron  l  l]CC": 'P2ConeVar%s_X' % conestr,
+                "[Beauty ->  Hadron ^l  l]CC": 'P2ConeVar%s_Tau1' % conestr,
+                "[Beauty ->  Hadron  l ^l]CC": 'P2ConeVar%s_Tau2' % conestr
+            }
+        }]
+        relInfo += [{
+            "Type": "RelInfoVertexIsolation",
+            "Location": "VertexIsoInfo"
+        }]
+        return relInfo
-- 
GitLab


From 3854da6ef0ee2b700c257044f5b4f90967c9e218 Mon Sep 17 00:00:00 2001
From: Yunxuan Song <yunxuan.song@cern.ch>
Date: Sun, 9 Jul 2023 11:23:11 +0200
Subject: [PATCH 2/9] update the isolation

---
 .../StrippingRD/StrippingLb2pKTauX.py                  | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
index e08064ca5..86d4a95a8 100644
--- a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
+++ b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
@@ -17,6 +17,7 @@ __version__ = '$Revision: 0.1$'
 from GaudiKernel.SystemOfUnits import MeV
 from GaudiKernel.SystemOfUnits import mm
 """
+  Lb->LambdaTauTau_3pi_3pi
   Lb->pKTauTau_3pi_3pi
   Lb->pKTauTau_3pi_pi
   Lb->pKTauTau_3pi_mu
@@ -348,10 +349,11 @@ def getRelInfoLb2pKTauX():
                 'CONEDELTAETA'
             ],
             "DaughterLocations": {
-                "^[Beauty -> Hadron  l  l]CC": 'P2ConeVar%s_B' % conestr,
-                "[Beauty -> ^Hadron  l  l]CC": 'P2ConeVar%s_X' % conestr,
-                "[Beauty ->  Hadron ^l  l]CC": 'P2ConeVar%s_Tau1' % conestr,
-                "[Beauty ->  Hadron  l ^l]CC": 'P2ConeVar%s_Tau2' % conestr
+                "^[Beauty -> Hadron Hadron l  l]CC": 'P2ConeVar%s_B' % conestr,
+                "[Beauty -> ^Hadron Hadron l  l]CC": 'P2ConeVar%s_X1' % conestr,
+                "[Beauty ->  Hadron ^Hadron l  l]CC": 'P2ConeVar%s_X2' % conestr,
+                "[Beauty ->  Hadron Hadron ^l  l]CC": 'P2ConeVar%s_Tau1' % conestr,
+                "[Beauty ->  Hadron Hadron l ^l]CC": 'P2ConeVar%s_Tau2' % conestr
             }
         }]
         relInfo += [{
-- 
GitLab


From 300b4ccaf8fa768437b2ffb79e46f7f481e6e454 Mon Sep 17 00:00:00 2001
From: Yunxuan Song <yunxuan.song@cern.ch>
Date: Mon, 10 Jul 2023 17:40:05 +0200
Subject: [PATCH 3/9] Update the C.C. channel

---
 .../StrippingRD/StrippingLb2pKTauX.py             | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
index 86d4a95a8..47802bc10 100644
--- a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
+++ b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
@@ -245,7 +245,10 @@ class Lb2pKTauXConf(LineBuilder):
 
         n = name + "TauTau"
 
-        descriptors = ["[Lambda_b0 -> Lambda(1520)0 tau+ pi-]cc"]
+        descriptors = [
+                "[Lambda_b0 -> Lambda(1520)0 tau+ pi-]cc",
+                "[Lambda_b0 -> Lambda(1520)0 tau- pi+]cc"
+            ]
 
         if SS:
             n += "SS"
@@ -270,7 +273,10 @@ class Lb2pKTauXConf(LineBuilder):
 
         n = name + "TauTau"
 
-        descriptors = ["[Lambda_b0 -> Lambda(1520)0 tau+ mu-]cc"]
+        descriptors = [
+                "[Lambda_b0 -> Lambda(1520)0 tau+ mu-]cc",
+                "[Lambda_b0 -> Lambda(1520)0 tau- mu+]cc"
+            ]
 
         if SS:
             n += "SS"
@@ -295,7 +301,10 @@ class Lb2pKTauXConf(LineBuilder):
 
         n = name + "TauTau"
 
-        descriptors = ["[Lambda_b0 -> Lambda(1520)0 tau+ e-]cc"]
+        descriptors = [
+                "[Lambda_b0 -> Lambda(1520)0 tau+ e-]cc",
+                "[Lambda_b0 -> Lambda(1520)0 tau- e+]cc"
+            ]
 
         if SS:
             n += "SS"
-- 
GitLab


From 7738a7f805cf5a614acdfd983f03cc23e39f089f Mon Sep 17 00:00:00 2001
From: Yunxuan Song <yunxuan.song@cern.ch>
Date: Mon, 10 Jul 2023 17:41:55 +0200
Subject: [PATCH 4/9] Update the info

---
 .../StrippingSelections/StrippingRD/StrippingLb2pKTauX.py     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
index 47802bc10..fd583cbd2 100644
--- a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
+++ b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
@@ -8,8 +8,8 @@
 # granted to it by virtue of its status as an Intergovernmental Organization  #
 # or submit itself to any jurisdiction.                                       #
 ###############################################################################
-__author__ = [' Y. Song']
-__date__ = '15/06/2023'
+__author__ = [' Yunxuan Song','Han Gao']
+__date__ = '10/07/2023'
 __version__ = '$Revision: 0.1$'
 
 # Stripping line for B->Htautau
-- 
GitLab


From ff19cfb63e527e6ef86dcca3627d902edbf7ec5b Mon Sep 17 00:00:00 2001
From: Yunxuan Song <yunxuan.song@cern.ch>
Date: Wed, 12 Jul 2023 12:01:22 +0200
Subject: [PATCH 5/9] optimize the code

---
 .../StrippingRD/StrippingLb2pKTauX.py         | 67 ++++++++++---------
 1 file changed, 35 insertions(+), 32 deletions(-)

diff --git a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
index fd583cbd2..0acb89ce7 100644
--- a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
+++ b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
@@ -32,8 +32,8 @@ default_config = {
     'CONFIG': {
         'SpdMult': '600',
         #
-        'FD_B_Max': 100,
-        'PT_B': 5000 * MeV,
+        'FD_B_Max': 100 * mm,
+        'PT_B': 4000 * MeV,
         'P_B': 10000 * MeV,
         'FDCHI2_B': 16,
         'MASS_LOW_B': 3000 * MeV,
@@ -42,7 +42,7 @@ default_config = {
         #
         'VCHI2_pK': 9,
         'PT_kaon': 250 * MeV,
-        'PT_pion': 250 * MeV,
+        'PT_pion': 500 * MeV,
         'PT_muon': 250 * MeV,
         'PT_elec': 250 * MeV,
         'PT_proton': 500 * MeV,
@@ -89,11 +89,11 @@ class Lb2pKTauXConf(LineBuilder):
         LineBuilder.__init__(self, name, config)
 
         trackCuts = "(MIPCHI2DV(PRIMARY) > %(IPCHI2_Tr)s) & (TRCHI2DOF < %(TRACKCHI2_Tr)s) & (TRGHOSTPROB < %(TRGHOPROB_Tr)s)" % config
-        KaonCuts = trackCuts + " & (PT > %(PT_kaon)s) & (P > %(P_kaon)s) & ((PIDK-PIDpi)>0)" % config
-        PionCuts = trackCuts + " & (PT > %(PT_pion)s) & (P > %(P_pion)s) & ((PIDpi-PIDK)>0) & ((PIDpi-PIDmu)>0)" % config
-        MuonCuts = trackCuts + " & (PT > %(PT_muon)s) & (P > %(P_muon)s) & ((PIDmu-PIDpi)>0)" % config
-        ElecCuts = trackCuts + " & (PT > %(PT_elec)s) & (P > %(P_elec)s) & ((PIDe-PIDpi)>0)" % config
-        ProtonCuts = trackCuts + " & (PT > %(PT_proton)s) & (P > %(P_proton)s) & ((PIDp-PIDK)>0) & ((PIDp-PIDpi)>0)" % config
+        KaonCuts = trackCuts + " & (PT > %(PT_kaon)s) & (P > %(P_kaon)s) & ((PIDK)>0)" % config
+        PionCuts = trackCuts + " & (PT > %(PT_pion)s) & (P > %(P_pion)s) & ((PIDK)<0) & ((PIDmu)<0)" % config
+        MuonCuts = trackCuts + " & (PT > %(PT_muon)s) & (P > %(P_muon)s) & ((PIDmu)>0)" % config
+        ElecCuts = trackCuts + " & (PT > %(PT_elec)s) & (P > %(P_elec)s) & ((PIDe)>0)" % config
+        ProtonCuts = trackCuts + " & (PT > %(PT_proton)s) & (P > %(P_proton)s) & ((PIDp-PIDK)>0) & ((PIDp)>0)" % config
 
         TauCuts = "(M < %(MASS_HIGH_Tau)s)" % config
 
@@ -118,8 +118,7 @@ class Lb2pKTauXConf(LineBuilder):
             ])
         self.LambdaList =  self.createSubSel(OutputList = "LambdaFor" + name,
                                              InputList = self.LambdaListLoose ,
-                                             Cuts = "(MAXTREE('p+'==ABSID, PT) > 250.*MeV) "\
-                                             "& (MAXTREE('pi-'==ABSID, PT) > 250.*MeV) " \
+                                             Cuts = "(MAXTREE('p+'==ABSID, PT) > 100.*MeV) "\
                                              "& (ADMASS('Lambda0') < 15.*MeV) & (VFASPF(VCHI2) < 20 )  & (BPVDLS> %(DLSForLongLived)s ) " % config)
 
         self.selKaon = SimpleSelection("Kaon" + name, FilterDesktop, [StdNoPIDsKaons], Code=KaonCuts)
@@ -195,17 +194,18 @@ class Lb2pKTauXConf(LineBuilder):
 
         n = name + "TauTau"
 
-        descriptors = ["[Lambda_b0 -> Lambda0 tau+ tau-]cc"]
+        descriptors = ["[Lambda_b0 -> tau+ tau- Lambda0]cc"]
 
         if SS:
             n += "SS"
             descriptors = [
-                "[Lambda_b0 -> Lambda0 tau+ tau+]cc",
-                "[Lambda_b0 -> Lambda0 tau- tau-]cc"
+                "[Lambda_b0 ->  tau+ tau+ Lambda0]cc",
+                "[Lambda_b0 ->  tau- tau- Lambda0]cc"
             ]
 
-        Combine = CombineParticles(
+        Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
+            Combination12Cut="AM<6000",
             CombinationCut=combcut,
             MotherCut=mothercut)
 
@@ -220,17 +220,18 @@ class Lb2pKTauXConf(LineBuilder):
 
         n = name + "TauTau"
 
-        descriptors = ["[Lambda_b0 -> Lambda(1520)0 tau+ tau-]cc"]
+        descriptors = ["[Lambda_b0 -> tau+ tau- Lambda(1520)0]cc"]
 
         if SS:
             n += "SS"
             descriptors = [
-                "[Lambda_b0 -> Lambda(1520)0 tau+ tau+]cc",
-                "[Lambda_b0 -> Lambda(1520)0 tau- tau-]cc"
+                "[Lambda_b0 ->  tau+ tau+ Lambda(1520)0]cc",
+                "[Lambda_b0 ->  tau- tau- Lambda(1520)0]cc"
             ]
 
-        Combine = CombineParticles(
+        Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
+            Combination12Cut="AM<4200",
             CombinationCut=combcut,
             MotherCut=mothercut)
 
@@ -246,8 +247,8 @@ class Lb2pKTauXConf(LineBuilder):
         n = name + "TauTau"
 
         descriptors = [
-                "[Lambda_b0 -> Lambda(1520)0 tau+ pi-]cc",
-                "[Lambda_b0 -> Lambda(1520)0 tau- pi+]cc"
+                "[Lambda_b0 -> tau+ pi- Lambda(1520)0]cc",
+                "[Lambda_b0 -> tau- pi+ Lambda(1520)0]cc"
             ]
 
         if SS:
@@ -256,9 +257,9 @@ class Lb2pKTauXConf(LineBuilder):
                 "[Lambda_b0 -> Lambda(1520)0 tau+ pi+]cc",
                 "[Lambda_b0 -> Lambda(1520)0 tau- pi-]cc"
             ]
-
-        Combine = CombineParticles(
+        Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
+            Combination12Cut="AM<4200",
             CombinationCut=combcut,
             MotherCut=mothercut)
 
@@ -274,19 +275,20 @@ class Lb2pKTauXConf(LineBuilder):
         n = name + "TauTau"
 
         descriptors = [
-                "[Lambda_b0 -> Lambda(1520)0 tau+ mu-]cc",
-                "[Lambda_b0 -> Lambda(1520)0 tau- mu+]cc"
+                "[Lambda_b0 -> tau+ mu-  Lambda(1520)0]cc",
+                "[Lambda_b0 -> tau- mu+  Lambda(1520)0]cc"
             ]
 
         if SS:
             n += "SS"
             descriptors = [
-                "[Lambda_b0 -> Lambda(1520)0 tau+ mu+]cc",
-                "[Lambda_b0 -> Lambda(1520)0 tau- mu-]cc"
+                "[Lambda_b0 -> tau+ mu+ Lambda(1520)0]cc",
+                "[Lambda_b0 -> tau- mu- Lambda(1520)0]cc"
             ]
 
-        Combine = CombineParticles(
+        Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
+            Combination12Cut="AM<4200",
             CombinationCut=combcut,
             MotherCut=mothercut)
 
@@ -302,19 +304,20 @@ class Lb2pKTauXConf(LineBuilder):
         n = name + "TauTau"
 
         descriptors = [
-                "[Lambda_b0 -> Lambda(1520)0 tau+ e-]cc",
-                "[Lambda_b0 -> Lambda(1520)0 tau- e+]cc"
+                "[Lambda_b0 -> tau+ e- Lambda(1520)0]cc",
+                "[Lambda_b0 -> tau- e+ Lambda(1520)0]cc"
             ]
 
         if SS:
             n += "SS"
             descriptors = [
-                "[Lambda_b0 -> Lambda(1520)0 tau+ e+]cc",
-                "[Lambda_b0 -> Lambda(1520)0 tau- e-]cc"
+                "[Lambda_b0 -> tau+ e+ Lambda(1520)0]cc",
+                "[Lambda_b0 -> tau- e- Lambda(1520)0]cc"
             ]
 
-        Combine = CombineParticles(
+        Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
+            Combination12Cut="AM<4200",
             CombinationCut=combcut,
             MotherCut=mothercut)
 
-- 
GitLab


From 99634c97629f4950385507782fb6426c5fe888d1 Mon Sep 17 00:00:00 2001
From: Yunxuan Song <yunxuan.song@cern.ch>
Date: Fri, 14 Jul 2023 17:01:02 +0200
Subject: [PATCH 6/9] Add the isolation

---
 .../StrippingRD/StrippingLb2pKTauX.py         | 340 +++++++++++++++++-
 1 file changed, 335 insertions(+), 5 deletions(-)

diff --git a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
index 0acb89ce7..ab9732730 100644
--- a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
+++ b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
@@ -8,7 +8,7 @@
 # granted to it by virtue of its status as an Intergovernmental Organization  #
 # or submit itself to any jurisdiction.                                       #
 ###############################################################################
-__author__ = [' Yunxuan Song','Han Gao']
+__author__ = [' Yunxuan Song','A.Venkateswaran','Han Gao']
 __date__ = '10/07/2023'
 __version__ = '$Revision: 0.1$'
 
@@ -34,7 +34,7 @@ default_config = {
         #
         'FD_B_Max': 100 * mm,
         'PT_B': 4000 * MeV,
-        'P_B': 10000 * MeV,
+        'P_B': 30000 * MeV,
         'FDCHI2_B': 16,
         'MASS_LOW_B': 3000 * MeV,
         'MASS_HIGH_B': 7000 * MeV,
@@ -45,7 +45,7 @@ default_config = {
         'PT_pion': 500 * MeV,
         'PT_muon': 250 * MeV,
         'PT_elec': 250 * MeV,
-        'PT_proton': 500 * MeV,
+        'PT_proton': 250 * MeV,
         'PT_Ls': 1000 * MeV,
         'P_kaon': 3000 * MeV,
         'P_pion': 3000 * MeV,
@@ -58,9 +58,209 @@ default_config = {
         'MASS_LOW_pK': 1400 * MeV,
         'MASS_HIGH_pK': 2400 * MeV,
         'MASS_HIGH_Tau': 1800 * MeV,
+        #Tau pion
+        'PT_TauPion': 250 * MeV,
+        'P_TauPion': 2000 * MeV,
+        'MIPCHI2DV_TauPion': 16.0,
+        'TRACKCHI2_TauPion': 4,
+        'TRGHOPROB_TauPion': 0.4,
+        'TRCHI2DOF_TauPion': 4,
+        'PROBNNpi_TauPion': 0.55,
+        #Tau Kaon
+        'PT_TauKaon': 250 * MeV,
+        'P_TauKaon': 2000 * MeV,
+        'MIPCHI2DV_TauKaon': 16.0,
+        'TRACKCHI2_TauKaon': 4,
+        'TRGHOPROB_TauKaon': 0.4,
+        'TRCHI2DOF_TauKaon': 4,
+        #Loose Tau
+        'LooseTau_APT': 800.*MeV,
+        'LooseTau_AM_LOW': 400.*MeV,
+        'LooseTau_AM_HIGH': 2100.*MeV,
+        'LooseTau_AMAXDOCA': 0.2*mm,
+        #Loose Tau Combine
+        'LooseTau_MOTHER_PT': 1000.*MeV,
+        'LooseTau_MOTHER_M_LOW': 500.*MeV,
+        'LooseTau_MOTHER_M_HIGH': 2000.*MeV,
+        'LooseTau_MOTHER_BPVDIRA': 0.99,
+        'LooseTau_MOTHER_VFASPF': 16,
+        'LooseTau_MOTHER_BPVVDCHI2': 16,
+        'LooseTau_MOTHER_BPVVDRHO_LOW': 0.1*mm,
+        'LooseTau_MOTHER_BPVVDRHO_HIGH': 7.0*mm,
+        'LooseTau_MOTHER_BPVVDZ': 5.0*mm,
         #
         'B2HTauTau_LinePrescale': 1,
         'B2HTauTau_LinePostscale': 1,
+        # X0TauTau RelInfo (cover Lambda(*) Taup->(3pi) Taum->3pi, mu ,e ,pi
+        'RelInfoTools_X0DD':
+        [
+            {"Type": "RelInfoVertexIsolation",
+             "Location": "BVars_VertexIsoInfo",
+             "DaughterLocations": {"[Beauty ->  ^D+  X- X0 ]CC": "Dp_VertexIsoInfo",
+                                   "[Beauty ->   D+ ^X- X0 ]CC": "Xm_VertexIsoInfo"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 0.5,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone05",
+             "DaughterLocations": {"[Beauty ->  D+  X- ^X0]CC": "H_ConeIsoInfo_Cone05",
+                                   "[Beauty -> ^D+  X-  X0]CC": "Dp_ConeIsoInfo_Cone05",
+                                   "[Beauty ->  D+ ^X-  X0]CC": "Xm_ConeIsoInfo_Cone05"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 1.0,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone10",
+             "DaughterLocations": {"[Beauty ->  D+  X- ^X0]CC": "H_ConeIsoInfo_Cone10",
+                                   "[Beauty -> ^D+  X-  X0]CC": "Dp_ConeIsoInfo_Cone10",
+                                   "[Beauty ->  D+ ^X-  X0]CC": "Xm_ConeIsoInfo_Cone10"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 1.5,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone15",
+             "DaughterLocations": {"[Beauty ->  D+  X- ^X0]CC": "H_ConeIsoInfo_Cone15",
+                                   "[Beauty -> ^D+  X-  X0]CC": "Dp_ConeIsoInfo_Cone15",
+                                   "[Beauty ->  D+ ^X-  X0]CC": "Xm_ConeIsoInfo_Cone15"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 2.0,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone20",
+             "DaughterLocations": {"[Beauty ->  D+  X- ^X0]CC": "H_ConeIsoInfo_Cone20",
+                                   "[Beauty -> ^D+  X-  X0]CC": "Dp_ConeIsoInfo_Cone20",
+                                   "[Beauty ->  D+ ^X-  X0]CC": "Xm_ConeIsoInfo_Cone20"
+                                   }
+             },
+            {'Type': 'RelInfoVertexIsolationBDT',
+             'Location': 'BVars_VertexIsoBDTInfo',
+             'DaughterLocations': {"[Beauty ->  D+  X- ^X0]CC": "H_VertexIsoBDTInfo",
+                                   "[Beauty -> ^D+  X-  X0]CC": "Dp_VertexIsoBDTInfo",
+                                   "[Beauty ->  D+ ^X-  X0]CC": "Xm_VertexIsoBDTInfo"
+                                   }
+             },
+            {"Type": "RelInfoBKsttautauTauIsolationBDT",
+             "Location": "B2KstTauTau_TauIsolationBDT"
+             },
+        ],
+        # X0TauTau RelInfo (cover Lambda(*) Taup->(3pi) Taum->3pi, mu ,e ,pi
+        'RelInfoTools_X0TauTau':
+        [
+            {"Type": "RelInfoVertexIsolation",
+             "Location": "BVars_VertexIsoInfo",
+             "DaughterLocations": {"[Beauty ->  ^tau+  X- X0 ]CC": "Taup_VertexIsoInfo",
+                                   "[Beauty ->   tau+ ^X- X0 ]CC": "Xm_VertexIsoInfo"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 0.5,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone05",
+             "DaughterLocations": {"[Beauty ->  tau+  X- ^X0]CC": "H_ConeIsoInfo_Cone05",
+                                   "[Beauty -> ^tau+  X-  X0]CC": "Taup_ConeIsoInfo_Cone05",
+                                   "[Beauty ->  tau+ ^X-  X0]CC": "Xm_ConeIsoInfo_Cone05"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 1.0,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone10",
+             "DaughterLocations": {"[Beauty ->  tau+  X- ^X0]CC": "H_ConeIsoInfo_Cone10",
+                                   "[Beauty -> ^tau+  X-  X0]CC": "Taup_ConeIsoInfo_Cone10",
+                                   "[Beauty ->  tau+ ^X-  X0]CC": "Xm_ConeIsoInfo_Cone10"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 1.5,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone15",
+             "DaughterLocations": {"[Beauty ->  tau+  X- ^X0]CC": "H_ConeIsoInfo_Cone15",
+                                   "[Beauty -> ^tau+  X-  X0]CC": "Taup_ConeIsoInfo_Cone15",
+                                   "[Beauty ->  tau+ ^X-  X0]CC": "Xm_ConeIsoInfo_Cone15"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 2.0,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone20",
+             "DaughterLocations": {"[Beauty ->  tau+  X- ^X0]CC": "H_ConeIsoInfo_Cone20",
+                                   "[Beauty -> ^tau+  X-  X0]CC": "Taup_ConeIsoInfo_Cone20",
+                                   "[Beauty ->  tau+ ^X-  X0]CC": "Xm_ConeIsoInfo_Cone20"
+                                   }
+             },
+            {'Type': 'RelInfoVertexIsolationBDT',
+             'Location': 'BVars_VertexIsoBDTInfo',
+             'DaughterLocations': {"[Beauty ->  tau+  X- ^X0]CC": "H_VertexIsoBDTInfo",
+                                   "[Beauty -> ^tau+  X-  X0]CC": "Taup_VertexIsoBDTInfo",
+                                   "[Beauty ->  tau+ ^X-  X0]CC": "Xm_VertexIsoBDTInfo"
+                                   }
+             },
+            {"Type": "RelInfoBKsttautauTauIsolationBDT",
+             "Location": "B2KstTauTau_TauIsolationBDT"
+             },
+        ],
+                # X0TauTau RelInfo (cover Lambda(*) Taup->(3pi) Taum->3pi, mu ,e ,pi
+        'RelInfoTools_X0TauTau_SS':
+        [
+            {"Type": "RelInfoVertexIsolation",
+             "Location": "BVars_VertexIsoInfo",
+             "DaughterLocations": {"[Beauty ->  ^tau+  X+ X0 ]CC": "Taup_VertexIsoInfo",
+                                   "[Beauty ->   tau+ ^X+ X0 ]CC": "Xm_VertexIsoInfo"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 0.5,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone05",
+             "DaughterLocations": {"[Beauty ->  tau+  X+ ^X0]CC": "H_ConeIsoInfo_Cone05",
+                                   "[Beauty -> ^tau+  X+  X0]CC": "Taup_ConeIsoInfo_Cone05",
+                                   "[Beauty ->  tau+ ^X+  X0]CC": "Xm_ConeIsoInfo_Cone05"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 1.0,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone10",
+             "DaughterLocations": {"[Beauty ->  tau+  X+ ^X0]CC": "H_ConeIsoInfo_Cone10",
+                                   "[Beauty -> ^tau+  X+  X0]CC": "Taup_ConeIsoInfo_Cone10",
+                                   "[Beauty ->  tau+ ^X+  X0]CC": "Xm_ConeIsoInfo_Cone10"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 1.5,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone15",
+             "DaughterLocations": {"[Beauty ->  tau+  X+ ^X0]CC": "H_ConeIsoInfo_Cone15",
+                                   "[Beauty -> ^tau+  X+  X0]CC": "Taup_ConeIsoInfo_Cone15",
+                                   "[Beauty ->  tau+ ^X+  X0]CC": "Xm_ConeIsoInfo_Cone15"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 2.0,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone20",
+             "DaughterLocations": {"[Beauty ->  tau+  X+ ^X0]CC": "H_ConeIsoInfo_Cone20",
+                                   "[Beauty -> ^tau+  X+  X0]CC": "Taup_ConeIsoInfo_Cone20",
+                                   "[Beauty ->  tau+ ^X+  X0]CC": "Xm_ConeIsoInfo_Cone20"
+                                   }
+             },
+            {'Type': 'RelInfoVertexIsolationBDT',
+             'Location': 'BVars_VertexIsoBDTInfo',
+             'DaughterLocations': {"[Beauty ->  tau+  X+ ^X0]CC": "H_VertexIsoBDTInfo",
+                                   "[Beauty -> ^tau+  X+  X0]CC": "Taup_VertexIsoBDTInfo",
+                                   "[Beauty ->  tau+ ^X+  X0]CC": "Xm_VertexIsoBDTInfo"
+                                   }
+             },
+            {"Type": "RelInfoBKsttautauTauIsolationBDT",
+             "Location": "B2KstTauTau_TauIsolationBDT"
+             },
+        ],
+        
+
     },
     'STREAMS': ['Bhadron']
 }
@@ -94,6 +294,8 @@ class Lb2pKTauXConf(LineBuilder):
         MuonCuts = trackCuts + " & (PT > %(PT_muon)s) & (P > %(P_muon)s) & ((PIDmu)>0)" % config
         ElecCuts = trackCuts + " & (PT > %(PT_elec)s) & (P > %(P_elec)s) & ((PIDe)>0)" % config
         ProtonCuts = trackCuts + " & (PT > %(PT_proton)s) & (P > %(P_proton)s) & ((PIDp-PIDK)>0) & ((PIDp)>0)" % config
+        TauPionCuts = "(PT>%(PT_TauPion)s) & (P>%(P_TauPion)s) & (MIPCHI2DV(PRIMARY) > %(MIPCHI2DV_TauPion)s) & (TRCHI2DOF<%(TRCHI2DOF_TauPion)s) & (TRGHOSTPROB< %(TRGHOPROB_TauPion)s) & (PROBNNpi > %(PROBNNpi_TauPion)s)" % config
+        TauKaonCuts = "(PT>%(PT_TauKaon)s) & (P>%(P_TauKaon)s) & (MIPCHI2DV(PRIMARY) > %(MIPCHI2DV_TauKaon)s) & (TRCHI2DOF<%(TRCHI2DOF_TauKaon)s) & (TRGHOSTPROB< %(TRGHOPROB_TauKaon)s)" % config
 
         TauCuts = "(M < %(MASS_HIGH_Tau)s)" % config
 
@@ -126,8 +328,11 @@ class Lb2pKTauXConf(LineBuilder):
         self.selMuon = SimpleSelection("Muon" + name, FilterDesktop, [StdNoPIDsMuons], Code=MuonCuts)
         self.selElec = SimpleSelection("Elec" + name, FilterDesktop, [StdNoPIDsElectrons], Code=ElecCuts)
         self.selProton = SimpleSelection("Proton" + name, FilterDesktop, [StdNoPIDsProtons], Code=ProtonCuts)
+        #self.selTauKaon = SimpleSelection("TauKaon" + name, FilterDesktop, [StdNoPIDsKaons], Code=TauKaonCuts)
+        #self.selTauPion = SimpleSelection("TauPion" + name, FilterDesktop, [StdNoPIDsPions], Code=TauPionCuts)
 
         self.selpK = self._makepK("pK" + name, ProtonCuts, KaonCuts, config)
+        self.selLooseTau = self._makelooseTau("LooseTau" + name, TauPionCuts, TauKaonCuts, config)
         
         self.selB2LsTauTau_3pi_3pi  = self._makeLb2LsTauTau_3pi_3pi(name + "_Ls3pi3pi", self.selTau, self.LambdaList, config)
         self.selB2LsTauTauSS_3pi_3pi= self._makeLb2LsTauTau_3pi_3pi(name + "_Ls3pi3pi", self.selTau, self.LambdaList, config, SS=True)
@@ -144,6 +349,15 @@ class Lb2pKTauXConf(LineBuilder):
         self.selB2pKTauTau_3pi_e    = self._makeLb2pKTauTau_3pi_e(name + "_pK3pie", self.selTau, self.selpK, self.selElec, config)
         self.selB2pKTauTauSS_3pi_e  = self._makeLb2pKTauTau_3pi_e(name + "_pK3pie", self.selTau, self.selpK, self.selElec, config, SS=True)
 
+        self.selB2pKDD_3pi_3pi  = self._makeLb2pKDD_3pi_3pi(name + "_pKDD3pi3pi", self.selLooseTau, self.selpK, config)
+        self.selB2pKDDSS_3pi_3pi= self._makeLb2pKDD_3pi_3pi(name + "_pKDD3pi3pi", self.selLooseTau, self.selpK, config, SS=True)
+
+        self.selB2pKDD_3pi_mu   = self._makeLb2pKDD_3pi_mu(name + "_pKDD3pimu", self.selLooseTau, self.selpK, self.selMuon, config)
+        self.selB2pKDDSS_3pi_mu = self._makeLb2pKDD_3pi_mu(name + "_pKDD3pimu", self.selLooseTau, self.selpK, self.selMuon, config, SS=True)
+        
+        self.selB2pKDD_3pi_e    = self._makeLb2pKDD_3pi_e(name + "_pKDD3pie", self.selLooseTau, self.selpK, self.selElec, config)
+        self.selB2pKDDSS_3pi_e  = self._makeLb2pKDD_3pi_e(name + "_pKDD3pie", self.selLooseTau, self.selpK, self.selElec, config, SS=True)
+
         ## Finished making selections build and register lines
         self.LsTauTau3pi3pi_Line   = self._makeLine("B2LsTauTau3pi3piLine"  , self.selB2LsTauTau_3pi_3pi  , config)
         self.LsTauTau3pi3piSS_Line = self._makeLine("B2LsTauTau3pi3piSSLine", self.selB2LsTauTauSS_3pi_3pi, config)
@@ -160,6 +374,15 @@ class Lb2pKTauXConf(LineBuilder):
         self.pKTauTau3pie_Line    = self._makeLine("B2pKTauTau3pieLine"  , self.selB2pKTauTau_3pi_e  , config)
         self.pKTauTau3pieSS_Line  = self._makeLine("B2pKTauTau3pieSSLine", self.selB2pKTauTauSS_3pi_e, config)
 
+        self.pKDD3pi3pi_Line   = self._makeLine("B2pKDD3pi3piLine"  , self.selB2pKDD_3pi_3pi  , config)
+        self.pKDD3pi3piSS_Line = self._makeLine("B2pKDD3pi3piSSLine", self.selB2pKDDSS_3pi_3pi, config)
+
+        self.pKDD3pimu_Line   = self._makeLine("B2pKDD3pimuLine"  , self.selB2pKDD_3pi_mu  , config)
+        self.pKDD3pimuSS_Line = self._makeLine("B2pKDD3pimuSSLine", self.selB2pKDDSS_3pi_mu, config)
+
+        self.pKDD3pie_Line    = self._makeLine("B2pKDD3pieLine"  , self.selB2pKDD_3pi_e  , config)
+        self.pKDD3pieSS_Line  = self._makeLine("B2pKDD3pieSSLine", self.selB2pKDDSS_3pi_e, config)
+
     def createSubSel(self, OutputList, InputList, Cuts):
         '''create a selection using a FilterDesktop'''
         filter = FilterDesktop(Code=Cuts)
@@ -174,7 +397,7 @@ class Lb2pKTauXConf(LineBuilder):
         combcut = "in_range ( %(MASS_LOW_pK)s, AM, %(MASS_HIGH_pK)s )" % config
         mothercut = " (PT > %(PT_Ls)s) & (VFASPF(VCHI2) < %(VCHI2_pK)s)" % config
 
-        daucut = {'p+': protonSel, 'K-': kaonSel}
+        daucut = {'p+': protonSel, 'K-': kaonSel, 'p~-': protonSel, 'K+': kaonSel}
 
         return SimpleSelection(
             name + "_pK",
@@ -184,6 +407,21 @@ class Lb2pKTauXConf(LineBuilder):
             MotherCut=mothercut,
             DaughtersCuts=daucut)
 
+    def _makelooseTau(self, name, pionSel, kaonSel, config):####Same as StdTightDetachedTau3pi, but wrong PID for pi
+
+        combcut = "(APT>%(LooseTau_APT)s) & ((AM>%(LooseTau_AM_LOW)s) & (AM<%(LooseTau_AM_HIGH)s)) & (AMAXDOCA('')<%(LooseTau_AMAXDOCA)s) & (ANUM(PT > 800*MeV) >= 1)" % config
+        mothercut = "(PT>%(LooseTau_MOTHER_PT)s) & (M>%(LooseTau_MOTHER_M_LOW)s) & (M<%(LooseTau_MOTHER_M_HIGH)s) & (BPVDIRA>%(LooseTau_MOTHER_BPVDIRA)s) & (VFASPF(VCHI2) < %(LooseTau_MOTHER_VFASPF)s) & (BPVVDCHI2>%(LooseTau_MOTHER_BPVVDCHI2)s) & (BPVVDRHO>%(LooseTau_MOTHER_BPVVDRHO_LOW)s) & (BPVVDRHO<%(LooseTau_MOTHER_BPVVDRHO_HIGH)s) & (BPVVDZ>%(LooseTau_MOTHER_BPVVDZ)s)" % config
+
+        daucut = {'pi+': pionSel, 'K-': kaonSel, 'pi-': pionSel, 'K+': kaonSel}
+
+        return SimpleSelection(
+            name + "_D",
+            CombineParticles, [StdNoPIDsPions, StdNoPIDsKaons],
+            DecayDescriptors=["[D+ -> K- pi+ pi+]cc"],
+            CombinationCut=combcut,
+            MotherCut=mothercut,
+            DaughtersCuts=daucut)
+
 #### Make B ###################################################
 
     def _makeLb2LsTauTau_3pi_3pi(self, name, tauSel, pKSel, config, SS=False):
@@ -324,6 +562,92 @@ class Lb2pKTauXConf(LineBuilder):
         return Selection(
             n, Algorithm=Combine, RequiredSelections=[tauSel, pKSel, XSel])
 
+
+    def _makeLb2pKDD_3pi_3pi(self, name, tauSel, pKSel, config, SS=False):
+
+        combcut = "in_range ( %(MASS_LOW_B)s, AM, %(MASS_HIGH_B)s )" % config
+        mothercut = "( BPVVDCHI2 > %(FDCHI2_B)s ) & ( BPVVD < %(FD_B_Max)s ) " % config
+        mothercut += " & (PT > %(PT_B)s) & (P > %(P_B)s) " % config
+
+        n = name + "TauTau"
+
+        descriptors = ["[Lambda_b0 -> D+ D- Lambda(1520)0]cc"]
+
+        if SS:
+            n += "SS"
+            descriptors = [
+                "[Lambda_b0 ->  D+ D+ Lambda(1520)0]cc",
+                "[Lambda_b0 ->  D- D- Lambda(1520)0]cc"
+            ]
+
+        Combine = DaVinci__N3BodyDecays(
+            DecayDescriptors=descriptors,
+            Combination12Cut="AM<4200",
+            CombinationCut=combcut,
+            MotherCut=mothercut)
+
+        return Selection(
+            n, Algorithm=Combine, RequiredSelections=[tauSel, pKSel])
+
+    def _makeLb2pKDD_3pi_mu(self, name, tauSel, pKSel, XSel, config, SS=False):
+
+        combcut = "in_range ( %(MASS_LOW_B)s, AM, %(MASS_HIGH_B)s )" % config
+        mothercut = "( BPVVDCHI2 > %(FDCHI2_B)s ) & ( BPVVD < %(FD_B_Max)s ) " % config
+        mothercut += " & (PT > %(PT_B)s) & (P > %(P_B)s) " % config
+
+        n = name + "DD"
+
+        descriptors = [
+                "[Lambda_b0 -> D+ mu-  Lambda(1520)0]cc",
+                "[Lambda_b0 -> D- mu+  Lambda(1520)0]cc"
+            ]
+
+        if SS:
+            n += "SS"
+            descriptors = [
+                "[Lambda_b0 -> D+ mu+ Lambda(1520)0]cc",
+                "[Lambda_b0 -> D- mu- Lambda(1520)0]cc"
+            ]
+
+        Combine = DaVinci__N3BodyDecays(
+            DecayDescriptors=descriptors,
+            Combination12Cut="AM<4200",
+            CombinationCut=combcut,
+            MotherCut=mothercut)
+
+        return Selection(
+            n, Algorithm=Combine, RequiredSelections=[tauSel, pKSel, XSel])
+
+    def _makeLb2pKDD_3pi_e(self, name, tauSel, pKSel, XSel, config, SS=False):
+
+        combcut = "in_range ( %(MASS_LOW_B)s, AM, %(MASS_HIGH_B)s )" % config
+        mothercut = "( BPVVDCHI2 > %(FDCHI2_B)s ) & ( BPVVD < %(FD_B_Max)s ) " % config
+        mothercut += " & (PT > %(PT_B)s) & (P > %(P_B)s) " % config
+
+        n = name + "DD"
+
+        descriptors = [
+                "[Lambda_b0 -> D+ e- Lambda(1520)0]cc",
+                "[Lambda_b0 -> D- e+ Lambda(1520)0]cc"
+            ]
+
+        if SS:
+            n += "SS"
+            descriptors = [
+                "[Lambda_b0 -> D+ e+ Lambda(1520)0]cc",
+                "[Lambda_b0 -> D- e- Lambda(1520)0]cc"
+            ]
+
+        Combine = DaVinci__N3BodyDecays(
+            DecayDescriptors=descriptors,
+            Combination12Cut="AM<4200",
+            CombinationCut=combcut,
+            MotherCut=mothercut)
+
+        return Selection(
+            n, Algorithm=Combine, RequiredSelections=[tauSel, pKSel, XSel])
+
+
 #### Helpers to make lines
 
     def _makeLine(self, name, sel, config):
@@ -334,9 +658,15 @@ class Lb2pKTauXConf(LineBuilder):
             postscale=config['B2HTauTau_LinePostscale'],
             #MDSTFlag = False,
             FILTER=self.FilterSPD,
-            RelatedInfoTools=getRelInfoLb2pKTauX(),
+            #RelatedInfoTools=config['RelInfoTools_X0TauTau'],#getRelInfoLb2pKTauX(),
             selection=sel,
             MaxCandidates=50)
+        if 'TauTau' in name and 'SS' not in name:
+            line.RelatedInfoTools=config['RelInfoTools_X0TauTau']
+        elif 'TauTau' in name and 'SS' in name:
+            line.RelatedInfoTools=config['RelInfoTools_X0TauTau_SS']
+        elif 'DD' in name and 'SS' not in name:
+            line.RelatedInfoTools=config['RelInfoTools_X0DD']
         self.registerLine(line)
         return line
 
-- 
GitLab


From 57a47ef049f1011583709d3e901cc2c95c133d56 Mon Sep 17 00:00:00 2001
From: Yunxuan Song <yunxuan.song@cern.ch>
Date: Mon, 17 Jul 2023 16:26:55 +0200
Subject: [PATCH 7/9] Update a bug in descriptor

---
 .../StrippingRD/StrippingLb2pKTauX.py                 | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
index ab9732730..037d44291 100644
--- a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
+++ b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
@@ -9,7 +9,7 @@
 # or submit itself to any jurisdiction.                                       #
 ###############################################################################
 __author__ = [' Yunxuan Song','A.Venkateswaran','Han Gao']
-__date__ = '10/07/2023'
+__date__ = '14/07/2023'
 __version__ = '$Revision: 0.1$'
 
 # Stripping line for B->Htautau
@@ -22,6 +22,7 @@ from GaudiKernel.SystemOfUnits import mm
   Lb->pKTauTau_3pi_pi
   Lb->pKTauTau_3pi_mu
   Lb->pKTauTau_3pi_e
+  Lb->pKDD for bkg check
 """
 __all__ = ('Lb2pKTauXConf', 'getRelInfoLb2pKTauX', 'default_config')
 
@@ -275,6 +276,8 @@ from StandardParticles import StdNoPIDsKaons
 from StandardParticles import StdNoPIDsMuons
 from StandardParticles import StdNoPIDsElectrons
 from StandardParticles import StdNoPIDsProtons
+from StandardParticles import StdLoosePions
+
 
 
 class Lb2pKTauXConf(LineBuilder):
@@ -416,7 +419,7 @@ class Lb2pKTauXConf(LineBuilder):
 
         return SimpleSelection(
             name + "_D",
-            CombineParticles, [StdNoPIDsPions, StdNoPIDsKaons],
+            CombineParticles, [StdLoosePions, StdNoPIDsKaons],
             DecayDescriptors=["[D+ -> K- pi+ pi+]cc"],
             CombinationCut=combcut,
             MotherCut=mothercut,
@@ -492,8 +495,8 @@ class Lb2pKTauXConf(LineBuilder):
         if SS:
             n += "SS"
             descriptors = [
-                "[Lambda_b0 -> Lambda(1520)0 tau+ pi+]cc",
-                "[Lambda_b0 -> Lambda(1520)0 tau- pi-]cc"
+                "[Lambda_b0 -> tau+ pi+ Lambda(1520)0]cc",
+                "[Lambda_b0 -> tau- pi- Lambda(1520)0]cc"
             ]
         Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
-- 
GitLab


From fde3102d1eb062c3455d72a04a1f72ff2b1263ef Mon Sep 17 00:00:00 2001
From: Yunxuan Song <yunxuan.song@cern.ch>
Date: Mon, 17 Jul 2023 22:13:49 +0200
Subject: [PATCH 8/9] update the cuts and fix some bugs

---
 .../StrippingRD/StrippingLb2pKTauX.py         | 78 ++++++++-----------
 1 file changed, 31 insertions(+), 47 deletions(-)

diff --git a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
index 037d44291..a1b5549d6 100644
--- a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
+++ b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
@@ -53,6 +53,13 @@ default_config = {
         'P_muon': 3000 * MeV,
         'P_elec': 3000 * MeV,
         'P_proton': 3000 * MeV,
+        'PID_KaonCuts_PIDK': 0,
+        'PID_PionCuts_PIDK': 0,
+        'PID_PionCuts_PIDmu': 0,
+        'PID_MuonCuts_PIDmu': 0,
+        'PID_ElecCuts_PIDe': 0,
+        'PID_ProtonCuts_PIDpk': 0,
+        'PID_ProtonCuts_PIDk': 0,
         'IPCHI2_Tr': 16,
         'TRACKCHI2_Tr': 4,
         'TRGHOPROB_Tr': 0.4,
@@ -89,6 +96,16 @@ default_config = {
         'LooseTau_MOTHER_BPVVDRHO_LOW': 0.1*mm,
         'LooseTau_MOTHER_BPVVDRHO_HIGH': 7.0*mm,
         'LooseTau_MOTHER_BPVVDZ': 5.0*mm,
+        #M12 cut
+        'M12_HIGH_LsTauTau_3pi_3pi': 6000,
+        'M12_HIGH_pKTauTau_3pi_3pi': 4200,
+        'M12_HIGH_pKTauTau_3pi_pi': 4200,
+        'M12_HIGH_pKTauTau_3pi_mu': 4200,
+        'M12_HIGH_pKTauTau_3pi_e': 4200,
+        'M12_HIGH_pKDD_3pi_3pi': 4200,
+        'M12_HIGH_pKDD_3pi_mu': 4200,
+        'M12_HIGH_pKDD_3pi_e': 4200,
+        'M12_HIGH_pKDD_3pi_3pi': 4200,
         #
         'B2HTauTau_LinePrescale': 1,
         'B2HTauTau_LinePostscale': 1,
@@ -266,7 +283,7 @@ default_config = {
     'STREAMS': ['Bhadron']
 }
 
-from Gaudi.Configuration import *
+#from Gaudi.Configuration import *
 from GaudiConfUtils.ConfigurableGenerators import FilterDesktop, CombineParticles, OfflineVertexFitter, DaVinci__N3BodyDecays
 from PhysSelPython.Wrappers import Selection, DataOnDemand, SimpleSelection, MergedSelection
 from StrippingConf.StrippingLine import StrippingLine
@@ -292,11 +309,11 @@ class Lb2pKTauXConf(LineBuilder):
         LineBuilder.__init__(self, name, config)
 
         trackCuts = "(MIPCHI2DV(PRIMARY) > %(IPCHI2_Tr)s) & (TRCHI2DOF < %(TRACKCHI2_Tr)s) & (TRGHOSTPROB < %(TRGHOPROB_Tr)s)" % config
-        KaonCuts = trackCuts + " & (PT > %(PT_kaon)s) & (P > %(P_kaon)s) & ((PIDK)>0)" % config
-        PionCuts = trackCuts + " & (PT > %(PT_pion)s) & (P > %(P_pion)s) & ((PIDK)<0) & ((PIDmu)<0)" % config
-        MuonCuts = trackCuts + " & (PT > %(PT_muon)s) & (P > %(P_muon)s) & ((PIDmu)>0)" % config
-        ElecCuts = trackCuts + " & (PT > %(PT_elec)s) & (P > %(P_elec)s) & ((PIDe)>0)" % config
-        ProtonCuts = trackCuts + " & (PT > %(PT_proton)s) & (P > %(P_proton)s) & ((PIDp-PIDK)>0) & ((PIDp)>0)" % config
+        KaonCuts = trackCuts + " & (PT > %(PT_kaon)s) & (P > %(P_kaon)s) & ((PIDK)>%(PID_KaonCuts_PIDK)s)" % config
+        PionCuts = trackCuts + " & (PT > %(PT_pion)s) & (P > %(P_pion)s) & ((PIDK)<%(PID_PionCuts_PIDK)s) & ((PIDmu)<%(PID_PionCuts_PIDmu)s)" % config
+        MuonCuts = trackCuts + " & (PT > %(PT_muon)s) & (P > %(P_muon)s) & ((PIDmu)>%(PID_MuonCuts_PIDmu)s)" % config
+        ElecCuts = trackCuts + " & (PT > %(PT_elec)s) & (P > %(P_elec)s) & ((PIDe)>%(PID_ElecCuts_PIDe)s)" % config
+        ProtonCuts = trackCuts + " & (PT > %(PT_proton)s) & (P > %(P_proton)s) & ((PIDp-PIDK)>%(PID_ProtonCuts_PIDpk)s) & ((PIDp)>%(PID_ProtonCuts_PIDk)s)" % config
         TauPionCuts = "(PT>%(PT_TauPion)s) & (P>%(P_TauPion)s) & (MIPCHI2DV(PRIMARY) > %(MIPCHI2DV_TauPion)s) & (TRCHI2DOF<%(TRCHI2DOF_TauPion)s) & (TRGHOSTPROB< %(TRGHOPROB_TauPion)s) & (PROBNNpi > %(PROBNNpi_TauPion)s)" % config
         TauKaonCuts = "(PT>%(PT_TauKaon)s) & (P>%(P_TauKaon)s) & (MIPCHI2DV(PRIMARY) > %(MIPCHI2DV_TauKaon)s) & (TRCHI2DOF<%(TRCHI2DOF_TauKaon)s) & (TRGHOSTPROB< %(TRGHOPROB_TauKaon)s)" % config
 
@@ -446,7 +463,7 @@ class Lb2pKTauXConf(LineBuilder):
 
         Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
-            Combination12Cut="AM<6000",
+            Combination12Cut="AM<%(M12_HIGH_LsTauTau_3pi_3pi)s" % config,
             CombinationCut=combcut,
             MotherCut=mothercut)
 
@@ -472,7 +489,7 @@ class Lb2pKTauXConf(LineBuilder):
 
         Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
-            Combination12Cut="AM<4200",
+            Combination12Cut="AM<%(M12_HIGH_pKTauTau_3pi_3pi)s" % config,
             CombinationCut=combcut,
             MotherCut=mothercut)
 
@@ -500,7 +517,7 @@ class Lb2pKTauXConf(LineBuilder):
             ]
         Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
-            Combination12Cut="AM<4200",
+            Combination12Cut="AM<%(M12_HIGH_pKTauTau_3pi_pi)s" % config,
             CombinationCut=combcut,
             MotherCut=mothercut)
 
@@ -529,7 +546,7 @@ class Lb2pKTauXConf(LineBuilder):
 
         Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
-            Combination12Cut="AM<4200",
+            Combination12Cut="AM<%(M12_HIGH_pKTauTau_3pi_mu)s" % config,
             CombinationCut=combcut,
             MotherCut=mothercut)
 
@@ -558,7 +575,7 @@ class Lb2pKTauXConf(LineBuilder):
 
         Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
-            Combination12Cut="AM<4200",
+            Combination12Cut="AM<%(M12_HIGH_pKTauTau_3pi_e)s" % config,
             CombinationCut=combcut,
             MotherCut=mothercut)
 
@@ -585,7 +602,7 @@ class Lb2pKTauXConf(LineBuilder):
 
         Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
-            Combination12Cut="AM<4200",
+            Combination12Cut="AM<%(M12_HIGH_pKDD_3pi_3pi)s" % config,
             CombinationCut=combcut,
             MotherCut=mothercut)
 
@@ -614,7 +631,7 @@ class Lb2pKTauXConf(LineBuilder):
 
         Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
-            Combination12Cut="AM<4200",
+            Combination12Cut="AM<%(M12_HIGH_pKDD_3pi_mu)s" % config,
             CombinationCut=combcut,
             MotherCut=mothercut)
 
@@ -643,7 +660,7 @@ class Lb2pKTauXConf(LineBuilder):
 
         Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
-            Combination12Cut="AM<4200",
+            Combination12Cut="AM<%(M12_HIGH_pKDD_3pi_e)s" % config,
             CombinationCut=combcut,
             MotherCut=mothercut)
 
@@ -673,36 +690,3 @@ class Lb2pKTauXConf(LineBuilder):
         self.registerLine(line)
         return line
 
-
-#### Related Info
-def getRelInfoLb2pKTauX():
-#def getRelInfoB2XTauTau():
-    relInfo = []
-    for coneAngle in [0.5, 0.8, 1.0, 1.3, 1.5]:
-        conestr = str(coneAngle).replace('.', '')
-        relInfo += [{
-            "Type":
-            "RelInfoConeVariables",
-            "IgnoreUnmatchedDescriptors":
-            True,
-            "ConeAngle":
-            coneAngle,
-            "Location":
-            "VertexConeInfo",
-            "Variables": [
-                'CONEANGLE', 'CONEMULT', 'CONEPASYM', 'CONEPTASYM',
-                'CONEDELTAETA'
-            ],
-            "DaughterLocations": {
-                "^[Beauty -> Hadron Hadron l  l]CC": 'P2ConeVar%s_B' % conestr,
-                "[Beauty -> ^Hadron Hadron l  l]CC": 'P2ConeVar%s_X1' % conestr,
-                "[Beauty ->  Hadron ^Hadron l  l]CC": 'P2ConeVar%s_X2' % conestr,
-                "[Beauty ->  Hadron Hadron ^l  l]CC": 'P2ConeVar%s_Tau1' % conestr,
-                "[Beauty ->  Hadron Hadron l ^l]CC": 'P2ConeVar%s_Tau2' % conestr
-            }
-        }]
-        relInfo += [{
-            "Type": "RelInfoVertexIsolation",
-            "Location": "VertexIsoInfo"
-        }]
-        return relInfo
-- 
GitLab


From 1f60d0302eac4223ae0cc0414efbdfee98547bf2 Mon Sep 17 00:00:00 2001
From: Yunxuan Song <yunxuan.song@cern.ch>
Date: Tue, 18 Jul 2023 10:16:10 +0200
Subject: [PATCH 9/9] minor update

---
 .../StrippingSelections/StrippingRD/StrippingLb2pKTauX.py      | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
index a1b5549d6..82237cdd7 100644
--- a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
+++ b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingLb2pKTauX.py
@@ -1,5 +1,5 @@
 ###############################################################################
-# (c) Copyright 2000-2019 CERN for the benefit of the LHCb Collaboration      #
+# (c) Copyright 2000-2023 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".   #
@@ -283,7 +283,6 @@ default_config = {
     'STREAMS': ['Bhadron']
 }
 
-#from Gaudi.Configuration import *
 from GaudiConfUtils.ConfigurableGenerators import FilterDesktop, CombineParticles, OfflineVertexFitter, DaVinci__N3BodyDecays
 from PhysSelPython.Wrappers import Selection, DataOnDemand, SimpleSelection, MergedSelection
 from StrippingConf.StrippingLine import StrippingLine
-- 
GitLab