11 from basf2
import B2ERROR
12 import modularAnalysis
as ma
13 from stdCharged
import stdPi, stdPr
17 def stdKshorts(prioritiseV0=True, fitter='TreeFit', path=None):
19 Load a combined list of the Kshorts list from V0 objects merged with
20 a list of particles combined using the analysis ParticleCombiner module.
22 The ParticleList is named ``K_S0:merged``. A vertex fit is performed and only
23 candidates with an invariant mass in the range :math:`0.450 < M < 0.550~GeV`,
24 and for which the vertex fit did not fail, are kept.
26 The vertex fitter can be selected among ``TreeFit``, ``KFit``, and ``Rave``.
29 prioritiseV0 (bool): should the V0 mdst objects be prioritised when merging?
30 fitter (str): vertex fitter name, valid options are ``TreeFit``, ``KFit``, and ``Rave``.
31 path (basf2.Path): the path to load the modules
34 ma.fillParticleList(
'K_S0:V0 -> pi+ pi-',
'',
True, path=path)
35 ma.cutAndCopyList(
'K_S0:V0_MassWindow',
'K_S0:V0',
'0.3 < M < 0.7', path=path)
37 if fitter ==
'TreeFit':
39 elif fitter ==
'KFit':
40 vertex.kFit(
'K_S0:V0_MassWindow', conf_level=0.0, path=path)
41 elif fitter ==
'Rave':
42 vertex.raveFit(
'K_S0:V0_MassWindow', conf_level=0.0, path=path, silence_warning=
True)
44 B2ERROR(
"Valid fitter options for Kshorts are 'TreeFit', 'KFit', and 'Rave'. However, the latter is not recommended.")
45 ma.applyCuts(
'K_S0:V0_MassWindow',
'0.450 < M < 0.550', path=path)
47 stdPi(
'all', path=path)
48 ma.reconstructDecay(
'K_S0:RD -> pi+:all pi-:all',
'0.3 < M < 0.7', 1,
True, path=path)
50 if fitter ==
'TreeFit':
52 elif fitter ==
'KFit':
54 elif fitter ==
'Rave':
55 vertex.raveFit(
'K_S0:RD', conf_level=0.0, path=path, silence_warning=
True)
56 ma.applyCuts(
'K_S0:RD',
'0.450 < M < 0.550', path=path)
58 ma.mergeListsWithBestDuplicate(
'K_S0:merged', [
'K_S0:V0_MassWindow',
'K_S0:RD'],
59 variable=
'particleSource', preferLowest=prioritiseV0, path=path)
62 def goodBelleKshort(path):
64 Load the Belle goodKshort list. Creates a ParticleList named
65 ``K_S0:legacyGoodKS``. A vertex fit is performed and only candidates that
66 satisfy the :b2:var:`goodBelleKshort` criteria, with an invariant mass in the range
67 :math:`0.468 < M < 0.528~GeV`, and for which the vertex fit did not fail, are kept
70 path (basf2.Path): the path to load the modules
72 ma.fillParticleList(
'K_S0:legacyGoodKS -> pi+ pi-',
'0.3 < M < 0.7',
True, path=path)
73 vertex.kFit(
'K_S0:legacyGoodKS', conf_level=0.0, path=path)
74 ma.applyCuts(
'K_S0:legacyGoodKS',
'0.468 < M < 0.528 and goodBelleKshort==1', path=path)
77 def stdLambdas(prioritiseV0=True, fitter='TreeFit', path=None):
79 Load a combined list of the Lambda list from V0 objects merged with
80 a list of particles combined using the analysis ParticleCombiner module.
82 The ParticleList is named ``Lambda0:merged``. A vertex fit is performed and only
83 candidates with an invariant mass in the range :math:`1.10 < M < 1.13~GeV`,
84 and for which the vertex fit did not fail, are kept.
86 The vertex fitter can be selected among ``TreeFit``, ``KFit``, and ``Rave``.
89 prioritiseV0 (bool): should the V0 mdst objects be prioritised when merging?
90 fitter (str): vertex fitter name, valid options are ``TreeFit``, ``KFit``, and ``Rave``.
91 path (basf2.Path): the path to load the modules
94 ma.fillParticleList(
'Lambda0:V0 -> p+ pi-',
'',
True, path=path)
95 ma.cutAndCopyList(
'Lambda0:V0_MassWindow',
'Lambda0:V0',
'0.9 < M < 1.3', path=path)
97 if fitter ==
'TreeFit':
99 elif fitter ==
'KFit':
100 vertex.kFit(
'Lambda0:V0_MassWindow', conf_level=0.0, path=path)
101 elif fitter ==
'Rave':
102 vertex.raveFit(
'Lambda0:V0_MassWindow', conf_level=0.0, path=path, silence_warning=
True)
104 B2ERROR(
"Valid fitter options for Lambdas are 'TreeFit', 'KFit', and 'Rave'. However, the latter is not recommended.")
105 ma.applyCuts(
'Lambda0:V0_MassWindow',
'1.10 < M < 1.13', path=path)
107 ma.markDuplicate(
'Lambda0:V0_MassWindow',
False, path=path)
108 ma.applyCuts(
'Lambda0:V0_MassWindow',
'extraInfo(highQualityVertex)', path=path)
110 stdPi(
'all', path=path)
111 stdPr(
'all', path=path)
112 ma.reconstructDecay(
'Lambda0:RD -> p+:all pi-:all',
'0.9 < M < 1.3', 1,
True, path=path)
114 if fitter ==
'TreeFit':
116 elif fitter ==
'KFit':
117 vertex.kFit(
'Lambda0:RD', conf_level=0.0, path=path)
118 elif fitter ==
'Rave':
119 vertex.raveFit(
'Lambda0:RD', conf_level=0.0, path=path, silence_warning=
True)
120 ma.applyCuts(
'Lambda0:RD',
'1.10 < M < 1.13', path=path)
122 ma.markDuplicate(
'Lambda0:RD',
False, path=path)
123 ma.applyCuts(
'Lambda0:RD',
'extraInfo(highQualityVertex)', path=path)
124 ma.mergeListsWithBestDuplicate(
'Lambda0:merged', [
'Lambda0:V0_MassWindow',
'Lambda0:RD'],
125 variable=
'particleSource', preferLowest=prioritiseV0, path=path)
def kFit(list_name, conf_level, fit_type='vertex', constraint='', daughtersUpdate=False, decay_string='', massConstraint=[], smearing=0, path=None)
def raveFit(list_name, conf_level, fit_type='vertex', decay_string='', constraint='', daughtersUpdate=False, path=None, silence_warning=False)
def treeFit(list_name, conf_level=0.001, massConstraint=[], ipConstraint=False, updateAllDaughters=False, customOriginConstraint=False, customOriginVertex=[0.001, 0, 0.0116], customOriginCovariance=[0.0048, 0, 0, 0, 0.003567, 0, 0, 0, 0.0400], path=None)