26 using namespace WireCell::SigProc;
31 double fine_time_offset,
32 double coarse_time_offset,
48 double r_fake_signal_low_th ,
49 double r_fake_signal_high_th,
50 double r_fake_signal_low_th_ind_factor,
51 double r_fake_signal_high_th_ind_factor,
53 int r_break_roi_loop ,
56 double r_low_peak_sep_threshold_pre ,
62 const std::
string& wiener_threshold_tag,
64 bool use_roi_debug_mode,
68 const std::
string& break_roi_loop1_tag,
69 const std::
string& break_roi_loop2_tag,
72 : m_anode_tn (anode_tn)
73 , m_per_chan_resp(per_chan_resp_tn)
74 , m_field_response(field_response)
75 , m_fine_time_offset(fine_time_offset)
76 , m_coarse_time_offset(coarse_time_offset)
81 , m_shaping_time(shaping_time)
82 , m_inter_gain(inter_gain)
84 , m_th_factor_ind(th_factor_ind)
85 , m_th_factor_col(th_factor_col)
89 , m_l_factor(l_factor)
90 , m_l_max_th(l_max_th)
91 , m_l_factor1(l_factor1)
92 , m_l_short_length(l_short_length)
93 , m_l_jump_one_bin(l_jump_one_bin)
94 , m_r_th_factor(r_th_factor)
95 , m_r_fake_signal_low_th(r_fake_signal_low_th)
96 , m_r_fake_signal_high_th(r_fake_signal_high_th)
97 , m_r_fake_signal_low_th_ind_factor(r_fake_signal_low_th_ind_factor)
98 , m_r_fake_signal_high_th_ind_factor(r_fake_signal_high_th_ind_factor)
100 , m_r_break_roi_loop(r_break_roi_loop)
101 , m_r_th_peak(r_th_peak)
102 , m_r_sep_peak(r_sep_peak)
103 , m_r_low_peak_sep_threshold_pre(r_low_peak_sep_threshold_pre)
104 , m_r_max_npeaks(r_max_npeaks)
106 , m_r_th_percent(r_th_percent)
107 , m_charge_ch_offset(charge_ch_offset)
108 , m_wiener_tag(wiener_tag)
109 , m_wiener_threshold_tag(wiener_threshold_tag)
110 , m_gauss_tag(gauss_tag)
111 , m_frame_tag("sigproc")
112 , m_use_roi_debug_mode(use_roi_debug_mode)
113 , m_tight_lf_tag(tight_lf_tag)
114 , m_loose_lf_tag(loose_lf_tag)
115 , m_cleanup_roi_tag(cleanup_roi_tag)
116 , m_break_roi_loop1_tag(break_roi_loop1_tag)
117 , m_break_roi_loop2_tag(break_roi_loop2_tag)
118 , m_shrink_roi_tag(shrink_roi_tag)
119 , m_extend_roi_tag(extend_roi_tag)
130 OmnibusSigProc::~OmnibusSigProc()
136 std::stringstream ss;
137 ss<<
"OspChan<c:"<<
channel<<
",w:"<<wire<<
",p:"<<plane<<
",i:"<<ident<<
">";
151 if (! config[
"nticks"].isNull() ) {
152 log->warn(
"OmnibusSigProc has not setting \"nticks\", ignoring value {}", config[
"nticks"].asInt());
155 if (! config[
"period"].isNull() ) {
156 log->warn(
"OmnibusSigProc has not setting \"period\", ignoring value {}", config[
"period"].asDouble());
217 std::stringstream ss;
218 ss <<
"OmnibusSigproc: internal channel map for tags: gauss:\"" 221 for (
auto face :
m_anode->faces()) {
225 for (
auto plane: face->planes()) {
226 int plane_index = plane->planeid().index();
227 auto& pchans = plane_channels[plane_index];
229 const auto& ichans = plane->channels();
231 pchans.reserve(pchans.size() + ichans.size());
232 pchans.insert(pchans.end(), ichans.begin(), ichans.end());
233 ss <<
"\tpind" << plane_index <<
" " 234 <<
"aid" <<
m_anode->ident() <<
" " 235 <<
"fid" << face->ident() <<
" " 236 <<
"pid" << plane->ident() <<
" " 237 <<
"cid" << ichans.front()->ident() <<
" -> cid" << ichans.back()->ident() <<
", " 238 <<
"cind" << ichans.front()->index() <<
" -> cind" << ichans.back()->index() <<
", " 239 <<
"(n="<<pchans.size()<<
")\n";
242 log->debug(ss.str());
244 int osp_channel_number = 0;
245 for (
int iplane = 0; iplane < 3; ++iplane) {
246 m_nwires[iplane] = plane_channels[iplane].size();
247 int osp_wire_number = 0;
248 for (
auto ichan : plane_channels[iplane]) {
249 const int wct_chan_ident = ichan->ident();
250 OspChan och(osp_channel_number, osp_wire_number, iplane, wct_chan_ident);
254 ++osp_channel_number;
281 cfg[
"troi_pad"] =
m_pad;
282 cfg[
"troi_asy"] =
m_asy;
321 cfg[
"sparse"] =
false;
331 auto traces = in->traces();
333 auto& bad =
m_cmm[
"bad"];
336 for (
auto trace : *traces.get()) {
337 int wct_channel_ident =
trace->channel();
339 if (plane != och.
plane) {
344 int tbin =
trace->tbin();
345 auto const& charges =
trace->charge();
347 for (
int qind = 0; qind < ntbins; ++qind) {
352 auto const& badch = bad.find(och.
channel);
353 if (badch == bad.end()) {
357 auto const& binranges = badch->second;
358 for (
auto const& br : binranges) {
360 for (
int i = br.first; i != br.second; ++i) {
366 log->debug(
"OmnibusSigProc: plane index: {} input data identifies {} bad regions",
373 static bool isZero(
float x) {
return x == 0.0; }
376 const std::vector<float>& perwire_rmses,
387 for (
int itick=0;itick!=
m_nticks;itick++){
388 const float q =
m_r_data(och.wire, itick);
392 else charge.at(itick) = q > 0.0 ? q : 0.0;
395 auto& bad =
m_cmm[
"bad"];
396 auto badit = bad.find(och.channel);
397 if (badit != bad.end()) {
398 for (
auto bad : badit->second) {
399 for (
int itick=bad.first; itick < bad.second; ++itick) {
400 charge.at(itick) = 0.0;
409 qtot += charge.at(j);
412 const float thresh = perwire_rmses[och.wire];
422 const std::vector<float> q(i1,i2);
425 const int tbin = i1 - beg;
427 const size_t trace_index = itraces.size();
428 indices.push_back(trace_index);
430 threshold.push_back(thresh);
439 const size_t trace_index = itraces.size();
440 indices.push_back(trace_index);
442 threshold.push_back(thresh);
447 if (indices.empty()) {
448 log->debug(
"OmnibusSigProc::save_data plane index: {} empty", plane);
451 const int nadded = indices.back() - indices.front() + 1;
452 log->debug(
"OmnibusSigProc::save_data plane index: Qtot={} added {} traces to total {} indices:[{},{}]",
453 plane, qtot, nadded, indices.size(), indices.front(), indices.back());
459 int plane,
std::vector<std::list<SignalROI*> >& roi_channel_list)
468 std::fill(charge.begin(), charge.end(), 0);
477 int prev_roi_end = -1;
478 for (
auto signal_roi: roi_channel_list.at(och.wire) ) {
479 int start = signal_roi->get_start_bin();
480 int end = signal_roi->get_end_bin();
483 if (start<0 or end<0)
continue;
484 for (
int i=start; i<=
end; i++) {
485 if (i-prev_roi_end<2)
continue;
492 auto& bad =
m_cmm[
"bad"];
493 auto badit = bad.find(och.channel);
494 if (badit != bad.end()) {
495 for (
auto bad : badit->second) {
496 for (
int itick=bad.first; itick < bad.second; ++itick) {
497 charge.at(itick) = 0.0;
512 const std::vector<float> q(i1,i2);
515 const int tbin = i1 - beg;
517 const size_t trace_index = itraces.size();
518 indices.push_back(trace_index);
529 const size_t trace_index = itraces.size();
530 indices.push_back(trace_index);
540 std::vector<int>
tbins;
541 for (
auto trace : *frame->traces()) {
542 const int tbin =
trace->tbin();
544 tbins.push_back(tbin);
545 tbins.push_back(tbin+nbins);
547 auto mme = std::minmax_element(tbins.begin(), tbins.end());
548 int tbinmin = *mme.first;
549 int tbinmax = *mme.second;
551 log->debug(
"OmnibusSigProc: nticks={} tbinmin={} tbinmax={}",
573 for (
int i=0;i!=3;i++){
579 log->debug(
"OmnibusSigProc: enlarge wire number in plane {} from {} to {}",
587 int fine_nwires = fravg.
planes[0].paths.size();
596 std::complex<float> fine_period(fravg.
period,0);
607 for (
size_t i=0;i!=fine_nticks;i++){
608 ftbins.at(i) = i * fravg.
period;
612 for (
int i=0;i!=3;i++){
620 for (
int iplane=0; iplane<3; ++iplane) {
625 int nrows = c_data.rows();
626 int ncols = c_data.cols();
628 for (
int irow = 0; irow <
nrows; ++irow){
629 for (
int icol = 0; icol < ncols; ++ icol){
630 c_data(irow,icol) = c_data(irow,icol) * elec.at(icol) * fine_period;
639 if (fine_time_shift>0){
641 arr1 = arr.block(0,0,nrows,ncols - fine_time_shift);
643 arr2 = arr.block(0,ncols-fine_time_shift,nrows,fine_time_shift);
644 arr.block(0,0,nrows,fine_time_shift) = arr2;
645 arr.block(0,fine_time_shift,nrows,ncols-fine_time_shift) = arr1;
657 for (
int irow = 0; irow < fine_nwires; ++ irow){
662 double ctime = ctbins.at(i);
664 if (fcount < fine_nticks)
665 while(ctime > ftbins.at(fcount)){
667 if (fcount >= fine_nticks)
break;
671 if(fcount < fine_nticks){
672 wfs.at(i) = ((ctime - ftbins.at(fcount-1)) /fravg.
period * arr(irow,fcount-1) + (ftbins.at(fcount)-ctime)/fravg.
period * arr(irow,fcount)) ;
696 for (
int i=0;i!=arr.rows();i++){
699 for (
int j=0;j!=arr.cols();j++){
701 signal.at(ncount) = arr(i,j);
705 signal.resize(ncount);
710 for (
size_t j =0; j!=signal.size();j++){
711 if (fabs(signal.at(j)-baseline) < 500){
712 temp_signal.at(ncount) = signal.at(j);
716 temp_signal.resize(ncount);
720 for (
int j=0;j!=arr.cols();j++){
722 arr(i,j) -= baseline;
737 log->debug(
"OmnibusSigProc: applying ch-by-ch electronics response correction");
739 auto cr_bins = cr->channel_response_binning();
740 if (cr_bins.binsize() !=
m_period) {
741 log->critical(
"OmnibusSigProc::decon_2D_init: channel response size mismatch");
757 const auto ewave = ce.generate(
tbins);
767 for (
int icol = 0; icol !=
m_c_data.cols(); icol++){
768 const auto four = ch_elec.at(icol);
770 m_c_data(irow,icol) *= elec.at(icol) / four;
802 const std::vector<std::string> filter_names{
"Wire_ind",
"Wire_ind",
"Wire_col"};
804 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter", filter_names[plane]);
805 wire_filter_wf = ncr1->filter_waveform(
m_c_data.rows());
806 for (
int irow=0; irow<
m_c_data.rows(); ++irow) {
807 for (
int icol=0; icol<
m_c_data.cols(); ++icol) {
815 m_c_data(irow,icol) *= wire_filter_wf.at(irow);
841 arr1 =
m_r_data.block(0,0,nrows,ncols - time_shift);
843 arr2 =
m_r_data.block(0,ncols-time_shift,nrows,time_shift);
844 m_r_data.block(0,0,nrows,time_shift) = arr2;
845 m_r_data.block(0,time_shift,nrows,ncols-time_shift) = arr1;
854 const std::vector<std::string> filter_names{
"Wiener_tight_U",
"Wiener_tight_V",
"Wiener_tight_W"};
857 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter", filter_names[plane]);
858 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
861 for (
int irow=0; irow<
m_c_data.rows(); ++irow) {
862 for (
int icol=0; icol<
m_c_data.cols(); ++icol) {
863 c_data_afterfilter(irow,icol) =
m_c_data(irow,icol) * roi_hf_filter_wf.at(icol);
879 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_tight_U");
880 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
881 auto ncr2 = Factory::find<IFilterWaveform>(
"LfFilter",
"ROI_tight_lf");
882 auto temp_filter = ncr2->filter_waveform(
m_c_data.cols());
883 for(
size_t i=0;i!=roi_hf_filter_wf.size();i++){
884 roi_hf_filter_wf.at(i) *= temp_filter.at(i);
887 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_tight_V");
888 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
889 auto ncr2 = Factory::find<IFilterWaveform>(
"LfFilter",
"ROI_tight_lf");
890 auto temp_filter = ncr2->filter_waveform(
m_c_data.cols());
891 for(
size_t i=0;i!=roi_hf_filter_wf.size();i++){
892 roi_hf_filter_wf.at(i) *= temp_filter.at(i);
895 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_tight_W");
896 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
900 for (
int irow=0; irow<
m_c_data.rows(); ++irow) {
901 for (
int icol=0; icol<
m_c_data.cols(); ++icol) {
902 c_data_afterfilter(irow,icol) =
m_c_data(irow,icol) * roi_hf_filter_wf.at(icol);
919 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_tight_U");
920 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
921 auto ncr2 = Factory::find<IFilterWaveform>(
"LfFilter",
"ROI_tighter_lf");
922 auto temp_filter = ncr2->filter_waveform(
m_c_data.cols());
923 for(
size_t i=0;i!=roi_hf_filter_wf.size();i++){
924 roi_hf_filter_wf.at(i) *= temp_filter.at(i);
927 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_tight_V");
928 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
929 auto ncr2 = Factory::find<IFilterWaveform>(
"LfFilter",
"ROI_tighter_lf");
930 auto temp_filter = ncr2->filter_waveform(
m_c_data.cols());
931 for(
size_t i=0;i!=roi_hf_filter_wf.size();i++){
932 roi_hf_filter_wf.at(i) *= temp_filter.at(i);
935 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_tight_W");
936 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
940 for (
int irow=0; irow<
m_c_data.rows(); ++irow) {
941 for (
int icol=0; icol<
m_c_data.cols(); ++icol) {
942 c_data_afterfilter(irow,icol) =
m_c_data(irow,icol) * roi_hf_filter_wf.at(icol);
966 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_tight_U");
967 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
968 roi_hf_filter_wf1 = roi_hf_filter_wf;
970 auto ncr2 = Factory::find<IFilterWaveform>(
"LfFilter",
"ROI_loose_lf");
971 auto temp_filter = ncr2->filter_waveform(
m_c_data.cols());
972 for(
size_t i=0;i!=roi_hf_filter_wf.size();i++){
973 roi_hf_filter_wf.at(i) *= temp_filter.at(i);
977 auto ncr2 = Factory::find<IFilterWaveform>(
"LfFilter",
"ROI_tight_lf");
978 auto temp_filter = ncr2->filter_waveform(
m_c_data.cols());
979 for(
size_t i=0;i!=roi_hf_filter_wf.size();i++){
980 roi_hf_filter_wf1.at(i) *= temp_filter.at(i);
984 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_tight_V");
985 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
986 roi_hf_filter_wf1 = roi_hf_filter_wf;
988 auto ncr2 = Factory::find<IFilterWaveform>(
"LfFilter",
"ROI_loose_lf");
989 auto temp_filter = ncr2->filter_waveform(
m_c_data.cols());
990 for(
size_t i=0;i!=roi_hf_filter_wf.size();i++){
991 roi_hf_filter_wf.at(i) *= temp_filter.at(i);
995 auto ncr2 = Factory::find<IFilterWaveform>(
"LfFilter",
"ROI_tight_lf");
996 auto temp_filter = ncr2->filter_waveform(
m_c_data.cols());
997 for(
size_t i=0;i!=roi_hf_filter_wf.size();i++){
998 roi_hf_filter_wf1.at(i) *= temp_filter.at(i);
1002 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_tight_W");
1003 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
1006 const int n_lfn_nn = 2;
1007 const int n_bad_nn = plane ? 1 : 2;
1011 const int irow = och.wire;
1013 roi_hf_filter_wf2 = roi_hf_filter_wf;
1017 roi_hf_filter_wf2 = roi_hf_filter_wf1;
1020 for (
int icol=0; icol<
m_c_data.cols(); ++icol) {
1021 c_data_afterfilter(irow,icol) =
m_c_data(irow,icol) * roi_hf_filter_wf2.at(icol);
1040 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_tight_U");
1041 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
1042 auto ncr2 = Factory::find<IFilterWaveform>(
"LfFilter",
"ROI_loose_lf");
1043 auto temp_filter = ncr2->filter_waveform(
m_c_data.cols());
1044 for(
size_t i=0;i!=roi_hf_filter_wf.size();i++){
1045 roi_hf_filter_wf.at(i) *= temp_filter.at(i);
1047 }
else if (plane==1){
1048 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_tight_V");
1049 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
1050 auto ncr2 = Factory::find<IFilterWaveform>(
"LfFilter",
"ROI_loose_lf");
1051 auto temp_filter = ncr2->filter_waveform(
m_c_data.cols());
1052 for(
size_t i=0;i!=roi_hf_filter_wf.size();i++){
1053 roi_hf_filter_wf.at(i) *= temp_filter.at(i);
1056 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_tight_W");
1057 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
1061 for (
int irow=0; irow<
m_c_data.rows(); ++irow) {
1062 for (
int icol=0; icol<
m_c_data.cols(); ++icol) {
1063 c_data_afterfilter(irow,icol) =
m_c_data(irow,icol) * roi_hf_filter_wf.at(icol);
1079 int lo_wire = ochan.
wire - nnn;
1080 int lo_chan = ochan.
channel - nnn;
1081 while (lo_wire < 0) {
1086 int hi_wire = ochan.
wire + nnn;
1087 int hi_chan = ochan.
channel + nnn;
1088 while (hi_wire >= nwires) {
1092 if (hi_chan < lo_chan) {
1097 for (
int och = lo_chan; och <= hi_chan; ++och) {
1098 if (
cm.find(och) !=
cm.end()) {
1110 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_wide_U");
1111 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
1112 }
else if (plane==1){
1113 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_wide_V");
1114 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
1116 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Wiener_wide_W");
1117 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
1121 for (
int irow=0; irow<
m_c_data.rows(); ++irow) {
1122 for (
int icol=0; icol<
m_c_data.cols(); ++icol) {
1123 c_data_afterfilter(irow,icol) =
m_c_data(irow,icol) * roi_hf_filter_wf.at(icol);
1140 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Gaus_wide");
1141 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
1142 }
else if (plane==1){
1143 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Gaus_wide");
1144 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
1146 auto ncr1 = Factory::find<IFilterWaveform>(
"HfFilter",
"Gaus_wide");
1147 roi_hf_filter_wf = ncr1->filter_waveform(
m_c_data.cols());
1151 for (
int irow=0; irow<
m_c_data.rows(); ++irow) {
1152 for (
int icol=0; icol<
m_c_data.cols(); ++icol) {
1153 c_data_afterfilter(irow,icol) =
m_c_data(irow,icol) * roi_hf_filter_wf.at(icol);
1170 log->debug(
"OmnibusSigProc: see EOS");
1173 const size_t ntraces = in->traces()->size();
1175 log->debug(
"OmnibusSigProc: receive frame {} with {} traces",
1176 in->ident(), ntraces);
1179 out = std::make_shared<SimpleFrame>(in->ident(), in->time(),
1180 std::make_shared<ITrace::vector>(),
1182 log->debug(
"OmnibusSigProc: got and sending empty frame {}", out->ident());
1189 for (
auto cm : in->masks()) {
1191 for (
auto m:
cm.second) {
1192 const int wct_channel_ident =
m.first;
1194 if (och.
plane < 0) {
1206 IFrame::trace_list_t tight_lf_traces, loose_lf_traces, cleanup_roi_traces, break_roi_loop1_traces, break_roi_loop2_traces, shrink_roi_traces, extend_roi_traces;
1212 ROI_formation roi_form(
m_cmm,
m_nwires[0],
m_nwires[1],
m_nwires[2],
m_nticks,
m_th_factor_ind,
m_th_factor_col,
m_pad,
m_asy,
m_rebin,
m_l_factor,
m_l_max_th,
m_l_factor1,
m_l_short_length,
m_l_jump_one_bin);
1213 ROI_refinement roi_refine(
m_cmm,
m_nwires[0],
m_nwires[1],
m_nwires[2],
m_r_th_factor,
m_r_fake_signal_low_th,
m_r_fake_signal_high_th,
m_r_fake_signal_low_th_ind_factor,
m_r_fake_signal_high_th_ind_factor,
m_r_pad,
m_r_break_roi_loop,
m_r_th_peak,
m_r_sep_peak,
m_r_low_peak_sep_threshold_pre,
m_r_max_npeaks,
m_r_sigma,
m_r_th_percent);
1216 const std::vector<float>* perplane_thresholds[3] = {
1223 for (
int iplane = 0; iplane != 3; ++iplane){
1224 const std::vector<float>& perwire_rmses = *perplane_thresholds[iplane];
1244 std::vector<double>
dummy;
1252 save_data(*itraces, loose_lf_traces, iplane, perwire_rmses, dummy);
1271 std::cout <<
"[wgu] CleanUpROIs ..." <<
std::endl;
1275 std::cout <<
"[wgu] BreakROIs ..." <<
std::endl;
1279 std::cout <<
"[wgu] BreakROIs_2 ..." <<
std::endl;
1283 std::cout <<
"[wgu] ShrinkROIs ..." <<
std::endl;
1287 std::cout <<
"[wgu] ExtendROIs ..." <<
std::endl;
1297 save_data(*itraces, perframe_traces[iplane], iplane, perwire_rmses, thresholds);
1298 wiener_traces.insert(wiener_traces.end(), perframe_traces[iplane].begin(), perframe_traces[iplane].end());
1303 std::vector<double> dummy_thresholds;
1304 save_data(*itraces, gauss_traces, iplane, perwire_rmses, dummy_thresholds);
1343 log->debug(
"OmnibusSigProc: produce {} traces: {} {}, {} {}, frame tag: {}",
std::shared_ptr< const ITrace > pointer
void init_overall_response(IFrame::pointer frame)
std::string m_break_roi_loop1_tag
array_xxc dft_cc(const array_xxc &arr, int dim=1)
std::string m_loose_lf_tag
array_xxf idft_cr(const array_xxc &arr, int dim=0)
std::map< int, OspChan > m_channel_map
std::string m_break_roi_loop2_tag
static bool isZero(float x)
void tag_traces(const tag_t &tag, const IFrame::trace_list_t &indices, const IFrame::trace_summary_t &summary=IFrame::trace_summary_t(0))
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.
boost::error_info< struct tag_errmsg, std::string > errmsg
void decon_2D_init(int plane)
double m_r_fake_signal_low_th
std::size_t fft_best_length(size_t nsamples, bool keep_odd_even=false)
void decon_2D_hits(int plane)
Schema::FieldResponse wire_region_average(const Schema::FieldResponse &fr)
Eigen::ArrayXXcf array_xxc
A complex, 2D array.
double m_r_low_peak_sep_threshold_pre
std::string m_extend_roi_tag
array_xxc dft_rc(const array_xxf &arr, int dim=0)
double period
The sampling period of the response function.
std::vector< OspChan > m_channel_range[3]
std::string m_shrink_roi_tag
std::vector< pointer > vector
A functional object caching gain and shape.
virtual bool operator()(const input_pointer &in, output_pointer &out)
The calling signature:
Binning tbins(nticks, t0, t0+readout_time)
void decon_2D_ROI_refine(int plane)
void tag_frame(const tag_t &tag)
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
std::string m_per_chan_resp
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Array::array_xxf as_array(const Schema::PlaneResponse &pr)
std::shared_ptr< const IFrame > input_pointer
WIRECELL_FACTORY(OmnibusSigProc, WireCell::SigProc::OmnibusSigProc, WireCell::IFrameFilter, WireCell::IConfigurable) using namespace WireCell
void decon_2D_looseROI(int plane)
void load_data(const input_pointer &in, int plane)
array_xxc idft_cc(const array_xxc &arr, int dim=1)
std::string m_wiener_threshold_tag
void decon_2D_charge(int plane)
WireCell::Waveform::realseq_t generate(const WireCell::Waveform::Domain &domain, int nsamples)
FIXME: eradicate Domain in favor of Binning.
std::vector< double > trace_summary_t
constexpr std::array< std::size_t, geo::vect::dimension< Vector >)> indices()
Returns a sequence of indices valid for a vector of the specified type.
double m_fine_time_offset
std::vector< PlaneResponse > planes
List of PlaneResponse objects.
double m_intrinsic_time_offset
double m_coarse_time_offset
void decon_2D_looseROI_debug_mode(int plane)
IAnodePlane::pointer m_anode
std::string m_field_response
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
std::shared_ptr< const IFrame > output_pointer
void load_data(int plane, const Array::array_xxf &r_data, ROI_formation &roi_form)
logptr_t logger(std::string name)
Thrown when a wrong value has been encountered.
void decon_2D_tightROI(int plane)
bool m_use_roi_debug_mode
void decon_2D_tighterROI(int plane)
void log(source_loc source, level::level_enum lvl, const char *fmt, const Args &...args)
void apply_roi(int plane, Array::array_xxf &r_data)
Array::array_xxc m_c_data
static bool ispositive(float x)
Waveform::ChannelMaskMap m_cmm
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
SignalROIChList & get_rois_by_plane(int plane)
std::string m_cleanup_roi_tag
double m_r_fake_signal_high_th
Array::array_xxf m_r_data
void save_roi(ITrace::vector &itraces, IFrame::trace_list_t &indices, int plane, std::vector< std::list< SignalROI * > > &roi_channel_list)
Json::Value Configuration
double m_r_fake_signal_low_th_ind_factor
cet::LibraryManager dummy("noplugin")
bool masked_neighbors(const std::string &cmname, OspChan &ochan, int nnn)
void save_data(ITrace::vector &itraces, IFrame::trace_list_t &indices, int plane, const std::vector< float > &perwire_rmses, IFrame::trace_summary_t &threshold)
void restore_baseline(WireCell::Array::array_xxf &arr)
unsigned nrows(sqlite3 *db, std::string const &tablename)
std::string m_tight_lf_tag
std::vector< float > ChargeSequence
Sequential collection of charge.
std::vector< size_t > trace_list_t
std::vector< Waveform::realseq_t > overall_resp[3]
std::shared_ptr< const vector > shared_vector
Hold info about multiple plane responses in the detector.
void refine_data(int plane, ROI_formation &roi_form)
double m_r_fake_signal_high_th_ind_factor
QTextStream & endl(QTextStream &s)
Eigen::ArrayXXf array_xxf
A real, 2D array.
void refine_data_debug_mode(int plane, ROI_formation &roi_form, const std::string &cmd)