35 const string myname =
"test_AdcCodeMitigator: ";
37 cout << myname <<
"NDEBUG must be off." <<
endl;
40 string line =
"-----------------------------";
42 cout << myname << line <<
endl;
43 string fclfile =
"test_AdcCodeMitigator.fcl";
44 if ( ! useExistingFcl ) {
45 cout << myname <<
"Creating top-level FCL." <<
endl;
46 ofstream
fout(fclfile.c_str());
49 fout <<
" tool_type: AdcCodeMitigator" <<
endl;
53 fout <<
" InterpolateFlags: [8]" <<
endl;
56 fout <<
" InterpolateFlags: []" <<
endl;
59 fout <<
" FixedCurvThresh: 0.0" <<
endl;
64 cout << myname <<
"Using existing top-level FCL." <<
endl;
67 cout << myname << line <<
endl;
68 cout << myname <<
"Fetching tool manager." <<
endl;
70 assert ( ptm !=
nullptr );
75 cout << myname << line <<
endl;
76 cout << myname <<
"Fetching tool." <<
endl;
78 assert( pmit !=
nullptr );
80 cout << myname << line <<
endl;
81 cout << myname <<
"Create data and call tool." <<
endl;
83 AdcSignalVector inpSigs = {1000, 5, 11.0, 1000, 1000, 1000, 13, 14, 1000};
88 Index nsam = chkSigs.size();
90 for (
AdcIndex isam=0; isam<nsam; ++isam ) {
91 if ( inpFlgs[isam] != 0 ) {
100 DataMap ret = pmit->update(acd);
103 assert( ret.
getInt(
"mitCount") == 5 );
104 for (
AdcIndex isam=0; isam<nsam; ++isam ) {
105 cout << isam <<
":" <<
setw(6) << inpSigs[isam] <<
setw(6) << inpFlgs[isam]
108 assert( acd.
flags[isam] == chkFlgs[isam] );
111 cout << myname << line <<
endl;
112 cout << myname <<
"Done." <<
endl;
bool isEqual(float x1, float x2)
std::vector< AdcFlag > AdcFlagVector
void print(std::ostream *pout) const
const AdcFlag AdcSetFixed
const AdcFlag AdcExtrapolated
Q_EXPORT QTSManip setw(int w)
int getInt(Name name, int def=0) const
const AdcFlag AdcInterpolated
void line(double t, double *p, double &x, double &y, double &z)
std::vector< AdcSignal > AdcSignalVector
QTextStream & endl(QTextStream &s)