Belle II Software development
SVDDefaultCrossTalkStripsImporter.py
1#!/usr/bin/env python
2
3
10
11"""
12SVD Default CoG Time Calibration importer.
13Script to Import Calibrations into a local DB
14"""
15import basf2 as b2
16from ROOT import Belle2
17import datetime
18
19now = datetime.datetime.now()
20
21
23 '''default cross talk strips importer'''
24
25 def beginRun(self):
26 '''begin run'''
27
29
31 0, "CrossTalkStrips_default_" + str(now.isoformat()) + "_INFO:_noCrossTalkstrips")
33
34 for layer in geoCache.getLayers(Belle2.VXD.SensorInfoBase.SVD):
35 layerNumber = layer.getLayerNumber()
36 for ladder in geoCache.getLadders(layer):
37 ladderNumber = ladder.getLadderNumber()
38 for sensor in geoCache.getSensors(ladder):
39 sensorNumber = sensor.getSensorNumber()
40 for side in (0, 1):
41 print("setting crossTalk strips default value (0, good strip) for " +
42 str(layerNumber) + "." + str(ladderNumber) + "." + str(sensorNumber))
43 payload.set(layerNumber, ladderNumber, sensorNumber, bool(side), 1, 0)
44
45 Belle2.Database.Instance().storeData(Belle2.SVDCrossTalkStripsCalibrations.name, payload, iov)
46
47
48main = b2.create_path()
49
50# Event info setter - execute single event
51eventinfosetter = b2.register_module('EventInfoSetter')
52eventinfosetter.param({'evtNumList': [1], 'expList': 0, 'runList': 0})
53main.add_module(eventinfosetter)
54
55main.add_module("Gearbox")
56main.add_module("Geometry")
57main.add_module(defaultCrossTalkStripsImporter())
58
59# Show progress of processing
60progress = b2.register_module('Progress')
61main.add_module(progress)
62
63# Process events
64b2.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