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