Belle II Software development
file_dqm_test.py
1#!/usr/bin/env python3
2
3
10
11import basf2 as b2
12import sys
13argv = sys.argv
14
15# Set the log level to show only error and fatal messages
16# set_log_level(LogLevel.ERROR)
17b2.set_log_level(b2.LogLevel.INFO)
18
19# Create main path
20main = b2.create_path()
21
22# Modules
23input = b2.register_module('DQMHistAnalysisInputRootFile')
24# use full histogram names (wildcard characters supported), leave blank to include all histograms
25input.param('SelectHistograms', ['TOP/recoTime', 'TOP/recoPull', 'TOP/good_hits_xy_*'])
26input.param('FileList', ["root_file1.root", "root_file2.root"])
27input.param('RunList', [3000, 3001])
28input.param('EventsList', [10, 5])
29input.param('Experiment', 12)
30input.param('EventInterval', 10)
31input.param('NullHistogramMode', False) # Set to True to use the null histogram test mode, in which no histogram will be loaded
32main.add_module(input)
33main.add_module("DQMHistAutoCanvas") # Plot all Histo from Input
34
35top = b2.register_module('DQMHistAnalysisTOP')
36main.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
45output = b2.register_module('DQMHistAnalysisOutputRelayMsg')
46output.param("Port", 9192) # This port must match the port used in canvasserver.C
47main.add_module(output)
48
49# Process all events
50b2.process(main)