Belle II Software development
SVDDefaultCoGOnlyErrorScaleFactorsImporter.py
1#!/usr/bin/env python
2
3
10
11"""
12SVD Default CoGOnly Error Scaling Factors importer.
13"""
14import basf2 as b2
15from ROOT import Belle2
16from ROOT.Belle2 import SVDPosErrScaleFactors
17from basf2 import conditions as b2conditions
18import datetime
19
20# import sys
21
22# default values
23clsScaleErrSize1 = 1
24clsScaleErrSize2 = 1
25clsScaleErrSize3 = 1
26clsScaleErrSize4 = 1
27clsScaleErrSize5 = 1
28now = datetime.datetime.now()
29
30
32 """
33 Defining the python module to do the import.
34 """
35
36 def beginRun(self):
37 """
38 call the functions to import the cluster parameters
39 """
41
42 # cluster position error
43 clsParam = SVDPosErrScaleFactors()
44 clsParam.scaleError_clSize1 = clsScaleErrSize1
45 clsParam.scaleError_clSize2 = clsScaleErrSize2
46 clsParam.scaleError_clSize3 = clsScaleErrSize3
47 clsParam.scaleError_clSize4 = clsScaleErrSize4
48 clsParam.scaleError_clSize5 = clsScaleErrSize5
49
51 clsParam,
52 "CoGOnlyErrorScaleFactors_default_" +
53 str(
54 now.isoformat()) +
55 "_INFO:_scaleFactors=1")
56
58
59 for layer in geoCache.getLayers(Belle2.VXD.SensorInfoBase.SVD):
60 layerNumber = layer.getLayerNumber()
61 for ladder in geoCache.getLadders(layer):
62 ladderNumber = ladder.getLadderNumber()
63 for sensor in geoCache.getSensors(ladder):
64 sensorNumber = sensor.getSensorNumber()
65 for side in (0, 1):
66 print("setting CoGOnly Error Scale Factors for " +
67 str(layerNumber) + "." + str(ladderNumber) + "." + str(sensorNumber) + "." + str(side))
68 cls_payload.set(layerNumber, ladderNumber, sensorNumber, bool(side), 1, clsParam)
69
70 Belle2.Database.Instance().storeData(Belle2.SVDCoGOnlyErrorScaleFactors.name, cls_payload, iov)
71
72
73b2conditions.prepend_globaltag('svd_onlySVDinGeoConfiguration')
74
75main = b2.create_path()
76
77# Event info setter - execute single event
78eventinfosetter = b2.register_module('EventInfoSetter')
79eventinfosetter.param({'evtNumList': [1], 'expList': 0, 'runList': 0})
80main.add_module(eventinfosetter)
81
82main.add_module("Gearbox")
83main.add_module("Geometry")
84
86
87# Show progress of processing
88progress = b2.register_module('Progress')
89main.add_module(progress)
90
91# Process events
92b2.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