Belle II Software  release-08-01-10
SVDDefault3SampleELSTimeCalibrationImporter.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 """
13 SVD Default 3-sample ELS 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  """1st order pol importer for ELS3 (TB dep)"""
28 
29  def beginRun(self):
30  '''do everything here'''
31 
33 
34  timeCal = SVDCoGCalibrationFunction()
35  timeCal.set_bias(0., 0., 0., 0.)
36  timeCal.set_scale(1., 1., 1., 1.)
37  timeCal.set_current(0)
38 
39  # take the base class payload which is the same for all calibrations:
41  timeCal, "3SampleELSTimeCalibrations_default_" + str(now.isoformat()) + "_INFO:_1stOrderPol__alpha=1_beta=0")
42 
43  Belle2.Database.Instance().storeData(Belle2.SVD3SampleELSTimeCalibrations.name, payload, iov)
44 
45 
47  """3rd order pol importer for ELS3 (TB indep)"""
48 
49  def beginRun(self):
50  """do everything here"""
51 
53 
54  timeCal = SVDCoGCalibrationFunction()
55  timeCal.set_pol3parameters(0., 1., 0., 0.)
56  timeCal.set_current(1)
57 
58  # take the base class payload which is the same for all calibrations:
60  timeCal, "3SampleELSTimeCalibrations_default_" + str(now.isoformat()) + "_INFO:_3rdOrderPol_a=0_b=1_c=0_d=0")
61 
62  Belle2.Database.Instance().storeData(Belle2.SVD3SampleELSTimeCalibrations.name, payload, iov)
63 
64 
65 b2conditions.prepend_globaltag("svd_onlySVDinGeoConfiguration")
66 
67 main = b2.create_path()
68 
69 # Event info setter - execute single event
70 eventinfosetter = b2.register_module('EventInfoSetter')
71 eventinfosetter.param({'evtNumList': [1], 'expList': 0, 'runList': 0})
72 main.add_module(eventinfosetter)
73 
74 main.add_module("Gearbox")
75 main.add_module("Geometry")
76 
77 # main.add_module(defaultELSTimeCalibrationImporter_pol1TBdep())
79 #
80 # Show progress of processing
81 progress = b2.register_module('Progress')
82 main.add_module(progress)
83 
84 # Process events
85 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