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