Belle II Software  release-08-01-10
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 
16 from ROOT import Belle2
17 from 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
24 clusteralgo.setPrefix("PXDClusterPositionCollector")
25 
26 # Can use a Python list of input files/wildcards. It will resolve the existing files
27 clusteralgo.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
32 clusteralgo.minClusterForShapeLikelyhood = 250
33 # Minimum number of collected clusters for estimating cluster position offsets
34 clusteralgo.minClusterForPositionOffset = 1000
35 # Maximum number of eta bins for estimating cluster position offsets
36 clusteralgo.maxEtaBins = 10
37 # Select the clusterkinds to calibrate. This should match with the supplied source files.
38 clusteralgo.clusterKinds.push_back(0)
39 clusteralgo.clusterKinds.push_back(1)
40 clusteralgo.clusterKinds.push_back(2)
41 clusteralgo.clusterKinds.push_back(3)
42 
43 # Could also define an IoV for your calibrations at the start of execution
44 iov = IntervalOfValidity.always()
45 print("Result of calibration =", clusteralgo.execute([], 0, iov))
46 # IoV is applied to payloads during execution and gets used during commit
47 clusteralgo.commit()
Class implementing the PXD cluster position calibration algorithm.