Belle II Software development
ImportChannelStatus.py
1#!/usr/bin/env python3
2
3
10
11# Import KLM channel status payloads.
12
13import sys
14import basf2
15from ROOT.Belle2 import KLMDatabaseImporter, KLMChannelStatus
16
17basf2.set_log_level(basf2.LogLevel.INFO)
18
19mc = False
20if (len(sys.argv) >= 2):
21 if (sys.argv[1] == 'mc'):
22 mc = True
23
24dbImporter = KLMDatabaseImporter()
25
26channelStatus = KLMChannelStatus()
27channelStatus.setStatusAllChannels(KLMChannelStatus.c_Normal)
28
29if (mc):
30 dbImporter.setIOV(1002, 0, 1002, -1)
31 dbImporter.importChannelStatus(channelStatus)
32
33 dbImporter.setIOV(1003, 0, 1003, -1)
34 dbImporter.importChannelStatus(channelStatus)
35
36 dbImporter.setIOV(0, 0, 0, -1)
37 dbImporter.importChannelStatus(channelStatus)
38
39else:
40 dbImporter.setIOV(0, 0, -1, -1)
41 dbImporter.importChannelStatus(channelStatus)