Belle II Software development
generate_test_data.py
1#!/usr/bin/env python3
2
3
10
11import basf2 as b2
12import sys
13
14b2.set_log_level(b2.LogLevel.INFO)
15
16if len(sys.argv) != 6:
17 print('Usage: basf2 generate_test_data.py data_output_directory experiment_number run_number_low run_number_high num_events')
18 sys.exit(1)
19
20output_dir = sys.argv[1]
21experiment = int(sys.argv[2])
22run_low = int(sys.argv[3])
23run_high = int(sys.argv[4])
24nevents = int(sys.argv[5])
25
26runs = [run for run in range(run_low, run_high+1)]
27print(runs)
28
29main = b2.create_path()
30main.add_module('EventInfoSetter', expList=[experiment]*len(runs), runList=runs, evtNumList=[nevents]*len(runs))
31main.add_module('RootOutput',
32 outputFileName=output_dir + f'/DST_exp{experiment:d}_run{run_low:d}_run{run_high:d}.root')
33b2.process(main)
34print(b2.statistics)