19 Gen::PerChannelVariation::~PerChannelVariation()
34 cfg [
"nsamples"] = 310;
44 cfg[
"truncate"] =
true;
47 cfg[
"per_chan_resp"] =
"";
54 m_per_chan_resp = get<std::string>(
cfg,
"per_chan_resp",
"");
56 if (! m_per_chan_resp.empty()) {
57 std::cerr<<
"SIMULATION: CH-BY-CH ELECTRONICS RESPONSE VARIATION\n";
58 m_cr = Factory::find_tn<IChannelResponse>(m_per_chan_resp);
59 double tick = cfg[
"tick"].asDouble();
60 auto cr_bins = m_cr->channel_response_binning();
61 if (cr_bins.binsize() !=
tick) {
64 m_nsamples = cr_bins.nbins();
70 m_truncate = cfg[
"truncate"].asBool();
80 if (m_per_chan_resp.empty()) {
81 std::cerr <<
"Gen::PerChannelVariation: warning no ch-by-ch response was found!\n";
86 auto traces = in->traces();
88 std::cerr <<
"Gen::PerChannelVariation: error no traces in frame for me\n";
93 size_t ntraces = traces->size();
95 for (
size_t ind=0; ind<ntraces; ++ind) {
96 auto trace = traces->at(ind);
97 auto chid =
trace->channel();
99 tch_resp.resize(m_nsamples, 0);
101 tch_resp, m_from, m_truncate);
102 out_traces[ind] = std::make_shared<SimpleTrace>(chid,
trace->tbin(), wave);
105 out = std::make_shared<SimpleFrame>(in->ident(), in->time(), out_traces, in->tick());
boost::error_info< struct tag_errmsg, std::string > errmsg
std::vector< pointer > vector
A functional object caching gain and shape.
Binning tbins(nticks, t0, t0+readout_time)
std::shared_ptr< const IFrame > input_pointer
WireCell::Waveform::realseq_t generate(const WireCell::Waveform::Domain &domain, int nsamples)
FIXME: eradicate Domain in favor of Binning.
std::shared_ptr< const IFrame > output_pointer
Thrown when a wrong value has been encountered.
Json::Value Configuration
WIRECELL_FACTORY(PerChannelVariation, WireCell::Gen::PerChannelVariation, WireCell::IFrameFilter, WireCell::IConfigurable) using namespace WireCell