Belle II Software  release-06-01-15
ImportTimeResolution.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # Import KLM time resolution payloads.
13 
14 import sys
15 from ROOT import Belle2
16 
17 mc = False
18 if (len(sys.argv) >= 2):
19  if (sys.argv[1] == 'mc'):
20  mc = True
21 
22 timeResolution = Belle2.KLMTimeResolution()
23 index = Belle2.KLMChannelIndex()
24 index2 = Belle2.KLMChannelIndex()
25 while (index != index2.end()):
26  channel = index.getKLMChannelNumber()
27  timeResolution.setTimeResolution(channel, 3.0)
28  index.increment()
29 
31 
32 if (mc):
33  iov = Belle2.IntervalOfValidity(0, 0, 0, -1)
34  db.storeData("KLMTimeResolution", timeResolution, iov)
35 
36  iov = Belle2.IntervalOfValidity(1002, 0, 1002, -1)
37  db.storeData("KLMTimeResolution", timeResolution, iov)
38 
39  iov = Belle2.IntervalOfValidity(1003, 0, 1003, -1)
40  db.storeData("KLMTimeResolution", timeResolution, iov)
41 
42 else:
43  iov = Belle2.IntervalOfValidity(0, 0, -1, -1)
44  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:41