Belle II Software development
ImportKLMTriggerParameters.py
1#!/usr/bin/env python
2
3
10
11# Import KLMTriggerParameters payloads
12# Usage: basf2 ImportKLMTriggerParameters.py [mc]
13
14import sys
15from ROOT import Belle2 # noqa: make Belle2 namespace available
16from ROOT.Belle2 import KLMTriggerParameters, Database, IntervalOfValidity
17
18mc = False
19if (len(sys.argv) >= 2):
20 if (sys.argv[1] == 'mc'):
21 mc = True
22
23parameters = KLMTriggerParameters()
24parameters.setWhichLayers('0:16')
25
26database = Database.Instance()
27
28if mc:
29 parameters.setNLayers(4)
30 iov = IntervalOfValidity(0, 0, 0, -1)
31 database.storeData('KLMTriggerParameters', parameters, iov)
32 iov = IntervalOfValidity(1002, 0, 1002, -1)
33 database.storeData('KLMTriggerParameters', parameters, iov)
34 iov = IntervalOfValidity(1003, 0, 1003, -1)
35 database.storeData('KLMTriggerParameters', parameters, iov)
36else:
37 parameters.setNLayers(7)
38 iov = IntervalOfValidity(1, 0, 16, 1131)
39 database.storeData('KLMTriggerParameters', parameters, iov)
40 parameters.setNLayers(4)
41 iov = IntervalOfValidity(16, 1132, 16, 1132)
42 database.storeData('KLMTriggerParameters', parameters, iov)
43 parameters.setNLayers(7)
44 iov = IntervalOfValidity(16, 1133, 17, 169)
45 database.storeData('KLMTriggerParameters', parameters, iov)
46 parameters.setNLayers(4)
47 iov = IntervalOfValidity(17, 170, -1, -1)
48 database.storeData('KLMTriggerParameters', parameters, iov)