Commit d8a67984 authored by Agata Analysis's avatar Agata Analysis
Browse files

add an option in recalenergy to use only maximum instead of fiting the peaks

parent a67e4224
......@@ -101,6 +101,7 @@ bool doPoly1 = false; // linear
bool doPoly2 = false; // cubic
int numZero = 0; // number of fake peaks at (0,0)
int modXtalk = 0;
bool MaxMode = false; // Dont fit peaks, only use max position
bool useErrors = false; // fit using position and energy errors
double errE = 0.01;
......@@ -609,6 +610,9 @@ getparams(int argc, char *argv[])
else if(!strcmp(cmd, "-zero")) {
numZero++;
}
else if(!strcmp(cmd, "-max")) {
MaxMode = true;
}
else if(!strcmp(cmd, "-errors")) {
numparams(cmd, argc-argn-1);
errE = float(atof(argv[argn++]));
......@@ -1359,6 +1363,7 @@ int FitPeaks(int verbose)
chanA = max(1,chanA);
chanB = min(chanB, specLength-2);
nmult = 0;
if(nn < numpk-2) {
// check if the next peaks are in the same region
for(size_t jj = nn+1; jj < specPeaks.size(); jj++) {
......@@ -1377,6 +1382,7 @@ int FitPeaks(int verbose)
res.area = m_pCFit->Area(jj);
res.ampli = m_pCFit->Amplitude(jj);
res.posi = m_pCFit->Position(jj);
if(MaxMode) res.posi = specPeaks[nn+jj];
res.fw05 = m_pCFit->Fw05(jj);
res.fw01 = m_pCFit->Fw01(jj);
res.fwhm = m_pCFit->Fwhm(jj);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment