Belle II Software development
executionTime.py
1#!/usr/bin/env python3
2
3
10
11
19
20import sys
21import basf2 as b2
22from svd.executionTime_utils import SVDExtraEventStatisticsModule
23import simulation as simu
24import tracking as trk
25
26import glob
27
28tag = "test"
29if len(sys.argv) == 2:
30 tag = sys.argv[1]
31
32# EXAMPLE OF EXECUTION TIME MEASUREMENT
33main = b2.create_path()
34
35b2.set_random_seed(1)
36
37# set the exp/run event informations
38eventinfosetter = b2.register_module('EventInfoSetter')
39eventinfosetter.param('expList', [0])
40eventinfosetter.param('runList', [1])
41eventinfosetter.param('evtNumList', [10])
42main.add_module(eventinfosetter)
43
44# generate signal
45main.add_module('EvtGenInput')
46
47# add default simulation
48bkgDir = '/group/belle2/BGFile/OfficialBKG/early_phase3/prerelease-04-00-00a/overlay/phase31/BGx1/set0/*.root'
49bg = glob.glob(bkgDir)
50if len(bg) == 0:
51 b2.B2ERROR('No files found in ', bkgDir)
52 sys.exit()
53simu.add_simulation(main, bkgfiles=bg, usePXDDataReduction=False, forceSetPXDDataReduction=True)
54
55# add default tracking reconstruction
56trk.add_tracking_reconstruction(main)
57
58# add offline ZS for ExecutionTime module
59main.add_module(
60 'SVDZeroSuppressionEmulator',
61 SNthreshold=5,
62 ShaperDigits='SVDShaperDigits',
63 ShaperDigitsIN='SVDShaperDigitsZS5',
64 FADCmode=True)
65
66main.add_module(SVDExtraEventStatisticsModule("SVDExecutionTime_"+str(tag)+".root"))
67
68main.add_module('Progress')
69
70b2.process(main)
71
72print(b2.statistics)