50 const string myname =
"test_CnrGroupWeighted: ";
52 cout << myname <<
"NDEBUG must be off." <<
endl;
55 string line =
"-----------------------------";
57 cout << myname << line <<
endl;
58 string fclfile =
"test_CnrGroupWeighted.fcl";
59 if ( ! useExistingFcl ) {
60 ofstream
fout(fclfile.c_str());
63 fout <<
" tool_type: CnrGroupWeighted" <<
endl;
66 fout <<
" Groups: [\"grpa:0:5\", \"grpb:5:10\"]" <<
endl;
72 cout << myname <<
"Using existing top-level FCL." <<
endl;
75 cout << myname << line <<
endl;
76 cout << myname <<
"Fetching tool manager." <<
endl;
78 assert ( ptm !=
nullptr );
83 cout << myname << line <<
endl;
84 cout << myname <<
"Fetching tool." <<
endl;
86 assert( ptoo !=
nullptr );
88 cout << myname << line <<
endl;
89 cout << myname <<
"Create channel data." <<
endl;
91 std::vector<float> gain = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 };
93 float noiseSigma = 0.5;
94 for (
Index icha=0; icha<ncha; ++icha ) {
95 float off = icha < 5 ? 100 : 200;
96 for (
Index isam=0; isam<8; ++isam ) {
97 acds[icha].samples.push_back(gain[icha]*gRandom->Gaus(off, noiseSigma));
98 acds[icha].setChannelInfo(icha, 0, icha, 0);
99 acds[icha].setMetadata(
"gain", gain[icha]);
104 cout << myname << line <<
endl;
105 cout << myname <<
"Call tool." <<
endl;
106 DataMap ret = ptoo->updateMap(acds);
109 cout << myname <<
"Done." <<
endl;
void showSamples(const AdcChannelDataMap &acds, string pre)
void line(double t, double *p, double &x, double &y, double &z)
std::map< AdcChannel, AdcChannelData > AdcChannelDataMap
QTextStream & endl(QTextStream &s)