Belle II Software  release-05-02-19
stdHyperons.py
1 #!/usr/bin/env python3
2 
3 from basf2 import B2ERROR, B2WARNING
4 from b2bii import isB2BII
5 from modularAnalysis import cutAndCopyList, reconstructDecay, applyCuts
6 from vertex import treeFit, kFit
7 
8 from stdCharged import stdPi, stdK
9 from stdV0s import stdLambdas
10 from stdPhotons import stdPhotons
11 from stdPi0s import stdPi0s
12 
13 
14 def stdXi(fitter='TreeFit', path=None):
15  r"""
16  Reconstruct the standard :math:`\Xi^-` ``ParticleList`` named ``Xi-:std``.
17 
18  .. seealso:: `BELLE2-NOTE-PH-2019-011 <https://docs.belle2.org/record/BELLE2-NOTE-PH-2019-011.pdf>`_.
19 
20  Parameters:
21  fitter (str): specify either ``KFit`` or ``TreeFit`` for the vertex reconstructions (default ``TreeFit``)
22  path (basf2.Path): modules are added to this path building the ``Xi-:std`` list
23  """
24 
25  if not isB2BII():
26  stdLambdas(path=path)
27  # 3.5 MeV Range around the nominal mass
28  cutAndCopyList(
29  'Lambda0:reco',
30  'Lambda0:merged',
31  '[ abs( dM ) < 0.0035 ] and \
32  [ cosAngleBetweenMomentumAndVertexVector > 0.0 ] and \
33  [ formula( [ dr^2 + dz^2 ]^[0.5] ) > 0.35 ] and \
34  [ daughter(0,protonID) > 0.01 ] and \
35  [ chiProb > 0.0 ]',
36  True, path=path)
37  else:
38  stdPi('all', path=path)
39  # Rough Lambda0 cuts from J. Yelton Observations of an Excited Omega- Baryon
40  kFit('Lambda0:mdst', conf_level=0.0, path=path) # Re-vertexing, recover vertex variables and error matrix
41  cutAndCopyList(
42  'Lambda0:reco',
43  'Lambda0:mdst',
44  '[ abs( dM ) < 0.0035 ] and \
45  [ cosAngleBetweenMomentumAndVertexVector > 0.0 ] and \
46  [ dr > 0.35 ] and \
47  [ daughter(0,atcPIDBelle(4,3)) > 0.2 ] and \
48  [ daughter(0,atcPIDBelle(4,2)) > 0.2 ] and \
49  [ chiProb > 0.0 ]',
50  True, path=path)
51 
52  # stdXi-
53  if fitter == 'KFit':
54  kFit('Lambda0:reco', 0.0, fit_type='massvertex', path=path)
55  reconstructDecay('Xi-:reco -> Lambda0:reco pi-:all', '1.295 < M < 1.35', path=path)
56  kFit('Xi-:reco', conf_level=0.0, path=path)
57  elif fitter == 'TreeFit':
58  reconstructDecay('Xi-:reco -> Lambda0:reco pi-:all', '1.295 < M < 1.35', path=path)
59  treeFit('Xi-:reco', conf_level=0.0, massConstraint=[3122], path=path)
60  else:
61  B2ERROR(f"stdXi: invalid fitter ({fitter}). Choose from KFit or TreeFit")
62 
63  cutAndCopyList(
64  'Xi-:std',
65  'Xi-:reco',
66  '[ cosAngleBetweenMomentumAndVertexVector > 0.0 ] and \
67  [ formula( [ dr^2 + dz^2 ]^[0.5] ) > 0. and \
68  formula([dr^2 + dz^2 ]^[0.5])<formula([daughter(0,dr)^2 + daughter(0,dz)^2]^[0.5])] and \
69  [ chiProb > 0.0 ]',
70  True,
71  path=path)
72 
73 
74 def stdXi0(gammatype='eff40', path=None):
75  r"""
76  Reconstruct the standard :math:`\Xi^0` ``ParticleList`` named ``Xi0:std``.
77 
78  .. seealso:: `BELLE2-NOTE-PH-2019-011 <https://docs.belle2.org/record/BELLE2-NOTE-PH-2019-011.pdf>`_.
79 
80  Parameters:
81  gammatype (str): specify either ``eff60``, ``eff50``, ``eff40``, ``eff30``, or ``eff20``
82  to select the signal efficiency of the photons used in the pi0 reconstruction
83  (default ``eff40``)
84  path (basf2.Path): modules are added to this path building the ``Xi0:std`` list
85  """
86 
87  if not isB2BII():
88  stdLambdas(path=path)
89  # 3.5 MeV Range around nominal mass (~7*sigma_core)
90  cutAndCopyList(
91  'Lambda0:reco',
92  'Lambda0:merged',
93  '[ abs( dM ) < 0.0035 ] and \
94  [ cosAngleBetweenMomentumAndVertexVector > 0.0 ] and \
95  [ formula( [ dr^2 + dz^2 ]^[0.5] ) > 0.35 ] and \
96  [ daughter(0,protonID) > 0.01 ] and \
97  [ chiProb > 0.0 ]',
98  True, path=path)
99  # ~7*sigma Range around nominal mass
100  stdPhotons(f'pi0{gammatype}', path=path)
101  reconstructDecay(f'pi0:reco -> gamma:pi0{gammatype} gamma:pi0{gammatype}',
102  'abs( dM ) < 0.0406',
103  True, path=path)
104 
105  else:
106  # Rough pi0/Lambda0 cuts from J. Yelton Observations of an Excited Omega- Baryon
107  cutAndCopyList(
108  'pi0:reco',
109  'pi0:mdst',
110  '[ abs( dM ) < 0.0189 ] and \
111  [ [ daughter(0,clusterReg) == 1 and daughter(0,E) > 0.05 ] or [ daughter(0,clusterReg) == 3 and daughter(0,E) > 0.05 ] or \
112  [ daughter(0,clusterReg) == 2 and daughter(0,E) > 0.03 ] ] and \
113  [ [ daughter(1,clusterReg) == 1 and daughter(1,E) > 0.05 ] or [ daughter(1,clusterReg) == 3 and daughter(1,E) > 0.05 ] or \
114  [ daughter(1,clusterReg) == 2 and daughter(1,E) > 0.03 ] ]',
115  path=path)
116  kFit('Lambda0:mdst', conf_level=0.0, path=path) # Re-vertexing, recover vertex variables and error matrix
117  cutAndCopyList(
118  'Lambda0:reco',
119  'Lambda0:mdst',
120  '[ abs( dM ) < 0.0035 ] and \
121  [ cosAngleBetweenMomentumAndVertexVector > 0.0 ] and \
122  [ dr > 0.35 ] and \
123  [ daughter(0,atcPIDBelle(4,3)) > 0.2 ] and \
124  [ daughter(0,atcPIDBelle(4,2)) > 0.2 ] and \
125  [ chiProb > 0.0 ]',
126  True, path=path)
127 
128  reconstructDecay(
129  'Xi0:prelim -> Lambda0:reco pi0:reco',
130  '1.225 < M < 1.405',
131  path=path)
132  treeFit('Xi0:prelim', conf_level=0.0, massConstraint=[3122], ipConstraint=True, updateAllDaughters=True, path=path)
133  # Selecting ~4*sigma around the pi0 nominal mass
134  # pi0 mass range is invariant for B2BII, tighter selection is required by user
135  applyCuts('Xi0:prelim', '[ abs( daughter(1,dM) ) < 0.0232 ]', path=path)
136  treeFit('Xi0:prelim', conf_level=0.0, massConstraint=[111, 3122], ipConstraint=True, updateAllDaughters=False, path=path)
137 
138  cutAndCopyList(
139  'Xi0:std',
140  'Xi0:prelim',
141  '[ cosAngleBetweenMomentumAndVertexVector > 0.0 ] and \
142  [ daughter(0,cosAngleBetweenMomentumAndVertexVectorInXYPlane) < cosAngleBetweenMomentumAndVertexVectorInXYPlane ] and \
143  [ formula( [ dr^2 + dz^2 ]^[0.5] ) > 0.0 and \
144  formula([dr^2 + dz^2]^[0.5])<formula([daughter(0,dr)^2 + daughter(0,dz)^2]^[0.5])] and \
145  [ chiProb > 0.0 ]',
146  True,
147  path=path)
148 
149 
150 def stdOmega(fitter='TreeFit', path=None):
151  r"""
152  Reconstruct the standard :math:`\Omega^-` ``ParticleList`` named ``Omega-:std``.
153 
154  .. seealso:: `BELLE2-NOTE-PH-2019-011 <https://docs.belle2.org/record/BELLE2-NOTE-PH-2019-011.pdf>`_.
155 
156  Parameters:
157  fitter (str): specify either ``KFit`` or ``TreeFit`` for the vertex reconstructions (default ``TreeFit``)
158  path (basf2.Path): modules are added to this path building the ``Omega-:std`` list
159  """
160 
161  if not isB2BII():
162  stdLambdas(path=path)
163  # 3.5 MeV Range around the nominal mass
164  cutAndCopyList(
165  'Lambda0:reco',
166  'Lambda0:merged',
167  '[ abs( dM ) < 0.0035 ] and \
168  [ cosAngleBetweenMomentumAndVertexVector > 0.0 ] and \
169  [ formula( [ dr^2 + dz^2 ]^[0.5] ) > 0.35 ] and \
170  [ daughter(0,protonID) > 0.01 ] and \
171  [ chiProb > 0.0 ]',
172  True, path=path)
173  else:
174  stdPi('all', path=path)
175  # Rough Lambda0 cuts from J. Yelton Observations of an Excited Omega- Baryon
176  kFit('Lambda0:mdst', conf_level=0.0, path=path) # Re-vertexing, recover vertex variables and error matrix
177  cutAndCopyList(
178  'Lambda0:reco',
179  'Lambda0:mdst',
180  '[ abs( dM ) < 0.0035 ] and \
181  [ cosAngleBetweenMomentumAndVertexVector > 0.0 ] and \
182  [ dr > 0.35 ] and \
183  [ daughter(0,atcPIDBelle(4,3)) > 0.2 ] and \
184  [ daughter(0,atcPIDBelle(4,2)) > 0.2 ] and \
185  [ chiProb > 0.0 ]',
186  True, path=path)
187 
188  stdK('all', path=path)
189  # stdOmega-
190  if fitter == 'KFit':
191  kFit('Lambda0:reco', 0.0, fit_type='massvertex', path=path)
192  reconstructDecay('Omega-:reco -> Lambda0:reco K-:all', '1.622 < M < 1.722', path=path)
193  kFit('Omega-:reco', conf_level=0.0, path=path)
194  elif fitter == 'TreeFit':
195  reconstructDecay('Omega-:reco -> Lambda0:reco K-:all', '1.622 < M < 1.722', path=path)
196  treeFit('Omega-:reco', conf_level=0.0, massConstraint=[3122], path=path)
197  else:
198  B2ERROR(f"stdOmega: invalid fitter ({fitter}). Choose from KFit or TreeFit")
199 
200  if not isB2BII():
201  cutAndCopyList(
202  'Omega-:std',
203  'Omega-:reco',
204  '[ cosAngleBetweenMomentumAndVertexVector > 0.0] and \
205  [ formula( [ dr^2 + dz^2 ]^[0.5] ) > 0. and \
206  formula([dr^2 + dz^2]^[0.5])<formula([daughter(0,dr)^2 + daughter(0,dz)^2]^[0.5])] and \
207  [ chiProb > 0.0 ] and \
208  [ daughter(1,kaonID) > 0.01 ]',
209  True,
210  path=path)
211 
212  else:
213  cutAndCopyList(
214  'Omega-:std',
215  'Omega-:reco',
216  '[ cosAngleBetweenMomentumAndVertexVector > 0.0 ] and \
217  [ formula( [ dr^2 + dz^2 ]^[0.5] ) > 0. and \
218  formula([dr^2 + dz^2]^[0.5])<formula([daughter(0,dr)^2 + daughter(0,dz)^2 ]^[0.5])] and \
219  [ chiProb > 0.0 ] and \
220  [ daughter(1,atcPIDBelle(3,4)) > 0.2 and daughter(1,atcPIDBelle(3,2)) > 0.2 ]',
221  True,
222  path=path)
223 
224 
225 def goodXi(xitype='loose', path=None):
226  r"""
227  Select the standard good :math:`\Xi^-` ``ParticleList`` named ``Xi-:veryloose``, ``Xi-:loose``, or ``Xi-:tight``
228  from the reconstructed ``Xi-:std``.
229 
230  .. seealso:: `BELLE2-NOTE-PH-2019-011 <https://docs.belle2.org/record/BELLE2-NOTE-PH-2019-011.pdf>`_.
231 
232  Parameters:
233  xitype (str): specify either ``veryloose``, ``loose``, or ``tight`` for good ``ParticleList`` selection (default ``loose``)
234  path (basf2.Path): modules are added to this path building the ``Xi-:veryloose``, ``Xi-:loose``, or ``Xi-:tight``, list
235  """
236 
237  if xitype == 'veryloose':
238  cutAndCopyList(
239  'Xi-:veryloose',
240  'Xi-:std',
241  '[ daughter(1,pt) > 0.05 and \
242  formula( [ dr^2 + dz^2 ]^[0.5] ) > 0.1 ]',
243  True,
244  path=path)
245 
246  elif xitype == 'loose':
247  cutAndCopyList(
248  'Xi-:loose',
249  'Xi-:std',
250  '[ daughter(1,pt) > 0.05 and \
251  formula( [ dr^2 + dz^2 ]^[0.5] ) > 0.1 and \
252  formula([daughter(0,cosAngleBetweenMomentumAndVertexVectorInXYPlane)/cosAngleBetweenMomentumAndVertexVectorInXYPlane])\
253 <1.006 ]',
254  True,
255  path=path)
256 
257  elif xitype == 'tight':
258  cutAndCopyList(
259  'Xi-:tight',
260  'Xi-:std',
261  '[ daughter(1,pt) > 0.1 and \
262  formula( [ dr^2 + dz^2 ]^[0.5] ) > 0.15 and \
263  formula([daughter(0,cosAngleBetweenMomentumAndVertexVectorInXYPlane)/cosAngleBetweenMomentumAndVertexVectorInXYPlane])\
264 <1.001 ]',
265  True,
266  path=path)
267 
268 
269 def goodXi0(xitype='loose', path=None):
270  r"""
271  Select the standard good :math:`\Xi^0` ``ParticleList`` named ``Xi0:veryloose``, ``Xi0:loose``, or ``Xi0:tight``
272  from the reconstructed ``Xi0:std``.
273 
274  .. seealso:: `BELLE2-NOTE-PH-2019-011 <https://docs.belle2.org/record/BELLE2-NOTE-PH-2019-011.pdf>`_.
275 
276  Parameters:
277  xitype (str): specify either ``veryloose``, ``loose``, or ``tight`` for good ``ParticleList`` selection (default ``loose``)
278  path (basf2.Path): modules are added to this path building the ``Xi0:veryloose``, ``Xi0:loose``, or ``Xi0:tight``, list
279  """
280 
281  if xitype == 'veryloose':
282  # Select pi0 at 3*sigma around the nominal mass
283  cutAndCopyList(
284  'Xi0:veryloose',
285  'Xi0:std',
286  '[ formula( [ dr^2 + dz^2 ]^[0.5] ) > 0.25 and \
287  daughter(1,p) > 0.1 and \
288  abs( daughter(1,dM) ) < 0.0174 ]',
289  True,
290  path=path)
291 
292  elif xitype == 'loose':
293  # Select pi0 at 3*sigma around the nominal mass
294  cutAndCopyList(
295  'Xi0:loose',
296  'Xi0:std',
297  '[ formula( [ dr^2 + dz^2 ]^[0.5] ) > 0.5 and \
298  daughter(1,p) > 0.15 and \
299  abs( daughter(1,dM) ) < 0.0174 ]',
300  True,
301  path=path)
302 
303  elif xitype == 'tight':
304  # Select pi0 at 2*sigma around the nominal mass
305  cutAndCopyList(
306  'Xi0:tight',
307  'Xi0:std',
308  '[ formula( [ dr^2 + dz^2 ]^[0.5] ) > 1.4 and \
309  daughter(1,p) > 0.25 and \
310  abs( daughter(1,dM) ) < 0.0116 ]',
311  True,
312  path=path)
313 
314 
315 def goodOmega(omegatype='loose', path=None):
316  r"""
317  Select the standard good :math:`\Omega^-` ``ParticleList`` named ``Omega-:veryloose``, ``Omega-:loose``,
318  or ``Omega-:tight`` from the reconstructed ``Omega-:std``.
319 
320  .. seealso:: `BELLE2-NOTE-PH-2019-011 <https://docs.belle2.org/record/BELLE2-NOTE-PH-2019-011.pdf>`_.
321 
322  Parameters:
323  omegatype (str): specify either ``veryloose``, ``loose``, or ``tight`` for good ``ParticleList`` selection
324  (default ``veryloose``)
325  path (basf2.Path): modules are added to this path building the ``Omega-:veryloose``, ``Omega-:loose``,
326  or ``Omega-:tight``, list
327  """
328 
329  if omegatype == 'veryloose':
330  cutAndCopyList(
331  'Omega-:veryloose',
332  'Omega-:std',
333  '[ daughter(1,pt) > 0.15 and \
334  formula( [ dr^2 + dz^2 ]^[0.5] ) > 0.05 ]',
335  True,
336  path=path)
337 
338  elif omegatype == 'loose':
339  cutAndCopyList(
340  'Omega-:loose',
341  'Omega-:std',
342  '[ daughter(1,pt) > 0.15 and \
343  formula( [ dr^2 + dz^2 ]^[0.5] ) > 0.15 and \
344  formula([daughter(0,cosAngleBetweenMomentumAndVertexVectorInXYPlane)/cosAngleBetweenMomentumAndVertexVectorInXYPlane])\
345 <1.0015 ]',
346  True,
347  path=path)
348 
349  elif omegatype == 'tight':
350  cutAndCopyList(
351  'Omega-:tight',
352  'Omega-:std',
353  '[ daughter(1,pt) > 0.3 and \
354  formula( [ dr^2 + dz^2 ]^[0.5] ) > 0.15 and \
355  formula([daughter(0,cosAngleBetweenMomentumAndVertexVectorInXYPlane)/cosAngleBetweenMomentumAndVertexVectorInXYPlane])\
356 <1.0005 ]',
357  True,
358  path=path)
stdPhotons
Definition: stdPhotons.py:1
treeFit
Definition: treeFit.py:1