Go to the source code of this file.
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
int test_AdcSuppressSignalFindingService |
( |
| ) |
|
Definition at line 34 of file test_AdcSuppressSignalFindingService.cxx.
35 const string myname =
"test_AdcSuppressSignalFindingService: ";
37 cout << myname <<
"NDEBUG must be off." <<
endl;
40 string line =
"-----------------------------";
42 cout << myname << line <<
endl;
43 cout << myname <<
"Create top-level FCL." <<
endl;
44 std::ostringstream oss;
45 oss <<
"services.AdcSuppressService: {" <<
endl;
46 oss <<
" service_provider: Legacy35tZeroSuppressService" <<
endl;
47 oss <<
" AdcThreshold: 30.0" <<
endl;
48 oss <<
" TickRange: 4" <<
endl;
49 oss <<
" MinTickGap: 2" <<
endl;
50 oss <<
" SuppressStickyBits: false" <<
endl;
52 oss <<
"services.AdcSignalFindingService: {" <<
endl;
53 oss <<
" service_provider: AdcSuppressSignalFindingService" <<
endl;
57 cout << myname << line <<
endl;
58 cout << myname <<
"Create data." <<
endl;
62 for (
unsigned int tic=0; tic<50; ++tic ) {
64 if ( tic > 10 && tic < 20 ) sig += 100;
66 data.
raw.push_back(cnt);
70 unsigned int nsig = data.
samples.size();
72 cout << myname << line <<
endl;
73 cout << myname <<
"Fetch signal finding service." <<
endl;
78 for (
unsigned int isig=7; isig<24; ++isig ) exp[isig] =
true;
80 cout << myname << line <<
endl;
81 cout << myname <<
"Find signal." <<
endl;
82 assert( hsfs->
find(data) == 0 );
83 assert( data.
raw.size() == nsig );
84 assert( data.
samples.size() == nsig );
85 assert( data.
flags.size() == nsig );
86 assert( data.
signal.size() == nsig );
87 for (
unsigned int isig=0; isig<nsig; ++isig ) {
88 cout <<
setw(4) << isig <<
": " <<
setw(6) << data.
raw[isig]
90 <<
" " << ( data.
signal[isig] ?
"*" :
" ") << endl;
91 assert( data.
signal[isig] == exp[isig] );
virtual int find(AdcChannelData &data) const =0
static void load_services(std::string const &config)
Q_EXPORT QTSManip setprecision(int p)
void setChannelInfo(ChannelInfoPtr pchi)
Q_EXPORT QTSManip setw(int w)
std::vector< bool > AdcFilterVector
virtual std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const =0
void line(double t, double *p, double &x, double &y, double &z)
QTextStream & endl(QTextStream &s)