Belle II Software development
beamSpotCalibrationCheck.py
1#!/usr/bin/env python
2
3
10
11"""
12Beam Spot Calibration Check Script
13one file for all BeamSpot payload in the local database
14usage:
15> basf2 beamSpotMonitor.py current_localDB
16"""
17
18import basf2
19import sys
20from basf2 import conditions as b2conditions
21
22if __name__ == '__main__':
23
24 current_localDB = sys.argv[1]
25
26 expList = []
27 runList = []
28 evtList = []
29 with open(current_localDB + '/database.txt') as fp:
30 for line in fp:
31 run = line.split(',')
32 exp = run[0].split(' ')
33 expList.append(int(exp[2]))
34 runList.append(int(run[1]))
35 evtList.append(int(1))
36
37 b2conditions.testing_payloads = [str(current_localDB) + "/database.txt"]
38
39 main = basf2.create_path()
40
41 eventinfosetter = basf2.register_module('EventInfoSetter')
42 eventinfosetter.param({'evtNumList': evtList, 'expList': expList, 'runList': runList})
43 main.add_module(eventinfosetter)
44
45 main.add_module('BeamSpotMonitor')
46
47 basf2.print_path(main)
48 basf2.process(main)