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