ResponseSys.cxx
Go to the documentation of this file.
2 
5 
6 
9 
10 using namespace WireCell;
11 
12 Gen::ResponseSys::ResponseSys(int nticks, double start, double tick, double magnitude, double time_smear, double offset)
13 {
14  m_cfg["nticks"] = tick;
15  m_cfg["start"] = start;
16  m_cfg["tick"] = tick;
17  m_cfg["magnitude"] = magnitude;
18  m_cfg["time_smear"] = time_smear;
19  m_cfg["offset"] = offset;
20 }
21 WireCell::Configuration Gen::ResponseSys::default_configuration() const
22 {
23  return m_cfg;
24 }
26 {
27  m_cfg = cfg;
28 
29  const double tick = waveform_period();
30  const double offset = m_cfg["offset"].asDouble();
31  const double sigma = m_cfg["time_smear"].asDouble();
32  // Sys is a Gaussian function
33  Response::SysResp sysresp(tick,
34  m_cfg["magnitude"].asDouble(),
35  sigma,
36  offset
37  );
38 
39  const int nbins = m_cfg["nticks"].asInt();
40  const double start = waveform_start();
41  Binning tbins(nbins, start, nbins*tick+start);
42  m_wave = sysresp.generate(tbins);
43 }
44 
45 double Gen::ResponseSys::waveform_start() const
46 {
47  return m_cfg["start"].asDouble();
48 }
49 
50 double Gen::ResponseSys::waveform_period() const
51 {
52  return m_cfg["tick"].asDouble();
53 }
54 
55 const IWaveform::sequence_type& Gen::ResponseSys::waveform_samples() const
56 {
57  return m_wave;
58 }
59 
cfg
Definition: dbjson.py:29
const double tick
const int nticks
Binning tbins(nticks, t0, t0+readout_time)
std::vector< float > sequence_type
Definition: IWaveform.h:17
def configure(cfg)
Definition: cuda.py:34
WireCell::Waveform::realseq_t generate(const WireCell::Waveform::Domain &domain, int nsamples)
FIXME: eradicate Domain in favor of Binning.
Definition: Response.cxx:303
Definition: Main.h:22
WIRECELL_FACTORY(ResponseSys, WireCell::Gen::ResponseSys, WireCell::IWaveform, WireCell::IConfigurable) using namespace WireCell
realseq_t magnitude(const compseq_t &seq)
Return the magnitude or absolute value of the sequence.
Definition: Waveform.cxx:65
Json::Value Configuration
Definition: Configuration.h:50