Go to the source code of this file.
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
int test_DuneRoiBuildingService |
( |
int |
a_LogLevel = 1 | ) |
|
Definition at line 37 of file test_DuneRoiBuildingService.cxx.
38 const string myname =
"test_DuneRoiBuildingService: ";
40 cout << myname <<
"NDEBUG must be off." <<
endl;
43 string line =
"-----------------------------";
45 cout << myname << line <<
endl;
46 cout << myname <<
"Create top-level FCL." <<
endl;
48 std::ostringstream oss;
49 oss <<
"#include \"services_dune.fcl\"" <<
endl;
50 oss <<
"services: @local::dune35t_services_legacy" <<
endl;
51 oss <<
"services.AdcRoiBuildingService: {" <<
endl;
52 oss <<
" service_provider: DuneRoiBuildingService" <<
endl;
53 oss <<
" NSigmaStart: 4.0" <<
endl;
54 oss <<
" NSigmaEnd: 1.0" <<
endl;
55 oss <<
" PadLow: 5" <<
endl;
56 oss <<
" PadHigh: 10" <<
endl;
57 oss <<
" LogLevel: " << a_LogLevel <<
endl;
61 const unsigned int nsig = 100;
64 for (
unsigned int isig=0; isig<nsig; ++isig ) {
90 cout << myname <<
"Fetch shaping service." <<
endl;
94 cout << myname <<
"Fetch ROI building service." <<
endl;
96 hroi->
print(cout, myname);
98 cout << myname <<
"Build ROIs." <<
endl;
100 cout << myname <<
"Samples size: " << acd.
samples.size() <<
endl;
101 cout << myname <<
"Output ROIS size: " << acd.
rois.size() <<
endl;
102 assert( sigs.size() == nsig );
103 for (
unsigned int isig=0; isig<nsig; ++isig ) {
104 cout << myname <<
setw(4) << isig <<
": " 108 assert( sigs[isig] == sigsin[isig] );
110 cout << myname << line <<
endl;
111 cout << myname <<
"ROIS:" <<
endl;
113 cout <<
setw(6) << roi.first <<
setw(6) << roi.second <<
endl;
116 cout << myname << line <<
endl;
117 cout << myname <<
"Check ROIs." <<
endl;
118 assert( acd.
rois.size() == 3 );
119 assert( acd.
rois[0].first == 25 );
120 assert( acd.
rois[0].second == 44 );
121 assert( acd.
rois[1].first == 55 );
122 assert( acd.
rois[1].second == 80 );
123 assert( acd.
rois[2].first == 85 );
124 assert( acd.
rois[2].second == 99 );
126 cout << myname << line <<
endl;
127 cout << myname <<
"Done." <<
endl;
virtual int build(AdcChannelData &data) const =0
virtual std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const =0
std::pair< AdcIndex, AdcIndex > AdcRoi
double GetDeconNoise(Channel channel) const override
static void load_services(std::string const &config)
Q_EXPORT QTSManip setprecision(int p)
void setChannelInfo(ChannelInfoPtr pchi)
Q_EXPORT QTSManip setw(int w)
void line(double t, double *p, double &x, double &y, double &z)
std::vector< AdcSignal > AdcSignalVector
QTextStream & endl(QTextStream &s)