void FindARange(vector<double> pData, int& begin, int& end) { begin = -1, end = -1;
bool bFindBegin = false;
vector<double>::iterator it = pData.begin();
while (it != pData.end()) { if(abs(*it) < 0.05) { if(!bFindBegin) { begin = it - pData.begin() + 1; bFindBegin = true; } } else { if(bFindBegin) { end = it - pData.begin(); break; } }
++it; }
if (bFindBegin && end < 0) end = pData.size(); }