Belle II Software  release-05-02-19
monitoringObject.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 
9 # Set the log level to show only error and fatal messages
10 # set_log_level(LogLevel.ERROR)
11 b2.set_log_level(b2.LogLevel.INFO)
12 # set_log_level(LogLevel.DEBUG)
13 # set_debug_level(1000)
14 
15 # Create main path
16 main = b2.create_path()
17 
18 # Modules
19 
20 # input root file with DQM histograms
21 inroot = b2.register_module('DQMHistAnalysisInputRootFile')
22 inroot.param('InputRootFile', sys.argv[1])
23 inroot.param('SelectFolders', 'ARICH')
24 main.add_module(inroot)
25 
26 # add DQM analysis module
27 arich = b2.register_module('DQMHistAnalysisMonObj')
28 main.add_module(arich)
29 
30 # output created MonitoringObject to the root file
31 outroot = b2.register_module('DQMHistAnalysisOutputMonObj')
32 outroot.param('ProcID', 'online') # set processing ID
33 # uncomment to to store monitoring variables to run summary TTree
34 # outroot.param('TreeFile', 'run_tree.root')
35 main.add_module(outroot)
36 
37 
38 b2.print_path(main)
39 # Process all events
40 b2.process(main)