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