28 const string myname =
"test_StandardAdcChannelStringTool: ";
30 cout << myname <<
"NDEBUG must be off." <<
endl;
33 string line =
"-----------------------------";
35 cout << myname << line <<
endl;
36 string fclfile =
"test_StandardAdcChannelStringTool.fcl";
37 if ( ! useExistingFcl ) {
38 cout << myname <<
"Creating top-level FCL." <<
endl;
39 ofstream
fout(fclfile.c_str());
42 fout <<
" tool_type: StandardAdcChannelStringTool" <<
endl;
51 fout <<
" TrigNames: [unknown]" <<
endl;
56 cout << myname <<
"Using existing top-level FCL." <<
endl;
59 cout << myname << line <<
endl;
60 cout << myname <<
"Fetching tool manager." <<
endl;
62 assert ( ptm !=
nullptr );
67 cout << myname << line <<
endl;
68 cout << myname <<
"Fetching tool." <<
endl;
70 assert( past !=
nullptr );
72 cout << myname << line <<
endl;
73 cout << myname <<
"Create data." <<
endl;
79 cout << myname << line <<
endl;
80 cout << myname <<
"Call tool." <<
endl;
81 vector<string> rawNames = {
84 "run%RUN%_srun%XXBRUN%",
85 "run%RUN%_srun%SUBRUN%",
86 "data_run%RUN%-%SUBRUN%_ev%EVENT%_ch%CHAN%_%COUNT%.dat",
87 "data_run%5RUN%-%5SUBRUN%_ev%5EVENT%_ch%5CHAN%_%5COUNT%.dat",
88 "data_run%0RUN%-%0SUBRUN%_ev%0EVENT%_ch%0CHAN%_%0COUNT%.dat",
89 "data_run%0RUN%_run%8RUN%.dat",
91 "Units are %(SUNIT)%",
92 "Units are %((SUNIT))%",
93 "Units are% ((SUNIT))%",
100 vector<string> expNames = {
103 "run123_srun%XXBRUN%",
105 "data_run123-45_ev246_ch1357_23.dat",
106 "data_run00123-00045_ev00246_ch01357_00023.dat",
107 "data_run0123-045_ev000246_ch01357_000023.dat",
108 "data_run0123_run00000123.dat",
109 "Units are my units",
110 "Units are (my units)",
111 "Units are (my units)",
112 "Units are (my units)",
116 "date: 2028-07-17 21:54:07",
117 "time: 2028-07-17 21:54:07.123456789" 123 for (
Index inam=0; inam<rawNames.size(); ++inam ) {
124 string rawName = rawNames[inam];
125 string expName = expNames[inam];
126 string outName = past->build(acd, dm, rawName);
127 cout << myname <<
" Raw name: " << rawName <<
endl;
128 cout << myname <<
" Exp name: " << expName <<
endl;
129 cout << myname <<
" Out name: " << outName <<
endl;
130 assert( outName == expName );
133 cout << myname << line <<
endl;
134 cout << myname <<
"Done." <<
endl;
141 bool useExistingFcl =
false;
143 string sarg(argv[1]);
144 if ( sarg ==
"-h" ) {
145 cout <<
"Usage: " << argv[0] <<
" [ARG]" <<
endl;
146 cout <<
" If ARG = true, existing FCL file is used." <<
endl;
149 useExistingFcl = sarg ==
"true" || sarg ==
"1";
bool haveInt(Name name) const
void setChannelInfo(ChannelInfoPtr pchi)
void setEventInfo(EventInfoPtr pevi)
void setInt(Name name, int val)
void line(double t, double *p, double &x, double &y, double &z)
QTextStream & endl(QTextStream &s)