From d41b94668097711b280a33c88b27f67d148b541b Mon Sep 17 00:00:00 2001
From: Aravindhan Venkateswaran <aravindhan.venkateswaran@cern.ch>
Date: Fri, 14 Jul 2023 13:16:40 +0200
Subject: [PATCH] Add DDKSS isolation, remove some hardcoded cuts, update
 version

---
 .../StrippingRD/StrippingB2XTauTau.py         | 95 +++++++++++++++++--
 1 file changed, 87 insertions(+), 8 deletions(-)

diff --git a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingB2XTauTau.py b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingB2XTauTau.py
index df7aef588..b286fe12b 100644
--- a/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingB2XTauTau.py
+++ b/Phys/StrippingSelections/python/StrippingSelections/StrippingRD/StrippingB2XTauTau.py
@@ -22,8 +22,8 @@ from GaudiKernel.SystemOfUnits import MeV
 from GaudiKernel.SystemOfUnits import mm
 
 __author__ = [' L. Pescatore', 'F. Blanc', 'A.Venkateswaran']
-__date__ = '13/07/2023'
-__version__ = '$Revision: 0.1$'
+__date__ = '14/07/2023'
+__version__ = '$Revision: 0.3$'
 
 """
   B->KTauTau, B->K1TauTau, B->RhoTauTau, B->Eta'TauTau, B -> D+ D- K+
@@ -53,6 +53,9 @@ default_config = {
         'FDCHI2_B': 16,
         'MASS_LOW_B': 1000 * MeV,
         'MASS_HIGH_B': 8000 * MeV,
+        'M12_HIGH_BD2HTAUTAU': 7000 * MeV,
+        'M12_HIGH_BU2K1TAUTAU': 6000 * MeV,
+        'M12_HIGH_BU2KTAUTAU': 5000 * MeV,
         # Resonance properties
         'VCHI2_Etap': 16,
         'VCHI2_Rho': 16,
@@ -174,6 +177,80 @@ default_config = {
             # }
 
         ],
+        # DDK SS RelInfo
+        'RelInfoTools_DDKSS':
+        [
+            {"Type": "RelInfoVertexIsolation",
+             "Location": "BVars_VertexIsoInfo",
+             "DaughterLocations": {  # "[Beauty -> ^X  D+  D+]CC": "H_VertexIsoInfo",
+                 "[Beauty ->  X ^D+  D+]CC": "Dp_VertexIsoInfo",
+                 "[Beauty ->  X  D+ ^D+]CC": "Dm_VertexIsoInfo"
+             }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 0.5,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone05",
+             "DaughterLocations": {"[Beauty -> ^X  D+  D+]CC": "H_ConeIsoInfo_Cone05",
+                                   "[Beauty ->  X ^D+  D+]CC": "Dp_ConeIsoInfo_Cone05",
+                                   "[Beauty ->  X  D+ ^D+]CC": "Dm_ConeIsoInfo_Cone05"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 1.0,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone10",
+             "DaughterLocations": {"[Beauty -> ^X  D+  D+]CC": "H_ConeIsoInfo_Cone10",
+                                   "[Beauty ->  X ^D+  D+]CC": "Dp_ConeIsoInfo_Cone10",
+                                   "[Beauty ->  X  D+ ^D+]CC": "Dm_ConeIsoInfo_Cone10"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 1.5,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone15",
+             "DaughterLocations": {"[Beauty -> ^X  D+  D+]CC": "H_ConeIsoInfo_Cone15",
+                                   "[Beauty ->  X ^D+  D+]CC": "Dp_ConeIsoInfo_Cone15",
+                                   "[Beauty ->  X  D+ ^D+]CC": "Dm_ConeIsoInfo_Cone15"
+                                   }
+             },
+            {"Type": "RelInfoConeIsolation",
+             "ConeSize": 2.0,
+             "Variables": [],
+             "Location": "BVars_ConeIsoInfo_Cone20",
+             "DaughterLocations": {"[Beauty -> ^X  D+  D+]CC": "H_ConeIsoInfo_Cone20",
+                                   "[Beauty ->  X ^D+  D+]CC": "Dp_ConeIsoInfo_Cone20",
+                                   "[Beauty ->  X  D+ ^D+]CC": "Dm_ConeIsoInfo_Cone20"
+                                   }
+             },
+            {'Type': 'RelInfoVertexIsolationBDT',
+             'Location': 'BVars_VertexIsoBDTInfo',
+             'DaughterLocations': {"[Beauty -> ^X  D+  D+]CC": "H_VertexIsoBDTInfo",
+                                   "[Beauty ->  X ^D+  D+]CC": "Dp_VertexIsoBDTInfo",
+                                   "[Beauty ->  X  D+ ^D+]CC": "Dm_VertexIsoBDTInfo"
+                                   }
+             },
+            {'Type': 'RelInfoTrackIsolationBDT',
+             'Variables': 2,
+             'WeightsFile':  'BsMuMu_TrackIsolationBDT9vars_v1r4.xml',
+             'DaughterLocations': {"[Beauty ->  ^X  D+  D+]CC": "H_TrackIsoBDTInfo",
+                                   "[Beauty ->  X  (D+ -> ^X+ X- X+)  D+]CC": "Dp_pi1_TrackIsoBDTInfo",
+                                   "[Beauty ->  X  (D+ -> X+ ^X- X+)  D+]CC": "Dp_pi2_TrackIsoBDTInfo",
+                                   "[Beauty ->  X  (D+ -> X+ X- ^X+)  D+]CC": "Dp_pi3_TrackIsoBDTInfo",
+                                   "[Beauty ->  X  D+  (D+ -> ^X+ X- X+)]CC": "Dm_pi1_TrackIsoBDTInfo",
+                                   "[Beauty ->  X  D+  (D+ -> X+ ^X- X+)]CC": "Dm_pi2_TrackIsoBDTInfo",
+                                   "[Beauty ->  X  D+  (D+ -> X+ X- ^X+)]CC": "Dm_pi3_TrackIsoBDTInfo",
+                                   }},
+
+            {"Type": "RelInfoBKsttautauTauIsolationBDT",
+             "Location": "B2KstTauTau_TauIsolationBDT"
+             },
+            # {"Type": "RelInfoBKsttautauTrackIsolationBDT",
+            #  "Location": "B2KstTauTau_TrackIsolationBDT"
+            # }
+
+        ],
+
         # XpTauTau RelInfo (cover K+TauTau, K1+TauTau)
         'RelInfoTools_XpTauTau':
         [
@@ -474,7 +551,7 @@ class B2XTauTauConf(LineBuilder):
         self.DDK_Line = self._makeLine(
             "B2KTauTau_DDKLine", self.selB2DDK, config)
         self.DDKSS_Line = self._makeLine(
-            "B2KTauTau_DDSSKLine", self.selB2DDKSS, config)
+            "B2KTauTau_DDKSSLine", self.selB2DDKSS, config)
         
         self.RhoTauTau_Line = self._makeLine(
             "B2RhoTauTauLine", self.selB2RhoTauTau, config)
@@ -567,7 +644,7 @@ class B2XTauTauConf(LineBuilder):
 
         Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
-            Combination12Cut="AM < 7000",
+            Combination12Cut="AM < %(M12_HIGH_BD2HTAUTAU)s" % config,
             CombinationCut=combcut,
             MotherCut=mothercut
         )
@@ -590,7 +667,7 @@ class B2XTauTauConf(LineBuilder):
             ]
 
         Combine = DaVinci__N3BodyDecays(DecayDescriptors=descriptors,
-                                        Combination12Cut="AM<6000",
+                                        Combination12Cut="AM < %(M12_HIGH_BU2K1TAUTAU)s" % config,
                                         CombinationCut=combcut,
                                         MotherCut=mothercut)
 
@@ -619,7 +696,7 @@ class B2XTauTauConf(LineBuilder):
         
         Combine = DaVinci__N3BodyDecays(
             DecayDescriptors=descriptors,
-            Combination12Cut="AM<5000",
+            Combination12Cut="AM < %(M12_HIGH_BU2KTAUTAU)s" % config,
             CombinationCut=combcut,
             MotherCut=mothercut
         )
@@ -637,8 +714,10 @@ class B2XTauTauConf(LineBuilder):
                                  FILTER=self.FilterSPD,
                                  selection=sel,
                                  MaxCandidates=50
-        )
-        if 'DDK' in name:
+                             )
+        if 'DDKSS' in name:
+            line.RelatedInfoTools=config['RelInfoTools_DDKSS']
+        elif 'DDK' in name:
             line.RelatedInfoTools=config['RelInfoTools_DDK']
         elif "SS" in name:
             line.RelatedInfoTools=config['RelInfoTools_XTauTau_SS']
-- 
GitLab