Belle II Software  release-05-01-25
analysisDQM.py
1 # !/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 """
5 This module defines functions to add analysis DQM modules.
6 """
7 
8 import basf2 as b2
9 from stdPi0s import stdPi0s
10 import modularAnalysis as ma
11 
12 
13 def add_analysis_dqm(path):
14  ma.fillParticleList('gamma:physDQM', 'E > 0.15', path=path)
15  ma.fillParticleList('pi+:physDQM', 'pt>0.2 and abs(d0) < 2 and abs(z0) < 4', path=path)
16  ma.reconstructDecay('pi0:physDQM -> gamma:physDQM gamma:physDQM', '0.10 < M < 0.15', 1, True, path)
17  ma.reconstructDecay('K_S0:physDQM -> pi-:physDQM pi+:physDQM', '0.48 < M < 0.52', 1, True, path)
18  ma.buildEventShape(
19  path=path,
20  default_cleanup=False,
21  foxWolfram=True,
22  cleoCones=False,
23  collisionAxis=False,
24  harmonicMoments=False,
25  jets=False,
26  sphericity=False,
27  thrust=False)
28 
29  dqm = b2.register_module('PhysicsObjectsDQM')
30  dqm.param('PI0PListName', 'pi0:physDQM')
31  dqm.param('KS0PListName', 'K_S0:physDQM')
32  path.add_module(dqm)
33 
34 
35 def add_mirabelle_dqm(path):
36  # Software Trigger to divert the path
37  MiraBelleMumu_path = b2.create_path()
38  MiraBelleDst1_path = b2.create_path()
39  MiraBelleNotDst1_path = b2.create_path()
40  MiraBelleDst2_path = b2.create_path()
41 
42  trigger_skim_mumutight = path.add_module(
43  "TriggerSkim",
44  triggerLines=["software_trigger_cut&skim&accept_mumutight"],
45  resultOnMissing=0,
46  )
47  trigger_skim_mumutight.if_value("==1", MiraBelleMumu_path, b2.AfterConditionPath.CONTINUE)
48 
49  trigger_skim_dstar_1 = path.add_module(
50  "TriggerSkim",
51  triggerLines=["software_trigger_cut&skim&accept_dstar_1"],
52  resultOnMissing=0,
53  )
54  trigger_skim_dstar_1.if_value("==1", MiraBelleDst1_path, b2.AfterConditionPath.CONTINUE)
55 
56  trigger_skim_not_dstar_1 = path.add_module(
57  "TriggerSkim",
58  triggerLines=["software_trigger_cut&skim&accept_dstar_1"],
59  expectedResult=0,
60  resultOnMissing=0,
61  )
62  trigger_skim_not_dstar_1.if_value("==1", MiraBelleNotDst1_path, b2.AfterConditionPath.CONTINUE)
63  trigger_skim_dstar_2 = MiraBelleNotDst1_path.add_module(
64  "TriggerSkim",
65  triggerLines=["software_trigger_cut&skim&accept_dstar_2"],
66  resultOnMissing=0,
67  )
68  trigger_skim_dstar_2.if_value("==1", MiraBelleDst2_path, b2.AfterConditionPath.CONTINUE)
69 
70  # MiraBelle di-muon path
71  ma.fillParticleList('mu+:physMiraBelle', '', path=MiraBelleMumu_path)
72  MiraBelleMumu = b2.register_module('PhysicsObjectsMiraBelle')
73  MiraBelleMumu.param('MuPListName', 'mu+:physMiraBelle')
74  MiraBelleMumu_path.add_module(MiraBelleMumu)
75 
76  # MiraBelle D* (followed by D0 -> K pi) path
77  ma.fillParticleList('pi+:MiraBelleDst1', 'abs(d0)<0.5 and abs(z0)<3', path=MiraBelleDst1_path)
78  ma.fillParticleList('K+:MiraBelleDst1', 'abs(d0)<0.5 and abs(z0)<3', path=MiraBelleDst1_path)
79  ma.reconstructDecay('D0:MiraBelleDst1_kpi -> K-:MiraBelleDst1 pi+:MiraBelleDst1', '1.7 < M < 2.1', path=MiraBelleDst1_path)
80  ma.reconstructDecay('D*+:MiraBelleDst1_kpi -> D0:MiraBelleDst1_kpi pi+:MiraBelleDst1',
81  'useCMSFrame(p) > 2.5 and massDifference(0) < 0.16', path=MiraBelleDst1_path)
82  MiraBelleDst1 = b2.register_module('PhysicsObjectsMiraBelleDst')
83  MiraBelleDst1.param('DstListName', 'D*+:MiraBelleDst1_kpi')
84  MiraBelleDst1_path.add_module(MiraBelleDst1)
85 
86  # MiraBelle D* (followed by D0 -> K pi pi0) path
87  ma.fillParticleList('pi+:MiraBelleDst2', 'abs(d0)<0.5 and abs(z0)<3', path=MiraBelleDst2_path)
88  ma.fillParticleList('K+:MiraBelleDst2', 'abs(d0)<0.5 and abs(z0)<3', path=MiraBelleDst2_path)
89  stdPi0s(listtype='eff60_Jan2020', path=MiraBelleDst2_path)
90  ma.reconstructDecay(
91  'D0:MiraBelleDst2_kpipi0 -> K-:MiraBelleDst2 pi+:MiraBelleDst2 pi0:eff60_Jan2020',
92  '1.7 < M < 2.1',
93  path=MiraBelleDst2_path)
94  ma.reconstructDecay('D*+:MiraBelleDst2_kpipi0 -> D0:MiraBelleDst2_kpipi0 pi+:MiraBelleDst2',
95  'useCMSFrame(p) > 2.5 and massDifference(0) < 0.16', path=MiraBelleDst2_path)
96  MiraBelleDst2 = b2.register_module('PhysicsObjectsMiraBelleDst2')
97  MiraBelleDst2.param('DstListName', 'D*+:MiraBelleDst2_kpipi0')
98  MiraBelleDst2_path.add_module(MiraBelleDst2)
stdPi0s
Definition: stdPi0s.py:1