Belle II Software development
getTBCInfo.py
1#!/usr/bin/env python
2
3
10
11# ---------------------------------------------------------------------------------------
12# Prints info about TBC constants in database
13#
14# usage: basf2 getTBCInfo.py expNo runNo [globalTag or localDB]
15# ---------------------------------------------------------------------------------------
16
17import basf2 as b2
18from ROOT import Belle2 # noqa: make Belle2 namespace available
19from ROOT.Belle2 import TOPDatabaseImporter
20import sys
21
22argvs = sys.argv
23if len(argvs) < 3:
24 print("usage: basf2", argvs[0], "expNo runNo [globalTag or localDB]")
25 sys.exit()
26expNo = int(argvs[1])
27runNo = int(argvs[2])
28
29# Database
30tag = '(main)'
31if len(argvs) == 4:
32 tag = argvs[3]
33 if '.txt' in tag:
34 b2.conditions.append_testing_payloads(tag)
35 else:
36 b2.conditions.append_globaltag(tag)
37
38
39class PrintInfo(b2.Module):
40 ''' Prints timebase calibration info '''
41
42 def initialize(self):
43 ''' Prints calibration status of boardstacks '''
44
45 print()
46 print('Experiment =', expNo, 'Run =', runNo, 'global tag =', tag)
47 print()
48
49 dbImporter = TOPDatabaseImporter()
50 dbImporter.printSampleTimeCalibrationInfo()
51
52
53# create path
54main = b2.create_path()
55
56# Event info setter - execute single event
57eventinfosetter = b2.register_module('EventInfoSetter')
58eventinfosetter.param({'evtNumList': [1], 'runList': [runNo], 'expList': [expNo]})
59main.add_module(eventinfosetter)
60
61# Geometry parameters
62main.add_module('TOPGeometryParInitializer')
63
64# Print TBC Info
65main.add_module(PrintInfo())
66
67# process single event
68b2.process(main)
def initialize(self)
Definition: getTBCInfo.py:42