Belle II Software  release-08-01-10
writeCKFParametersToDB.py
1 #!/usr/bin/env python3
2 
3 
10 
11 from ROOT import Belle2
12 
13 
14 def writeCKFParametersToDB(iovList=(0, 0, 0, 0), ptThreshold=-1., layerJumpLowPt=1, layerJumpHighPt=1):
15  """
16  run this script to create db file storing the payload information of the CKFParameters
17  see `tracking/dbobjects/include/CKFParameters.h` for definition of the parameters
18  """
19 
20  # just a small sanity check (expLow, runLow, expHigh, runHigh)
21  if len(iovList) != 4:
22  return
23 
24  # make sure the defined parameters make sense.
25  if layerJumpLowPt < 0 or layerJumpHighPt < 0:
26  return
27  # If you don't want to use different parameters for low/high pt,
28  # please set 'ptThreshold' to -1 and assign same value to layerJumpLowPt/layerJumpHighPt
29  if ptThreshold <= 0.:
30  if (layerJumpLowPt != layerJumpHighPt):
31  return
32 
33  # create the iov
34  iov = Belle2.IntervalOfValidity(*iovList)
35  # and the payload object
36  dbobj = Belle2.CKFParameters()
37  # then set the parameters it contains
38  dbobj.setLayerJumpPtThreshold(ptThreshold)
39  dbobj.setLayerJumpLowPt(layerJumpLowPt)
40  dbobj.setLayerJumpHighPt(layerJumpHighPt)
41 
42  # write db object to 'localdb/'
43  Belle2.Database.Instance().storeData("PXDCKFSeedHitParameters", dbobj, iov)
44 
45 
46 if __name__ == "__main__":
47  # writeCKFParametersToDB((1002,0,1003,-1), -1, 1, 1)
48  writeCKFParametersToDB((0, 0, 0, -1), 0.5, 0, 1)
The payload containing all parameters for the PXD and SVD CKF.
Definition: CKFParameters.h:23
A class that describes the interval of experiments/runs for which an object in the database is valid.
static Database & Instance()
Instance of a singleton Database.
Definition: Database.cc:42