StrongPixelSet: ReadFPGAOutput (not tested)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <bitset>
|
||||
#include "StrongPixelSet.h"
|
||||
#include "../common/RawToConvertedGeometry.h"
|
||||
|
||||
StrongPixelSet::StrongPixelSet(const DiffractionExperiment &experiment)
|
||||
: xpixel(experiment.GetXPixelsNum()),
|
||||
@@ -122,4 +123,21 @@ size_t StrongPixelSet::Common(const StrongPixelSet &set) const {
|
||||
ret++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
void StrongPixelSet::ReadFPGAOutput(const DiffractionExperiment& experiment,
|
||||
const DeviceOutput &output,
|
||||
uint16_t module) {
|
||||
auto out_ptr = (uint32_t *) output.spot_finding_result.strong_pixel;
|
||||
for (int i = 0; i < RAW_MODULE_SIZE / (8 * sizeof(out_ptr[0])); i++) {
|
||||
if (out_ptr[i]) {
|
||||
for (int j = 0; j < 8 * sizeof(out_ptr[0]); j++) {
|
||||
if (out_ptr[i] & (1 << j)) {
|
||||
size_t npixel = i * 8 * sizeof(out_ptr[0])| j;
|
||||
auto [col, line] = RawToConvertedCoordinate(experiment, module, npixel);
|
||||
AddStrongPixel(col, line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user