Belle II Software  release-08-01-10
SVDDefault3SampleCoGTimeCalibrationImporter.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 """
13 SVD Default 3-sample CoG Time Calibration importer.
14 alfa = 1 and beta = 0 for all sensors and sides
15 Script to Import Calibrations into a local DB
16 """
17 import basf2 as b2
18 from ROOT import Belle2
19 from ROOT.Belle2 import SVDCoGCalibrationFunction
20 from basf2 import conditions as b2conditions
21 import datetime
22 
23 now = datetime.datetime.now()
24 
25 
27  """ default importer for the first order polynomial, TB dependent
28  for the 3-sample CoG calibration payload
29  """
30 
31  def beginRun(self):
32  """do everything here"""
33 
35 
36  timeCal = SVDCoGCalibrationFunction()
37  timeCal.set_bias(0., 0., 0., 0.)
38  timeCal.set_scale(1., 1., 1., 1.)
39  timeCal.set_current(0)
40 
41  # take the base class payload which is the same for all calibrations:
43  timeCal, "3SampleCoGTimeCalibrations_default_" + str(now.isoformat()) + "_INFO:_1stOrderPol__alpha=1_beta=0")
44 
45  Belle2.Database.Instance().storeData(Belle2.SVD3SampleCoGTimeCalibrations.name, payload, iov)
46 
47 
49  """ default importer for the third order polynomial, TB independent
50  for the 3-sample CoG calibration payload
51  """
52 
53  def beginRun(self):
54  """ do everything here"""
55 
57 
58  timeCal = SVDCoGCalibrationFunction()
59  timeCal.set_pol3parameters(0., 1., 0., 0.)
60  timeCal.set_current(1)
61 
62  # take the base class payload which is the same for all calibrations:
64  timeCal, "3SampleCoGTimeCalibrations_default_" + str(now.isoformat()) + "_INFO:_3rdOrderPol_a=0_b=1_c=0_d=0")
65 
66  Belle2.Database.Instance().storeData(Belle2.SVD3SampleCoGTimeCalibrations.name, payload, iov)
67 
68 
69 b2conditions.prepend_globaltag("svd_onlySVDinGeoConfiguration")
70 
71 main = b2.create_path()
72 
73 # Event info setter - execute single event
74 eventinfosetter = b2.register_module('EventInfoSetter')
75 eventinfosetter.param({'evtNumList': [1], 'expList': 0, 'runList': 0})
76 main.add_module(eventinfosetter)
77 
78 main.add_module("Gearbox")
79 main.add_module("Geometry")
80 
81 # main.add_module(defaultCoGTimeCalibrationImporter_pol1TBdep())
83 #
84 # Show progress of processing
85 progress = b2.register_module('Progress')
86 main.add_module(progress)
87 
88 # Process events
89 b2.process(main)
static IntervalOfValidity always()
Function that returns an interval of validity that is always valid, c.f.
base class for calibrations classes
static Database & Instance()
Instance of a singleton Database.
Definition: Database.cc:42