Belle II Software light-2406-ragdoll
B2A601-ParticleStats.py
1#!/usr/bin/env python3
2
3
10
11
37
38import basf2 as b2
39import modularAnalysis as ma
40import stdCharged as stdc
41from stdPi0s import stdPi0s
42
43# create path
44my_path = b2.create_path()
45
46# load input ROOT file
47ma.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.)
53stdc.stdPi(listtype='loose', path=my_path)
54# creates "K+:loose" ParticleList (and c.c.)
55stdc.stdK(listtype='loose', path=my_path)
56
57
58stdPi0s(listtype='eff40_May2020Fit', path=my_path)
59
60# 1. reconstruct D0 in multiple decay modes
61ma.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)
65ma.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)
69ma.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
75ma.copyLists(outputListName='D0:all', inputListNames=['D0:ch1', 'D0:ch2', 'D0:ch3'], path=my_path)
76
77# 2. reconstruct D+ -> K- pi+ pi+
78ma.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+
84ma.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)
90ma.matchMCTruth(list_name='D0:all', path=my_path)
91ma.matchMCTruth(list_name='D+:kpipi', path=my_path)
92ma.matchMCTruth(list_name='D_s+:kkpi', path=my_path)
93
94# print out summary of lists
95# first for D0 lists only
96ma.summaryOfLists(particleLists=['D0:ch1', 'D0:ch2', 'D0:ch3'], path=my_path)
97# and for all charm
98ma.summaryOfLists(particleLists=['D0:all', 'D+:kpipi', 'D_s+:kkpi'], path=my_path)
99
100# Process the events
101b2.process(my_path)
102
103# print out the summary
104print(b2.statistics)