Belle II Software  release-05-01-25
file_dqm_test.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 import basf2 as b2
5 import sys
6 argv = sys.argv
7 
8 # Set the log level to show only error and fatal messages
9 # set_log_level(LogLevel.ERROR)
10 b2.set_log_level(b2.LogLevel.INFO)
11 
12 # Create main path
13 main = b2.create_path()
14 
15 # Modules
16 input = b2.register_module('DQMHistAnalysisInputRootFile')
17 # use full histogram names (wildcard characters supported), leave blank to include all histograms
18 input.param('SelectHistograms', ['TOP/recoTime', 'TOP/recoPull', 'TOP/good_hits_xy_*'])
19 input.param('FileList', ["root_file1.root", "root_file2.root"])
20 input.param('RunList', [3000, 3001])
21 input.param('EventsList', [10, 5])
22 input.param('Experiment', 12)
23 input.param('EventInterval', 10)
24 input.param('NullHistogramMode', False) # Set to True to use the null histogram test mode, in which no histogram will be loaded
25 main.add_module(input)
26 
27 top = b2.register_module('DQMHistAnalysisTOP')
28 main.add_module(top)
29 
30 # Output to root file
31 # output = register_module('DQMHistAnalysisOutputFile')
32 # output.param('SaveHistos', False) # don't save histograms
33 # output.param('SaveCanvases', True) # save canvases
34 # main.add_module(output)
35 
36 # Output to canvas server
37 output = b2.register_module('DQMHistAnalysisOutputRelayMsg')
38 output.param("Port", 9192) # This port must match the port used in canvasserver.C
39 main.add_module(output)
40 
41 # Process all events
42 b2.process(main)