Go to the source code of this file.
|
using | Index = unsigned int |
|
using Index = unsigned int |
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 106 of file test_VintageDeconvoluter.cxx.
107 bool useExistingFcl =
false;
109 string sarg(
argv[1]);
110 if ( sarg ==
"-h" ) {
111 cout <<
"Usage: " <<
argv[0] <<
" [ARG]" <<
endl;
112 cout <<
" If ARG = true, existing FCL file is used." <<
endl;
115 useExistingFcl = sarg ==
"true" || sarg ==
"1";
int test_VintageDeconvoluter(bool useExistingFcl=false)
QTextStream & endl(QTextStream &s)
int test_VintageDeconvoluter |
( |
bool |
useExistingFcl = false | ) |
|
Definition at line 28 of file test_VintageDeconvoluter.cxx.
29 const string myname =
"test_VintageDeconvoluter: ";
31 cout << myname <<
"NDEBUG must be off." <<
endl;
34 string line =
"-----------------------------";
36 cout << myname << line <<
endl;
37 string fclfile =
"test_VintageDeconvoluter.fcl";
39 cout << myname <<
"Using existing top-level FCL." <<
endl;
41 cout << myname <<
"Creating top-level FCL." <<
endl;
42 std::ofstream
config{fclfile};
43 config <<
"#include \"services_dune.fcl\"" <<
endl;
45 config <<
"services: @local::dune35t_services_legacy" <<
endl;
48 config <<
" tool_type: VintageDeconvoluter" <<
endl;
55 cout << myname << line <<
endl;
56 cout << myname <<
"Fetching tool manager." <<
endl;
58 assert ( ptm !=
nullptr );
63 cout << myname << line <<
endl;
64 cout << myname <<
"Fetching tool." <<
endl;
66 assert( psgf !=
nullptr );
68 assert( psgfmod !=
nullptr );
70 cout << myname << line <<
endl;
71 cout << myname <<
"Create data and call tool." <<
endl;
74 for (
AdcIndex itic=0; itic<100; ++itic ) {
75 float xadc = rand()%20 - 10.0;
79 assert( data.
signal.size() == 0 );
80 assert( data.
rois.size() == 0 );
81 assert( data.
samples[30] = 150 );
87 cout << myname << line <<
endl;
88 cout << myname <<
"Running tool." <<
endl;
89 DataMap resmod = psgfmod->update(data);
92 cout << myname << line <<
endl;
93 cout << myname <<
"Checking results." <<
endl;
95 for (
Index isam=0; isam<data0.
samples.size(); ++isam ) {
99 cout << myname << line <<
endl;
100 cout << myname <<
"Done." <<
endl;
static constexpr FileOnPath_t FileOnPath
void print(std::ostream *pout) const
static void load_services(std::string const &config)
void setChannelInfo(ChannelInfoPtr pchi)
void line(double t, double *p, double &x, double &y, double &z)
QTextStream & endl(QTextStream &s)