32 #include "../../../pappsoexception.h"
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;
136 qDebug() <<
"polynom_array :";
141 alglib::real_1d_array polynom_array;
144 polynom_array.setcontent(X.size(), &(X[0]));
146 catch(alglib::ap_error &error)
150 QObject::tr(
"ERROR in alglib::polynom_array.setcontent :\n%1")
151 .arg(error.msg.c_str()));
163 alglib::complex_1d_array m;
164 alglib::polynomialsolverreport rep;
168 alglib::polynomialsolve(polynom_array, X.size() - 1, m, rep);
170 catch(alglib::ap_error &error)
172 qDebug() <<
" X.size() - 1 = " << X.size() - 1;
180 QObject::tr(
"ERROR in alglib::polynomialsolve :\n%1")
181 .arg(error.msg.c_str()));
190 QObject::tr(
"ERROR in TimsFrame::getMzFromTof m.size() == 0"));
196 QObject::tr(
"ERROR in TimsFrame::getMzFromTof m[0].y!= 0"));
199 qDebug() <<
"m.length()=" << m.length();
200 qDebug() <<
"m1=" << pow(m[0].
x, 2);
201 qDebug() <<
"m2=" << pow(m[1].
x, 2);
213 qDebug() <<
"mz=" <<
mz;
218 qDebug() <<
"tof ( m_mzCalibrationArr[0])=" << tof;
221 qDebug() <<
"tof=" << tof;
223 qDebug() <<
"tof=" << tof;
225 qDebug() <<
"tof=" << tof;
227 qDebug() <<
"tof=" << tof;
229 qDebug() <<
"index=" << tof;
230 return (quint32)std::round(tof);
236 double digitizerTimebase,
237 double digitizerDelay,
271 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
MzCalibrationModel1(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)
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...