29 using std::istringstream;
41 const string myname =
"test_DuneDeconvolutionService: ";
43 cout << myname <<
"NDEBUG must be off." <<
endl;
46 string line =
"-----------------------------";
48 if ( a_LogLevel < 0 ) {
49 cout << myname <<
"Skipping test while we wat for resolution of larsoft issue 10618" <<
endl;
53 cout << myname << line <<
endl;
54 cout << myname <<
"Create top-level FCL." <<
endl;
56 std::ostringstream oss;
57 oss <<
"#include \"services_dune.fcl\"" <<
endl;
58 oss <<
"services: @local::dune35t_services_legacy" <<
endl;
59 oss <<
"services.AdcDeconvolutionService: {" <<
endl;
60 oss <<
" service_provider: DuneDeconvolutionService" <<
endl;
61 oss <<
" LogLevel: " << a_LogLevel <<
endl;
65 const unsigned int nsig = 100;
68 for (
unsigned int isig=0; isig<nsig; ++isig ) {
76 cout << myname <<
"Fetch FFT service." <<
endl;
78 unsigned int fftsize = hfft->
FFTSize();
79 cout << myname <<
"Resizing signal vector to FFT size " << fftsize
80 <<
" as required for convolution." <<
endl;
81 sigs.resize(fftsize, 0.0);
83 cout << myname <<
"Fetch shaping service." <<
endl;
86 cout << myname <<
"Convolute." <<
endl;
91 cout << myname <<
"Fetch deconvolution service." <<
endl;
95 cout << myname << line <<
endl;
96 cout << myname <<
"Deconvolute." <<
endl;
97 assert( hdco->
update(clockData, acd) == 0 );
98 cout << myname <<
"Output vector size: " << sigs.size() <<
endl;
99 assert( sigs.size() == sigsco.size() );
100 for (
unsigned int isig=0; isig<nsig; ++isig ) {
101 cout <<
setw(4) << isig <<
": " 109 cout << myname <<
"Done." <<
endl;
116 const string myname =
"main: ";
119 istringstream ssarg(argv[1]);
123 cout << myname <<
"Exiting." <<
endl;
Service to provide microboone-specific signal shaping for simulation (convolution) and reconstruction...
int test_DuneDeconvolutionService(int a_LogLevel=-1)
static void load_services(std::string const &config)
Q_EXPORT QTSManip setprecision(int p)
void setChannelInfo(ChannelInfoPtr pchi)
Q_EXPORT QTSManip setw(int w)
void Convolute(detinfo::DetectorClocksData const &clockData, Channel channel, std::vector< T > &func) const
vector< unsigned int > IndexVector
virtual std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const =0
void line(double t, double *p, double &x, double &y, double &z)
std::vector< AdcSignal > AdcSignalVector
virtual int update(detinfo::DetectorClocksData const &clockData, AdcChannelData &data) const =0
QTextStream & endl(QTextStream &s)
int main(int argc, char *argv[])