Belle II Software  release-08-01-10
DQM_V0.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2 as b2
13 import sys
14 argv = sys.argv
15 
16 
17 # Set the log level to show only error and fatal messages
18 # set_log_level(LogLevel.ERROR)
19 b2.set_log_level(b2.LogLevel.INFO)
20 # set_log_level(LogLevel.DEBUG)
21 # set_debug_level(1000)
22 
23 # Create main path
24 main = b2.create_path()
25 
26 # Modules
27 inroot = b2.register_module('DQMHistAnalysisInputRootFile')
28 inroot.param('InputRootFile', sys.argv[1])
29 main.add_module(inroot)
30 
31 # input = register_module('DQMHistAnalysisInput')
32 # input.param('HistMemoryPath', argv[1])
33 # main.add_module(input)
34 
35 # main.add_module("DQMHistAutoCanvas") # Plot all Histo from Input not needed
36 
37 # v0a = register_module('DQMHistAnalysisV0')
38 # v0a.param('OverlayPath', Belle2.FileSystem.findFile('/dqm/analysis/CAD'))
39 # main.add_module(v0a)
40 
41 epicsarray = b2.register_module('DQMHistOutputToEPICS')
42 epicsarray.param('HistoList', [
43  ['V0Objects/xvsz', 'DQM:Beam:V0:XZ', 'DQM:Beam:V0:XZ:Last'],
44  ['V0Objects/xvsy[0]', 'DQM:Beam:V0:XY0', 'DQM:Beam:V0:XY0:Last'],
45  ['V0Objects/xvsy[1]', 'DQM:Beam:V0:XY1', 'DQM:Beam:V0:XY1:Last'],
46  ['V0Objects/xvsy[2]', 'DQM:Beam:V0:XY2', 'DQM:Beam:V0:XY2:Last'],
47  ['V0Objects/xvsy[3]', 'DQM:Beam:V0:XY3', 'DQM:Beam:V0:XY3:Last'],
48  ['V0Objects/xvsy[4]', 'DQM:Beam:V0:XY4', 'DQM:Beam:V0:XY4:Last'],
49  ['V0Objects/xvsy[5]', 'DQM:Beam:V0:XY5', 'DQM:Beam:V0:XY5:Last'],
50  ['V0Objects/xvsy[6]', 'DQM:Beam:V0:XY6', 'DQM:Beam:V0:XY6:Last'],
51  ['V0Objects/xvsy[7]', 'DQM:Beam:V0:XY7', 'DQM:Beam:V0:XY7:Last'],
52  ['V0Objects/xvsy[8]', 'DQM:Beam:V0:XY8', 'DQM:Beam:V0:XY8:Last'],
53  ['V0Objects/xvsy[9]', 'DQM:Beam:V0:XY9', 'DQM:Beam:V0:XY9:Last'],
54  ['V0Objects/xvsy[10]', 'DQM:Beam:V0:XY10', 'DQM:Beam:V0:XY10:Last'],
55  ['V0Objects/xvsy[11]', 'DQM:Beam:V0:XY11', 'DQM:Beam:V0:XY11:Last'],
56  ['V0Objects/xvsy[12]', 'DQM:Beam:V0:XY12', 'DQM:Beam:V0:XY12:Last'],
57  ['V0Objects/xvsy[13]', 'DQM:Beam:V0:XY13', 'DQM:Beam:V0:XY13:Last'],
58  ['V0Objects/xvsy[14]', 'DQM:Beam:V0:XY14', 'DQM:Beam:V0:XY14:Last'],
59  ['V0Objects/xvsy[15]', 'DQM:Beam:V0:XY15', 'DQM:Beam:V0:XY15:Last'],
60  ['V0Objects/xvsy[16]', 'DQM:Beam:V0:XY16', 'DQM:Beam:V0:XY16:Last'],
61  ['V0Objects/xvsy[17]', 'DQM:Beam:V0:XY17', 'DQM:Beam:V0:XY17:Last'],
62  ['V0Objects/xvsy[18]', 'DQM:Beam:V0:XY18', 'DQM:Beam:V0:XY18:Last'],
63  ['V0Objects/xvsy[19]', 'DQM:Beam:V0:XY19', 'DQM:Beam:V0:XY19:Last'],
64  ['V0Objects/xvsy[20]', 'DQM:Beam:V0:XY20', 'DQM:Beam:V0:XY20:Last'],
65  ['V0Objects/xvsy[21]', 'DQM:Beam:V0:XY21', 'DQM:Beam:V0:XY21:Last'],
66  ['V0Objects/xvsy[22]', 'DQM:Beam:V0:XY22', 'DQM:Beam:V0:XY22:Last'],
67  ['V0Objects/xvsy[23]', 'DQM:Beam:V0:XY23', 'DQM:Beam:V0:XY23:Last'],
68  ['V0Objects/xvsy[24]', 'DQM:Beam:V0:XY24', 'DQM:Beam:V0:XY24:Last'],
69  ['V0Objects/xvsy[25]', 'DQM:Beam:V0:XY25', 'DQM:Beam:V0:XY25:Last'],
70  ['V0Objects/xvsy[26]', 'DQM:Beam:V0:XY26', 'DQM:Beam:V0:XY26:Last'],
71  ['V0Objects/xvsy[27]', 'DQM:Beam:V0:XY27', 'DQM:Beam:V0:XY27:Last'],
72  ['V0Objects/xvsy[28]', 'DQM:Beam:V0:XY28', 'DQM:Beam:V0:XY28:Last'],
73  ['V0Objects/xvsy[29]', 'DQM:Beam:V0:XY29', 'DQM:Beam:V0:XY29:Last'],
74  ['V0Objects/xvsy[30]', 'DQM:Beam:V0:XY30', 'DQM:Beam:V0:XY30:Last'],
75  ['V0Objects/xvsy[31]', 'DQM:Beam:V0:XY31', 'DQM:Beam:V0:XY31:Last'],
76 ])
77 
78 
79 main.add_module(epicsarray)
80 
81 # outroot = register_module('DQMHistAnalysisOutputFile')
82 # outroot.param('SaveHistos', False) # don't save histograms
83 # outroot.param('SaveCanvases', True) # save canvases
84 # main.add_module(outroot)
85 
86 output = b2.register_module('DQMHistAnalysisOutputRelayMsg')
87 # check that port fit your root canvas server
88 output.param('Port', int(argv[2]))
89 main.add_module(output)
90 
91 
92 b2.print_path(main)
93 # Process all events
94 b2.process(main)