33 double rel_cen_imp_pos ;
35 rel_cen_imp_pos = -
m_pir->pitch()/2.+
m_pir->impact()*i+1
e-9;
37 rel_cen_imp_pos = -
m_pir->pitch()/2.+
m_pir->impact()*i-1
e-9;
40 std::map<int, IImpactResponse::pointer> map_resp;
42 for (
int j=0;j!=
m_pir->nwires();j++){
57 std::vector<std::tuple<int,int, double> > vec_charge;
87 int start_ch = std::floor(impact_range.first*1.0/(
m_num_group-1))-1;
88 int end_ch = std::ceil(impact_range.second*1.0/(
m_num_group-1))+2;
89 if ( (end_ch-start_ch)%2==1) end_ch += 1;
90 int start_tick = time_range.first-1;
91 int end_tick = time_range.second+2;
92 if ( (end_tick-start_tick)%2==1 ) end_tick += 1;
100 const size_t ntotal_wires =
fft_best_length(end_ch - start_ch + 2 * m_num_pad_wire,1);
111 npad_wire= (ntotal_wires -end_ch + start_ch)/2;
117 int npad_time =
m_pir->closest(0)->waveform_pad();
118 const size_t ntotal_ticks =
fft_best_length(end_tick - start_tick + npad_time);
123 npad_time = ntotal_ticks - end_tick + start_tick;
145 for (
int i=0;i!=num_double;i++){
168 int ii=num_double*2-i;
199 if (icol >=
int(rs1_t.size()))
break;
200 rs1_reduced.at(icol) = rs1_t[icol];
206 resp_f_w(0,icol) = rs1[icol];
216 if (icol >=
int(rs1_t.size()))
break;
217 rs1_reduced.at(icol) = rs1_t[icol];
224 if (icol >=
int(rs2_t.size()))
break;
225 rs2_reduced.at(icol) = rs2_t[icol];
229 resp_f_w(irow+1,icol) = rs1[icol];
230 resp_f_w(end_ch-start_ch-1-irow+2*npad_wire,icol) = rs2[icol];
238 c_data = c_data * resp_f_w;
246 acc_data_f_w += c_data;
302 if (icol >=
int(rs1_t.size()))
break;
303 rs1_reduced.at(icol) = rs1_t[icol];
311 resp_f_w(0,icol) = rs1[icol];
319 if (icol >=
int(rs1_t.size()))
break;
320 rs1_reduced.at(icol) = rs1_t[icol];
327 if (icol >=
int(rs2_t.size()))
break;
328 rs2_reduced.at(icol) = rs2_t[icol];
332 resp_f_w(irow+1,icol) = rs1[icol];
333 resp_f_w(end_ch-start_ch-1-irow+2*npad_wire,icol) = rs2[icol];
343 data_f_w = data_f_w * resp_f_w;
350 acc_data_f_w += data_f_w;
357 Array::array_xxf img_m_decon_data = acc_data_f_w.imag().colwise().reverse();
437 log->debug(
"ImpactTransform: # of channels: {} # of ticks: {}",
array_xxc dft_cc(const array_xxc &arr, int dim=1)
std::size_t fft_best_length(size_t nsamples, bool keep_odd_even=false)
Eigen::ArrayXXcf array_xxc
A complex, 2D array.
array_xxc dft_rc(const array_xxf &arr, int dim=0)
array_xxc idft_cc(const array_xxc &arr, int dim=1)
logptr_t logger(std::string name)
Pimpos pimpos(nwires, min_wire_pitch, max_wire_pitch)
Eigen::ArrayXXf array_xxf
A real, 2D array.