Belle II Software  release-05-02-19
monitoringObject_tmp.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 # example steering to make root file with monitoring object
5 # includes arich and pxd monitoring object
6 # set to use local database
7 
8 import basf2 as b2
9 import sys
10 argv = sys.argv
11 
12 
13 # Set the log level to show only error and fatal messages
14 b2.set_log_level(b2.LogLevel.INFO)
15 
16 b2.conditions.metadata_providers = ["conditions/metadata.sqlite"]
17 b2.conditions.override_globaltags(["master_2020-02-25"])
18 b2.conditions.payload_locations = ["conditions/"]
19 
20 # Create main path
21 main = b2.create_path()
22 
23 # Modules
24 # input root file with DQM histograms
25 inroot = b2.register_module('DQMHistAnalysisInputRootFile')
26 inroot.param('InputRootFile', sys.argv[1])
27 inroot.param('Experiment', 1003)
28 main.add_module(inroot)
29 
30 
31 gearbox = b2.register_module('Gearbox')
32 main.add_module(gearbox)
33 
34 geometry = b2.register_module('Geometry')
35 main.add_module(geometry)
36 
37 
38 # add DQM analysis module
39 arich = b2.register_module('DQMHistAnalysisARICHMonObj')
40 main.add_module(arich)
41 pxd1 = b2.register_module('DQMHistAnalysisPXDTrackCharge')
42 pxd1.param('RefHistoFile', "")
43 main.add_module(pxd1)
44 
45 pxd2 = b2.register_module('DQMHistAnalysisPXDCM')
46 main.add_module(pxd2)
47 
48 pxd3 = b2.register_module('DQMHistAnalysisPXDEff')
49 main.add_module(pxd3)
50 
51 pxd4 = b2.register_module('DQMHistAnalysisPXDReduction')
52 main.add_module(pxd4)
53 
54 
55 # output created MonitoringObject to the root file
56 outroot = b2.register_module('DQMHistAnalysisOutputMonObj')
57 outroot.param('ProcID', 'online') # set processing ID
58 # uncomment to to store monitoring variables to run summary TTree
59 outroot.param('TreeFile', 'run_tree.root')
60 main.add_module(outroot)
61 
62 
63 b2.print_path(main)
64 # Process all events
65 b2.process(main)