libatomprobe
Library for Atom Probe Tomography (APT) computation
processing.h
Go to the documentation of this file.
1 /* processing.h : Mass spectrum processing functions
2  * Copyright (C) 2018 Daniel Haley
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 #ifndef ATOMPROBE_PROCESSING_H
18 #define ATOMPROBE_PROCESSING_H
19 namespace AtomProbe
20 {
22 enum
23 {
26 };
27 
29 {
30  enum
31  {
37  };
38  //background fitting mode to use
39  unsigned int mode;
40  //-- start/end window for const tof background fit
42  //step size in bins for fitting histogram
43  float binWidth;
44 
45  //result parameters
46  float intensity,stdev;
47 
48 };
49 
50 
52 
58 unsigned int doFitBackground(const std::vector<float> &massData, BACKGROUND_PARAMS &params) ;
59 
62 std::string getFitErrorMsg(unsigned int errCode);
63 
65 
71 void createMassBackground(float massStart, float massEnd, unsigned int nBinsMass,
72  float tofBackIntensity, std::vector<float> &histogram);
73 
75 // for your application
90 void findPeaks(const std::vector<float> &x0, std::vector<unsigned int>& peakInds, float sel,
91  bool autoSel=true,bool includeEndpoints=true);
92 
93 #ifdef DEBUG
94 bool testBackgroundFitMaths();
95 #endif
96 }
97 #endif
std::string getFitErrorMsg(unsigned int errCode)
Definition: processing.cpp:146
unsigned int doFitBackground(const std::vector< float > &massData, BACKGROUND_PARAMS &params)
Perform a background fit, assuming constant TOF noise, from 0->inf time.
Definition: processing.cpp:160
void findPeaks(const std::vector< float > &x0, std::vector< unsigned int > &peakInds, float sel, bool autoSel=true, bool includeEndpoints=true)
Simple peak-finding algorithm.
Definition: processing.cpp:268
void createMassBackground(float massStart, float massEnd, unsigned int nBinsMass, float tofBackIntensity, std::vector< float > &histogram)
Build a histogram of the background counts.
Definition: processing.cpp:224