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