Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cmsgemonline
gem-daq
cmsgemos-analysis
Commits
00709f55
Commit
00709f55
authored
May 13, 2022
by
Camilla Galloni
Browse files
Set the range of sbit plots as a function of max rate
parent
780304b2
Pipeline
#3969074
passed with stages
in 2 minutes and 40 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gemos/analysis/threshold_scan_analysis.py
View file @
00709f55
...
...
@@ -32,9 +32,12 @@ def create_configuration(input_filenames, output_directory, target_rate, plottin
def
plot_scan_oh
(
df
):
"""Plot threshold scans for all VFATs in single OH"""
def
plot_scan_vfat
(
vfat
,
df
,
ax
):
def
plot_scan_vfat
(
vfat
,
df
,
ax
,
time_interval
):
"""Plot threshold scan for single VFAT"""
ax
.
plot
(
df
[
"dac-value"
],
df
[
"rate"
],
"o"
)
# The axis limit is chosen to be twice the maximum rate aquired in the time interval of the scan
ax
.
set_ylim
(
1
,
time_interval
*
40080000
*
2
)
ax
.
set_xlim
(
0
,
255
)
ax
.
title
.
set_text
(
f
"VFAT
{
vfat
}
"
)
ax
.
set_xlabel
(
"THR_ARM_DAC"
)
ax
.
set_ylabel
(
"S-bt rate (Hz)"
)
...
...
@@ -44,6 +47,12 @@ def create_configuration(input_filenames, output_directory, target_rate, plottin
slot
=
df
.
iloc
[
0
][
"slot"
]
oh
=
df
.
iloc
[
0
][
"oh"
]
# The s-bit counters increase of maximum 1 per each bunch crossing;
# the bunch crissing rate in LHC is 40.07897 MHz approximated to 4008000 MHz
# giving a possible increase in the s-bit counters of maximum 4008000 per second.
# The time interval used for the scan can be estimated in second as:
time_interval
=
(
df
[
"rate"
].
max
()
//
40080000
)
+
1
vfat_group
=
df
.
groupby
([
"vfat"
])
nrows
,
ncols
=
3
,
int
(
np
.
ceil
(
len
(
vfat_group
)
/
3
))
# Round-up the number of columns
...
...
@@ -51,7 +60,7 @@ def create_configuration(input_filenames, output_directory, target_rate, plottin
thr_scan_axs
=
thr_scan_axs
.
flat
for
group_index
,
(
vfat_index
,
vfat_df
)
in
enumerate
(
vfat_group
):
plot_scan_vfat
(
vfat_index
,
vfat_df
,
thr_scan_axs
[
group_index
])
plot_scan_vfat
(
vfat_index
,
vfat_df
,
thr_scan_axs
[
group_index
]
,
time_interval
)
output_figure
=
"{}/plots/fed{}-slot{}-oh{}.png"
.
format
(
output_directory
,
fed
,
slot
,
oh
)
thr_scan_fig
.
savefig
(
output_figure
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment