Belle II Software  release-08-01-10
ImportScintillatorFirmware.py
1 #!/usr/bin/env python3
2 
3 
10 
11 # Import KLM scintillator firmware payloads.
12 
13 import sys
14 import basf2
15 from ROOT.Belle2 import Database, IntervalOfValidity, KLMScintillatorFirmware
16 
17 basf2.set_log_level(basf2.LogLevel.INFO)
18 
19 mc = False
20 if (len(sys.argv) >= 2):
21  if (sys.argv[1] == 'mc'):
22  mc = True
23 
24 
25 db = Database.Instance()
26 
27 if (mc):
28  db.storeData(
29  "KLMScintillatorFirmware",
30  KLMScintillatorFirmware(KLMScintillatorFirmware.c_Run2),
31  IntervalOfValidity(0, 0, 0, -1)
32  )
33  db.storeData(
34  "KLMScintillatorFirmware",
35  KLMScintillatorFirmware(KLMScintillatorFirmware.c_Phase2),
36  IntervalOfValidity(1002, 0, 1002, -1)
37  )
38  db.storeData(
39  "KLMScintillatorFirmware",
40  KLMScintillatorFirmware(KLMScintillatorFirmware.c_Run1),
41  IntervalOfValidity(1003, 0, 1003, -1)
42  )
43  db.storeData(
44  "KLMScintillatorFirmware",
45  KLMScintillatorFirmware(KLMScintillatorFirmware.c_Run2),
46  IntervalOfValidity(1004, 0, 1004, -1)
47  )
48 
49 else:
50  db.storeData(
51  "KLMScintillatorFirmware",
52  KLMScintillatorFirmware(KLMScintillatorFirmware.c_Phase2),
53  IntervalOfValidity(1, 0, 3, -1)
54  )
55  db.storeData(
56  "KLMScintillatorFirmware",
57  KLMScintillatorFirmware(KLMScintillatorFirmware.c_Run1),
58  IntervalOfValidity(4, 0, 27, -1)
59  )
60  db.storeData(
61  "KLMScintillatorFirmware",
62  KLMScintillatorFirmware(KLMScintillatorFirmware.c_Run2),
63  IntervalOfValidity(28, 0, -1, -1)
64  )