Belle II Software  release-08-01-10
B2A601-ParticleStats.py
1 #!/usr/bin/env python3
2 
3 
10 
11 
37 
38 import basf2 as b2
39 import modularAnalysis as ma
40 import stdCharged as stdc
41 from stdPi0s import stdPi0s
42 
43 # create path
44 my_path = b2.create_path()
45 
46 # load input ROOT file
47 ma.inputMdst(filename=b2.find_file('B2pi0D_D2hh_D2hhh_B2munu.root', 'examples', False),
48  path=my_path)
49 
50 # create and fill final state ParticleLists
51 # use standard lists
52 # creates "pi+:loose" ParticleList (and c.c.)
53 stdc.stdPi(listtype='loose', path=my_path)
54 # creates "K+:loose" ParticleList (and c.c.)
55 stdc.stdK(listtype='loose', path=my_path)
56 
57 
58 stdPi0s(listtype='eff40_May2020Fit', path=my_path)
59 
60 # 1. reconstruct D0 in multiple decay modes
61 ma.reconstructDecay(decayString='D0:ch1 -> K-:loose pi+:loose',
62  cut='1.8 < M < 1.9 and 2.5 < useCMSFrame(p) < 5.5',
63  dmID=1,
64  path=my_path)
65 ma.reconstructDecay(decayString='D0:ch2 -> K-:loose pi+:loose pi0:eff40_May2020Fit',
66  cut='1.8 < M < 1.9 and 2.5 < useCMSFrame(p) < 5.5',
67  dmID=2,
68  path=my_path)
69 ma.reconstructDecay(decayString='D0:ch3 -> K-:loose pi+:loose pi+:loose pi-:loose',
70  cut='1.8 < M < 1.9 and 2.5 < useCMSFrame(p) < 5.5',
71  dmID=3,
72  path=my_path)
73 
74 # merge the D0 lists together into one single list
75 ma.copyLists(outputListName='D0:all', inputListNames=['D0:ch1', 'D0:ch2', 'D0:ch3'], path=my_path)
76 
77 # 2. reconstruct D+ -> K- pi+ pi+
78 ma.reconstructDecay(decayString='D+:kpipi -> K-:loose pi+:loose pi+:loose',
79  cut='1.8 < M < 1.9 and 2.5 < useCMSFrame(p) < 5.5',
80  dmID=1,
81  path=my_path)
82 
83 # 3. reconstruct Ds+ -> K- K+ pi+
84 ma.reconstructDecay(decayString='D_s+:kkpi -> K-:loose K+:loose pi+:loose',
85  cut='1.9 < M < 2.0 and 2.5 < useCMSFrame(p) < 5.5',
86  dmID=1,
87  path=my_path)
88 
89 # perform MC matching (MC truth association)
90 ma.matchMCTruth(list_name='D0:all', path=my_path)
91 ma.matchMCTruth(list_name='D+:kpipi', path=my_path)
92 ma.matchMCTruth(list_name='D_s+:kkpi', path=my_path)
93 
94 # print out summary of lists
95 # first for D0 lists only
96 ma.summaryOfLists(particleLists=['D0:ch1', 'D0:ch2', 'D0:ch3'], path=my_path)
97 # and for all charm
98 ma.summaryOfLists(particleLists=['D0:all', 'D+:kpipi', 'D_s+:kkpi'], path=my_path)
99 
100 # Process the events
101 b2.process(my_path)
102 
103 # print out the summary
104 print(b2.statistics)