Belle II Software
development
DQMHistAnalysisSVD_test.py
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
4
11
12
# script to analyze raw histograms from DQM modules
13
#
14
# Usage: basf2 DQMHistAnalysisSVD_test.py input_files
15
# input_files: one of the raw dqm files placed under /group/belle2/phase3/dqm/dqmsrv1/
16
#
17
# i.e basf2 DQMHistAnalysisSVD_test.py /group/belle2/phase3/dqm/dqmsrv1/e0018/dqmhisto/erecodqm_e0018r001313.root
18
# -----------------------------------------------------------------------------------------------
19
20
21
import
basf2
as
b2
22
import
sys
23
import
re
24
25
argv = sys.argv
26
if
len(argv) < 2:
27
print(
'\nUsage: %s input_filename\n'
% argv[0])
28
exit(1)
29
inputFile = sys.argv[1]
30
fileOut = sys.argv[2]
31
32
exp_nr = int(re.findall(
r'\d+'
, inputFile)[0])
33
run_nr = int(re.findall(
r'\d+'
, inputFile)[1])
34
35
# Set log level
36
b2.set_log_level(b2.LogLevel.INFO)
37
38
# Create main path
39
main = b2.create_path()
40
41
# Load histograms from file
42
main.add_module(
'DQMHistAnalysisInputRootFile'
,
43
Experiment=0,
44
RunList=[0],
45
FileList=[inputFile],
46
EventsList=[1],
47
RunType=
'physics'
,
48
EventInterval=1)
49
50
main.add_module(
'Gearbox'
)
51
main.add_module(
'Geometry'
)
52
53
# enable EPICS
54
main.add_module(
'DQMHistAnalysisEpicsEnable'
)
55
56
# Analysis module to calculate unpacker error
57
main.add_module(
'DQMHistAnalysisSVDUnpacker'
,
58
samples3=
False
)
59
60
# Analysis module to calculate occupancy of each sensor and check control plots
61
main.add_module(
'DQMHistAnalysisSVDOccupancy'
,
62
samples3=
False
)
63
64
# Analysis module to calculate cluster time on tracks
65
main.add_module(
'DQMHistAnalysisSVDClustersOnTrack'
,
66
samples3=
False
)
67
68
# Analysis module to calculate efficiency of each sensor
69
main.add_module(
'DQMHistAnalysisSVDEfficiency'
,
70
samples3=
False
)
71
72
# mirabelle
73
main.add_module(
'DQMHistAnalysisSVDOnMiraBelle'
)
74
75
# Save canvases based on histograms used to prepare monitoring variables and monitoring variables to root file
76
main.add_module(
'DQMHistAnalysisOutputMonObj'
,
77
exp=exp_nr,
78
run=run_nr)
79
80
# Dose analysis
81
# main.add_module('DQMHistAnalysisSVDDose')
82
83
# injection
84
# main.add_module('DQMHistInjection')
85
86
# Output canvases to root file
87
main.add_module(
'DQMHistAnalysisOutputFile'
,
88
OutputFolder=
"./"
,
89
Filename=fileOut,
90
SaveHistos=
False
,
91
SaveCanvases=
True
)
92
93
# Process all event at main path
94
b2.process(main, calculateStatistics=
True
)
95
96
# Print modules' statistics
97
print(b2.statistics)
dqm
analysis
examples
DQMHistAnalysisSVD_test.py
Generated on Mon Sep 1 2025 02:49:46 for Belle II Software by
1.13.2