Belle II Software  release-06-00-14
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(environmentType='None',
43  filename=b2.find_file('B2pi0D_D2hh_D2hhh_B2munu_evtgen.root', 'examples', False),
44  path=my_path)
45 
46 # simulation
47 si.add_simulation(path=my_path)
48 
49 # reconstruction
50 re.add_reconstruction(path=my_path)
51 
52 # dump in MDST format
53 mdst.add_mdst_output(path=my_path,
54  mc=True,
55  filename='B2pi0D_D2hh_D2hhh_B2munu.root')
56 
57 # Show progress of processing
58 my_path.add_module('ProgressBar')
59 
60 # Process the events
61 b2.process(my_path)
62 
63 # print out the summary
64 print(b2.statistics)
def add_mdst_output(path, mc=True, filename='mdst.root', additionalBranches=[], dataDescription=None)
Definition: mdst.py:39