// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #ifndef JUNGFRAUJOCH_AZIMUTHALINTEGRATIONPROFILE_H #define JUNGFRAUJOCH_AZIMUTHALINTEGRATIONPROFILE_H #include #include #include "MultiLinePlot.h" #include "AzimuthalIntegration.h" #include "../acquisition_device/AcquisitionDevice.h" class AzimuthalIntegrationProfile { mutable std::mutex m; std::vector sum; std::vector sum2; std::vector count; std::vector bin_to_q; std::vector bin_to_d; std::vector bin_to_2theta; std::vector bin_to_phi; std::vector bin_to_q_1d; int32_t q_bins; int32_t azim_bins; std::string title; const std::vector& GetXAxis(PlotAzintUnit unit) const; public: explicit AzimuthalIntegrationProfile(const AzimuthalIntegration &mapping); void Clear(const AzimuthalIntegration &mapping); void SetTitle(const std::string& input); void Add(const DeviceOutput &result); void Add(const std::vector &sum, const std::vector &count); void Add(int64_t bin, int64_t value); std::vector GetResult() const; std::vector GetResult1D() const; float GetMeanValueOfBins(uint16_t min_bin, uint16_t max_bin) const; float GetBkgEstimate(const AzimuthalIntegrationSettings& settings) const; MultiLinePlot GetPlot(bool force_1d = false, PlotAzintUnit plot_unit = PlotAzintUnit::Q_recipA) const; AzimuthalIntegrationProfile& operator+=(const AzimuthalIntegrationProfile& profile); // Not thread safe }; #endif //JUNGFRAUJOCH_AZIMUTHALINTEGRATIONPROFILE_H