Belle II Software  release-08-01-10
ImportTimeResolution.py
1 #!/usr/bin/env python3
2 
3 
10 
11 # Import KLM time resolution payloads.
12 
13 import sys
14 from ROOT import Belle2
15 
16 mc = False
17 if (len(sys.argv) >= 2):
18  if (sys.argv[1] == 'mc'):
19  mc = True
20 
21 timeResolution = Belle2.KLMTimeResolution()
22 index = Belle2.KLMChannelIndex()
23 index2 = Belle2.KLMChannelIndex()
24 while (index != index2.end()):
25  channel = index.getKLMChannelNumber()
26  timeResolution.setTimeResolution(channel, 3.0)
27  index.increment()
28 
30 
31 if (mc):
32  iov = Belle2.IntervalOfValidity(0, 0, 0, -1)
33  db.storeData("KLMTimeResolution", timeResolution, iov)
34 
35  iov = Belle2.IntervalOfValidity(1002, 0, 1002, -1)
36  db.storeData("KLMTimeResolution", timeResolution, iov)
37 
38  iov = Belle2.IntervalOfValidity(1003, 0, 1003, -1)
39  db.storeData("KLMTimeResolution", timeResolution, iov)
40 
41 else:
42  iov = Belle2.IntervalOfValidity(0, 0, -1, -1)
43  db.storeData("KLMTimeResolution", timeResolution, iov)
A class that describes the interval of experiments/runs for which an object in the database is valid.
KLM channel index.
Class to store KLM time resolution in the database.
static Database & Instance()
Instance of a singleton Database.
Definition: Database.cc:42