Belle II Software development
writeKinkFinderParametersToDB.py
1#!/usr/bin/env python
2
3
10
11from ROOT import Belle2
12
13
15 """
16 run this script to create db file storing the payload information of the KinkFinderParameters
17 see `tracking/dbobjects/include/KinkFinderParameters.h` for definition of the parameters
18 """
19
20 parameters = Belle2.KinkFinderParameters()
21
22 # kinkFitter working mode (unsigned char) from 0 to 15 in binary:
23 # 1st bit: reassign hits (1 is On, 0 is Off)
24 # 2nd bit: flip tracks with close end points (1 is On, 0 is Off)
25 # 3rd bit: fit both tracks as one (1 is On, 0 is Off)
26 # 4th bit: find candidate tracks to be split and do it (1 is On, 0 is Off)
27 kinkFitterMode = 0b1111
28 # Cut on Chi2 for the Kink vertex (double)
29 vertexChi2Cut = 10000.
30 # Cut on distance between tracks at the Kink vertex [cm] (double)
31 vertexDistanceCut = 2.
32 # Preselection cut on transverse shift from the outer CDC wall for the track ending points [cm] (double)
33 precutRho = 10.
34 # Preselection cut on z shift from the outer CDC wall for the track ending points [cm] (double)
35 precutZ = 0.
36 # Preselection cut on distance between ending points of two tracks [cm] (double)
37 precutDistance = 10.
38 # Preselection cut on 2D distance between ending points of two tracks (for bad z cases) [cm] (double)
39 precutDistance2D = 10.
40 # Preselection cut on maximal number of fitted CDC hits for a track candidate to be split (int)
41 precutSplitNCDCHit = 49
42 # Preselection cut on maximal p-value for a track candidate to be split
43 precutSplitPValue = 0.01
44
45 parameters.setParameters(kinkFitterMode, vertexChi2Cut, vertexDistanceCut,
46 precutRho, precutZ, precutDistance, precutDistance2D,
47 precutSplitNCDCHit, precutSplitPValue)
48 iov = Belle2.IntervalOfValidity(0, 0, -1, -1)
49
50 # write db object to 'localdb/'
51 Belle2.Database.Instance().storeData('KinkFinderParameters', parameters, iov)
52
53
54if __name__ == '__main__':
A class that describes the interval of experiments/runs for which an object in the database is valid.
The payload containing the parameters for the kinkFinder.
static Database & Instance()
Instance of a singleton Database.
Definition: Database.cc:42