Belle II Software development
SVDDefaultDetectorConfigurationImporter.py
1#!/usr/bin/env python
2
3
10"""
11SVD Default Detecotr Configuration importer.
12"""
13
14import basf2 as b2
15from ROOT import Belle2
16from basf2 import conditions as b2conditions
17import datetime
18
19now = datetime.datetime.now()
20
21# default values
22# local config
23calibrationTimeUnits = '2' # in RFC units, it is a string as the xml field where it is written
24calibDate = '20190314'
25injCharge = 22500
26
27# global config
28latency = 158
29maskFilter = 7
30zeroSuppress = 3
31apvClockTimeUnits = '16' # in RFC units, it is a string as the xml field where it is written
32hv = 50
33relativeShift = 0
34nrFrames = 6
35
36
38 '''default importer for the detector configuration'''
39
40 def beginRun(self):
41 '''begin run'''
42
44
45 local_payload = Belle2.SVDLocalConfigParameters(
46 "LocalConfiguration_default_" + str(now.isoformat()) +
47 "_INFO:_injCharge=" + str(injCharge) + "_calTimeUnits=" + str(calibrationTimeUnits))
48
49 global_payload = Belle2.SVDGlobalConfigParameters(
50 "GlobalConfiguration_default_" + str(now.isoformat()) +
51 "_INFO:_latency=" + str(latency) +
52 "_maskFilter=" + str(maskFilter) + "_ZS=" + str(zeroSuppress) +
53 "_apvClkUnits=" + str(apvClockTimeUnits))
54
55 local_payload.setCalibrationTimeInRFCUnits(calibrationTimeUnits)
56 local_payload.setCalibDate(calibDate)
57 local_payload.setInjectedCharge(injCharge)
58 global_payload.setLatency(latency)
59 global_payload.setZeroSuppression(zeroSuppress)
60 global_payload.setMaskFilter(maskFilter)
61 global_payload.setAPVClockInRFCUnits(apvClockTimeUnits)
62 global_payload.setHV(hv)
63 global_payload.setRelativeTimeShift(relativeShift)
64 global_payload.setNrFrames(nrFrames)
65
66 Belle2.Database.Instance().storeData("SVDLocalConfigParameters", local_payload, iov)
67 Belle2.Database.Instance().storeData("SVDGlobalConfigParameters", global_payload, iov)
68
69
70b2conditions.prepend_globaltag("svd_onlySVDinGeoConfiguration")
71
72main = b2.create_path()
73
74# Event info setter - execute single event
75eventinfosetter = b2.register_module('EventInfoSetter')
76eventinfosetter.param({'evtNumList': [1], 'expList': 0, 'runList': 0})
77main.add_module(eventinfosetter)
78
79main.add_module("Gearbox")
80main.add_module("Geometry")
81
83
84# Show progress of processing
85progress = b2.register_module('Progress')
86main.add_module(progress)
87
88# Process events
89b2.process(main)
static IntervalOfValidity always()
Function that returns an interval of validity that is always valid, c.f.
This class defines the payload which stores to the central DB the SVD global configuring parameters,...
This class defines the payload which stores to the central DB the SVD local configuring parameters,...
static Database & Instance()
Instance of a singleton Database.
Definition: Database.cc:42