Belle II Software  release-08-01-10
B2A104-SimulateAndReconstruct-withoutBeamBkg.py
1 #!/usr/bin/env python3
2 
3 
10 
11 
26 
27 import basf2 as b2
28 from modularAnalysis import inputMdst
29 from simulation import add_simulation
30 from reconstruction import add_reconstruction
31 from mdst import add_mdst_output
32 
33 # create a path
34 my_path = b2.create_path()
35 
36 # load input ROOT file
37 inputMdst(filename=b2.find_file('B2A101-Y4SEventGeneration-evtgen.root'), path=my_path)
38 
39 # simulation
40 add_simulation(path=my_path)
41 
42 # reconstruction
43 add_reconstruction(path=my_path)
44 
45 # dump in MDST format
46 add_mdst_output(path=my_path,
47  mc=True,
48  filename='B2A101-Y4SEventGeneration-gsim-BKGx0.root')
49 
50 # Show progress of processing
51 my_path.add_module('ProgressBar')
52 
53 # Process the events
54 b2.process(my_path)
55 
56 # print out the summary
57 print(b2.statistics)