Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
util
test
test_most_frequent.cxx
Go to the documentation of this file.
1
#include "
WireCellUtil/Waveform.h
"
2
#include <iostream>
3
4
using namespace
WireCell
;
5
using namespace
std
;
6
7
int
main
()
8
{
9
{
10
std::vector<short> adcv{-1,0,0,1,1,2,3,4,4,4,5,6,4,3,4,5,6,7,7,6,5};
11
auto
mf
=
Waveform::most_frequent
(adcv);
12
cerr <<
mf
<<
endl
;
13
}
14
{
15
std::vector<short> adcv{-1,0,0,-1,-1,2,3,4,4,-1,-1,5,6,4,3,4,5,6,7,7,6,5};
16
auto
mf
=
Waveform::most_frequent
(adcv);
17
cerr <<
mf
<<
endl
;
18
}
19
{
20
std::vector<short> adcv{5,5,5,5,1,1,1,2,2,2,2};
21
auto
mf
=
Waveform::most_frequent
(adcv);
22
cerr <<
mf
<<
endl
;
23
}
24
}
mf
Definition:
MessageLogger.cc:50
std
STL namespace.
WireCell::Waveform::most_frequent
short most_frequent(const std::vector< short > &vals)
Return the smallest, most frequent value to appear in vector.
Definition:
Waveform.cxx:289
main
int main()
Definition:
test_most_frequent.cxx:7
Waveform.h
WireCell
Definition:
Main.h:22
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11