Belle II Software  release-06-01-15
lightmesons.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import modularAnalysis as ma
13 from vertex import kFit
14 from stdPi0s import stdPi0s
15 
16 # Creates list of neutral pions for hadronic B skims following the recommendations of the neutral group
17 # for winter 2020.
18 
19 
20 def loadStdPi0ForBToHadrons(persistent=True, path=None):
21  """
22  Creates a list 'pi0:bth_skim' for :math:`B\\to {\\rm hadrons}` skims, based on recommendations of
23  the neutral group (avoiding ECL timing cuts) for winter 2020 and BtoCharmless for 2021. We require the energy of the photons
24  to be larger than :math:`22.50~{\\rm MeV}` in the forward end cap, :math:`20~{\\rm MeV}` in the barrel,
25  and :math:`20~{\\rm MeV}` in the backward end cap. For the :math:`\\pi^{0}`, we require the mass to be
26  :math:`105 < M < 150~{\\rm MeV}/c^2` and a mass-constrained KFit to converge.
27  """
28  stdPi0s('all', path, loadPhotonBeamBackgroundMVA=False)
29  ma.cutAndCopyList(outputListName='pi0:bth_skim', inputListName='pi0:all',
30  cut='[[daughter(0, clusterReg) == 1 and daughter(0, E) > 0.02250] or ' +
31  '[daughter(0, clusterReg) == 2 and daughter(0, E) > 0.020] or ' +
32  '[daughter(0, clusterReg) == 3 and daughter(0, E) > 0.020]] and ' +
33  '[[daughter(1, clusterReg) == 1 and daughter(1, E) > 0.02250] or ' +
34  '[daughter(1, clusterReg) == 2 and daughter(1, E) > 0.020] or ' +
35  '[daughter(1, clusterReg) == 3 and daughter(1, E) > 0.020]] and ' +
36  'M > 0.105 and M < 0.150', path=path)
37  kFit('pi0:bth_skim', 0.0, 'mass', path=path)
38 
39 
40 def loadStdSkimHighEffTracks(particletype, path):
41  """
42  Function to prepare high eff charged particle lists (:SkimHighEff).
43  We require only fiducial the cuts
44  :b2:var:`thetaInCDCAcceptance` and :b2:var:`chiProb` :math:`> 0` and
45  abs(:b2:var:`dr`) :math:`< 0.5~{\\rm cm}` and abs(dz) :math:` < 3~{\\rm cm}`
46  and (global) PID>0.01
47 
48  @param particletype type of charged particle to make a list of
49  @param path modules are added to this path
50  """
51 
52  pidnames = {'pi': 'pionID', 'K': 'kaonID', 'p': 'protonID', 'e': 'electronID', 'mu': 'muonID'}
53 
54  # basic quality cut strings
55  trackQuality = 'thetaInCDCAcceptance and chiProb > 0 '
56  ipCut = 'abs(dr) < 0.5 and abs(dz) < 3'
57  goodTrack = trackQuality + ' and ' + ipCut
58 
59  if particletype not in pidnames.keys():
60  ma.B2ERROR(f"The requested list is not a standard charged particle. Use one of {pidnames.keys()}")
61  pidCut = f'{pidnames[particletype]} > 0.01 and {goodTrack}'
62 
63  ma.fillParticleList(particletype + '+:SkimHighEff', pidCut, True, path=path)
64 
65 # Call to build all light mesons. Not recommended to use this general function as it creates many candidates
66 
67 
68 def loadStdLightMesons(persistent=True, path=None):
69  """
70  Create the following lists of light mesons:
71  - 'rho0:loose'
72  - 'rho0:all'
73  - 'rho+:loose'
74  - 'K*0:loose'
75  - 'K*0:all'
76  - 'K*+:loose'
77  - 'phi:loose'
78  - 'phi:all'
79  - 'f_0:loose'
80  - 'f_0:all'
81  - 'omega:loose'
82  - 'omega:all'
83  - 'eta:loose'
84  - 'eta\':loose'
85  - 'eta:all'
86  - 'eta\':all'
87 
88  @param persistent whether RootOutput module should save the created ParticleLists (default True)
89  @param path modules are added to this path
90  """
91 
92  loadStdLooseRho0(persistent, path)
93  loadStdAllRho0(persistent, path)
94  loadStdLooseRhoPlus(persistent, path)
95  loadStdLooseKstar0(persistent, path)
96  loadStdAllKstar0(persistent, path)
97  loadStdLooseKstarPlus(persistent, path)
98  loadStdLoosePhi(persistent, path)
99  loadStdAllPhi(persistent, path)
100  loadStdLooseF_0(persistent, path)
101  loadStdAllF_0(persistent, path)
102  loadStdLooseOmega(persistent, path)
103  loadStdAllOmega(persistent, path)
104  loadStdLooseEta(persistent, path)
105  loadStdAllEta(persistent, path)
106  loadStdLooseEtaPrime(persistent, path)
107  loadStdAllEtaPrime(persistent, path)
108 
109 # NoCut mesons not to be included by default
110 
111 
112 def loadStdLooseRho0(persistent=True, path=None):
113  """
114  Create a list of 'rho0:loose' list from 'pi-:loose pi+:loose' with :math:`0.47 < M < 1.07~GeV`
115 
116  @param persistent whether RootOutput module should save the created ParticleLists (default True)
117  @param path modules are added to this path
118  """
119  ma.reconstructDecay('rho0:loose -> pi-:loose pi+:loose', '0.47 < M < 1.07', 1, persistent, path)
120  return 'rho0:loose'
121 
122 
123 def loadStdAllRho0(persistent=True, path=None):
124  """
125  Create a list of 'rho0:all' list from 'pi-:all pi+:all' with :math:`0.47 < M < 1.07~GeV`
126 
127  @param persistent whether RootOutput module should save the created ParticleLists (default True)
128  @param path modules are added to this path
129  """
130  ma.reconstructDecay('rho0:all -> pi-:all pi+:all', '0.47 < M < 1.07', 1, persistent, path)
131  return 'rho0:all'
132 
133 
134 def loadStdSkimHighEffRho0(persistent=True, path=None):
135  """
136  Create a list of 'rho0:SkimHighEff' list from 'pi-:SkimHighEff pi+:SkimHighEff' with :math:`0.47 < M < 1.07~GeV`
137 
138  @param persistent whether RootOutput module should save the created ParticleLists (default True)
139  @param path modules are added to this path
140  """
141  ma.reconstructDecay('rho0:SkimHighEff -> pi-:SkimHighEff pi+:SkimHighEff', '0.47 < M < 1.07', 1, persistent, path)
142  return 'rho0:SkimHighEff'
143 
144 
145 def loadStdLooseRhoPlus(persistent=True, path=None):
146  """
147  Create a list of 'rho+:loose' list from 'pi0:eff40_May2020 pi+:loose' with :math:`0.47 < M < 1.07~GeV`
148 
149  @param persistent whether RootOutput module should save the created ParticleLists (default True)
150  @param path modules are added to this path
151  """
152  ma.reconstructDecay('rho+:loose -> pi+:loose pi0:eff40_May2020', '0.47 < M < 1.07', 1, persistent, path)
153  return 'rho+:loose'
154 
155 
156 def loadStdAllRhoPlus(persistent=True, path=None):
157  """
158  Create a list of 'rho+:all' list from 'pi0:bth_skim' pi+:all' with :math:`0.47 < M < 1.07~GeV`.
159  We apply few sanity cuts on the pi+: thetaInCDCAcceptance, abs(dr) < 0.5, and abs(dz) < 3.
160 
161  @param persistent whether RootOutput module should save the created ParticleLists (default True)
162  @param path modules are added to this path
163  """
164  ma.reconstructDecay('rho+:all -> pi+:all pi0:bth_skim ', '0.47 < M < 1.07 and ' +
165  'daughter(0,thetaInCDCAcceptance) > 0 and abs(daughter(0,dr)) < 0.5 and ' +
166  'abs(daughter(0,dz)) < 3', 1, persistent, path)
167  return 'rho+:all'
168 
169 
170 def loadA_1Plus(persistent=True, path=None):
171  """
172  Creates a 'a_1+:all' list from 'pi+:all pi+:all pi-:all' requiring :math:`0.8 < M < 1.6~{\\rm GeV}/c^2`.
173 
174  @param persistent whether RootOutput module should save the created ParticleLists (default True)
175  @param path modules are added to this path
176  """
177  ma.reconstructDecay(
178  decayString='a_1+:all -> pi+:all pi+:all pi-:all',
179  cut='0.8 < M < 1.6',
180  dmID=1, writeOut=persistent,
181  path=path)
182 
183  return 'a_1+:all'
184 
185 
186 def loadStdLooseKstar0(persistent=True, path=None):
187  """
188  Create a list of 'K*0:loose' list from 'pi-:loose K+:loose' with :math:`0.74 < M < 1.04~GeV`
189 
190  @param persistent whether RootOutput module should save the created ParticleLists (default True)
191  @param path modules are added to this path
192  """
193  ma.reconstructDecay('K*0:loose -> pi-:loose K+:loose', '0.74 < M < 1.04', 1, persistent, path)
194  return 'K*0:loose'
195 
196 
197 def loadStdAllKstar0(persistent=True, path=None):
198  """
199  Create a list of 'K*0:all' list from 'pi-:all K+:all' with :math:`0.74 < M < 1.04~GeV`
200 
201  @param persistent whether RootOutput module should save the created ParticleLists (default True)
202  @param path modules are added to this path
203  """
204  ma.reconstructDecay('K*0:all -> pi-:all K+:all', '0.74 < M < 1.04', 1, persistent, path)
205  return 'K*0:all'
206 
207 
208 def loadStdSkimHighEffKstar0(persistent=True, path=None):
209  """
210  Create a list of 'K*0:SkimHighEff' list from 'pi-:SkimHighEff K+:SkimHighEff' with :math:`0.74 < M < 1.04~GeV`
211 
212  @param persistent whether RootOutput module should save the created ParticleLists (default True)
213  @param path modules are added to this path
214  """
215  ma.reconstructDecay('K*0:SkimHighEff -> pi-:SkimHighEff K+:SkimHighEff', '0.74 < M < 1.04', 1, persistent, path)
216  return 'K*0:SkimHighEff'
217 
218 
219 def loadStdLooseKstarPlus(persistent=True, path=None):
220  """
221  Create a list of 'K*+:loose' list from 'pi+:loose K_S0:merged' with :math:`0.74 < M < 1.04~GeV`
222 
223  @param persistent whether RootOutput module should save the created ParticleLists (default True)
224  @param path modules are added to this path
225  """
226  ma.reconstructDecay('K*+:loose -> pi+:loose K_S0:merged', '0.74 < M < 1.04', 1, persistent, path)
227  return 'K*+:loose'
228 
229 
230 def loadStdAllKstarPlus(persistent=True, path=None):
231  """
232  Create a list of 'K*+:all' list from 'pi+:all K_S0:merged' with :math:`0.74 < M < 1.04~GeV`
233 
234  @param persistent whether RootOutput module should save the created ParticleLists (default True)
235  @param path modules are added to this path
236  """
237  ma.reconstructDecay('K*+:all -> pi+:all K_S0:merged', '0.74 < M < 1.04', 1, persistent, path)
238  return 'K*+:all'
239 
240 
241 def loadStdAllPhi(persistent=True, path=None):
242  """
243  Create a list of 'phi:all' list from 'K+:all K-:all' with :math:`0.97 < M < 1.1~GeV`
244 
245  @param persistent whether RootOutput module should save the created ParticleLists (default True)
246  @param path modules are added to this path
247  """
248  ma.reconstructDecay('phi:all -> K+:all K-:all', '0.97 < M < 1.1', 1, persistent, path)
249  return 'phi:all'
250 
251 
252 def loadStdSkimHighEffPhi(persistent=True, path=None):
253  """
254  Create a list of 'phi:SkimHighEff' list from 'K+:SkimHighEff K-:SkimHighEff' with :math:`0.97 < M < 1.1~GeV`
255 
256  @param persistent whether RootOutput module should save the created ParticleLists (default True)
257  @param path modules are added to this path
258  """
259  ma.reconstructDecay('phi:SkimHighEff -> K+:SkimHighEff K-:SkimHighEff', '0.97 < M < 1.1', 1, persistent, path)
260  return 'phi:SkimHighEff'
261 
262 
263 def loadStdLoosePhi(persistent=True, path=None):
264  """
265  Create a list of 'phi:loose' list from 'K+:loose K-:loose' with :math:`0.97 < M < 1.1~GeV`
266 
267  @param persistent whether RootOutput module should save the created ParticleLists (default True)
268  @param path modules are added to this path
269  """
270  ma.reconstructDecay('phi:loose -> K+:loose K-:loose', '0.97 < M < 1.1', 1, persistent, path)
271  return 'phi:loose'
272 
273 
274 def loadStdAllF_0(persistent=True, path=None):
275  """
276  Create a list of 'f_0:all' list from 'pi+:all pi-:all' with :math:`0.78 < M < 1.18~GeV`
277 
278  @param persistent whether RootOutput module should save the created ParticleLists (default True)
279  @param path modules are added to this path
280  """
281  ma.reconstructDecay('f_0:all -> pi+:all pi-:all', '0.78 < M < 1.18', 1, persistent, path)
282  return 'f_0:all'
283 
284 
285 def loadStdSkimHighEffF_0(persistent=True, path=None):
286  """
287  Create a list of 'f_0:SkimHighEff' list from 'pi+:SkimHighEff pi-:SkimHighEff' with :math:`0.78 < M < 1.18~GeV`
288 
289  @param persistent whether RootOutput module should save the created ParticleLists (default True)
290  @param path modules are added to this path
291  """
292  ma.reconstructDecay('f_0:SkimHighEff -> pi+:SkimHighEff pi-:SkimHighEff', '0.78 < M < 1.18', 1, persistent, path)
293  return 'f_0:SkimHighEff'
294 
295 
296 def loadStdLooseF_0(persistent=True, path=None):
297  """
298  Create a list of 'f_0:loose' list from 'pi+:loose pi1:loose' with :math:`0.78 < M < 1.18~GeV`
299 
300  @param persistent whether RootOutput module should save the created ParticleLists (default True)
301  @param path modules are added to this path
302  """
303  ma.reconstructDecay('f_0:loose -> pi+:loose pi-:loose', '0.78 < M < 1.18', 1, persistent, path)
304  return 'f_0:loose'
305 
306 
307 def loadStdAllOmega(persistent=True, path=None):
308  """
309  Create a list of 'omega:all' list from 'pi0:eff40_May2020 pi-:all pi+:all' with :math:`0.73 < M < 0.83~GeV`
310 
311  @param persistent whether RootOutput module should save the created ParticleLists (default True)
312  @param path modules are added to this path
313  """
314  ma.reconstructDecay('omega:all -> pi0:eff40_May2020 pi-:all pi+:all', '0.73 < M < 0.83', 1, persistent, path)
315  return 'omega:all'
316 
317 
318 def loadStdSkimHighEffOmega(persistent=True, path=None):
319  """
320  Create a list of 'omega:SkimHighEff' list from 'pi0:eff40_May2020 pi-:SkimHighEff pi+:SkimHighEff'
321  with :math:`0.73 < M < 0.83~GeV`
322 
323  @param persistent whether RootOutput module should save the created ParticleLists (default True)
324  @param path modules are added to this path
325  """
326  ma.reconstructDecay(
327  'omega:SkimHighEff -> pi0:eff40_May2020 pi-:SkimHighEff pi+:SkimHighEff',
328  '0.73 < M < 0.83',
329  1,
330  persistent,
331  path)
332  return 'omega:SkimHighEff'
333 
334 
335 def loadStdLooseOmega(persistent=True, path=None):
336  """
337  Create a list of 'omega:loose' list from 'pi0:eff40_May2020 pi-:loose pi+:loose' with :math:`0.73 < M < 0.83~GeV`
338 
339  @param persistent whether RootOutput module should save the created ParticleLists (default True)
340  @param path modules are added to this path
341  """
342  ma.reconstructDecay('omega:loose -> pi0:eff40_May2020 pi-:loose pi+:loose', '0.73 < M < 0.83', 1, persistent, path)
343  return 'omega:loose'
344 
345 
346 def loadStdAllEta(persistent=True, path=None):
347  """
348  Create a list of 'eta:all' list from 'gamma:all gamma:all' (dmID=1) and 'pi0:eff40_May2020 pi-:all pi+:all'
349  (dmID=2), with :math:`0.4< M < 0.6~GeV`
350 
351  @param persistent whether RootOutput module should save the created ParticleLists (default True)
352  @param path modules are added to this path
353  """
354  ma.reconstructDecay('eta:all1 -> gamma:all gamma:all', '0.4 < M < 0.6', 1, persistent, path)
355  ma.reconstructDecay('eta:all2 -> pi0:eff40_May2020 pi-:all pi+:all', '0.4 < M < 0.6', 2, persistent, path)
356  ma.copyLists('eta:all', ['eta:all1', 'eta:all2'], persistent, path)
357  return 'eta:all'
358 
359 
360 def loadStdSkimHighEffEta(persistent=True, path=None):
361  """
362  Create a list of 'eta:SkimHighEff' list from 'gamma:all gamma:all' (dmID=1) and
363  'pi0:eff40_May2020 pi-:SkimHighEff pi+:SkimHighEff'
364  (dmID=2), with :math:`0.4< M < 0.6~GeV`
365 
366  @param persistent whether RootOutput module should save the created ParticleLists (default True)
367  @param path modules are added to this path
368  """
369  ma.reconstructDecay('eta:SkimHighEff1 -> gamma:all gamma:all', '0.4 < M < 0.6', 1, persistent, path)
370  ma.reconstructDecay(
371  'eta:SkimHighEff2 -> pi0:eff40_May2020 pi-:SkimHighEff pi+:SkimHighEff',
372  '0.4 < M < 0.6',
373  2,
374  persistent,
375  path)
376  ma.copyLists('eta:SkimHighEff', ['eta:SkimHighEff1', 'eta:SkimHighEff2'], persistent, path)
377  return 'eta:SkimHighEff'
378 
379 
380 def loadStdLooseEta(persistent=True, path=None):
381  """
382  Create a list of 'eta:loose' list from 'gamma:loose gamma:loose' (dmID=1) and 'pi0:eff40_May2020 pi-:loose pi+:loose'
383  (dmID=2), with :math:`0.4< M < 0.6~GeV`
384 
385  @param persistent whether RootOutput module should save the created ParticleLists (default True)
386  @param path modules are added to this path
387  """
388  ma.reconstructDecay('eta:loose1 -> gamma:loose gamma:loose', '0.4 < M < 0.6', 1, persistent, path)
389  ma.reconstructDecay('eta:loose2 -> pi0:eff40_May2020 pi-:loose pi+:loose', '0.4 < M < 0.6', 2, persistent, path)
390  ma.copyLists('eta:loose', ['eta:loose1', 'eta:loose2'], persistent, path)
391  return 'eta:loose'
392 
393 
394 def loadStdAllEtaPrime(persistent=True, path=None):
395  """
396  Create a list of 'eta\':all' list from 'pi+:all pi-:all gamma:all' (dmID=1) and 'pi+:all pi-:all eta:all'
397  (dmID=2), with :math:`0.8< M < 1.1~GeV`
398 
399  @param persistent whether RootOutput module should save the created ParticleLists (default True)
400  @param path modules are added to this path
401  """
402  ma.reconstructDecay('eta\':all1 -> pi+:all pi-:all gamma:all', '0.8 < M < 1.1', 1, persistent, path)
403  ma.reconstructDecay('eta\':all2 -> pi+:all pi-:all eta:all', '0.8 < M < 1.1', 2, persistent, path)
404  ma.reconstructDecay('eta\':all3 -> rho0:all gamma:all', '0.8 < M < 1.1', 3, persistent, path)
405  ma.copyLists('eta\':all', ['eta\':all1', 'eta\':all2', 'eta\':all3'], persistent, path)
406  return 'eta\':all'
407 
408 
409 def loadStdSkimHighEffEtaPrime(persistent=True, path=None):
410  """
411  Create a list of 'eta\':SkimHighEff' list from 'pi+:SkimHighEff pi-:SkimHighEff gamma:all' (dmID=1)
412  and 'pi+:SkimHighEff pi-:SkimHighEff eta:SkimHighEff'
413  (dmID=2), with :math:`0.8< M < 1.1~GeV`
414 
415  @param persistent whether RootOutput module should save the created ParticleLists (default True)
416  @param path modules are added to this path
417  """
418  ma.reconstructDecay('eta\':SkimHighEff1 -> pi+:SkimHighEff pi-:SkimHighEff gamma:all', '0.8 < M < 1.1', 1, persistent, path)
419  ma.reconstructDecay(
420  'eta\':SkimHighEff2 -> pi+:SkimHighEff pi-:SkimHighEff eta:SkimHighEff',
421  '0.8 < M < 1.1',
422  2,
423  persistent,
424  path)
425  ma.copyLists('eta\':SkimHighEff', ['eta\':SkimHighEff1', 'eta\':SkimHighEff2'], persistent, path)
426  return 'eta\':SkimHighEff'
427 
428 
429 def loadStdLooseEtaPrime(persistent=True, path=None):
430  """
431  Create a list of 'eta\':loose' list from 'pi+:loose pi-:loose gamma:loose' (dmID=1) and 'pi+:loose pi-:loose eta:loose'
432  (dmID=2), with :math:`0.8< M < 1.1~GeV`
433 
434  @param persistent whether RootOutput module should save the created ParticleLists (default True)
435  @param path modules are added to this path
436  """
437  ma.reconstructDecay('eta\':loose1 -> pi+:loose pi-:loose gamma:loose', '0.8 < M < 1.1', 1, persistent, path)
438  ma.reconstructDecay('eta\':loose2 -> pi+:loose pi-:loose eta:loose', '0.8 < M < 1.1', 2, persistent, path)
439  ma.copyLists('eta\':loose', ['eta\':loose1', 'eta\':loose2'], persistent, path)
440  return 'eta\':loose'