Belle II Software  release-08-01-10
014_first_steering_file.py
1 #!/usr/bin/env python3
2 
3 import sys
4 import basf2 as b2
5 import modularAnalysis as ma
6 import stdV0s
7 
8 # get input file number from the command line
9 filenumber = sys.argv[1]
10 
11 # create path
12 main = b2.Path()
13 
14 # load input data from mdst/udst file
15 ma.inputMdstList(
16  filelist=[b2.find_file(f"starterkit/2021/1111540100_eph3_BGx0_{filenumber}.root", "examples")],
17  path=main,
18 )
19 
20 # fill final state particle lists
21 ma.fillParticleList(
22  "e+:uncorrected",
23  "electronID > 0.1 and dr < 0.5 and abs(dz) < 2 and thetaInCDCAcceptance",
24  path=main,
25 )
26 stdV0s.stdKshorts(path=main)
27 
28 # combine final state particles to form composite particles
29 ma.reconstructDecay(
30  "J/psi:ee -> e+:uncorrected e-:uncorrected", cut="dM < 0.11", path=main
31 )
32 
33 # combine J/psi and KS candidates to form B0 candidates
34 ma.reconstructDecay(
35  "B0 -> J/psi:ee K_S0:merged",
36  cut="",
37  path=main,
38 )
39 
40 # match reconstructed with MC particles
41 ma.matchMCTruth("B0", path=main)
42 
43 # save variables to an output file (ntuple)
44 ma.variablesToNtuple(
45  "B0",
46  variables=['Mbc', 'isSignal'],
47  filename="Bd2JpsiKS.root",
48  treename="tree",
49  path=main,
50 )
51 
52 # start the event loop (actually start processing things)
53 b2.process(main)
54 
55 # print out the summary
56 print(b2.statistics)
def stdKshorts(prioritiseV0=True, fitter='TreeFit', path=None, updateAllDaughters=False, writeOut=False)
Definition: stdV0s.py:17