Belle II Software development
SVDDefaultHotStripsImporter.py
1#!/usr/bin/env python
2
3
10
11"""
12SVD Default HotStrips Calibration importer.
13Script to Import Calibrations into a local DB
14"""
15import basf2 as b2
16from ROOT import Belle2
17import datetime
18from basf2 import conditions as b2conditions
19
20now = datetime.datetime.now()
21
22
23class defaultHotStripsImporter(b2.Module):
24 '''default importer for hot strips'''
25
26 def beginRun(self):
27 '''begin run'''
28
30 # iov = IntervalOfValidity(0,0,-1,-1)
31
32 payload = Belle2.SVDHotStripsCalibrations.t_payload(0, "HotStrips_default_" + str(now.isoformat()) + "_INFO:_noHotstrips")
33
35
36 for layer in geoCache.getLayers(Belle2.VXD.SensorInfoBase.SVD):
37 layerNumber = layer.getLayerNumber()
38 for ladder in geoCache.getLadders(layer):
39 ladderNumber = ladder.getLadderNumber()
40 for sensor in geoCache.getSensors(ladder):
41 sensorNumber = sensor.getSensorNumber()
42 for side in (0, 1):
43 Nstrips = 768
44 print("setting hot strips default value (0, good strip) for " +
45 str(layerNumber) + "." + str(ladderNumber) + "." + str(sensorNumber))
46
47 if side == 0 and not layerNumber == 3: # non-L3 V side
48 Nstrips = 512
49
50 for strip in range(0, Nstrips):
51 payload.set(layerNumber, ladderNumber, sensorNumber, bool(side), 1, 0)
52
53 Belle2.Database.Instance().storeData(Belle2.SVDHotStripsCalibrations.name, payload, iov)
54
55
56b2conditions.prepend_globaltag("svd_onlySVDinGeoConfiguration")
57
58main = b2.create_path()
59
60# Event info setter - execute single event
61eventinfosetter = b2.register_module('EventInfoSetter')
62eventinfosetter.param({'evtNumList': [1], 'expList': 0, 'runList': 0})
63main.add_module(eventinfosetter)
64
65main.add_module("Gearbox")
66main.add_module("Geometry")
67
68main.add_module(defaultHotStripsImporter())
69
70# Show progress of processing
71progress = b2.register_module('Progress')
72main.add_module(progress)
73
74# Process events
75b2.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