Belle II Software  release-06-01-15
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(environmentType='default',
48  filename=b2.find_file('B2pi0D_D2hh_D2hhh_B2munu.root', 'examples', False),
49  path=my_path)
50 
51 # create and fill final state ParticleLists
52 # use standard lists
53 # creates "pi+:loose" ParticleList (and c.c.)
54 stdc.stdPi(listtype='loose', path=my_path)
55 # creates "K+:loose" ParticleList (and c.c.)
56 stdc.stdK(listtype='loose', path=my_path)
57 
58 
59 stdPi0s(listtype='eff40_May2020Fit', path=my_path)
60 
61 # 1. reconstruct D0 in multiple decay modes
62 ma.reconstructDecay(decayString='D0:ch1 -> K-:loose pi+:loose',
63  cut='1.8 < M < 1.9 and 2.5 < useCMSFrame(p) < 5.5',
64  dmID=1,
65  path=my_path)
66 ma.reconstructDecay(decayString='D0:ch2 -> K-:loose pi+:loose pi0:eff40_May2020Fit',
67  cut='1.8 < M < 1.9 and 2.5 < useCMSFrame(p) < 5.5',
68  dmID=2,
69  path=my_path)
70 ma.reconstructDecay(decayString='D0:ch3 -> K-:loose pi+:loose pi+:loose pi-:loose',
71  cut='1.8 < M < 1.9 and 2.5 < useCMSFrame(p) < 5.5',
72  dmID=3,
73  path=my_path)
74 
75 # merge the D0 lists together into one single list
76 ma.copyLists(outputListName='D0:all', inputListNames=['D0:ch1', 'D0:ch2', 'D0:ch3'], path=my_path)
77 
78 # 2. reconstruct D+ -> K- pi+ pi+
79 ma.reconstructDecay(decayString='D+:kpipi -> K-:loose pi+:loose pi+:loose',
80  cut='1.8 < M < 1.9 and 2.5 < useCMSFrame(p) < 5.5',
81  dmID=1,
82  path=my_path)
83 
84 # 3. reconstruct Ds+ -> K- K+ pi+
85 ma.reconstructDecay(decayString='D_s+:kkpi -> K-:loose K+:loose pi+:loose',
86  cut='1.9 < M < 2.0 and 2.5 < useCMSFrame(p) < 5.5',
87  dmID=1,
88  path=my_path)
89 
90 # perform MC matching (MC truth association)
91 ma.matchMCTruth(list_name='D0:all', path=my_path)
92 ma.matchMCTruth(list_name='D+:kpipi', path=my_path)
93 ma.matchMCTruth(list_name='D_s+:kkpi', path=my_path)
94 
95 # print out summary of lists
96 # first for D0 lists only
97 ma.summaryOfLists(particleLists=['D0:ch1', 'D0:ch2', 'D0:ch3'], path=my_path)
98 # and for all charm
99 ma.summaryOfLists(particleLists=['D0:all', 'D+:kpipi', 'D_s+:kkpi'], path=my_path)
100 
101 # Process the events
102 b2.process(my_path)
103 
104 # print out the summary
105 print(b2.statistics)