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