本文整理汇总了C++中adcontrols::MassSpectrum::findProtocol方法的典型用法代码示例。如果您正苦于以下问题:C++ MassSpectrum::findProtocol方法的具体用法?C++ MassSpectrum::findProtocol怎么用?C++ MassSpectrum::findProtocol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类adcontrols::MassSpectrum
的用法示例。
在下文中一共展示了MassSpectrum::findProtocol方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: result
adfs::file
QuanSampleProcessor::processIt( adcontrols::QuanSample& sample
, adcontrols::MassSpectrum& profile
, QuanDataWriter * writer
, bool bSerialize )
{
if ( auto pCentroidMethod = procmethod_->find< adcontrols::CentroidMethod >() ) {
adcontrols::MassSpectrum centroid;
adcontrols::MSPeakInfo pkInfo;
adcontrols::MassSpectrum filtered;
bool result(false);
if ( pCentroidMethod->noiseFilterMethod() == adcontrols::CentroidMethod::eDFTLowPassFilter ) {
filtered.clone( profile, true );
for ( auto& ms : adcontrols::segment_wrapper<>( filtered ) ) {
adcontrols::waveform_filter::fft4c::lowpass_filter( ms, pCentroidMethod->cutoffFreqHz() );
double base( 0 ), rms( 0 );
const double * intens = ms.getIntensityArray();
adportable::spectrum_processor::tic( uint32_t( ms.size() ), intens, base, rms );
for ( size_t i = 0; i < ms.size(); ++i )
ms.setIntensity( i, intens[ i ] - base );
}
filtered.addDescription( adcontrols::description( L"process", dataproc::Constants::F_DFT_FILTERD ) );
result = doCentroid( pkInfo, centroid, filtered, *pCentroidMethod );
} else {
result = doCentroid( pkInfo, centroid, profile, *pCentroidMethod );
}
if ( result ) {
// doMSLock if required.
if ( auto pCompounds = procmethod_->find< adcontrols::QuanCompounds >() ) {
if ( auto lkMethod = procmethod_->find< adcontrols::MSLockMethod >() ) {
if ( lkMethod->enabled() )
doMSLock( pkInfo, centroid, *lkMethod, *pCompounds );
}
}
// Look up compounds
if ( auto pCompounds = procmethod_->find< adcontrols::QuanCompounds >() ) {
if ( auto pTgtMethod = procmethod_->find< adcontrols::TargetingMethod >() ) {
doMSFind( pkInfo, centroid, sample, *pCompounds, *pTgtMethod );
}
}
if ( bSerialize ) {
adcontrols::MassSpectrum * pProfile = &profile;
adcontrols::MassSpectrum * pFiltered = (filtered.size() > 0 ) ? &filtered : 0;
adcontrols::MassSpectrum * pCentroid = ¢roid;
adcontrols::MSPeakInfo * pPkInfo = &pkInfo;
if ( sample.channel() > 0 ) {
if ( auto p = profile.findProtocol( sample.channel() - 1 ) ) {
p->clearSegments();
pProfile = p;
}
if ( pFiltered ) {
if ( auto p = filtered.findProtocol( sample.channel() - 1 ) ) {
p->clearSegments();
pFiltered = p;
}
}
if ( auto p = centroid.findProtocol( sample.channel() - 1 ) ) {
p->clearSegments();
pCentroid = p;
}
if ( auto p = pkInfo.findProtocol( sample.channel() - 1 ) ) {
p->clearSegments();
pPkInfo = p;
}
}
std::lock_guard<std::mutex> lock( mutex_ );
if ( adfs::file file = writer->write( *pProfile, sample.name() ) ) {
for ( auto& resp: sample.results() )
resp.dataGuid_ = file.name();
if ( pFiltered )
writer->attach<adcontrols::MassSpectrum>( file, *pFiltered, dataproc::Constants::F_DFT_FILTERD );
auto afile = writer->attach< adcontrols::MassSpectrum >( file, *pCentroid, dataproc::Constants::F_CENTROID_SPECTRUM );
writer->attach< adcontrols::ProcessMethod >( afile, *procmethod_, L"ProcessMethod" );
writer->attach< adcontrols::MSPeakInfo >( file, *pPkInfo, dataproc::Constants::F_MSPEAK_INFO );
writer->attach< adcontrols::QuanSample >( file, sample, dataproc::Constants::F_QUANSAMPLE );
return file;
}
}
}
}
return adfs::file();
}