24 using std::istringstream;
34 const string myname =
"test_MedianPedestalService: ";
36 cout << myname <<
"NDEBUG must be off." <<
endl;
39 string line =
"-----------------------------";
41 cout << myname << line <<
endl;
43 cout << myname <<
"Using existing top-level FCL." <<
endl;
47 cout << myname <<
"Creating top-level FCL." <<
endl;
49 config <<
"services.PedestalEvaluationService: {" <<
endl;
50 config <<
" service_provider: MedianPedestalService" <<
endl;
51 config <<
" LogLevel: 1" <<
endl;
52 config <<
" UseMean: false" <<
endl;
53 config <<
" SkipFlaggedSamples: true" <<
endl;
54 config <<
" SkipSignals: true" <<
endl;
55 config <<
"}" <<
endl;
59 cout << myname << line <<
endl;
60 cout << myname <<
"Make data." <<
endl;
63 AdcSignalVector flgsigs = { 1.0, 8.0, 111.0, 2.0, 4.0, 6.0, 222.0, 9.0 };
73 flgData.
flags = flags;
75 cout << myname << line <<
endl;
76 cout << myname <<
"Fetch service." <<
endl;
80 cout << myname << line <<
endl;
81 cout << myname <<
"Checking odd data." <<
endl;
83 assert( hpev->
evaluate(oddData, &ped) == 0 );
86 cout << myname << line <<
endl;
87 cout << myname <<
"Checking even data." <<
endl;
89 assert( hpev->
evaluate(evnData, &ped) == 0 );
92 cout << myname << line <<
endl;
93 cout << myname <<
"Checking flagged data." <<
endl;
95 assert( hpev->
evaluate(flgData, &ped) == 0 );
98 cout << myname << line <<
endl;
99 cout << myname <<
"Done." <<
endl;
106 bool useExistingFcl =
false;
108 string sarg(argv[1]);
109 if ( sarg ==
"-h" ) {
110 cout <<
"Usage: " << argv[0] <<
" [ARG]" <<
endl;
111 cout <<
" If ARG = true, existing FCL file is used." <<
endl;
114 useExistingFcl = sarg ==
"true" || sarg ==
"1";
static constexpr FileOnPath_t FileOnPath
std::vector< AdcFlag > AdcFlagVector
virtual int evaluate(const AdcChannelData &data, AdcSignal *pped=nullptr, AdcSignal *prms=nullptr, AdcSignal *ppederr=nullptr, AdcSignal *prmserr=nullptr) const =0
static void load_services(std::string const &config)
Q_EXPORT QTSManip setprecision(int p)
const AdcFlag AdcOverflow
virtual std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const =0
Q_EXPORT QTSManip setw(int w)
const AdcFlag AdcStuckOff
void line(double t, double *p, double &x, double &y, double &z)
std::vector< AdcSignal > AdcSignalVector
QTextStream & endl(QTextStream &s)