Public Member Functions | Private Attributes | List of all members
WireCell::Gen::ResponseSys Class Reference

#include <ResponseSys.h>

Inheritance diagram for WireCell::Gen::ResponseSys:
WireCell::IWaveform WireCell::IConfigurable WireCell::IData< IWaveform > WireCell::IComponent< IConfigurable > WireCell::Interface

Public Member Functions

 ResponseSys (int nticks=10000, double start=0.0 *units::us, double tick=0.5 *units::us, double magnitude=1.0, double time_smear=0.0 *units::us, double offset=0.0 *units::us)
 
virtual void configure (const WireCell::Configuration &cfg)
 Accept a configuration. More...
 
virtual WireCell::Configuration default_configuration () const
 Optional, override to return a hard-coded default configuration. More...
 
virtual double waveform_start () const
 
virtual double waveform_period () const
 
virtual const sequence_typewaveform_samples () const
 
- Public Member Functions inherited from WireCell::IWaveform
virtual ~IWaveform ()
 
- Public Member Functions inherited from WireCell::IConfigurable
virtual ~IConfigurable ()
 
- Public Member Functions inherited from WireCell::IComponent< IConfigurable >
virtual ~IComponent ()
 
- Public Member Functions inherited from WireCell::Interface
virtual ~Interface ()
 

Private Attributes

Configuration m_cfg
 
sequence_type m_wave
 

Additional Inherited Members

- Public Types inherited from WireCell::IWaveform
typedef std::vector< float > sequence_type
 
- Public Types inherited from WireCell::IComponent< IConfigurable >
typedef std::shared_ptr< IConfigurablepointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 
- Public Types inherited from WireCell::Interface
typedef std::shared_ptr< Interfacepointer
 

Detailed Description

Definition at line 14 of file ResponseSys.h.

Constructor & Destructor Documentation

Gen::ResponseSys::ResponseSys ( int  nticks = 10000,
double  start = 0.0*units::us,
double  tick = 0.5*units::us,
double  magnitude = 1.0,
double  time_smear = 0.0*units::us,
double  offset = 0.0*units::us 
)

Definition at line 12 of file ResponseSys.cxx.

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 }
const double tick
realseq_t magnitude(const compseq_t &seq)
Return the magnitude or absolute value of the sequence.
Definition: Waveform.cxx:65

Member Function Documentation

void Gen::ResponseSys::configure ( const WireCell::Configuration config)
virtual

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 25 of file ResponseSys.cxx.

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 }
cfg
Definition: dbjson.py:29
const double tick
Binning tbins(nticks, t0, t0+readout_time)
virtual double waveform_period() const
Definition: ResponseSys.cxx:50
virtual double waveform_start() const
Definition: ResponseSys.cxx:45
WireCell::Configuration Gen::ResponseSys::default_configuration ( ) const
virtual

Optional, override to return a hard-coded default configuration.

Reimplemented from WireCell::IConfigurable.

Definition at line 21 of file ResponseSys.cxx.

22 {
23  return m_cfg;
24 }
double Gen::ResponseSys::waveform_period ( ) const
virtual

Implements WireCell::IWaveform.

Definition at line 50 of file ResponseSys.cxx.

51 {
52  return m_cfg["tick"].asDouble();
53 }
const IWaveform::sequence_type & Gen::ResponseSys::waveform_samples ( ) const
virtual

Implements WireCell::IWaveform.

Definition at line 55 of file ResponseSys.cxx.

56 {
57  return m_wave;
58 }
double Gen::ResponseSys::waveform_start ( ) const
virtual

Implements WireCell::IWaveform.

Definition at line 45 of file ResponseSys.cxx.

46 {
47  return m_cfg["start"].asDouble();
48 }

Member Data Documentation

Configuration WireCell::Gen::ResponseSys::m_cfg
private

Definition at line 38 of file ResponseSys.h.

sequence_type WireCell::Gen::ResponseSys::m_wave
private

Definition at line 39 of file ResponseSys.h.


The documentation for this class was generated from the following files: