Belle II Software  release-08-01-10
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 # main.add_module("DQMHistAutoCanvas") # Plot all Histo from Input not needed
38 
39 
40 gearbox = b2.register_module('Gearbox')
41 main.add_module(gearbox)
42 
43 geometry = b2.register_module('Geometry')
44 main.add_module(geometry)
45 
46 
47 # add DQM analysis module
48 arich = b2.register_module('DQMHistAnalysisARICHMonObj')
49 main.add_module(arich)
50 pxd1 = b2.register_module('DQMHistAnalysisPXDTrackCharge')
51 pxd1.param('RefHistoFile', "")
52 main.add_module(pxd1)
53 
54 pxd2 = b2.register_module('DQMHistAnalysisPXDCM')
55 main.add_module(pxd2)
56 
57 pxd3 = b2.register_module('DQMHistAnalysisPXDEff')
58 main.add_module(pxd3)
59 
60 pxd4 = b2.register_module('DQMHistAnalysisPXDReduction')
61 main.add_module(pxd4)
62 
63 
64 # output created MonitoringObject to the root file
65 outroot = b2.register_module('DQMHistAnalysisOutputMonObj')
66 outroot.param('ProcID', 'online') # set processing ID
67 # uncomment to to store monitoring variables to run summary TTree
68 outroot.param('TreeFile', 'run_tree.root')
69 main.add_module(outroot)
70 
71 
72 b2.print_path(main)
73 # Process all events
74 b2.process(main)