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