Commit 00709f55 authored by Camilla Galloni's avatar 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
......@@ -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_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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment