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