34 const string myname =
"test_AdcChannelSplitter: ";
36 cout << myname <<
"NDEBUG must be off." <<
endl;
39 string line =
"-----------------------------";
41 cout << myname << line <<
endl;
42 string fclfile =
"test_AdcChannelSplitter.fcl";
43 if ( ! useExistingFcl ) {
44 cout << myname <<
"Creating top-level FCL." <<
endl;
45 ofstream
fout(fclfile.c_str());
46 fout <<
"#include \"dataprep_tools.fcl\"" <<
endl;
48 fout <<
" tool_type: AdcChannelSplitter" <<
endl;
54 fout <<
"tools.mytool2: @local::tools.mytool" <<
endl;
55 fout <<
"tools.mytool2.Length: 3 " <<
endl;
56 fout <<
"tools.mytool2.DataPath: \"split\"" <<
endl;
57 fout <<
"tools.mytool2.DataView: \"split2\"" <<
endl;
61 cout << myname <<
"Using existing top-level FCL." <<
endl;
64 cout << myname << line <<
endl;
65 cout << myname <<
"Fetching tool manager." <<
endl;
67 assert ( ptm !=
nullptr );
72 cout << myname << line <<
endl;
73 cout << myname <<
"Fetching tools." <<
endl;
79 cout << myname << line <<
endl;
80 cout << myname <<
"Create data." <<
endl;
88 acd.
raw[isam] = 10 + isam;
91 assert( acd.
samples.size() == 20 );
93 cout << myname << line <<
endl;
94 cout << myname <<
"Split the top data." <<
endl;
95 DataMap dmv = ptoo->update(acd);
98 assert( dmv.
getInt(
"splitInputCount") == 1 );
99 assert( dmv.
getInt(
"splitOutputCount") == 2);
100 assert( dmv.
getInt(
"splitRawCopyCount") == 16);
101 assert( dmv.
getInt(
"splitSampleCopyCount") == 16);
102 cout << myname <<
"Data view names:";
105 assert( acd.
viewSize(
"split") == 2 );
106 assert( acd.
viewSize(
"split2") == 0 );
109 assert( acv.viewParent !=
nullptr );
110 assert( acv.viewParent == &acd );
114 cout << myname << line <<
endl;
115 cout << myname <<
"Split the split." <<
endl;
119 assert( dmv.
getInt(
"splitInputCount") == 2 );
120 assert( dmv.
getInt(
"splitOutputCount") == 4);
121 assert( dmv.
getInt(
"splitRawCopyCount") == 12);
122 assert( dmv.
getInt(
"splitSampleCopyCount") == 12);
123 assert( acd.
viewSize(
"split") == 2 );
124 assert( acd.
viewSize(
"split/split") == 0 );
125 assert( acd.
viewSize(
"split/split2") == 4 );
127 cout << myname << line <<
endl;
128 cout << myname <<
"Done." <<
endl;
ChannelGroupService::Name Name
void print(std::ostream *pout) const
void setChannelInfo(ChannelInfoPtr pchi)
NameVector viewNames() const
void setEventInfo(EventInfoPtr pevi)
const View & view(Name vnam) const
int getInt(Name name, int def=0) const
void line(double t, double *p, double &x, double &y, double &z)
QTextStream & endl(QTextStream &s)