Belle II Software release-09-00-00
importTimeWalk.py
1#!/usr/bin/env python
2
3
10
11# --------------------------------------------------------------------------------
12# Import payload TOPCalTimeWalk
13# --------------------------------------------------------------------------------
14
15import basf2 as b2
16from ROOT.Belle2 import TOPDatabaseImporter
17
18# Create path
19main = b2.create_path()
20
21# Event info setter - execute single event
22eventinfosetter = b2.register_module('EventInfoSetter')
23eventinfosetter.param('evtNumList', [1])
24main.add_module(eventinfosetter)
25
26# Gearbox - access to xml files
27gearbox = b2.register_module('Gearbox')
28main.add_module(gearbox)
29
30# Initialize TOP geometry parameters from gearbox
31main.add_module('TOPGeometryParInitializer', useDB=False)
32
33# process single event
34b2.process(main)
35
36# define a local database to save payloads(created automatically, if not existing)
37b2.conditions.expert_settings(save_payloads="localDB/localDB.txt")
38
39# and then run the importer
40dbImporter = TOPDatabaseImporter()
41
42# import constants
43params = [-106.757,
44 0.317404,
45 4.11324e-06,
46 -1.31485e-07,
47 1.10216e-11] # ps
48a = 8806.6 # ps
49b = 5.25439e-05 # ps
50
51for i in range(len(params)):
52 params[i] /= 1000 # ns
53a /= 1000 # ns
54b /= 1000 # ns
55
56print('time_walk =', params)
57print('a =', a, 'b = ', b)
58
59dbImporter.importTimeWalk(params, a, b)
60
61b2.B2RESULT("Done")