Belle II Software development
TestSVDToCDCCKFParametersPayload.py
1#!/usr/bin/env python3
2
3
10
11"""
12Run with: basf2 TestSVDToCDCCKFParametersPayload.py
13"""
14
15import ROOT
16from ROOT import Belle2
17
18
19PAYLOAD_NAME = "SVDToCDCCKFParameters"
20LOCAL_DB_FILE = "localdb/database.txt"
21
22
23def default_payload(p):
24 """Create and return a default SVDToCDCCKFParameters payload.
25 Values match those in SVDToCDCCKFParameters.h constructor."""
26
27 # Float parameters
28 p.setMaximalDeltaPhi(ROOT.TMath.Pi() / 8)
29 p.setMinimalPtRequirement(0.0)
30
31 # Integer parameters
32 p.setMaximalLayerJump(2)
33 p.setMaximalLayerJumpBackwardSeed(3)
34 p.setPathMaximalCandidatesInFlight(3)
35 p.setStateMaximalHitCandidates(4)
36 p.setStateCreatorFirstCDCLayer(0)
37 p.setMaxArcLengthRoughCDCStateFilter(20.)
38
39 return p
40
41
42def print_payload(p):
43 """Print the payload values."""
44
45 print(f"\n{PAYLOAD_NAME} payload values:")
46 print()
47 print(f" maximalDeltaPhi = {p.getMaximalDeltaPhi()}")
48 print(f" minimalPtRequirement = {p.getMinimalPtRequirement()}")
49 print(f" maximalLayerJump = {p.getMaximalLayerJump()}")
50 print(f" maximalLayerJumpBackwardSeed = {p.getMaximalLayerJumpBackwardSeed()}")
51 print(f" pathMaximalCandidatesInFlight = {p.getPathMaximalCandidatesInFlight()}")
52 print(f" stateMaximalHitCandidates = {p.getStateMaximalHitCandidates()}")
53 print(f" stateCreatorFirstCDCLayer = {p.getStateCreatorFirstCDCLayer()}")
54 print(f" maxArcLengthRoughCDCStateFilter = {p.getMaxArcLengthRoughCDCStateFilter()}")
55 print()
56
57
58def main():
59
60 # Create a test/default payload
62 p = default_payload(p)
63
64 # Print the payload
65 print_payload(p)
66
67 # Store the payload to local conditions DB
68 iov = Belle2.IntervalOfValidity(0, 0, -1, -1)
69 Belle2.Database.Instance().storeData(PAYLOAD_NAME, p, iov)
70
71 # Print storage info
72 print(f"\n{PAYLOAD_NAME} payload stored.")
73 print(f"Metadata : {LOCAL_DB_FILE}")
74 print("Files : localdb/")
75
76
77if __name__ == "__main__":
78 main()
A class that describes the interval of experiments/runs for which an object in the database is valid.
The payload containing all parameters for the SVD and CDC CKF.
static Database & Instance()
Instance of a singleton Database.
Definition Database.cc:42
Definition main.py:1