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