Belle II Software development
SVDDefaultFADCMaskedStripsImporter.py
1#!/usr/bin/env python
2
3
10
11"""
12SVD Default FADC Masked Strips 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
24 '''default importer for FADC masked strips'''
25
26 def beginRun(self):
27 '''begin run'''
28
30
32 0, "FADCMaskedStrips_default_" + str(now.isoformat()) + "_INFO:_noFADCMaskedstrips")
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 masked strips default value (0, not masked) for " +
45 str(layerNumber) + "." + str(ladderNumber) + "." + str(sensorNumber))
46 if side == 0 and not layerNumber == 3: # non-L3 V side
47 Nstrips = 512
48
49 for strip in range(0, Nstrips):
50 payload.set(layerNumber, ladderNumber, sensorNumber, bool(side), strip, 0)
51
52 # mask something, uncomment the following 2 lines:
53 # if(layerNumber == 3 and ladderNumber == 2 and sensorNumber == 2 and side == 0):
54 # payload.set(layerNumber, ladderNumber, sensorNumber, bool(side), strip, 1)
55
56 Belle2.Database.Instance().storeData(Belle2.SVDFADCMaskedStrips.name, payload, iov)
57
58
59b2conditions.prepend_globaltag("svd_onlySVDinGeoConfiguration")
60
61main = b2.create_path()
62
63# Event info setter - execute single event
64eventinfosetter = b2.register_module('EventInfoSetter')
65eventinfosetter.param({'evtNumList': [1], 'expList': 0, 'runList': 0})
66main.add_module(eventinfosetter)
67
68main.add_module("Gearbox")
69main.add_module("Geometry")
70
71main.add_module(defaultFADCMaskedStripsImporter())
72
73# Show progress of processing
74progress = b2.register_module('Progress')
75main.add_module(progress)
76
77# Process events
78b2.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