33 for(
int i=1; i<
argc; i++) {
34 if(
strcmp(argv[i],
"-n")==0 ) {
35 stringstream
convert( argv[i+1] );
36 if( !( convert>>nInputs ) ) {
37 cerr<<
" ---> Error Scan !"<<
endl;
42 if(
strcmp(argv[i],
"-b")==0 ) {
43 stringstream
convert( argv[i+1] );
44 if( !( convert>>nBegin ) ) {
45 cerr<<
" ---> Error Scan !"<<
endl;
50 if(
strcmp(argv[i],
"-e")==0 ) {
51 stringstream
convert( argv[i+1] );
52 if( !( convert>>nEnd ) ) {
53 cerr<<
" ---> Error Scan !"<<
endl;
58 if(
strcmp(argv[i],
"-id")==0 ) {
59 stringstream
convert( argv[i+1] );
60 if( !( convert>>
id ) ) {
61 cerr<<
" ---> Error Scan !"<<
endl;
68 if( nInputs==0 || nBegin==0 || nEnd==0 ||
id==0) {
70 <<
"\t"<<
"./test_scan_fft -id ID_Num -n NumA -b NumB -e NumC"<<
endl<<
endl;
76 const std::vector<double> gains = {7.8*
GUnit, 14.0*
GUnit};
83 cerr <<
"Using nticks=" << nticks <<
endl;
87 cout<<endl<<
" nSamples, fwd_time, fwd_time per sample, rev_time, rev_time per sample, average time of (fwd and rev)"<<endl<<
endl;
89 ofstream output(
TString::Format(
"%s_%02d.txt", argv[0],
id), ios::out|ios::trunc);
91 std::vector<int> nsampleslist;
93 for(
int i=0; i<nInputs; i++) {
94 int nsamples = nBegin + i;
95 if( nsamples>nEnd )
break;
96 nsampleslist.push_back( nsamples );
99 const int ntries = 1000;
100 for (
auto nsamps : nsampleslist) {
106 for (
int i=0;i!=ntries;i++){
107 for (
int j=0;j!=nsamps;j++){
108 test_array(i,j) = std::complex<float> (1.1,1.3);
112 double fwd_time = 0.0;
126 double rev_time = 0.0;
145 fwd_time/1000., fwd_time/nsamps/1000.,
146 rev_time/1000., rev_time/nsamps/1000.,
147 0.5*(fwd_time+rev_time)/1000.
155 cout<<endl<<
" Complete "<<endl<<
endl;
array_xxc dft_cc(const array_xxc &arr, int dim=1)
Eigen::ArrayXXcf array_xxc
A complex, 2D array.
Binning tbins(nticks, t0, t0+readout_time)
array_xxc idft_cc(const array_xxc &arr, int dim=1)
def convert(inputfile, outputfile="wire-cell-garfield-fine-response.json.bz2", average=False, shaped=False)
int main(int argc, char **argv)
int strcmp(const String &s1, const String &s2)
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
QTextStream & endl(QTextStream &s)
nanosecond nanoseconds
Alias for common language habits.