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