1 #ifndef IWaveformRecog_H 2 #define IWaveformRecog_H 23 findROI(
const std::vector<float>& adcin)
const 28 std::vector<std::vector<float>> predv =
scanWaveform(adcin);
50 predROI(
const std::vector<float>& adcin)
const 55 std::vector<std::vector<float>> predv =
scanWaveform(adcin);
61 std::fill_n(fvec.begin() + j1,
fWindowSize, predv[i][0]);
77 if (
stat(fileName, &buffer) == 0) { fname_out =
fileName; }
80 <<
"Could not find the model file " <<
fileName;
95 if (!fMeanFilename.empty() && !fScaleFilename.empty()) {
97 std::ifstream meanfile(
findFile(fMeanFilename.c_str()).c_str());
98 if (meanfile.is_open()) {
99 while (meanfile >> val)
104 <<
"vector of mean values does not match waveform size, exiting" <<
std::endl;
109 <<
"failed opening StdScaler mean file, exiting" <<
std::endl;
111 std::ifstream scalefile(
findFile(fScaleFilename.c_str()).c_str());
112 if (scalefile.is_open()) {
113 while (scalefile >> val)
118 <<
"vector of scale values does not match waveform size, exiting" <<
std::endl;
123 <<
"failed opening StdScaler scale file, exiting" <<
std::endl;
141 fNumStrides = std::ceil(dmn /
float(fStrideLength));
145 std::cout <<
" !!!!! WaveformRoiFinder: WindowSize = " << fWindowSize
146 <<
", StrideLength = " << fStrideLength
147 <<
", dmn/StrideLength = " << dmn / fStrideLength <<
std::endl;
148 std::cout <<
" dmn = " << dmn <<
", NumStrides = " <<
fNumStrides 149 <<
", overshoot = " << overshoot <<
", LastWindowSize = " <<
fLastWindowSize 150 <<
", numwindows = " << numwindows <<
std::endl;
166 std::vector<std::vector<float>>
170 std::vector<float>
adc(fWaveformSize);
172 adc[itck] = (adcin[itck] - meanvec[itck]) / scalevec[itck];
176 std::vector<std::vector<float>> wwv(fNumStrides + 1, std::vector<float>(fWindowSize, 0.));
179 unsigned int j1, j2,
k;
184 for (
unsigned int j = j1; j < j2; j++) {
193 for (
unsigned int j = j1; j < j2; j++) {
T get(std::string const &key) const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::string find_file(std::string const &filename) const
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)