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