10 double mean = temp.first;
11 double rms = temp.second;
13 for (
size_t i=0;i!=signal.size();i++){
14 if (fabs(signal.at(i)-
mean) < 4.5 * rms){
15 temp1.push_back(signal.at(i));
25 float count_max_rms = 0;
26 const int nchannel = chansig.size();
27 const int nbins = (chansig.begin()->second).
size();
29 std::vector<float> content(nchannel*nbins, 0.0);
32 for (
auto it: chansig){
38 max_rms += temp.second;
42 for (
int i=0;i!=
nbins;i++){
43 content[start_ch*nbins + i] = signal.at(i);
48 if (count_max_rms >0) {
49 max_rms /= count_max_rms;
53 for (
int ibin=0;ibin!=
nbins;ibin++){
55 for (
int ich=0; ich!=nchannel; ich++) {
56 const float cont = content.at(ich*nbins + ibin);
57 if (fabs(cont) < 5 * max_rms &&
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Waveform::realseq_t signal_t
std::pair< double, double > CalcRMS(const WireCell::Waveform::realseq_t &signal)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
WireCell::Waveform::realseq_t CalcMedian(const WireCell::IChannelFilter::channel_signals_t &chansig)
std::map< int, signal_t > channel_signals_t
double mean(sqlite3 *db, std::string const &table_name, std::string const &column_name)