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