140 auto hits = std::vector<RunningSumTPFinderTool::Hit>();
141 std::cout <<
"findHits called with " << collection_samples.size()
142 <<
" channels. First chan has " << collection_samples[0].size() <<
" samples" <<
std::endl;
144 for(
size_t ich=0; ich<collection_samples.size(); ++ich){
145 const std::vector<short>& waveformOrig = collection_samples[ich];
147 std::vector<short> waveform =
downSample (waveformOrig);
149 std::vector<short> pedsub(waveform.size(), 0);
150 for(
size_t i=0; i<pedsub.size(); ++i)
151 pedsub[i]=waveform[i]-pedestal[i];
153 std::vector<short> filtered =
filter(pedsub);
154 std::vector<short> runingSum =
runSum(filtered);
155 hitFinding(runingSum, iqr, hits, channel_numbers[ich]);
157 std::cout <<
"Returning " << hits.size() <<
" hits" <<
std::endl;
158 std::cout <<
"hits/channel=" <<
float(hits.size())/collection_samples .
size() <<
std::endl;
159 std::cout <<
"hits/tick=" <<
float(hits.size())/collection_samples[0].
size() <<
std::endl;
std::vector< short > filter(const std::vector< short > &orig)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
std::vector< short > findPedestal(const std::vector< short > &orig)
std::vector< short > downSample(const std::vector< short > &orig)
void hitFinding(const std::vector< short > &waveform, const std::vector< short > &iqr, std::vector< RunningSumTPFinderTool::Hit > &hits, int channel)
std::vector< short > frugal_iqr(const std::vector< short > &raw_in, const std::vector< short > &median, const int ncontig)
QTextStream & endl(QTextStream &s)
std::vector< short > runSum(const std::vector< short > &orig)