Belle II Software development
SVDDefaultCoGOnlyPositionErrorImporter.py
1#!/usr/bin/env python
2
3
10
11"""
12SVD Default CoGOnly Position Error Formulas importer.
13"""
14import basf2 as b2
15from ROOT import Belle2
16from ROOT.Belle2 import SVDPositionErrorFunction
17from basf2 import conditions as b2conditions
18import datetime
19
20# import sys
21
22# default values
23# read the svd/dbobjects/SVDPositionErrorFunction class
24# now replicates the same formulas as in release-05
25
26now = datetime.datetime.now()
27
28
30 """
31 Defining the python module to do the import.
32 """
33
34 def beginRun(self):
35 """
36 call the functions to import the cluster parameters
37 """
39
40 # cluster position error
41 clsParam = SVDPositionErrorFunction()
42
44 clsParam,
45 "CoGOnlyPositionError_default_" +
46 str(
47 now.isoformat()) +
48 "_INFO:_formulas=rel05")
49
51
52 for layer in geoCache.getLayers(Belle2.VXD.SensorInfoBase.SVD):
53 layerNumber = layer.getLayerNumber()
54 for ladder in geoCache.getLadders(layer):
55 ladderNumber = ladder.getLadderNumber()
56 for sensor in geoCache.getSensors(ladder):
57 sensorNumber = sensor.getSensorNumber()
58 for side in (0, 1):
59 print("setting CoGOnly Position Error for " +
60 str(layerNumber) + "." + str(ladderNumber) + "." + str(sensorNumber) + "." + str(side))
61 cls_payload.set(layerNumber, ladderNumber, sensorNumber, bool(side), 1, clsParam)
62
63 Belle2.Database.Instance().storeData(Belle2.SVDCoGOnlyPositionError.name, cls_payload, iov)
64
65
66b2conditions.prepend_globaltag('svd_onlySVDinGeoConfiguration')
67
68main = b2.create_path()
69
70# Event info setter - execute single event
71eventinfosetter = b2.register_module('EventInfoSetter')
72eventinfosetter.param({'evtNumList': [1], 'expList': 0, 'runList': 0})
73main.add_module(eventinfosetter)
74
75main.add_module("Gearbox")
76main.add_module("Geometry")
77
79
80# Show progress of processing
81progress = b2.register_module('Progress')
82main.add_module(progress)
83
84# Process events
85b2.process(main)
static IntervalOfValidity always()
Function that returns an interval of validity that is always valid, c.f.
base class for calibrations classes
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
static Database & Instance()
Instance of a singleton Database.
Definition: Database.cc:42