Belle II Software  release-05-01-25
B2A102-SimulateAndReconstruct.py
1 #!/usr/bin/env python3
2 
3 
20 import basf2 as b2
21 import mdst as mdst
22 import simulation as si
23 import reconstruction as re
24 import modularAnalysis as ma
25 
26 # We previously generated events but we want to simulate them with the
27 # currently best values, not whatever whas valid back then. So we have to
28 # disable reuse of the same globaltag from when the events were generated
29 b2.conditions.disable_globaltag_replay()
30 
31 # create path
32 my_path = b2.create_path()
33 
34 # load input ROOT file
35 ma.inputMdst(environmentType='None',
36  filename=b2.find_file('B2pi0D_D2hh_D2hhh_B2munu_evtgen.root', 'examples', False),
37  path=my_path)
38 
39 # simulation
40 si.add_simulation(path=my_path)
41 
42 # reconstruction
43 re.add_reconstruction(path=my_path)
44 
45 # dump in MDST format
46 mdst.add_mdst_output(path=my_path,
47  mc=True,
48  filename='B2pi0D_D2hh_D2hhh_B2munu.root')
49 
50 # Show progress of processing
51 progress = b2.register_module('ProgressBar')
52 my_path.add_module(progress)
53 
54 # Process the events
55 b2.process(my_path)
56 
57 # print out the summary
58 print(b2.statistics)
mdst.add_mdst_output
def add_mdst_output(path, mc=True, filename='mdst.root', additionalBranches=[], dataDescription=None)
Definition: mdst.py:8