32#include "../../../pappsoexception.h"
37MzCalibrationModel1::MzCalibrationModel1(
double T1_frame,
39 double digitizerTimebase,
40 double digitizerDelay,
53 double temperature_correction =
54 dC1 * (T1_ref - T1_frame) + dC2 * (T2_ref - T2_frame);
55 temperature_correction = (double)1.0 + (temperature_correction / 1.0e6);
58 C1 = C1 * temperature_correction;
59 C2 = C2 / temperature_correction;
120 std::vector<double> X;
143 alglib::real_1d_array polynom_array;
146 polynom_array.setcontent(X.size(), &(X[0]));
148 catch(alglib::ap_error &error)
152 QObject::tr(
"ERROR in alglib::polynom_array.setcontent :\n%1")
153 .arg(error.msg.c_str()));
165 alglib::complex_1d_array m;
166 alglib::polynomialsolverreport rep;
170 alglib::polynomialsolve(polynom_array, X.size() - 1, m, rep);
172 catch(alglib::ap_error &error)
174 qDebug() <<
" X.size() - 1 = " << X.size() - 1;
182 QObject::tr(
"ERROR in MzCalibrationModel1::getMzFromTofIndex, "
183 "alglib::polynomialsolve :\n%1")
184 .arg(error.msg.c_str()));
193 "ERROR in MzCalibrationModel1::getMzFromTofIndex m.size() == 0"));
199 QObject::tr(
"ERROR in MzCalibrationModel1::getMzFromTofIndex m[0].y!= "
200 "0 for tof index=%1")
218 qDebug() <<
"mz=" <<
mz;
223 qDebug() <<
"tof ( m_mzCalibrationArr[0])=" << tof;
226 qDebug() <<
"tof=" << tof;
228 qDebug() <<
"tof=" << tof;
230 qDebug() <<
"tof=" << tof;
232 qDebug() <<
"tof=" << tof;
234 qDebug() <<
"index=" << tof;
235 return (quint32)std::round(tof);
241 double digitizerTimebase,
242 double digitizerDelay,
276 if(
m_max > tof_index)
std::vector< double > m_mzCalibrationArr
MZ calibration parameters.
double m_digitizerTimebase
virtual ~MzCalibrationModel1Cached()
MzCalibrationModel1Cached(double T1_frame, double T2_frame, double digitizerTimebase, double digitizerDelay, double C0, double C1, double C2, double C3, double C4, double T1_ref, double T2_ref, double dC1, double dC2)
double m_arrMasses[600000]
virtual double getMzFromTofIndex(quint32 tof_index) override
get m/z from time of flight raw index
virtual double getMzFromTofIndex(quint32 tof_index) override
get m/z from time of flight raw index
virtual quint32 getTofIndexFromMz(double mz) override
get raw TOF index of a given m/z
virtual ~MzCalibrationModel1()
implement Bruker's model type 1 formula to compute m/z
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...