libatomprobe
Library for Atom Probe Tomography (APT) computation
overlaps.h
Go to the documentation of this file.
1 /* overlaps.h : Mass spectrum Overlap finding algorithms
2  * Copyright (C) 2020 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 
18 #ifndef ATOMPROBE_OVERLAPS_H
19 #define ATOMPROBE_OVERLAPS_H
20 
23 #include "atomprobe/io/ranges.h"
24 
25 #include <utility>
26 #include <set>
27 
28 namespace AtomProbe
29 {
30 
32 
50 void findOverlaps(const AbundanceData &natData,
51  const RangeFile &rng, float massDelta, unsigned int maxCharge,
52  std::vector<std::pair< size_t,size_t> > &overlapIdx, std::vector<std::pair<float,float> > &overlapMasses );
53 
55 void findOverlaps(const AbundanceData &natData,
56  const std::vector<std::string> &ions, float massDelta, unsigned int maxCharge,
57  std::vector<std::pair< size_t,size_t> > &overlapIdx, std::vector<std::pair<float,float> > &overlapMasses );
58 
59 
61 // - massDistributions is a vector of isotope fingerprints, where the first entry in the pair is mass and the second (unused) is intensity
62 // - skipIds (optional - can be empty) are the IDs of mass distributions to ignore
63 void findOverlapsFromSpectra(const std::vector<std::vector<std::pair<float,float> > > &massDistributions,
64  float massDelta,const std::set<unsigned int> &skipIDs,
65  std::vector<std::pair<size_t ,size_t> > &overlapIdx,
66  std::vector<std::pair<float,float> > &overlapMasses);
67 #ifdef DEBUG
68 bool testOverlapDetect();
69 #endif
70 
71 }
72 #endif
void findOverlaps(const AbundanceData &natData, const RangeFile &rng, float massDelta, unsigned int maxCharge, std::vector< std::pair< size_t, size_t > > &overlapIdx, std::vector< std::pair< float, float > > &overlapMasses)
Find the overlaps stemming from a given rangefile.
void findOverlapsFromSpectra(const std::vector< std::vector< std::pair< float, float > > > &massDistributions, float massDelta, const std::set< unsigned int > &skipIDs, std::vector< std::pair< size_t, size_t > > &overlapIdx, std::vector< std::pair< float, float > > &overlapMasses)
Find overlaps in the given mass distributions, as per findOverlaps(...Rangefile...)