Belle II Software development
SVDDefaultHitTimeSelectionImporter.py
1#!/usr/bin/env python
2
3
10
11"""
12SVD Default Hit Time Selection importer.
13"""
14import basf2 as b2
15from ROOT import Belle2
16from ROOT.Belle2 import SVDHitTimeSelectionFunction
17from basf2 import conditions as b2conditions
18import datetime
19
20# import sys
21
22# default values
23# cls hit time
24clsTimeMin = -999
25clsTimeFunctionID = 0 # default, t > clsTimeMin
26clsTimeDeltaT = 30 # NOT USED
27clsTimeNSigma = 10 # NOT USED
28
29# time difference U-V
30clsTimeDiff = 999 # default for DATA and exp 1003, 1002
31# clsTimeDiff = 10 # default for exp 0
32
33now = datetime.datetime.now()
34
35
37 """
38 Defining the python module to do the import.
39 """
40
41 def beginRun(self):
42 """
43 call the functions to import the cluster parameters
44 """
46
47 # SpacePoint time
48 hitTimeSelection = SVDHitTimeSelectionFunction()
49 # set default version = 0
50 hitTimeSelection.setFunctionID(clsTimeFunctionID)
51 # version 0: t > tMin
52 hitTimeSelection.setMinTime(clsTimeMin)
53 # version 1: |t-t0|<deltaT - NOT USED
54 hitTimeSelection.setDeltaTime(clsTimeDeltaT)
55 # version 2: |t-t0|<nSgma*tErrTOT - NOT USED
56 hitTimeSelection.setNsigma(clsTimeNSigma)
57 # cluster time difference
58 hitTimeSelection.setMaxUVTimeDifference(clsTimeDiff)
60 hitTimeSelection, "HitTimeSelection_noCuts_" + str(now.isoformat()) +
61 "_INFO:_tmin=" + str(clsTimeMin) + "_tDiff=" + str(clsTimeDiff))
62
64
65 for layer in geoCache.getLayers(Belle2.VXD.SensorInfoBase.SVD):
66 layerNumber = layer.getLayerNumber()
67 for ladder in geoCache.getLadders(layer):
68 ladderNumber = ladder.getLadderNumber()
69 for sensor in geoCache.getSensors(ladder):
70 sensorNumber = sensor.getSensorNumber()
71 for side in (0, 1):
72 print("setting SVD Hit Time Selections for " +
73 str(layerNumber) + "." + str(ladderNumber) + "." + str(sensorNumber) + "." + str(side))
74
75 Belle2.Database.Instance().storeData(Belle2.SVDHitTimeSelection.name, payload, iov)
76
77
78b2conditions.prepend_globaltag('svd_onlySVDinGeoConfiguration')
79
80main = b2.create_path()
81
82# Event info setter - execute single event
83eventinfosetter = b2.register_module('EventInfoSetter')
84eventinfosetter.param({'evtNumList': [1], 'expList': 0, 'runList': 0})
85main.add_module(eventinfosetter)
86
87main.add_module("Gearbox")
88main.add_module("Geometry")
89
91
92# Show progress of processing
93progress = b2.register_module('Progress')
94main.add_module(progress)
95
96# Process events
97b2.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