libpappsomspp
Library for mass spectrometry
mzcalibrationinterface.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/vendors/tims/mzcalibration/mzcalibrationinterface.h
3 * \date 11/11/2020
4 * \author Olivier Langella
5 * \brief handles different ways to compute m/z using calibration parameters
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2020 Olivier Langella <Olivier.Langella@u-psud.fr>.
10 *
11 * This file is part of the PAPPSOms++ library.
12 *
13 * PAPPSOms++ is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * PAPPSOms++ is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
25 *
26 ******************************************************************************/
27
28#pragma once
29
30#include <QtGlobal>
31#include <memory>
32#include <vector>
33
34namespace pappso
35{
36
37class MzCalibrationInterface;
38typedef std::shared_ptr<MzCalibrationInterface> MzCalibrationInterfaceSPtr;
39/**
40 * @todo write docs
41 */
43{
44 public:
45 /**
46 * Default constructor
47 */
48 MzCalibrationInterface(double digitizerTimebase, double digitizerDelay);
49
50 /**
51 * Destructor
52 */
54
55 /**
56 * Assignment operator
57 *
58 * @param other TODO
59 * @return TODO
60 */
62
63 /**
64 * @todo write docs
65 *
66 * @param other TODO
67 * @return TODO
68 */
69 bool operator==(const MzCalibrationInterface &other) const;
70
71 /** @brief get time of flight from raw index
72 * @param tof_index digitizer x raw value
73 * @return tof time of flight
74 */
75 double getTofFromTofIndex(quint32 tof_index) const;
76
77 /** @brief get time of flight from double index
78 */
79 double getTofFromTofIndex(double tof_index) const;
80
81
82 /** @brief get m/z from time of flight raw index
83 * @param tof_index time of flight
84 * @return m/z value
85 */
86 virtual double getMzFromTofIndex(quint32 tof_index) = 0;
87
88 /** @brief get raw TOF index of a given m/z
89 * @param mz the mass to transform
90 * @return integer x raw value
91 */
92 virtual quint32 getTofIndexFromMz(double mz) = 0;
93
94
95 protected:
97 double m_digitizerDelay = 0;
98
99 /** @brief MZ calibration parameters
100 */
101 std::vector<double> m_mzCalibrationArr;
102};
103} // namespace pappso
double getTofFromTofIndex(quint32 tof_index) const
get time of flight from raw index
MzCalibrationInterface(double digitizerTimebase, double digitizerDelay)
std::vector< double > m_mzCalibrationArr
MZ calibration parameters.
virtual double getMzFromTofIndex(quint32 tof_index)=0
get m/z from time of flight raw index
bool operator==(const MzCalibrationInterface &other) const
MzCalibrationInterface & operator=(const MzCalibrationInterface &other)
virtual quint32 getTofIndexFromMz(double mz)=0
get raw TOF index of a given m/z
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
std::shared_ptr< MzCalibrationInterface > MzCalibrationInterfaceSPtr