JFJochReceiverPlots: Use AutoIncrVector for XFEL pulse ID / event code

This commit is contained in:
2025-12-08 10:34:05 +01:00
parent 916e8349ab
commit b2325554f9
3 changed files with 13 additions and 8 deletions

View File

@@ -44,6 +44,10 @@ public:
bool empty() const {
return v.empty();
}
void Clear() {
v.clear();
}
};
#endif //JFJOCH_AUTOINCRVECTOR_H

View File

@@ -89,11 +89,12 @@ void JFJochReceiverPlots::Add(const DataMessage &msg, const AzimuthalIntegration
{
std::unique_lock ul(m);
*az_int_profile += profile;
if (msg.xfel_pulse_id.has_value())
xfel_pulse_id[msg.number] = msg.xfel_pulse_id.value();
if (msg.xfel_event_code.has_value())
xfel_event_code[msg.number] = msg.xfel_event_code.value();
}
xfel_pulse_id.AddElement(msg.number, msg.xfel_pulse_id);
xfel_event_code.AddElement(msg.number, msg.xfel_event_code);
for (const auto &[key, value] : msg.roi) {
roi_sum.AddElement(key, msg.number, value.sum);
roi_mean.AddElement(key, msg.number, static_cast<double>(value.sum) / static_cast<double>(value.pixels));
@@ -277,11 +278,11 @@ std::optional<float> JFJochReceiverPlots::GetBkgEstimate() const {
}
void JFJochReceiverPlots::GetXFELPulseID(std::vector<uint64_t> &v) const {
v = xfel_pulse_id.ExportArray(0);
v = xfel_pulse_id.vec();
}
void JFJochReceiverPlots::GetXFELEventCode(std::vector<uint64_t> &v) const {
v = xfel_event_code.ExportArray(0);
v = xfel_event_code.vec();
}
std::vector<float> JFJochReceiverPlots::GetAzIntProfile() const {

View File

@@ -7,6 +7,7 @@
#include "../common/StatusVector.h"
#include "../common/Histogram.h"
#include "../common/ADUHistogram.h"
#include "../common/AutoIncrVector.h"
#include "../common/DiffractionExperiment.h"
#include "../common/AzimuthalIntegrationProfile.h"
#include "../common/JFJochMessages.h"
@@ -19,9 +20,8 @@ class JFJochReceiverPlots {
std::optional<GridScanSettings> grid_scan;
int64_t default_binning = 1;
std::unique_ptr<AzimuthalIntegrationProfile> az_int_profile;
StatusVector<uint64_t> xfel_pulse_id;
StatusVector<uint64_t> xfel_event_code;
AutoIncrVector<uint64_t> xfel_pulse_id;
AutoIncrVector<uint64_t> xfel_event_code;
StatusVector<float> bkg_estimate;
StatusVector<int64_t> spot_count;