Belle II Software  release-05-02-19
tdcpv.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 """"""
5 
6 import modularAnalysis as ma
7 from skim.standardlists.dileptons import (loadStdDiLeptons, loadStdJpsiToee_noTOP,
8  loadStdJpsiTomumu, loadStdPsi2s2lepton)
9 from skim.standardlists.lightmesons import (loadStdSkimHighEffTracks,
10  loadStdSkimHighEffPhi, loadStdSkimHighEffEtaPrime,
11  loadStdSkimHighEffEta, loadStdSkimHighEffKstar0,
12  loadStdSkimHighEffRho0, loadStdSkimHighEffOmega,
13  loadStdSkimHighEffF_0)
14 
15 from skimExpertFunctions import BaseSkim, fancy_skim_header
16 from stdCharged import stdE, stdK, stdMu, stdPi
17 from stdPhotons import loadStdSkimPhoton, stdPhotons
18 from stdPi0s import loadStdSkimPi0, stdPi0s
19 from stdV0s import stdKshorts
20 from variables import variables as vm
21 from stdKlongs import stdKlongs
22 
23 __authors__ = [
24  "Chiara La Licata <chiara.lalicata@ts.infn.it>",
25  "Stefano Lacaprara <stefano.lacaprara@pd.infn.it>"
26 ]
27 
28 # __liaison__ = "Chiara La Licata <chiara.lalicata@ts.infn.it>"
29 __liaison__ = "Yoshiyuki ONUKI <onuki@hep.phys.s.u-tokyo.ac.jp>"
30 
31 
32 @fancy_skim_header
34  """
35  **Physics channels**: bd/u → qqs
36 
37  **Decay Channels**:
38 
39  * ``B0 -> phi K_S0``
40  * ``B0 -> eta K_S0``
41  * ``B0 -> eta' K_S0``
42  * ``B0 -> eta K*``
43  * ``B0 -> eta' K*``
44  * ``B0 -> K_S0 K_S0 K_S0``
45  * ``B0 -> pi0 K_S0``
46  * ``B0 -> rho0 K_S0``
47  * ``B0 -> omega K_S0``
48  * ``B0 -> f_0 K_S0``
49  * ``B0 -> pi0 pi0 K_S0``
50  * ``B0 -> phi K_S0 pi0``
51  * ``B0 -> pi+ pi- K_S0``
52  * ``B0 -> pi+ pi- K_S0 gamma``
53  * ``B0 -> pi0 K_S0 gamma``
54  * ``B0 -> pi0 pi0 K_S0``
55  * ``B0 -> phi K_S0 pi0``
56  * ``B0 -> pi+ pi- K_S0``
57  * ``B0 -> pi+ pi- K_S0 gamma``
58  * ``B0 -> pi0 K_S0 gamma``
59  * ``B+ -> eta' K+``
60  * ``B+ -> phi K+``
61 
62  **Particle lists used**:
63 
64  * ``phi:SkimHighEff``
65  * ``eta':SkimHighEff``
66  * ``eta:SkimHighEff``
67  * ``pi0:eff40_Jan2020``
68  * ``pi0:skim``
69  * ``rho0:SkimHighEff``
70  * ``omega:SkimHighEff``
71  * ``f_0:SkimHighEff``
72  * ``pi+:SkimHighEff``
73  * ``K+:SkimHighEff``
74  * ``omega:SkimHighEff``
75  * ``K*0:SkimHighEff``
76  * ``gamma:E15 , cut : 1.4 < E < 4``
77  * ``k_S0:merged``
78  * ``K+:1%``
79 
80  **Cuts used**:
81 
82  * ``SkimHighEff tracks thetaInCDCAcceptance AND chiProb > 0 AND abs(dr) < 0.5 AND abs(dz) < 3 and PID>0.01``
83  * ``5.2 < Mbc < 5.29``
84  * ``abs(deltaE) < 0.5``
85  * ``nCleanedECLClusters(0.296706 < theta < 2.61799 and E>0.2)>1``,
86  * ``E_ECL_TDCPV<9``
87  """
88 
89  __authors__ = ["Reem Rasheed", "Chiara La Licata", "Stefano Lacaprara"]
90  __description__ = "Skim for time-dependent CP violation analysis b->qqs decays"
91  __contact__ = __liaison__
92  __category__ = "physics, TDCPV"
93 
94  ApplyHLTHadronCut = True
95 
96  def load_standard_lists(self, path):
97  stdK("all", path=path)
98  stdPi("all", path=path)
99  stdPhotons("all", path=path)
100  loadStdSkimHighEffTracks('pi', path=path)
101  loadStdSkimHighEffTracks('K', path=path)
102  loadStdSkimPi0(path=path)
103  stdKshorts(path=path)
104  stdPi0s("eff40_Jan2020", path=path)
105 
106  loadStdSkimHighEffPhi(path=path)
107  loadStdSkimHighEffEta(path=path)
108  loadStdSkimHighEffEtaPrime(path=path)
109  loadStdSkimHighEffKstar0(path=path)
110  loadStdSkimHighEffRho0(path=path)
111  loadStdSkimHighEffOmega(path=path)
112  loadStdSkimHighEffF_0(path=path)
113 
114  def additional_setup(self, path):
115  ma.cutAndCopyList('gamma:E15', 'gamma:all', '1.4<E<4', path=path)
116 
117  def build_lists(self, path):
118  vm.addAlias('E_ECL_pi_TDCPV', 'totalECLEnergyOfParticlesInList(pi+:TDCPV_eventshape)')
119  vm.addAlias('E_ECL_gamma_TDCPV', 'totalECLEnergyOfParticlesInList(gamma:TDCPV_eventshape)')
120  vm.addAlias('E_ECL_TDCPV', 'formula(E_ECL_pi_TDCPV+E_ECL_gamma_TDCPV)')
121 
122  btotcpvcuts = '5.2 < Mbc < 5.29 and abs(deltaE) < 0.5'
123 
124  bd_qqs_Channels = [
125  'phi:SkimHighEff K_S0:merged',
126  'eta\':SkimHighEff K_S0:merged',
127  'eta:SkimHighEff K_S0:merged',
128  'eta\':SkimHighEff K*0:SkimHighEff',
129  'eta:SkimHighEff K*0:SkimHighEff',
130  'K_S0:merged K_S0:merged K_S0:merged',
131  'pi0:skim K_S0:merged',
132  'rho0:SkimHighEff K_S0:merged',
133  'omega:SkimHighEff K_S0:merged',
134  'f_0:SkimHighEff K_S0:merged',
135  'pi0:skim pi0:skim K_S0:merged',
136  'phi:SkimHighEff K_S0:merged pi0:skim',
137  'pi+:SkimHighEff pi-:SkimHighEff K_S0:merged',
138  'pi+:SkimHighEff pi-:SkimHighEff K_S0:merged gamma:E15',
139  'pi0:skim K_S0:merged gamma:E15',
140  ]
141 
142  bu_qqs_Channels = [
143  'eta\':SkimHighEff K+:SkimHighEff',
144  'phi:SkimHighEff K+:SkimHighEff',
145  ]
146 
147  bd_qqs_List = []
148  for chID, channel in enumerate(bd_qqs_Channels):
149  ma.reconstructDecay('B0:TDCPV_qqs' + str(chID) + ' -> ' + channel, btotcpvcuts, chID, path=path)
150  ma.applyCuts('B0:TDCPV_qqs' + str(chID), 'nTracks>4', path=path)
151  bd_qqs_List.append('B0:TDCPV_qqs' + str(chID))
152 
153  bu_qqs_List = []
154  for chID, channel in enumerate(bu_qqs_Channels):
155  ma.reconstructDecay('B+:TDCPV_qqs' + str(chID) + ' -> ' + channel, btotcpvcuts, chID, path=path)
156  ma.applyCuts('B+:TDCPV_qqs' + str(chID), 'nTracks>4', path=path)
157  bu_qqs_List.append('B+:TDCPV_qqs' + str(chID))
158 
159  ma.fillParticleList(decayString='pi+:TDCPV_eventshape',
160  cut='pt > 0.1 and abs(dr)<0.5 and abs(dz)<2 and nCDCHits>20', path=path)
161  ma.fillParticleList(decayString='gamma:TDCPV_eventshape',
162  cut='E > 0.1 and 0.296706 < theta < 2.61799', path=path)
163 
164  ma.buildEventShape(inputListNames=['pi+:TDCPV_eventshape', 'gamma:TDCPV_eventshape'],
165  allMoments=False,
166  foxWolfram=True,
167  harmonicMoments=False,
168  cleoCones=False,
169  thrust=False,
170  collisionAxis=False,
171  jets=False,
172  sphericity=False,
173  checkForDuplicates=False,
174  path=path)
175 
176  ma.buildEventKinematics(inputListNames=['pi+:TDCPV_eventshape', 'gamma:TDCPV_eventshape'], path=path)
177 
178  EventCuts = [
179  "nCleanedECLClusters(0.296706 < theta < 2.61799 and E>0.2)>1",
180  "E_ECL_TDCPV<9"
181  ]
182  path = self.skim_event_cuts(" and ".join(EventCuts), path=path)
183 
184  tcpvLists = bd_qqs_List + bu_qqs_List
185 
186  self.SkimLists = tcpvLists
187 
188  def validation_histograms(self, path):
189  ma.reconstructDecay("B0:etap -> eta':SkimHighEff K_S0:merged", '5.20 < Mbc < 5.3 and abs(deltaE) < 0.3', path=path)
190 
191  Kres = 'K_10'
192  ma.applyCuts('gamma:E15', '1.4 < E < 4', path=path)
193 
194  ma.reconstructDecay(Kres + ":all -> K_S0:merged pi+:all pi-:all ", "", path=path)
195  ma.reconstructDecay("B0:Kspipig -> " + Kres + ":all gamma:E15",
196  "Mbc > 5.2 and deltaE < 0.5 and deltaE > -0.5", path=path)
197  ma.matchMCTruth('B0:Kspipig', path=path)
198 
199  variableshisto = [('deltaE', 100, -0.5, 0.5), ('Mbc', 100, 5.2, 5.3)]
200 
201  ma.variablesToHistogram('B0:etap', variableshisto, filename='TDCPV_qqs_Validation.root', path=path, directory="etap")
202  ma.variablesToHistogram('B0:Kspipig', variableshisto, filename='TDCPV_qqs_Validation.root', path=path, directory="Kspipig")
203 
204 
205 @fancy_skim_header
207  """
208  **Physics channels**: bd → ccs
209 
210  **Decay Channels**:
211 
212  * ``B0 -> J/psi (ee/mm) K_S0``
213  * ``B0 -> psi(2s) (ee/mm) K_S0``
214  * ``B0 -> J/psi (ee/mm) K*``
215  * ``B+ -> J/psi (ee/mm) K+``
216  * ``B0 -> J/psi (ee/mm) KL``
217 
218  **Particle lists used**:
219 
220  * ``k_S0:merged``
221  * ``pi+:all``
222  * ``J/psi:ee``
223  * ``J/psi:mumu``
224  * ``psi(2S):ee``
225  * ``psi(2S):mumu``
226  * ``K*0:SkimHighEff``
227  * ``K+:SkimHighEff``
228  * ``K_L0:all``
229 
230  **Cuts used**:
231 
232  * ``SkimHighEff tracks thetaInCDCAcceptance AND chiProb > 0 AND abs(dr) < 0.5 AND abs(dz) < 3 and PID>0.01``
233  * ``5.2 < Mbc < 5.29 for Ks/K*``
234  * ``5.05 < Mbc < 5.29 for KL``
235  * ``abs(deltaE) < 0.5``
236  * ``nCleanedTracks(abs(dz) < 2.0 and abs(dr) < 0.5 and nCDCHits>20)>=3``
237  * ``nCleanedECLClusters(0.296706 < theta < 2.61799 and E>0.2)>1``,
238  * ``visibleEnergyOfEventCMS>4"``,
239  * ``E_ECL_TDCPV<9``
240  """
241 
242  __authors__ = ["Reem Rasheed", "Chiara La Licata", "Stefano Lacaprara"]
243  __description__ = "Skim for time-dependent CP violation analysis."
244  __contact__ = __liaison__
245  __category__ = "physics, TDCPV"
246 
247  ApplyHLTHadronCut = True
248 
249  def load_standard_lists(self, path):
250  stdE("all", path=path)
251  stdK("all", path=path)
252  stdMu("all", path=path)
253  stdPi("all", path=path)
254  stdPhotons("all", path=path)
255 
256  loadStdSkimHighEffTracks('pi', path=path)
257  loadStdSkimHighEffTracks('K', path=path)
258 
259  loadStdSkimPi0(path=path)
260  stdKshorts(path=path)
261  stdPi0s("eff40_Jan2020", path=path)
262  loadStdSkimHighEffKstar0(path=path)
263 
264  loadStdJpsiToee_noTOP(path=path)
265  loadStdJpsiTomumu(path=path)
266  loadStdPsi2s2lepton(path=path)
267  stdKlongs(listtype='allklm', path=path)
268  stdKlongs(listtype='allecl', path=path)
269 
270  def additional_setup(self, path):
271  ma.cutAndCopyList('K_L0:alleclEcut', 'K_L0:allecl', 'E>0.15', path=path)
272  ma.copyLists('K_L0:all', ['K_L0:allklm', 'K_L0:allecl'], writeOut=True, path=path)
273 
274  def build_lists(self, path):
275  vm.addAlias('E_ECL_pi_TDCPV', 'totalECLEnergyOfParticlesInList(pi+:TDCPV_eventshape)')
276  vm.addAlias('E_ECL_gamma_TDCPV', 'totalECLEnergyOfParticlesInList(gamma:TDCPV_eventshape)')
277  vm.addAlias('E_ECL_TDCPV', 'formula(E_ECL_pi_TDCPV+E_ECL_gamma_TDCPV)')
278 
279  btotcpvcuts = '5.2 < Mbc < 5.29 and abs(deltaE) < 0.5'
280  btotcpvcuts_KL = '5.05 < Mbc < 5.29 and abs(deltaE) < 0.5'
281 
282  bd_ccs_Channels = ['J/psi:ee K_S0:merged',
283  'J/psi:mumu K_S0:merged',
284  'psi(2S):ll K_S0:merged',
285  'J/psi:ee K*0:SkimHighEff',
286  'J/psi:mumu K*0:SkimHighEff']
287 
288  bPlustoJPsiK_Channel = ['J/psi:mumu K+:SkimHighEff',
289  'J/psi:ee K+:SkimHighEff']
290 
291  bd_ccs_KL_Channels = ['J/psi:mumu K_L0:all',
292  'J/psi:ee K_L0:all']
293 
294  bd_ccs_List = []
295  for chID, channel in enumerate(bd_ccs_Channels):
296  ma.reconstructDecay('B0:TDCPV_ccs' + str(chID) + ' -> ' + channel, btotcpvcuts, chID, path=path)
297  ma.applyCuts('B0:TDCPV_ccs' + str(chID), 'nTracks>4', path=path)
298  bd_ccs_List.append('B0:TDCPV_ccs' + str(chID))
299 
300  bPlustoJPsiK_List = []
301 
302  for chID, channel in enumerate(bPlustoJPsiK_Channel):
303  ma.reconstructDecay('B+:TDCPV_JPsiK' + str(chID) + ' -> ' + channel, btotcpvcuts, chID, path=path)
304  bPlustoJPsiK_List.append('B+:TDCPV_JPsiK' + str(chID))
305 
306  b0toJPsiKL_List = []
307  for chID, channel in enumerate(bd_ccs_KL_Channels):
308  ma.reconstructDecay('B0:TDCPV_JPsiKL' + str(chID) + ' -> ' + channel, btotcpvcuts_KL, chID, path=path)
309  b0toJPsiKL_List.append('B0:TDCPV_JPsiKL' + str(chID))
310 
311  ma.fillParticleList(decayString='pi+:TDCPV_eventshape',
312  cut='pt > 0.1 and abs(dr)<0.5 and abs(dz)<2 and nCDCHits>20', path=path)
313  ma.fillParticleList(decayString='gamma:TDCPV_eventshape',
314  cut='E > 0.1 and 0.296706 < theta < 2.61799', path=path)
315 
316  ma.buildEventShape(inputListNames=['pi+:TDCPV_eventshape', 'gamma:TDCPV_eventshape'],
317  allMoments=False,
318  foxWolfram=True,
319  harmonicMoments=False,
320  cleoCones=False,
321  thrust=False,
322  collisionAxis=False,
323  jets=False,
324  sphericity=False,
325  checkForDuplicates=False,
326  path=path)
327 
328  ma.buildEventKinematics(inputListNames=['pi+:TDCPV_eventshape', 'gamma:TDCPV_eventshape'], path=path)
329 
330  EventCuts = [
331  "nCleanedTracks(abs(dz) < 2.0 and abs(dr) < 0.5 and nCDCHits>20)>=3",
332  "nCleanedECLClusters(0.296706 < theta < 2.61799 and E>0.2)>1",
333  "visibleEnergyOfEventCMS>4",
334  "E_ECL_TDCPV<9"
335  ]
336  path = self.skim_event_cuts(" and ".join(EventCuts), path=path)
337 
338  tcpvLists = bd_ccs_List + bPlustoJPsiK_List + b0toJPsiKL_List
339 
340  self.SkimLists = tcpvLists
341 
342  def validation_histograms(self, path):
343  ma.reconstructDecay('B0:jpsiee -> J/psi:ee K_S0:merged', '5.24 < Mbc < 5.3 and abs(deltaE) < 0.15', path=path)
344  ma.reconstructDecay('B0:jpsimumu -> J/psi:mumu K_S0:merged', '5.24 < Mbc < 5.3 and abs(deltaE) < 0.15', path=path)
345 
346  variableshisto = [('deltaE', 100, -0.5, 0.5), ('Mbc', 100, 5.2, 5.3)]
347  ma.variablesToHistogram('B0:jpsiee', variableshisto, filename='TDCPV_ccs_Validation.root', path=path, directory="jpsiee")
348  ma.variablesToHistogram(
349  'B0:jpsimumu',
350  variableshisto,
351  filename='TDCPV_ccs_Validation.root',
352  path=path,
353  directory="jpsimumu")
skimExpertFunctions.BaseSkim.skim_event_cuts
def skim_event_cuts(self, cut, *path)
Definition: skimExpertFunctions.py:716
skim.tdcpv.TDCPV_ccs
Definition: tdcpv.py:206
skim.tdcpv.TDCPV_ccs.SkimLists
SkimLists
Definition: tdcpv.py:340
skim.tdcpv.TDCPV_ccs.build_lists
def build_lists(self, path)
Definition: tdcpv.py:274
skim.tdcpv.TDCPV_qqs.additional_setup
def additional_setup(self, path)
Definition: tdcpv.py:114
skim.tdcpv.TDCPV_ccs.validation_histograms
def validation_histograms(self, path)
Definition: tdcpv.py:342
stdPhotons
Definition: stdPhotons.py:1
skim.tdcpv.TDCPV_qqs.SkimLists
SkimLists
Definition: tdcpv.py:186
stdPi0s
Definition: stdPi0s.py:1
skimExpertFunctions.BaseSkim
Definition: skimExpertFunctions.py:504
skim.tdcpv.TDCPV_ccs.additional_setup
def additional_setup(self, path)
Definition: tdcpv.py:270
skim.tdcpv.TDCPV_qqs.validation_histograms
def validation_histograms(self, path)
Definition: tdcpv.py:188
skim.tdcpv.TDCPV_ccs.load_standard_lists
def load_standard_lists(self, path)
Definition: tdcpv.py:249
skim.tdcpv.TDCPV_qqs.build_lists
def build_lists(self, path)
Definition: tdcpv.py:117
skim.tdcpv.TDCPV_qqs.load_standard_lists
def load_standard_lists(self, path)
Definition: tdcpv.py:96
stdKlongs
Definition: stdKlongs.py:1
skim.tdcpv.TDCPV_qqs
Definition: tdcpv.py:33