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