#include <string>
#include <iostream>
#include <fstream>
#include "dunecore/DuneInterface/Tool/TpcDataTool.h"
#include "dunecore/ArtSupport/DuneToolManager.h"
#include <cassert>
Go to the source code of this file.
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 93 of file test_AdcRoiShifter.cxx.
94 bool useExistingFcl =
false;
98 cout <<
"Usage: " <<
argv[0] <<
" [ARG]" <<
endl;
99 cout <<
" If ARG = true, existing FCL file is used." <<
endl;
102 useExistingFcl = sarg ==
"true" || sarg ==
"1";
int test_AdcRoiShifter(bool useExistingFcl=false)
QTextStream & endl(QTextStream &s)
int test_AdcRoiShifter |
( |
bool |
useExistingFcl = false | ) |
|
Definition at line 26 of file test_AdcRoiShifter.cxx.
27 const string myname =
"test_AdcRoiShifter: ";
29 cout << myname <<
"NDEBUG must be off." <<
endl;
32 string line =
"-----------------------------";
34 cout << myname << line <<
endl;
35 string fclfile =
"test_AdcRoiShifter.fcl";
36 if ( ! useExistingFcl ) {
37 cout << myname <<
"Creating top-level FCL." <<
endl;
38 ofstream
fout(fclfile.c_str());
41 fout <<
" tool_type: AdcRoiShifter" <<
endl;
48 cout << myname <<
"Using existing top-level FCL." <<
endl;
51 cout << myname << line <<
endl;
52 cout << myname <<
"Fetching tool manager." <<
endl;
54 assert ( ptm !=
nullptr );
59 cout << myname << line <<
endl;
60 cout << myname <<
"Fetching tool." <<
endl;
62 assert( psgf !=
nullptr );
64 assert( psgfmod !=
nullptr );
66 cout << myname << line <<
endl;
67 cout << myname <<
"Create data and call tool." <<
endl;
69 vector<bool> sigdat = {
false,
true,
false,
false,
true,
false,
false,
false,
true};
70 vector<bool> sigchk = {
false,
false,
false,
false,
true,
false,
false,
true,
false};
72 assert( data.
signal == sigdat );
73 assert( data.
signal != sigchk );
75 cout << myname << line <<
endl;
76 cout << myname <<
"Running tool." <<
endl;
77 DataMap resmod = psgfmod->update(data);
80 cout << myname << line <<
endl;
81 cout << myname <<
"Checking results." <<
endl;
82 assert( resmod == 0 );
83 assert( data.
signal != sigdat );
84 assert( data.
signal == sigchk );
86 cout << myname << line <<
endl;
87 cout << myname <<
"Done." <<
endl;
void print(std::ostream *pout) const
void line(double t, double *p, double &x, double &y, double &z)
QTextStream & endl(QTextStream &s)