Go to the source code of this file.
void checkCount |
( |
const ToolPtr & |
ptool, |
|
|
double |
vin, |
|
|
Count |
countExpected |
|
) |
| |
Definition at line 38 of file test_IdealAdcSimulator.cxx.
39 Count countActual = ptool->count(vin);
40 cout <<
" ADC(" << vin <<
") = " << countActual <<
endl;
AdcSimulator::Count Count
void checkEqual(T1 x1, T2 x2, string msg="Assert failed")
QTextStream & endl(QTextStream &s)
template<class T1 , class T2 >
void checkEqual |
( |
T1 |
x1, |
|
|
T2 |
x2, |
|
|
string |
msg = "Assert failed" |
|
) |
| |
Definition at line 31 of file test_IdealAdcSimulator.cxx.
33 cout <<
msg <<
": " << x1 <<
" != " << x2 <<
endl;
void msg(const char *fmt,...)
QTextStream & endl(QTextStream &s)
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 110 of file test_IdealAdcSimulator.cxx.
111 bool useExistingFcl =
false;
113 string sarg(
argv[1]);
114 if ( sarg ==
"-h" ) {
115 cout <<
"Usage: " <<
argv[0] <<
" [ARG]" <<
endl;
116 cout <<
" If ARG = true, existing FCL file is used." <<
endl;
119 useExistingFcl = sarg ==
"true" || sarg ==
"1";
int test_IdealAdcSimulator(bool useExistingFcl)
QTextStream & endl(QTextStream &s)
int test_IdealAdcSimulator |
( |
bool |
useExistingFcl | ) |
|
Definition at line 46 of file test_IdealAdcSimulator.cxx.
47 const string myname =
"test_IdealAdcSimulator: ";
49 cout << myname <<
"NDEBUG must be off." <<
endl;
52 string line =
"-----------------------------";
54 cout << myname << line <<
endl;
55 string fclfile =
"test_IdealAdcSimulator.fcl";
56 if ( ! useExistingFcl ) {
57 cout << myname <<
"Creating top-level FCL." <<
endl;
58 ofstream
fout(fclfile.c_str());
60 fout <<
" tool_type: IdealAdcSimulator" <<
endl;
66 cout << myname <<
"Using existing top-level FCL." <<
endl;
70 cout << myname << line <<
endl;
71 cout << myname <<
"Creating parameter set." <<
endl;
77 cout << myname << line <<
endl;
78 cout << myname <<
"Checking tool type." <<
endl;
80 cout <<
"Tool type: " << psTool.
get<
string>(
"tool_type") << endl;
81 assert( psTool.
get<
string>(
"tool_type") ==
"IdealAdcSimulator" );
83 cout << myname << line <<
endl;
84 cout << myname <<
"Instantiate tool." <<
endl;
85 std::unique_ptr<AdcSimulator> ptool = art::make_tool<AdcSimulator>(psTool);
86 assert( ptool !=
nullptr );
88 cout <<
"ADC count is " << ptool->
count(vin) <<
endl;
103 cout << myname << line <<
endl;
104 cout << myname <<
"Done." <<
endl;
static ParameterSet make(intermediate_table const &tbl)
void checkCount(const ToolPtr &ptool, double vin, Count countExpected)
T get(std::string const &key) const
virtual Count count(double vin, Channel chan=0, Tick tick=0) const =0
intermediate_table parse_document(std::string const &filename, cet::filepath_maker &maker)
void line(double t, double *p, double &x, double &y, double &z)
QTextStream & endl(QTextStream &s)