Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit b4c8e710 authored by frey_m's avatar frey_m
Browse files

PeakFinder: Add single particle peak detection

parent 3b04e36b
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@
#include "AbstractObjects/OpalData.h"
#include "Ippl.h"
#include "Algorithms/PartBunchBase.h"
PeakFinder::PeakFinder(std::string elem):
element_m(elem), nBins_m(10), binWidth_m(1.0 /*mm*/),
......@@ -28,11 +29,19 @@ void PeakFinder::save() {
createHistogram_m();
bool found = findPeaks(smoothingNumber_m,
minArea_m,
minFractionalArea_m,
minAreaAboveNoise_m,
minSlope_m);
bool found = false;
std::size_t nParticles = (OpalData::getInstance()->getPartBunch())->getTotalNum();
if ( Ippl::getNodes() == 1 && nParticles == 1) {
found = findPeaks();
} else {
found = findPeaks(smoothingNumber_m,
minArea_m,
minFractionalArea_m,
minAreaAboveNoise_m,
minSlope_m);
}
if ( found ) {
fn_m = element_m + std::string(".peaks");
......@@ -59,6 +68,13 @@ void PeakFinder::save() {
}
bool PeakFinder::findPeaks() {
for (const auto &radius : radius_m)
peakRadii_m.push_back(radius);
return !peakRadii_m.empty();
}
bool PeakFinder::findPeaks(int smoothingNumber,
double minAreaFactor,
double minFractionalAreaFactor,
......
......@@ -54,6 +54,12 @@ public:
double minFractionalArea,
double minAreaAboveNoise,
double minSlope);
/**
* Single particle peak finder.
*/
bool findPeaks();
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment