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