Belle II Software development
monitoringObject.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
26
27# input root file with DQM histograms
28inroot = b2.register_module('DQMHistAnalysisInputRootFile')
29inroot.param('InputRootFile', sys.argv[1])
30inroot.param('SelectFolders', 'ARICH')
31main.add_module(inroot)
32main.add_module("DQMHistAutoCanvas") # Plot all Histo from Input
33
34# add DQM analysis module
35arich = b2.register_module('DQMHistAnalysisMonObj')
36main.add_module(arich)
37
38# output created MonitoringObject to the root file
39outroot = b2.register_module('DQMHistAnalysisOutputMonObj')
40outroot.param('ProcID', 'online') # set processing ID
41# uncomment to to store monitoring variables to run summary TTree
42# outroot.param('TreeFile', 'run_tree.root')
43main.add_module(outroot)
44
45
46b2.print_path(main)
47# Process all events
48b2.process(main)