Belle II Software development
pxd_analysis.py
1#!/usr/bin/env python3
2
3
10
11import basf2 as b2
12import sys
13argv = sys.argv
14
15# Set the log level to show only error and fatal messages
16b2.set_log_level(b2.LogLevel.ERROR)
17# set_log_level(LogLevel.INFO)
18# set_log_level(LogLevel.DEBUG)
19
20# globalTag = 'vxd_commissioning_20181030'
21globalTag = 'data_reprocessing_prompt'
22
23b2.conditions.prepend_globaltag(globalTag)
24b2.conditions.prepend_testing_payloads("localdb/database.txt")
25
26
27gearbox = b2.register_module('Gearbox')
28geometry = b2.register_module('Geometry')
29
30
31# Create main path
32main = b2.create_path()
33
34# Modules
35
36input = b2.register_module('DQMHistAnalysisInput')
37input.param('HistMemoryPath', argv[1])
38main.add_module(input)
39# main.add_module("DQMHistAutoCanvas") # Plot all Histo from Input not needed
40
41# input = register_module('DQMHistAnalysisInputRootFile')
42# input.param('InputRootFile', argv[1])
43# main.add_module(input)
44
45main.add_module(gearbox, fileName="/geometry/Belle2_earlyPhase3.xml")
46main.add_module(geometry) # , useDB=True)
47
48pxd_charge = b2.register_module('DQMHistAnalysisPXDCharge')
49pxd_charge.param('histogramDirectoryName', 'PXDER')
50main.add_module(pxd_charge)
51
52pxd_trackcharge = b2.register_module('DQMHistAnalysisPXDTrackCharge')
53pxd_trackcharge.param('histogramDirectoryName', 'PXDER')
54main.add_module(pxd_trackcharge)
55
56pxd_inj = b2.register_module('DQMHistInjection')
57main.add_module(pxd_inj)
58
59pxd_commode = b2.register_module('DQMHistAnalysisPXDCM')
60pxd_commode.param('histogramDirectoryName', 'PXDDAQ')
61main.add_module(pxd_commode)
62
63pxd_effi = b2.register_module('DQMHistAnalysisPXDEff')
64pxd_effi.param('histogramDirectoryName', 'PXDEFF')
65pxd_effi.param("binsU", 16)
66pxd_effi.param("binsV", 24)
67pxd_effi.param("singleHists", False)
68main.add_module(pxd_effi)
69
70pxd_redu = b2.register_module('DQMHistAnalysisPXDReduction')
71pxd_redu.param('histogramDirectoryName', 'PXDDAQ')
72main.add_module(pxd_redu)
73
74# output = register_module('DQMHistAnalysisOutputFile')
75# output.param('SaveHistos', False) # don't save histograms
76# output.param('SaveCanvases', True) # save canvases
77# main.add_module(output)
78
79output = b2.register_module('DQMHistAnalysisOutputRelayMsg')
80# check that port fit your root canvas server
81output.param('Port', int(argv[2]))
82main.add_module(output)
83
84# Process all events
85b2.process(main)