Belle II Software  release-08-01-10
ImportKLMTriggerParameters.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # Import KLMTriggerParameters payloads
13 # Usage: basf2 ImportKLMTriggerParameters.py [mc]
14 
15 import sys
16 from ROOT.Belle2 import KLMTriggerParameters, Database, IntervalOfValidity
17 
18 mc = False
19 if (len(sys.argv) >= 2):
20  if (sys.argv[1] == 'mc'):
21  mc = True
22 
23 parameters = KLMTriggerParameters()
24 parameters.setWhichLayers('0:16')
25 
26 database = Database.Instance()
27 
28 if 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)
36 else:
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)