Open mattiasoldani opened 11 months ago
Update: the polarity-dependent factor is not needed since all the waveforms are turned positive beforehand. However, since the selection on the PH really makes sense only after the baseline subtraction, currently not considered here, this modification is still needed:
# 2d-histogram with beam spot
fig2 = plt.figure(figsize=(10, 5))
sel_num = (np.amax(data["wave"+str(ind_wave[var0+"_BaseSub"])], axis=1)>sigCutSpot)
num = (np.array(data["x%s0" % var0])[sel_num], np.array(data["x%s1" % var0])[sel_num])
den = (np.array(data["x%s0" % var0]), np.array(data["x%s1" % var0]))
Another thing: it is worth it to modify this part by adding the last 2 lines:
ax2 = fig2.add_subplot(122)
ax2.set_title("detector efficiency spot, signal > %d" % sigCutSpot)
sl.hist2dRatio(num[0], num[1], den[0], den[1], bins=(xplot2, xplot2), ax=ax2, cmap="viridis") ;
ax2.plot(
(fidcut[0][0], fidcut[0][1], fidcut[0][1], fidcut[0][0], fidcut[0][0]),
(fidcut[1][0], fidcut[1][0], fidcut[1][1], fidcut[1][1], fidcut[1][0]),
color="red", ls="--"
)
ax2.grid(True)
ax2.set_xlim((xplot2[0], xplot2[-1]))
ax2.set_ylim((xplot2[0], xplot2[-1]))
This determines that the plot axis limits are set according to the user's preference rather than imposed by the fiducial cut box.
It should be something like
i.e. the selection on PH should depend on the waveform polarity (because negative waveforms are simply transformed with a minus sign).