本文整理汇总了C++中Spectrum::hasCVParam方法的典型用法代码示例。如果您正苦于以下问题:C++ Spectrum::hasCVParam方法的具体用法?C++ Spectrum::hasCVParam怎么用?C++ Spectrum::hasCVParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spectrum
的用法示例。
在下文中一共展示了Spectrum::hasCVParam方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
PWIZ_API_DECL void SpectrumInfo::update(const Spectrum& spectrum, bool getBinaryData)
{
*this = SpectrumInfo();
clearBinaryData();
id = spectrum.id;
index = spectrum.index;
scanNumber = id::valueAs<int>(spectrum.id, "scan");
Scan dummy;
const Scan& scan = spectrum.scanList.scans.empty() ? dummy : spectrum.scanList.scans[0];
massAnalyzerType = CVID_Unknown;
if (scan.instrumentConfigurationPtr.get())
try
{
massAnalyzerType = scan.instrumentConfigurationPtr->componentList.analyzer(0)
.cvParamChild(MS_mass_analyzer_type).cvid;
}
catch (out_of_range&)
{
// ignore out-of-range exception
}
scanEvent = scan.cvParam(MS_preset_scan_configuration).valueAs<int>();
msLevel = spectrum.cvParam(MS_ms_level).valueAs<int>();
isZoomScan = spectrum.hasCVParam(MS_zoom_scan);
retentionTime = scan.cvParam(MS_scan_start_time).timeInSeconds();
filterString = scan.cvParam(MS_filter_string).value;
mzLow = spectrum.cvParam(MS_lowest_observed_m_z).valueAs<double>();
mzHigh = spectrum.cvParam(MS_highest_observed_m_z).valueAs<double>();
basePeakMZ = spectrum.cvParam(MS_base_peak_m_z).valueAs<double>();
basePeakIntensity = spectrum.cvParam(MS_base_peak_intensity).valueAs<double>();
totalIonCurrent = spectrum.cvParam(MS_total_ion_current).valueAs<double>();
ionInjectionTime = scan.cvParam(MS_ion_injection_time).valueAs<double>();
UserParam userParamMonoisotopicMZ = scan.userParam("[Thermo Trailer Extra]Monoisotopic M/Z:");
if (!userParamMonoisotopicMZ.name.empty())
thermoMonoisotopicMZ = userParamMonoisotopicMZ.valueAs<double>();
for (vector<Precursor>::const_iterator it=spectrum.precursors.begin(); it!=spectrum.precursors.end(); ++it)
{
PrecursorInfo precursorInfo;
precursorInfo.index = 0; // TODO
if (!it->selectedIons.empty())
{
precursorInfo.mz = it->selectedIons[0].cvParam(MS_selected_ion_m_z).valueAs<double>();
precursorInfo.charge = it->selectedIons[0].cvParam(MS_charge_state).valueAs<int>();
precursorInfo.intensity = it->selectedIons[0].cvParam(MS_peak_intensity).valueAs<double>();
}
precursors.push_back(precursorInfo);
}
dataSize = spectrum.defaultArrayLength;
if (getBinaryData && !spectrum.binaryDataArrayPtrs.empty())
spectrum.getMZIntensityPairs(data);
}