Belle II Software
development
DQMHistAnalysisSVD_test.py
1
#!/usr/bin/env python3
2
3
10
11
# script to analyze raw histograms from DQM modules
12
#
13
# Usage: basf2 DQMHistAnalysisSVD_test.py input_files
14
# input_files: one of the raw dqm files placed under /group/belle2/phase3/dqm/dqmsrv1/
15
#
16
# i.e basf2 DQMHistAnalysisSVD_test.py /group/belle2/phase3/dqm/dqmsrv1/e0018/dqmhisto/erecodqm_e0018r001313.root
17
# -----------------------------------------------------------------------------------------------
18
19
20
import
basf2
as
b2
21
import
sys
22
23
argv = sys.argv
24
if
len(argv) < 2:
25
print(f
'\nUsage: {argv[0]} input_filename\n'
)
26
exit(1)
27
inputFile = sys.argv[1]
28
29
# Set log level
30
b2.set_log_level(b2.LogLevel.INFO)
31
32
# Create main path
33
main = b2.create_path()
34
35
# Load histograms from file
36
main.add_module(
'DQMHistAnalysisInputRootFile'
,
37
Experiment=0,
38
RunList=[0],
39
FileList=[inputFile],
40
EventsList=[1],
41
SelectHistograms=[
"DQMInfo/rtype"
,
42
"SVDExpReco/*"
,
43
"SVDUnpacker/DQMUnpackerHisto"
,
44
"SVDClsTrk/SVDTRK_ClusterTimeV456"
,
45
"SVDEfficiency/*"
],
46
EventInterval=1,
47
NullHistogramMode=
False
,
48
AutoCanvas=
False
)
49
# main.add_module("DQMHistAutoCanvas") # Plot all Histo from Input not needed
50
51
main.add_module(
'Gearbox'
)
52
main.add_module(
'Geometry'
)
53
54
# Analysis module to calculate occupancy of each sensor and check control plots
55
main.add_module(
'DQMHistAnalysisSVDGeneral'
)
56
57
# Analysis module to calculate efficiency of each sensor
58
main.add_module(
'DQMHistAnalysisSVDEfficiency'
)
59
60
# Output canvases to root file
61
main.add_module(
'DQMHistAnalysisOutputFile'
,
62
HistoFile=
"output_dqmHistAnalysis.root"
,
63
SaveHistos=
False
,
64
SaveCanvases=
True
)
65
66
# Process all event at main path
67
b2.process(main)
68
69
# Print modules' statistics
70
print(b2.statistics)
dqm
analysis
examples
DQMHistAnalysisSVD_test.py
Generated on Fri Nov 8 2024 02:36:04 for Belle II Software by
1.9.6