33 #include "../../../pappsoexception.h"
40 double digitizerTimebase,
41 double digitizerDelay,
54 double temperature_correction =
55 dC1 * (T1_ref - T1_frame) + dC2 * (T2_ref - T2_frame);
56 temperature_correction = (double)1.0 + (temperature_correction / 1.0e6);
59 C1 = C1 * temperature_correction;
60 C2 = C2 / temperature_correction;
121 std::vector<double> X;
144 alglib::real_1d_array polynom_array;
147 polynom_array.setcontent(X.size(), &(X[0]));
149 catch(alglib::ap_error &error)
153 QObject::tr(
"ERROR in alglib::polynom_array.setcontent :\n%1")
154 .arg(error.msg.c_str()));
166 alglib::complex_1d_array m;
167 alglib::polynomialsolverreport rep;
169 alglib::xparams params = alglib::xdefault;
173 alglib::polynomialsolve(polynom_array, X.size() - 1, m, rep, params);
175 catch(alglib::ap_error &error)
177 qDebug() <<
" X.size() - 1 = " << X.size() - 1;
185 QObject::tr(
"ERROR in MzCalibrationModel1::getMzFromTofIndex, "
186 "alglib::polynomialsolve :\n%1")
187 .arg(error.msg.c_str()));
196 "ERROR in MzCalibrationModel1::getMzFromTofIndex m.size() == 0"));
202 QObject::tr(
"ERROR in MzCalibrationModel1::getMzFromTofIndex m[0].y!= "
203 "0 for tof index=%1")
221 qDebug() <<
"mz=" <<
mz;
226 qDebug() <<
"tof ( m_mzCalibrationArr[0])=" << tof;
229 qDebug() <<
"tof=" << tof;
231 qDebug() <<
"tof=" << tof;
233 qDebug() <<
"tof=" << tof;
235 qDebug() <<
"tof=" << tof;
237 qDebug() <<
"index=" << tof;
238 return (quint32)std::round(tof);
244 double digitizerTimebase,
245 double digitizerDelay,
279 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...