46 lines
1.4 KiB
C++
46 lines
1.4 KiB
C++
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#ifndef JUNGFRAUJOCH_MXANALYZER_H
|
|
#define JUNGFRAUJOCH_MXANALYZER_H
|
|
|
|
#include "../common/DiffractionExperiment.h"
|
|
#include "bragg_integration/BraggPrediction.h"
|
|
#include "indexing/IndexerThreadPool.h"
|
|
#include "spot_finding/StrongPixelSet.h"
|
|
|
|
class MXAnalysisAfterFPGA {
|
|
mutable std::mutex read_from_cpu_mutex;
|
|
const DiffractionExperiment &experiment;
|
|
IndexerThreadPool *indexer = nullptr;
|
|
std::unique_ptr<BraggPrediction> prediction;
|
|
|
|
bool find_spots = false;
|
|
std::vector<DiffractionSpot> spots;
|
|
constexpr static const float spot_distance_threshold_pxl = 2.0f;
|
|
|
|
std::vector<float> arr_mean;
|
|
std::vector<float> arr_sttdev;
|
|
std::vector<uint32_t> arr_valid_count;
|
|
std::vector<uint32_t> arr_strong_pixel;
|
|
public:
|
|
|
|
explicit MXAnalysisAfterFPGA(const DiffractionExperiment& experiment);
|
|
|
|
void ReadFromFPGA(const DeviceOutput* output,
|
|
const SpotFindingSettings& settings,
|
|
size_t module_number);
|
|
|
|
void ReadFromCPU(DeviceOutput *output,
|
|
const SpotFindingSettings &settings,
|
|
size_t module_number);
|
|
|
|
void Process(DataMessage &message,
|
|
const SpotFindingSettings& settings);
|
|
|
|
MXAnalysisAfterFPGA& SetIndexer(IndexerThreadPool *input);
|
|
};
|
|
|
|
|
|
#endif //JUNGFRAUJOCH_MXANALYZER_H
|