4 from basf2
import B2ERROR
5 import modularAnalysis
as ma
6 from stdCharged
import stdPi, stdPr
10 def stdKshorts(prioritiseV0=True, fitter='TreeFit', path=None):
12 Load a combined list of the Kshorts list from V0 objects merged with
13 a list of particles combined using the analysis ParticleCombiner module.
15 The ParticleList is named ``K_S0:merged``. A vertex fit is performed and only
16 candidates with an invariant mass in the range :math:`0.450 < M < 0.550~GeV`,
17 and for which the vertex fit did not fail, are kept.
19 The vertex fitter can be selected among ``TreeFit``, ``KFit``, and ``Rave``.
22 prioritiseV0 (bool): should the V0 mdst objects be prioritised when merging?
23 fitter (str): vertex fitter name, valid options are ``TreeFit``, ``KFit``, and ``Rave``.
24 path (basf2.Path): the path to load the modules
27 ma.fillParticleList(
'K_S0:V0 -> pi+ pi-',
'0.3 < M < 0.7',
True, path=path)
29 if fitter ==
'TreeFit':
31 elif fitter ==
'KFit':
33 elif fitter ==
'Rave':
34 vertex.raveFit(
'K_S0:V0', conf_level=0.0, path=path, silence_warning=
True)
36 B2ERROR(
"Valid fitter options for Kshorts are 'TreeFit', 'KFit', and 'Rave'. However, the latter is not recommended.")
37 ma.applyCuts(
'K_S0:V0',
'0.450 < M < 0.550', path=path)
39 stdPi(
'all', path=path)
40 ma.reconstructDecay(
'K_S0:RD -> pi+:all pi-:all',
'0.3 < M < 0.7', 1,
True, path=path)
42 if fitter ==
'TreeFit':
44 elif fitter ==
'KFit':
46 elif fitter ==
'Rave':
47 vertex.raveFit(
'K_S0:RD', conf_level=0.0, path=path, silence_warning=
True)
48 ma.applyCuts(
'K_S0:RD',
'0.450 < M < 0.550', path=path)
50 ma.mergeListsWithBestDuplicate(
'K_S0:merged', [
'K_S0:V0',
'K_S0:RD'],
51 variable=
'particleSource', preferLowest=prioritiseV0, path=path)
54 def goodBelleKshort(path):
56 Load the Belle goodKshort list. Creates a ParticleList named
57 ``K_S0:legacyGoodKS``. A vertex fit is performed and only candidates that
58 satisfy the :b2:var:`goodBelleKshort` criteria, with an invariant mass in the range
59 :math:`0.468 < M < 0.528~GeV`, and for which the vertex fit did not fail, are kept
62 path (basf2.Path): the path to load the modules
64 ma.fillParticleList(
'K_S0:legacyGoodKS -> pi+ pi-',
'0.3 < M < 0.7',
True, path=path)
65 vertex.kFit(
'K_S0:legacyGoodKS', conf_level=0.0, path=path)
66 ma.applyCuts(
'K_S0:legacyGoodKS',
'0.468 < M < 0.528 and goodBelleKshort==1', path=path)
69 def stdLambdas(prioritiseV0=True, fitter='TreeFit', path=None):
71 Load a combined list of the Lambda list from V0 objects merged with
72 a list of particles combined using the analysis ParticleCombiner module.
74 The ParticleList is named ``Lambda0:merged``. A vertex fit is performed and only
75 candidates with an invariant mass in the range :math:`1.10 < M < 1.13~GeV`,
76 and for which the vertex fit did not fail, are kept.
78 The vertex fitter can be selected among ``TreeFit``, ``KFit``, and ``Rave``.
81 prioritiseV0 (bool): should the V0 mdst objects be prioritised when merging?
82 fitter (str): vertex fitter name, valid options are ``TreeFit``, ``KFit``, and ``Rave``.
83 path (basf2.Path): the path to load the modules
86 ma.fillParticleList(
'Lambda0:V0 -> p+ pi-',
'0.9 < M < 1.3',
True, path=path)
88 if fitter ==
'TreeFit':
90 elif fitter ==
'KFit':
91 vertex.kFit(
'Lambda0:V0', conf_level=0.0, path=path)
92 elif fitter ==
'Rave':
93 vertex.raveFit(
'Lambda0:V0', conf_level=0.0, path=path, silence_warning=
True)
95 B2ERROR(
"Valid fitter options for Lambdas are 'TreeFit', 'KFit', and 'Rave'. However, the latter is not recommended.")
96 ma.applyCuts(
'Lambda0:V0',
'1.10 < M < 1.13', path=path)
98 ma.markDuplicate(
'Lambda0:V0',
False, path=path)
99 ma.applyCuts(
'Lambda0:V0',
'extraInfo(highQualityVertex)', path=path)
101 stdPi(
'all', path=path)
102 stdPr(
'all', path=path)
103 ma.reconstructDecay(
'Lambda0:RD -> p+:all pi-:all',
'0.9 < M < 1.3', 1,
True, path=path)
105 if fitter ==
'TreeFit':
107 elif fitter ==
'KFit':
108 vertex.kFit(
'Lambda0:RD', conf_level=0.0, path=path)
109 elif fitter ==
'Rave':
110 vertex.raveFit(
'Lambda0:RD', conf_level=0.0, path=path, silence_warning=
True)
111 ma.applyCuts(
'Lambda0:RD',
'1.10 < M < 1.13', path=path)
113 ma.markDuplicate(
'Lambda0:RD',
False, path=path)
114 ma.applyCuts(
'Lambda0:RD',
'extraInfo(highQualityVertex)', path=path)
115 ma.mergeListsWithBestDuplicate(
'Lambda0:merged', [
'Lambda0:V0',
'Lambda0:RD'],
116 variable=
'particleSource', preferLowest=prioritiseV0, path=path)