Skip to content
Snippets Groups Projects

Adding of run 1 and 2 QEE A2MuMu lines to run 3

Open Arno Heister requested to merge QEE_A2MuMuLines into qee_upgrade
All threads resolved!
Files
16
###############################################################################
###############################################################################
# (c) Copyright 2019 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2025 CERN for the benefit of the LHCb Collaboration #
# #
# #
# This software is distributed under the terms of the GNU General Public #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
@@ -31,8 +31,11 @@ Hlt2QEE_BpToMajoE_MajoToMuE_SS_DD_Tight: tight PID cut line for the B(_c)+ -> e
@@ -31,8 +31,11 @@ Hlt2QEE_BpToMajoE_MajoToMuE_SS_DD_Tight: tight PID cut line for the B(_c)+ -> e
Hlt2QEE_BpToMajoE_MajoToMuE_OS_LL_Tight: tight PID cut line for the B(_c)+ -> e HNL(-> mu- e, LL)
Hlt2QEE_BpToMajoE_MajoToMuE_OS_LL_Tight: tight PID cut line for the B(_c)+ -> e HNL(-> mu- e, LL)
Hlt2QEE_BpToMajoE_MajoToMuE_OS_DD_Tight: tight PID cut line for the B(_c)+ -> e HNL(-> mu- e, DD)
Hlt2QEE_BpToMajoE_MajoToMuE_OS_DD_Tight: tight PID cut line for the B(_c)+ -> e HNL(-> mu- e, DD)
Contact: Louis Henry, louis.henry@cern.ch
Contact:
- Spencer Collaviti, spencer.collaviti@cern.ch
 
- Andrea Merli, andrea.merli@cern.ch
 
- Lisa Fantini, lisa.fantini@cern.ch
 
- Viacheslav Duk, viacheslav.duk@cern.ch
"""
"""
import Functors as F
import Functors as F
@@ -93,20 +96,20 @@ def _custom_monitoring_params(pvs, ptName):
@@ -93,20 +96,20 @@ def _custom_monitoring_params(pvs, ptName):
defaultCutDict = {
defaultCutDict = {
"LL": {
"LL": {
"AllTracks": {"P": 2000.0 * MeV},
"AllTracks": {"P": 2000.0 * MeV, "TRCHI2NDOFMAX": 3.0, "GHOSTPROBMAX": 0.4},
"Children": {"MINIPCHI2PV": 200},
"Children": {"MINIPCHI2PV": 200},
"Bachelor": {},
"Bachelor": {},
"Child1": {},
"Child1": {},
"Child2": {},
"Child2": {},
"Majo": {
"Majo": {
"FDCHI2MIN": 2000,
"FDCHI2MIN": 2000,
"MASS": [0.2 * GeV, 6.0 * GeV],
"MASS": [1.0 * GeV, 6.5 * GeV],
"MINIPCHI2PV": 20,
"MINIPCHI2PV": 20,
},
},
"B": {"MASS": [4.0 * GeV, 7.0 * GeV]},
"B": {"MASS": [4.0 * GeV, 7.0 * GeV]},
},
},
"DD": {
"DD": {
"AllTracks": {"P": 2000.0 * MeV},
"AllTracks": {"P": 2000.0 * MeV, "TRCHI2NDOFMAX": 3.0, "GHOSTPROBMAX": 0.4},
"Children": {},
"Children": {},
"Bachelor": {},
"Bachelor": {},
"Child1": {},
"Child1": {},
@@ -117,7 +120,7 @@ defaultCutDict = {
@@ -117,7 +120,7 @@ defaultCutDict = {
}
}
child_muon_pidCut = [F.ISMUON, F.PID_MU > 0.0]
child_muon_pidCut = [F.ISMUON, F.PID_MU > 0.0]
bach_muon_pidCut = [F.PID_MU > 2]
bach_muon_pidCut = [F.ISMUON, F.PID_MU > 2]
electron_pidCut = [F.PID_E > -2]
electron_pidCut = [F.PID_E > -2]
@@ -136,13 +139,16 @@ def buildFromList(cutList):
@@ -136,13 +139,16 @@ def buildFromList(cutList):
# Build a cut from a dictionnary
# Build a cut from a dictionnary
def build_cut_on_track(cutDict, pvs):
def build_cut_on_track(cutDict, pvs, corrm=False):
listOfFunctors = []
listOfFunctors = []
for cut, cutVal in cutDict.items():
for cut, cutVal in cutDict.items():
if cut == "PIDCuts":
if cut == "PIDCuts":
listOfFunctors += cutVal
listOfFunctors += cutVal
elif cut == "MASS":
elif cut == "MASS":
listOfFunctors.append(in_range(cutVal[0], F.MASS, cutVal[1]))
if corrm:
 
listOfFunctors.append(in_range(cutVal[0], F.OWNPVCORRM(), cutVal[1]))
 
else:
 
listOfFunctors.append(in_range(cutVal[0], F.MASS, cutVal[1]))
else:
else:
functors = {
functors = {
"P": F.P,
"P": F.P,
@@ -151,6 +157,8 @@ def build_cut_on_track(cutDict, pvs):
@@ -151,6 +157,8 @@ def build_cut_on_track(cutDict, pvs):
"FDCHI2MIN": F.OWNPVFDCHI2,
"FDCHI2MIN": F.OWNPVFDCHI2,
"FDCHI2MAX": F.OWNPVFDCHI2,
"FDCHI2MAX": F.OWNPVFDCHI2,
"MAXDOCA": F.MAXDOCA(),
"MAXDOCA": F.MAXDOCA(),
 
"TRCHI2NDOFMAX": F.CHI2DOF,
 
"GHOSTPROBMAX": F.GHOSTPROB,
}
}
if "MAX" in cut:
if "MAX" in cut:
listOfFunctors.append(functors[cut] < cutVal)
listOfFunctors.append(functors[cut] < cutVal)
@@ -161,18 +169,10 @@ def build_cut_on_track(cutDict, pvs):
@@ -161,18 +169,10 @@ def build_cut_on_track(cutDict, pvs):
return buildFromList(listOfFunctors)
return buildFromList(listOfFunctors)
def build_combination_cut(cutDict, pvs):
def builder_BToMajoL_line(name, bachelorName, children, cutDict=None, prescale=1):
listOfFunctors = []
if cutDict is None:
for cut, cutVal in cutDict.items():
cutDict = {}
if cut == "MASS":
listOfFunctors.append(in_range(cutVal[0], F.MASS, cutVal[1]))
# Build the cut
return buildFromList(listOfFunctors)
def builder_BToMajoL_line(
name, bachelorName, children, cutDict={}, prescale=1, persistreco=True
):
pvs = make_pvs
pvs = make_pvs
# Interpret name into a B decay
# Interpret name into a B decay
majoDecayDescr = "KS0 -> " + children[0] + "+ " + children[1] + "-"
majoDecayDescr = "KS0 -> " + children[0] + "+ " + children[1] + "-"
@@ -221,8 +221,7 @@ def builder_BToMajoL_line(
@@ -221,8 +221,7 @@ def builder_BToMajoL_line(
[firstChild, secondChild],
[firstChild, secondChild],
name="Majo2" + children[0] + children[1] + "_" + recoMode + "_{hash}",
name="Majo2" + children[0] + children[1] + "_" + recoMode + "_{hash}",
DecayDescriptor=majoDecayDescr,
DecayDescriptor=majoDecayDescr,
CombinationCut=build_combination_cut(cutDict["Majo"], pvs),
CompositeCut=build_cut_on_track(cutDict["Majo"], pvs, corrm=True),
CompositeCut=build_cut_on_track(cutDict["Majo"], pvs),
)
)
# Bachelor
# Bachelor
bachelor = make_filter_tracks(
bachelor = make_filter_tracks(
@@ -235,7 +234,6 @@ def builder_BToMajoL_line(
@@ -235,7 +234,6 @@ def builder_BToMajoL_line(
[majo, bachelor],
[majo, bachelor],
name=name + "_{hash}",
name=name + "_{hash}",
DecayDescriptor="[B+ -> KS0 " + bachelorName + "+]cc",
DecayDescriptor="[B+ -> KS0 " + bachelorName + "+]cc",
CombinationCut=build_combination_cut(cutDict["B"], pvs),
CompositeCut=build_cut_on_track(cutDict["B"], pvs),
CompositeCut=build_cut_on_track(cutDict["B"], pvs),
)
)
Loading