Belle II Software development
SVDDefaultClusteringImporter.py
1#!/usr/bin/env python
2
3
10
11"""
12SVD Default Clustering Parameters importer.
13"""
14import basf2 as b2
15from ROOT import Belle2
16from ROOT.Belle2 import SVDClusterCuts
17from basf2 import conditions as b2conditions
18import datetime
19
20# import sys
21
22# default values
23# cls cuts
24clsSeedSNR = 5
25clsAdjSNR = 3
26clsMinSNR = 0
27clsUnfoldingCoeffU = 0
28clsUnfoldingCoeffV = 0
29now = datetime.datetime.now()
30
31
33 """
34 Defining the python module to do the import.
35 """
36
37 def beginRun(self):
38 """
39 call the functions to import the cluster parameters
40 """
42
43 # cluster reconstruction & position error
44 clsParam = SVDClusterCuts()
45 clsParam.minSeedSNR = clsSeedSNR
46 clsParam.minAdjSNR = clsAdjSNR
47 clsParam.minClusterSNR = clsMinSNR
48 clsParam.UnfoldingCoeff = clsUnfoldingCoeffV
49
51 clsParam,
52 "Clustering_default_" +
53 str(
54 now.isoformat()) +
55 "_INFO:_seed=" +
56 str(clsSeedSNR) +
57 "_adj=" +
58 str(clsAdjSNR) +
59 "_cls=" +
60 str(clsMinSNR) +
61 "_unfU=" +
62 str(clsUnfoldingCoeffU) +
63 "_unfV=" +
64 str(clsUnfoldingCoeffV))
65
67
68 for layer in geoCache.getLayers(Belle2.VXD.SensorInfoBase.SVD):
69 layerNumber = layer.getLayerNumber()
70 for ladder in geoCache.getLadders(layer):
71 ladderNumber = ladder.getLadderNumber()
72 for sensor in geoCache.getSensors(ladder):
73 sensorNumber = sensor.getSensorNumber()
74 for side in (0, 1):
75 print("setting SVD Clustering parameters for " +
76 str(layerNumber) + "." + str(ladderNumber) + "." + str(sensorNumber) + "." + str(side))
77 if side == 1:
78 clsParam.UnfoldingCoeff = clsUnfoldingCoeffU
79 else:
80 clsParam.UnfoldingCoeff = clsUnfoldingCoeffV
81 print(clsParam.UnfoldingCoeff)
82 payload.set(layerNumber, ladderNumber, sensorNumber, bool(side), 1, clsParam)
83
84 Belle2.Database.Instance().storeData(Belle2.SVDClustering.name, payload, iov)
85
86
87b2conditions.prepend_globaltag('svd_onlySVDinGeoConfiguration')
88
89main = b2.create_path()
90
91# Event info setter - execute single event
92eventinfosetter = b2.register_module('EventInfoSetter')
93eventinfosetter.param({'evtNumList': [1], 'expList': 0, 'runList': 0})
94main.add_module(eventinfosetter)
95
96main.add_module("Gearbox")
97main.add_module("Geometry")
98
99main.add_module(defaultSVDClusteringImporter())
100
101# Show progress of processing
102progress = b2.register_module('Progress')
103main.add_module(progress)
104
105# Process events
106b2.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