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