24 cerr <<
"Using command line field response file: " << frfname <<
endl;
27 cerr <<
"Using default field response file: " << frfname <<
endl;
34 pm.
add(
"WireCellSigProc");
35 auto ifrcfg = Factory::lookup<IConfigurable>(
"FieldResponse");
36 auto cfg = ifrcfg->default_configuration();
37 cfg[
"filename"] = frfname;
38 ifrcfg->configure(cfg);
41 auto ifr = Factory::find<IFieldResponse>(
"FieldResponse");
47 cerr <<
"FR with " << fr.
planes[0].paths.size() <<
" responses per plane\n";
48 Assert(fr.planes[0].paths.size() == 21*6);
53 cerr <<
"FR with " << fravg.planes[0].paths.size() <<
" responses per plane\n";
64 auto ewave = ce.generate(
tbins);
68 std::complex<float> fine_period(fravg.period,0);
78 for (
int i=0;i!=9594;i++){
79 ctbins.at(i) = i * period;
83 ftbins.at(i) = i * fravg.period;
87 for (
int ind=0; ind<3; ++ind) {
92 int nrows = c_data.rows();
93 int ncols = c_data.cols();
95 for (
int irow = 0; irow <
nrows; ++irow){
96 for (
int icol = 0; icol < ncols; ++ icol){
97 c_data(irow,icol) = c_data(irow,icol) * elec.at(icol) * fine_period;
105 auto arr1 = arr.block(0,0,nrows,100);
106 arr.block(0,0,nrows,ncols-100) = arr.block(0,100,nrows,ncols-100);
107 arr.block(0,ncols-100,nrows,100) = arr1;
112 for (
int irow = 0; irow <
nrows; ++ irow){
116 for (
int i=0;i!=9594;i++){
117 double ctime = ctbins.at(i);
120 while(ctime > ftbins.at(fcount)){
122 if (fcount >= 1000)
break;
128 wfs.at(i) = (ctime - ftbins.at(fcount-1)) /fravg.period * arr(irow,fcount-1) + (ftbins.at(fcount)-ctime)/fravg.period * arr(irow,fcount);
array_xxf idft_cr(const array_xxc &arr, int dim=0)
microsecond_as<> microsecond
Type of time stored in microseconds, in double precision.
Schema::FieldResponse wire_region_average(const Schema::FieldResponse &fr)
const std::string instance
Eigen::ArrayXXcf array_xxc
A complex, 2D array.
array_xxc dft_rc(const array_xxf &arr, int dim=0)
A functional object caching gain and shape.
Binning tbins(nticks, t0, t0+readout_time)
Array::array_xxf as_array(const Schema::PlaneResponse &pr)
std::vector< PlaneResponse > planes
List of PlaneResponse objects.
Plugin * add(const std::string &plugin_name, const std::string &libname="")
Add a plugin. If libname is not given, try to derive it.
unsigned nrows(sqlite3 *db, std::string const &tablename)
array_xxc dft(const array_xxf &arr)
Hold info about multiple plane responses in the detector.
QTextStream & endl(QTextStream &s)