Belle II Software prerelease-11-00-00a
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
37 return p
38
39
40def print_payload(p):
41 """Print the payload values."""
42
43 print(f"\n{PAYLOAD_NAME} payload values:")
44 print()
45 print(f" maximalDeltaPhi = {p.getMaximalDeltaPhi()}")
46 print(f" minimalPtRequirement = {p.getMinimalPtRequirement()}")
47 print(f" maximalLayerJump = {p.getMaximalLayerJump()}")
48 print(f" maximalLayerJumpBackwardSeed = {p.getMaximalLayerJumpBackwardSeed()}")
49 print(f" pathMaximalCandidatesInFlight = {p.getPathMaximalCandidatesInFlight()}")
50 print(f" stateMaximalHitCandidates = {p.getStateMaximalHitCandidates()}")
51 print()
52
53
54def main():
55
56 # Create a test/default payload
58 p = default_payload(p)
59
60 # Print the payload
61 print_payload(p)
62
63 # Store the payload to local conditions DB
64 iov = Belle2.IntervalOfValidity(0, 0, -1, -1)
65 Belle2.Database.Instance().storeData(PAYLOAD_NAME, p, iov)
66
67 # Print storage info
68 print(f"\n{PAYLOAD_NAME} payload stored.")
69 print(f"Metadata : {LOCAL_DB_FILE}")
70 print("Files : localdb/")
71
72
73if __name__ == "__main__":
74 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