Belle II Software development
cluster_position_algo.py
1#!/usr/bin/env python3
2
3
10
11# This steering file to create an localdb containing PXDClusterPosition payloads
12# in a localdb
13#
14# Execute as: basf2 cluster_position_algo.py
15
16from ROOT import Belle2
17from ROOT.Belle2 import IntervalOfValidity
18
19# Only initialize RootInput, as we do not loop over events,
20# only load persistent objects stored during data collection
22
23# Set the prefix manually if you want to use the hotpixelkiller for a specific collector
24clusteralgo.setPrefix("PXDClusterPositionCollector")
25
26# Can use a Python list of input files/wildcards. It will resolve the existing files
27clusteralgo.setInputFileNames(["PXDClusterPositionCollectorOutput_kind_0.root", "PXDClusterPositionCollectorOutput_kind_1.root",
28 "PXDClusterPositionCollectorOutput_kind_2.root", "PXDClusterPositionCollectorOutput_kind_3.root"])
29
30# Here, we can play around with algo parameters
31# Minimum number of collected clusters for estimating shape likelyhood
32clusteralgo.minClusterForShapeLikelyhood = 250
33# Minimum number of collected clusters for estimating cluster position offsets
34clusteralgo.minClusterForPositionOffset = 1000
35# Maximum number of eta bins for estimating cluster position offsets
36clusteralgo.maxEtaBins = 10
37# Select the clusterkinds to calibrate. This should match with the supplied source files.
38clusteralgo.clusterKinds.push_back(0)
39clusteralgo.clusterKinds.push_back(1)
40clusteralgo.clusterKinds.push_back(2)
41clusteralgo.clusterKinds.push_back(3)
42
43# Could also define an IoV for your calibrations at the start of execution
44iov = IntervalOfValidity.always()
45print("Result of calibration =", clusteralgo.execute([], 0, iov))
46# IoV is applied to payloads during execution and gets used during commit
47clusteralgo.commit()
Class implementing the PXD cluster position calibration algorithm.