24 using std::istringstream;
36 const string myname =
"test_ConfigurableAdcChannelDataCopyService: ";
38 cout << myname <<
"NDEBUG must be off." <<
endl;
41 string line =
"-----------------------------";
43 cout << myname << line <<
endl;
44 cout << myname <<
"Create top-level FCL." <<
endl;
45 std::ostringstream oss;
46 oss <<
"services.AdcChannelDataCopyService: {" <<
endl;
47 oss <<
" service_provider: ConfigurableAdcChannelDataCopyService" <<
endl;
48 oss <<
" LogLevel: " << a_LogLevel <<
endl;
49 oss <<
" CopyChannel: true" <<
endl;
50 oss <<
" CopyPedestal: true" <<
endl;
51 oss <<
" CopySamples: true" <<
endl;
57 const unsigned int nsig = 50;
59 for (
unsigned int isig=0; isig<50; ++isig ) {
60 acd1.
samples.push_back(10+isig);
67 cout << myname << line <<
endl;
68 cout << myname <<
"Check original." <<
endl;
71 assert( acd1.
raw.size() == 0);
73 assert( acd1.
flags.size() == nsig );
74 assert( acd1.
raw.size() == 0 );
75 assert( acd1.
signal.size() == 0 );
76 assert( acd1.
rois.size() == 0 );
77 assert( acd1.
digit ==
nullptr );
78 assert( acd1.
wire ==
nullptr );
82 cout << myname << line <<
endl;
83 cout << myname <<
"Fetch service." <<
endl;
86 cout << myname << line <<
endl;
87 cout << myname <<
"Copy." <<
endl;
89 hcop->
copy(acd1, acd2);
91 cout << myname << line <<
endl;
92 cout << myname <<
"Check copy." <<
endl;
95 assert( acd2.
raw.size() == 0);
97 assert( acd2.
flags.size() == 0 );
98 assert( acd2.
raw.size() == 0 );
99 assert( acd2.
signal.size() == 0 );
100 assert( acd2.
rois.size() == 0 );
101 assert( acd2.
digit ==
nullptr );
102 assert( acd2.
wire ==
nullptr );
106 cout << myname << line <<
endl;
107 cout << myname <<
"Done." <<
endl;
115 int a_MaxConsecutiveFlag = 0;
117 istringstream ssarg(argv[1]);
121 istringstream ssarg(argv[1]);
122 ssarg >> a_MaxConsecutiveFlag;
int main(int argc, char *argv[])
const raw::RawDigit * digit
static void load_services(std::string const &config)
Q_EXPORT QTSManip setprecision(int p)
void setChannelInfo(ChannelInfoPtr pchi)
virtual int copy(const AdcChannelData &oldacd, AdcChannelData &newacd) const =0
Q_EXPORT QTSManip setw(int w)
void line(double t, double *p, double &x, double &y, double &z)
std::vector< AdcSignal > AdcSignalVector
vector< unsigned int > IndexVector
int test_ConfigurableAdcChannelDataCopyService(int a_LogLevel=1, int a_MaxConsecutiveFlag=0)
QTextStream & endl(QTextStream &s)