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