Belle II Software  release-08-01-10
file_dqm_test.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 # Set the log level to show only error and fatal messages
17 # set_log_level(LogLevel.ERROR)
18 b2.set_log_level(b2.LogLevel.INFO)
19 
20 # Create main path
21 main = b2.create_path()
22 
23 # Modules
24 input = b2.register_module('DQMHistAnalysisInputRootFile')
25 # use full histogram names (wildcard characters supported), leave blank to include all histograms
26 input.param('SelectHistograms', ['TOP/recoTime', 'TOP/recoPull', 'TOP/good_hits_xy_*'])
27 input.param('FileList', ["root_file1.root", "root_file2.root"])
28 input.param('RunList', [3000, 3001])
29 input.param('EventsList', [10, 5])
30 input.param('Experiment', 12)
31 input.param('EventInterval', 10)
32 input.param('NullHistogramMode', False) # Set to True to use the null histogram test mode, in which no histogram will be loaded
33 main.add_module(input)
34 main.add_module("DQMHistAutoCanvas") # Plot all Histo from Input
35 
36 top = b2.register_module('DQMHistAnalysisTOP')
37 main.add_module(top)
38 
39 # Output to root file
40 # output = register_module('DQMHistAnalysisOutputFile')
41 # output.param('SaveHistos', False) # don't save histograms
42 # output.param('SaveCanvases', True) # save canvases
43 # main.add_module(output)
44 
45 # Output to canvas server
46 output = b2.register_module('DQMHistAnalysisOutputRelayMsg')
47 output.param("Port", 9192) # This port must match the port used in canvasserver.C
48 main.add_module(output)
49 
50 # Process all events
51 b2.process(main)