Skip to content
Snippets Groups Projects
Commit 267473fc authored by Louis Henry's avatar Louis Henry Committed by Sebastien Ponce
Browse files

Add HNL lines for an HNL decaying into two leptons

parent 5fa3f567
No related branches found
No related tags found
2 merge requests!4232Run5: rebase, restructure run5 code, add back examples,!2991Add HNL lines for an HNL decaying into two leptons
###############################################################################
# (c) Copyright 2019 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
"""
This defines HLT2 lines for B+(-)/B_c+(-) -> (X) mu N, N-> l l' nu where N is a neutral lepton
N has no lifetime hypothesis applied. Combination of the neutral lepton daugthers is limited between 200(to cut conversion)-7000 MeV
All leptons from B are Long. Daughters of the neutral lepton can be both Long and Downstream.
Loose and Tight lines have a different PID cut looseness on pions and electrons. Note, PID_E is applied to pions too, so there is a need for a no_brem added calibration.
Tight lines will hopefully have raw event information saved, specifically tracking infor.
List of lines (LL - Long, DD - downstream):
Hlt2QEE_BpToMajoMu_MajoToMuMu_LL_Tight: tight PID cut line for the B(_c)+ -> mu HNL(-> mu mu, LL)
Hlt2QEE_BpToMajoMu_MajoToMuMu_DD_Tight: tight PID cut line for the B(_c)+ -> mu HNL(-> mu mu, DD)
Hlt2QEE_BpToMajoMu_MajoToMuE_SS_LL_Tight: tight PID cut line for the B(_c)+ -> mu HNL(-> mu+ e, LL)
Hlt2QEE_BpToMajoMu_MajoToMuE_SS_DD_Tight: tight PID cut line for the B(_c)+ -> mu HNL(-> mu+ e, DD)
Hlt2QEE_BpToMajoMu_MajoToMuE_OS_LL_Tight: tight PID cut line for the B(_c)+ -> mu HNL(-> mu- e, LL)
Hlt2QEE_BpToMajoMu_MajoToMuE_OS_DD_Tight: tight PID cut line for the B(_c)+ -> mu HNL(-> mu- e, DD)
Hlt2QEE_BpToMajoE_MajoToMuMu_LL_Tight: tight PID cut line for the B(_c)+ -> e HNL(-> mu mu, LL)
Hlt2QEE_BpToMajoE_MajoToMuMu_DD_Tight: tight PID cut line for the B(_c)+ -> e HNL(-> mu mu, DD)
Hlt2QEE_BpToMajoE_MajoToMuE_SS_LL_Tight: tight PID cut line for the B(_c)+ -> e HNL(-> mu+ e, LL)
Hlt2QEE_BpToMajoE_MajoToMuE_SS_DD_Tight: tight PID cut line for the B(_c)+ -> e HNL(-> mu+ e, DD)
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)
Contact: Louis Henry, louis.henry@cern.ch
"""
from Moore.config import register_line_builder
from Moore.lines import Hlt2Line
from GaudiKernel.SystemOfUnits import MeV
from Hlt2Conf.standard_particles import (
make_long_muons, make_long_electrons_with_brem, make_down_muons,
make_down_electrons_no_brem)
from RecoConf.reconstruction_objects import make_pvs
from Hlt2Conf.lines.qee.qee_builders import make_majorana_lepton, make_bhadron_majorana, hnl_prefilter, make_majorana
import Functors as F
all_lines = {}
_HNL_MONITORING_VARIABLES = ("pt", "eta", "vchi2", "ipchi2", "n_candidates")
_defaultCutDict = {
"Bachelor_MIN_PT": 700 * MeV,
"Child1_MIN_PT": 700 * MeV,
"Child2_MIN_PT": 700 * MeV,
}
def builder_BToMajoL_line(name,
cutDict=_defaultCutDict,
prescale=1,
persistreco=True):
pvs = make_pvs
# Interpret name into a B decay
bachelorName = "mu" if name.find("MajoMu") != -1 else "e"
bachelorContainer = {
"mu": make_long_muons,
"e": make_long_electrons_with_brem
}[bachelorName]
bachelorAddCuts = {"mu": {"pid": F.ISMUON}, "e": {}}[bachelorName]
bachelorContName = {
"mu": "majo_long_muons_{hash}",
"e": "majo_long_electrons_with_brem_{hash}"
}[bachelorName]
#Interpret name into a majorana constructor
recoMode = "LL" if name.find("LL") != -1 else "DD"
recoName1 = {"L": "long", "D": "down"}[recoMode[0]]
recoName2 = {"L": "long", "D": "down"}[recoMode[1]]
children = ("mu", "mu") if name.find("ToMuMu") != -1 else (
"e", "e") if name.find("ToEE") != -1 else (
"mu", "e") if name.find("SS") != -1 else ("e", "mu")
descr = "[KS0 -> " + children[0] + "+ " + children[1] + "-]cc"
constructors = {
"LL": {
"mu": make_long_muons,
"e": make_long_electrons_with_brem
},
"DD": {
"mu": make_down_muons,
"e": make_down_electrons_no_brem
}
}
childrenNames = {
"mu_long": "long_muons",
"mu_down": "down_muons",
"e_long": "long_electrons_with_brem",
"e_down": "down_electrons_without_brem",
}
childName1 = childrenNames[children[0] + "_" + recoName1]
childName2 = childrenNames[children[1] + "_" + recoName2]
addCut1 = {}
addCut2 = {}
if recoMode == "DD":
addCut1["mipchi2dvprimary_min"] = None
addCut2["mipchi2dvprimary_min"] = None
if children[0] == "muons":
addCut1["pid"] = F.ISMUON
if children[1] == "muons":
addCut2["pid"] = F.ISMUON
firstChild = make_majorana_lepton(
leptons=constructors[recoMode][children[0]],
name="majo_" + childName1 + "_{hash}",
pvs=pvs,
pt_min=cutDict["Child1_MIN_PT"],
**(addCut1))
secondChild = make_majorana_lepton(
leptons=constructors[recoMode][children[1]],
name="majo_" + childName2 + "_{hash}",
pvs=pvs,
pt_min=cutDict["Child2_MIN_PT"],
**(addCut2))
majo = make_majorana(
name="Majo2" + children[0] + children[1] + "_" + recoMode + "_{hash}",
child1=firstChild,
child2=secondChild,
descriptor=descr)
#Bachelor
bachelor = make_majorana_lepton(
leptons=bachelorContainer,
name=bachelorContName,
pvs=pvs,
pt_min=cutDict["Bachelor_MIN_PT"],
**bachelorAddCuts)
#Decay
b2LN = make_bhadron_majorana(
name=name + '_{hash}',
majoranas=majo,
bachelor=bachelor,
pvs=pvs,
descriptor='[B+ -> KS0 ' + bachelorName + '+]cc')
return Hlt2Line(
name=name,
algs=hnl_prefilter() + [majo, b2LN],
prescale=prescale,
monitoring_variables=_HNL_MONITORING_VARIABLES)
@register_line_builder(all_lines)
def BpToMajoMu_MajoToMuMu_LL_Tight_line(
name="Hlt2QEE_BpToMajoMu_MajoToMuMu_LL_Tight"):
return builder_BToMajoL_line(name)
@register_line_builder(all_lines)
def BpToMajoMu_MajoToMuE_LL_Tight_line(
name="Hlt2QEE_BpToMajoMu_MajoToMuE_SS_LL_Tight"):
return builder_BToMajoL_line(name)
@register_line_builder(all_lines)
def BpToMajoMu_MajoToEMu_LL_Tight_line(
name="Hlt2QEE_BpToMajoMu_MajoToEMu_OS_LL_Tight"):
return builder_BToMajoL_line(name)
@register_line_builder(all_lines)
def BpToMajoMu_MajoToEE_LL_Tight_line(
name="Hlt2QEE_BpToMajoMu_MajoToEE_LL_Tight",
cutDict={
"Bachelor_MIN_PT": 1000 * MeV,
"Child1_MIN_PT": 1000 * MeV,
"Child2_MIN_PT": 1000 * MeV,
}):
return builder_BToMajoL_line(name, cutDict)
# B-> eN
@register_line_builder(all_lines)
def BpToMajoE_MajoToMuMu_LL_Tight_line(
name="Hlt2QEE_BpToMajoE_MajoToMuMu_LL_Tight"):
return builder_BToMajoL_line(name)
@register_line_builder(all_lines)
def BpToMajoE_MajoToMuE_LL_Tight_line(
name="Hlt2QEE_BpToMajoE_MajoToMuE_SS_LL_Tight"):
return builder_BToMajoL_line(name)
@register_line_builder(all_lines)
def BpToMajoE_MajoToEMu_LL_Tight_line(
name="Hlt2QEE_BpToMajoE_MajoToEMu_OS_LL_Tight"):
return builder_BToMajoL_line(name)
@register_line_builder(all_lines)
def BpToMajoE_MajoToEE_LL_Tight_line(
name="Hlt2QEE_BpToMajoE_MajoToEE_LL_Tight",
cutDict={
"Bachelor_MIN_PT": 1000 * MeV,
"Child1_MIN_PT": 1000 * MeV,
"Child2_MIN_PT": 1000 * MeV,
}):
return builder_BToMajoL_line(name, cutDict)
......@@ -48,29 +48,16 @@ from Hlt2Conf.standard_particles import (
from RecoConf.reconstruction_objects import make_pvs
from Hlt2Conf.lines.qee.qee_builders import make_majorana_lepton, make_majorana, make_bhadron_majorana, filter_neutral_hadrons
from Hlt2Conf.lines.qee.qee_builders import make_majorana_lepton, make_majorana, make_bhadron_majorana, filter_neutral_hadrons, hnl_prefilter
import Functors as F
all_lines = {}
_HNL_MONITORING_VARIABLES = ("pt", "eta", "vchi2", "ipchi2", "n_candidates")
def hnl_prefilter(require_GEC=False):
from RecoConf.event_filters import require_pvs, require_gec
from RecoConf.reconstruction_objects import (make_pvs,
upfront_reconstruction)
"""
Args:
require_GEC (bool, optional): require the General Event Cut.
"""
gec = [require_gec()] if require_GEC else []
return upfront_reconstruction() + gec + [require_pvs(make_pvs())]
@register_line_builder(all_lines)
def BpToMajoMu_MajoToEPi_LL_Tight_line(
name="Hlt2QEE_BpToMajoMu_MajoToEPi_LL_Tight", prescale=1,
presistreco=True):
name="Hlt2QEE_BpToMajoMu_MajoToEPi_LL_Tight", prescale=1):
pvs = make_pvs
muons = make_majorana_lepton(
......@@ -94,14 +81,14 @@ def BpToMajoMu_MajoToEPi_LL_Tight_line(
majoranas2piE = make_majorana(
name='Majo2epi_{hash}',
pions=pions,
leptons=electrons_with_brem,
child1=pions,
child2=electrons_with_brem,
descriptor='[KS0 -> e- pi+]cc')
b2MuN = make_bhadron_majorana(
name='B2MajoMu_{hash}',
majoranas=majoranas2piE,
leptons=muons,
bachelor=muons,
pvs=pvs,
descriptor='[B+ -> KS0 mu+]cc')
......@@ -114,8 +101,7 @@ def BpToMajoMu_MajoToEPi_LL_Tight_line(
@register_line_builder(all_lines)
def BpToMajoE_MajoToMuPi_LL_Tight_line(
name="Hlt2QEE_BpToMajoE_MajoToMuPi_LL_Tight", prescale=1,
presistreco=True):
name="Hlt2QEE_BpToMajoE_MajoToMuPi_LL_Tight", prescale=1):
pvs = make_pvs
muons = make_majorana_lepton(
......@@ -139,14 +125,14 @@ def BpToMajoE_MajoToMuPi_LL_Tight_line(
majoranas2piMu = make_majorana(
name='Majo2mupi_{hash}',
pions=pions,
leptons=muons,
child1=pions,
child2=muons,
descriptor='[KS0 -> mu- pi+]cc')
b2EN = make_bhadron_majorana(
name='B2MajoE_{hash}',
majoranas=majoranas2piMu,
leptons=electrons_with_brem,
bachelor=electrons_with_brem,
pvs=pvs,
descriptor='[B+ -> KS0 e+]cc')
......@@ -159,8 +145,7 @@ def BpToMajoE_MajoToMuPi_LL_Tight_line(
@register_line_builder(all_lines)
def BpToMajoMu_MajoToEPi_DD_Tight_line(
name="Hlt2QEE_BpToMajoMu_MajoToEPi_DD_Tight", prescale=1,
presistreco=True):
name="Hlt2QEE_BpToMajoMu_MajoToEPi_DD_Tight", prescale=1):
pvs = make_pvs
muons = make_majorana_lepton(
......@@ -188,14 +173,14 @@ def BpToMajoMu_MajoToEPi_DD_Tight_line(
majoranas2piE = make_majorana(
name='Majo2epi_{hash}',
pions=down_pions,
leptons=down_electrons_without_brem,
child1=down_pions,
child2=down_electrons_without_brem,
descriptor='[KS0 -> e- pi+]cc')
b2MuN = make_bhadron_majorana(
name='B2MajoMu_{hash}',
majoranas=majoranas2piE,
leptons=muons,
bachelor=muons,
pvs=pvs,
descriptor='[B+ -> KS0 mu+]cc')
return Hlt2Line(
......@@ -207,8 +192,8 @@ def BpToMajoMu_MajoToEPi_DD_Tight_line(
@register_line_builder(all_lines)
def BpToMajoE_MajoToMuPi_DD_Tight_line(
name="Hlt2QEE_BpToMajoE_MajoToMuPi_DD_Tight", prescale=1,
presistreco=True):
name="Hlt2QEE_BpToMajoE_MajoToMuPi_DD_Tight", prescale=1):
pvs = make_pvs
electrons_with_brem = make_majorana_lepton(
......@@ -236,15 +221,15 @@ def BpToMajoE_MajoToMuPi_DD_Tight_line(
majoranas2piMu = make_majorana(
name='Majo2mupi_{hash}',
pions=down_pions,
leptons=down_muons,
child1=down_pions,
child2=down_muons,
descriptor='[KS0 -> mu- pi+]cc',
)
b2EN = make_bhadron_majorana(
name='B2MajoE_{hash}',
majoranas=majoranas2piMu,
leptons=electrons_with_brem,
bachelor=electrons_with_brem,
pvs=pvs,
descriptor='[B+ -> KS0 e+]cc')
......@@ -257,9 +242,8 @@ def BpToMajoE_MajoToMuPi_DD_Tight_line(
@register_line_builder(all_lines)
def BpToMajoMu_MajoToEPi_LL_Loose_line(
name="Hlt2QEE_BpToMajoMu_MajoToEPi_LL_Loose",
prescale=1,
presistreco=False):
name="Hlt2QEE_BpToMajoMu_MajoToEPi_LL_Loose", prescale=1):
pvs = make_pvs
muons = make_majorana_lepton(
......@@ -283,14 +267,14 @@ def BpToMajoMu_MajoToEPi_LL_Loose_line(
majoranas2piE = make_majorana(
name='Majo2epi_{hash}',
pions=pions,
leptons=electrons_with_brem,
child1=pions,
child2=electrons_with_brem,
descriptor='[KS0 -> e- pi+]cc')
b2MuN = make_bhadron_majorana(
name='B2MajoMu_{hash}',
majoranas=majoranas2piE,
leptons=muons,
bachelor=muons,
pvs=pvs,
descriptor='[B+ -> KS0 mu+]cc')
......@@ -303,9 +287,7 @@ def BpToMajoMu_MajoToEPi_LL_Loose_line(
@register_line_builder(all_lines)
def BpToMajoE_MajoToMuPi_LL_Loose_line(
name="Hlt2QEE_BpToMajoE_MajoToMuPi_LL_Loose",
prescale=1,
presistreco=False):
name="Hlt2QEE_BpToMajoE_MajoToMuPi_LL_Loose", prescale=1):
pvs = make_pvs
muons = make_majorana_lepton(
......@@ -329,14 +311,14 @@ def BpToMajoE_MajoToMuPi_LL_Loose_line(
majoranas2piMu = make_majorana(
name='Majo2mupi_{hash}',
pions=pions,
leptons=muons,
child1=pions,
child2=muons,
descriptor='[KS0 -> mu- pi+]cc')
b2EN = make_bhadron_majorana(
name='B2MajoE_{hash}',
majoranas=majoranas2piMu,
leptons=electrons_with_brem,
bachelor=electrons_with_brem,
pvs=pvs,
descriptor='[B+ -> KS0 e+]cc')
......@@ -349,9 +331,7 @@ def BpToMajoE_MajoToMuPi_LL_Loose_line(
@register_line_builder(all_lines)
def BpToMajoMu_MajoToEPi_DD_Loose_line(
name="Hlt2QEE_BpToMajoMu_MajoToEPi_DD_Loose",
prescale=1,
presistreco=False):
name="Hlt2QEE_BpToMajoMu_MajoToEPi_DD_Loose", prescale=1):
pvs = make_pvs
muons = make_majorana_lepton(
......@@ -379,14 +359,14 @@ def BpToMajoMu_MajoToEPi_DD_Loose_line(
majoranas2piE = make_majorana(
name='Majo2epi_{hash}',
pions=down_pions,
leptons=down_electrons_without_brem,
child1=down_pions,
child2=down_electrons_without_brem,
descriptor='[KS0 -> e- pi+]cc')
b2MuN = make_bhadron_majorana(
name='B2MajoMu_{hash}',
majoranas=majoranas2piE,
leptons=muons,
bachelor=muons,
pvs=pvs,
descriptor='[B+ -> KS0 mu+]cc')
return Hlt2Line(
......@@ -398,9 +378,7 @@ def BpToMajoMu_MajoToEPi_DD_Loose_line(
@register_line_builder(all_lines)
def BpToMajoE_MajoToMuPi_DD_Loose_line(
name="Hlt2QEE_BpToMajoE_MajoToMuPi_DD_Loose",
prescale=1,
presistreco=False):
name="Hlt2QEE_BpToMajoE_MajoToMuPi_DD_Loose", prescale=1):
pvs = make_pvs
electrons_with_brem = make_majorana_lepton(
......@@ -428,15 +406,15 @@ def BpToMajoE_MajoToMuPi_DD_Loose_line(
majoranas2piMu = make_majorana(
name='Majo2mupi_{hash}',
pions=down_pions,
leptons=down_muons,
child1=down_pions,
child2=down_muons,
descriptor='[KS0 -> mu- pi+]cc',
)
b2EN = make_bhadron_majorana(
name='B2MajoE_{hash}',
majoranas=majoranas2piMu,
leptons=electrons_with_brem,
bachelor=electrons_with_brem,
pvs=pvs,
descriptor='[B+ -> KS0 e+]cc')
......@@ -449,8 +427,8 @@ def BpToMajoE_MajoToMuPi_DD_Loose_line(
@register_line_builder(all_lines)
def BuToKs0Pi_Ks0ToPiPi_LL_line(name="Hlt2QEE_BuToKs0Pi_Ks0ToPiPi_LL",
prescale=1,
presistreco=False):
prescale=1):
pvs = make_pvs
b_pions = make_majorana_lepton(
......@@ -465,7 +443,7 @@ def BuToKs0Pi_Ks0ToPiPi_LL_line(name="Hlt2QEE_BuToKs0Pi_Ks0ToPiPi_LL",
b2Ks0Pi = make_bhadron_majorana(
name='B2KsPi_LL_{hash}',
majoranas=Ks2pipi,
leptons=b_pions,
bachelor=b_pions,
pvs=pvs,
am_min=5000.,
am_max=5600.,
......@@ -482,8 +460,7 @@ def BuToKs0Pi_Ks0ToPiPi_LL_line(name="Hlt2QEE_BuToKs0Pi_Ks0ToPiPi_LL",
@register_line_builder(all_lines)
def BuToKs0Pi_Ks0ToPiPi_DD_line(name="Hlt2QEE_BuToKs0Pi_Ks0ToPiPi_DD",
prescale=1,
presistreco=False):
prescale=1):
pvs = make_pvs
long_pions = make_majorana_lepton(
......@@ -497,7 +474,7 @@ def BuToKs0Pi_Ks0ToPiPi_DD_line(name="Hlt2QEE_BuToKs0Pi_Ks0ToPiPi_DD",
b2Ks0Pi = make_bhadron_majorana(
name='B2KsPi_DD_{hash}',
majoranas=Ks2pipi,
leptons=long_pions,
bachelor=long_pions,
pvs=pvs,
am_min=5000.,
am_max=5600.,
......
......@@ -18,6 +18,7 @@ from Hlt2Conf.lines.qee import di_bjet
from Hlt2Conf.lines.qee import high_mass_dimuon
from Hlt2Conf.lines.qee import high_mass_dielec
from Hlt2Conf.lines.qee import diphoton
from Hlt2Conf.lines.qee import b_to_majolep_majo_to_leplep
from Hlt2Conf.lines.qee import b_to_majolep_majo_to_leppi
from Hlt2Conf.lines.qee import wz_boson_rare_decays
from Hlt2Conf.lines.qee import drellyan
......@@ -37,6 +38,7 @@ full_lines.update(dielectron_persist_photons.full_lines)
turbo_lines = {}
turbo_lines.update(quarkonia.all_lines)
turbo_lines.update(b_to_majolep_majo_to_leplep.all_lines)
turbo_lines.update(b_to_majolep_majo_to_leppi.all_lines)
turbo_lines.update(diphoton.all_lines)
turbo_lines.update(dimuon_no_ip.turbo_lines)
......
......@@ -210,6 +210,9 @@ def Z_To_lepts_filter(lepton_type="mu", min_pt=10. * GeV):
return zcand
# For HNL lines
@configurable
def filter_neutral_hadrons(particles,
pvs,
......@@ -224,6 +227,18 @@ def filter_neutral_hadrons(particles,
return ParticleFilter(particles, F.FILTER(code), name=name)
def hnl_prefilter(require_GEC=False):
from RecoConf.event_filters import require_pvs, require_gec
from RecoConf.reconstruction_objects import (make_pvs,
upfront_reconstruction)
"""
Args:
require_GEC (bool, optional): require the General Event Cut.
"""
gec = [require_gec()] if require_GEC else []
return upfront_reconstruction() + gec + [require_pvs(make_pvs())]
@configurable
def make_majorana_lepton(leptons,
pvs,
......@@ -246,8 +261,8 @@ def make_majorana_lepton(leptons,
@configurable
def make_majorana(pions,
leptons,
def make_majorana(child1,
child2,
name='Generic_Majorana',
descriptor='',
am_min=0.2 * GeV,
......@@ -262,7 +277,7 @@ def make_majorana(pions,
in_range(am_min, F.MASS, am_max), F.MAXSDOCACHI2CUT(adocachi2))
majorana_code = F.require_all(F.PT > pt_min, F.CHI2 < vtxchi2_max)
return ParticleCombiner([leptons, pions],
return ParticleCombiner([child1, child2],
name=name,
DecayDescriptor=descriptor,
CombinationCut=combination_code,
......@@ -271,7 +286,7 @@ def make_majorana(pions,
@configurable
def make_bhadron_majorana(majoranas,
leptons,
bachelor,
pvs,
name='Generic_B_2_Majorana',
descriptor='',
......@@ -288,7 +303,6 @@ def make_bhadron_majorana(majoranas,
Make B-> lep + HNL
"""
#majoranas = make_majorana()
#leptons = make_majorana()
combination_code = F.require_all(
in_range(am_min, F.MASS, am_max), F.MAXDOCACHI2CUT(adocachi2))
b_code = F.require_all(
......@@ -296,7 +310,7 @@ def make_bhadron_majorana(majoranas,
F.BPVDLS(pvs()) > bpvdls_min, F.CHI2 < vtxchi2_max,
F.BPVDIRA(pvs()) > dira_min,
F.MINIPCHI2(pvs()) < mipchi2_max)
return ParticleCombiner([majoranas, leptons],
return ParticleCombiner([majoranas, bachelor],
name=name,
DecayDescriptor=descriptor,
CombinationCut=combination_code,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment