Belle II Software
development
Toggle main menu visibility
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
x
z
Typedefs
a
b
c
d
e
g
i
k
l
m
n
p
r
s
t
u
v
w
Enumerations
Enumerator
c
d
f
p
t
v
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
z
Related Functions
b
c
d
g
i
o
r
s
t
Files
File List
File Members
All
Functions
Typedefs
Macros
DQMHistAnalysisSVDMiraBelle_test.py
1
#!/usr/bin/env python3
2
3
10
11
# script to test module which create monitoring variables for SVD
12
#
13
# Usage: basf2 DQMHistAnalysisSVDMiraBelle_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 DQMHistAnalysisSVDMiraBelle_test.py /group/belle2/phase3/dqm/dqmsrv1/e0018/dqmhisto/erecodqm_e0018r001313.root
17
# Output file in format: mon_e0018r001313_online.root contains moniotring variables which can be pinted by script:
18
# dqm/analysis/examples/printDQMFile.C
19
20
import
basf2
as
b2
21
import
os
22
import
sys
23
import
re
24
25
argv = sys.argv
26
if
len(argv) < 2:
27
print(f
'\nUsage: {argv[0]} input_filename\n'
)
28
exit(1)
29
inputFile = sys.argv[1]
30
31
directory, fileName = os.path.split(inputFile)
32
exp_nr = int(re.findall(
r'\d+'
, fileName)[0])
33
run_nr = int(re.findall(
r'\d+'
, fileName)[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
SelectHistograms=[
"SVDExpReco/*"
,
48
"SVDClsTrk/*"
,
49
"SVDEfficiency/*"
],
50
EventInterval=1,
51
NullHistogramMode=
False
)
52
# main.add_module("DQMHistAutoCanvas") # Plot all Histo from Input not needed
53
54
# Run analysis module
55
main.add_module(
'DQMHistAnalysisSVDOnMiraBelle'
)
56
57
# Save canvases based on histograms used to prepare monitoring variables and monitoring variables to root file
58
main.add_module(
'DQMHistAnalysisOutputMonObj'
,
59
exp=exp_nr,
60
run=run_nr)
61
62
# Process the events
63
b2.print_path(main)
64
b2.process(main)
65
66
# print out the summary
67
print(b2.statistics)
dqm
analysis
examples
DQMHistAnalysisSVDMiraBelle_test.py
Generated on Sat Apr 12 2025 02:39:33 for Belle II Software by
1.9.6