Belle II Software  release-06-02-00
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 
35 top = b2.register_module('DQMHistAnalysisTOP')
36 main.add_module(top)
37 
38 # Output to root file
39 # output = register_module('DQMHistAnalysisOutputFile')
40 # output.param('SaveHistos', False) # don't save histograms
41 # output.param('SaveCanvases', True) # save canvases
42 # main.add_module(output)
43 
44 # Output to canvas server
45 output = b2.register_module('DQMHistAnalysisOutputRelayMsg')
46 output.param("Port", 9192) # This port must match the port used in canvasserver.C
47 main.add_module(output)
48 
49 # Process all events
50 b2.process(main)