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