Belle II Software  release-08-01-10
getTBCInfo.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # ---------------------------------------------------------------------------------------
13 # Prints info about TBC constants in database
14 #
15 # usage: basf2 getTBCInfo.py expNo runNo [globalTag or localDB]
16 # ---------------------------------------------------------------------------------------
17 
18 import basf2 as b2
19 from ROOT.Belle2 import TOPDatabaseImporter
20 import sys
21 
22 argvs = sys.argv
23 if len(argvs) < 3:
24  print("usage: basf2", argvs[0], "expNo runNo [globalTag or localDB]")
25  sys.exit()
26 expNo = int(argvs[1])
27 runNo = int(argvs[2])
28 
29 # Database
30 tag = '(main)'
31 if 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 
39 class 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
54 main = b2.create_path()
55 
56 # Event info setter - execute single event
57 eventinfosetter = b2.register_module('EventInfoSetter')
58 eventinfosetter.param({'evtNumList': [1], 'runList': [runNo], 'expList': [expNo]})
59 main.add_module(eventinfosetter)
60 
61 # Geometry parameters
62 main.add_module('TOPGeometryParInitializer')
63 
64 # Print TBC Info
65 main.add_module(PrintInfo())
66 
67 # process single event
68 b2.process(main)
def initialize(self)
Definition: getTBCInfo.py:42