Belle II Software development
stdKinks.py
1#!/usr/bin/env python3
2
3
10
11import modularAnalysis as ma
12
13
14def stdKKinks(path=None, writeOut=False, daughter='pi+'):
15 """
16 Load a list of kaon kinks from Kink objects using only kinks created from track pairs (Filter 1 and 2).
17 Kaon to muon and kaon to pion decays are hard to distinguish, so they are both saved by default.
18
19 The ParticleList is named ``K+:kinks``. A simple clone suppression is applied based on the
20 combined fit result flag. Loose kinematic cuts to suppress pion decays :math:`pPimu > 0.05~GeV` and
21 muon decays :math:`pPemu > 0.07~GeV` are applied. In addition, events with wrong kinematics are discarded
22 :math:`pKpi < 0.3~GeV`.
23
24 Parameters:
25 path (basf2.Path): the path to load the modules
26 writeOut (bool): whether RootOutput module should save the created ParticleList
27 daughter (str): the daughter to use in the decay string
28 """
29 # Fill list from Kinks
30 decayString = 'K+:kinks -> ' + daughter
31 ma.fillParticleList(decayString, '', writeOut=writeOut, path=path)
32 clonesCut = ('kinkCombinedFitResultFlag > 15 or kinkCombinedFitResultFlagB1==0 and '
33 'kinkCombinedFitResultFlagB2==0 and kinkCombinedFitResultFlagB4==0')
34 ma.applyCuts('K+:kinks',
35 clonesCut,
36 path=path)
37 ma.applyCuts(
38 'K+:kinks',
39 'kinkDaughterMomentumInMotherRestFramePiMuHypothesis > 0.05 and \
40 kinkDaughterMomentumInMotherRestFrameMuEHypothesis > 0.07 and \
41 kinkDaughterMomentumInMotherRestFrameKPiHypothesis < 0.3 and \
42 kinkFilterID < 3',
43 path=path)
44
45
46def stdPiKinks(path=None, writeOut=False, daughter='mu+'):
47 """
48 Load a list of pion kinks from Kink objects using only kinks created from track pairs (Filter 1 and 2).
49
50 The ParticleList is named ``pi+:kinks``. A simple clone suppression is applied based on the
51 combined fit result flag. Loose kinematic cut to suppress other decays is applied :math:`pPimu < 0.1~GeV`.
52
53 Parameters:
54 path (basf2.Path): the path to load the modules
55 writeOut (bool): whether RootOutput module should save the created ParticleList
56 daughter (str): the daughter to use in the decay string
57 """
58 # Fill list from Kinks
59 decayString = 'pi+:kinks -> ' + daughter
60 ma.fillParticleList(decayString, '', writeOut=writeOut, path=path)
61 clonesCut = ('kinkCombinedFitResultFlag > 15 or kinkCombinedFitResultFlagB1==0 and '
62 'kinkCombinedFitResultFlagB2==0 and kinkCombinedFitResultFlagB4==0')
63 ma.applyCuts('pi+:kinks',
64 clonesCut,
65 path=path)
66 ma.applyCuts('pi+:kinks', 'kinkDaughterMomentumInMotherRestFramePiMuHypothesis < 0.1 and kinkFilterID < 3', path=path)
67
68
69def stdMuKinks(path=None, writeOut=False, daughter='e+'):
70 """
71 Load a list of muon kinks from Kink objects using only kinks created from track pairs (Filter 1 and 2).
72
73 The ParticleList is named ``mu+:kinks``. A simple clone suppression is applied based on the
74 combined fit result flag. Loose kinematic cuts to suppress pion decays :math:`pPimu > 0.05~GeV` and
75 kaon decays :math:`pMue < 0.1~GeV` are applied.
76
77 Parameters:
78 path (basf2.Path): the path to load the modules
79 writeOut (bool): whether RootOutput module should save the created ParticleList
80 daughter (str): the daughter to use in the decay string
81 """
82 # Fill list from Kinks
83 decayString = 'mu+:kinks -> ' + daughter
84 ma.fillParticleList(decayString, '', writeOut=writeOut, path=path)
85 clonesCut = ('kinkCombinedFitResultFlag > 15 or kinkCombinedFitResultFlagB1==0 and '
86 'kinkCombinedFitResultFlagB2==0 and kinkCombinedFitResultFlagB4==0')
87 ma.applyCuts('mu+:kinks',
88 clonesCut,
89 path=path)
90 ma.applyCuts(
91 'mu+:kinks',
92 'kinkDaughterMomentumInMotherRestFramePiMuHypothesis > 0.05 and \
93 kinkDaughterMomentumInMotherRestFrameMuEHypothesis < 0.1 and kinkFilterID < 3',
94 path=path)