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

#include <ElecResponse.h>

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

Public Member Functions

 ElecResponse (int nticks=10000, double t0=0, double gain=14.0 *units::mV/units::fC, double shaping=2 *units::us, double postgain=1.0, double tick=0.5 *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 15 of file ElecResponse.h.

Constructor & Destructor Documentation

Gen::ElecResponse::ElecResponse ( int  nticks = 10000,
double  t0 = 0,
double  gain = 14.0*units::mV/units::fC,
double  shaping = 2*units::us,
double  postgain = 1.0,
double  tick = 0.5*units::us 
)

Definition at line 14 of file ElecResponse.cxx.

15 {
16  m_cfg["gain"] = gain;
17  m_cfg["shaping"] = shaping;
18  m_cfg["postgain"] = postgain;
19  m_cfg["start"] = t0;
20  m_cfg["tick"] = tick;
21  m_cfg["nticks"] = nticks;
22 }
const double tick
const int nticks
const double t0

Member Function Documentation

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

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 27 of file ElecResponse.cxx.

28 {
29  m_cfg = cfg;
30 
31  Response::ColdElec ce(m_cfg["gain"].asDouble(), m_cfg["shaping"].asDouble());
32  const int nbins = m_cfg["nticks"].asInt();
33  const double t0 = waveform_start();
34  const double tick = waveform_period();
35  Binning bins(nbins, t0, t0+nbins*tick);
36  m_wave = ce.generate(bins);
37  Waveform::scale(m_wave, m_cfg["postgain"].asDouble());
38 }
code to link reconstructed objects back to the MC truth information
virtual double waveform_period() const
cfg
Definition: dbjson.py:29
A functional object caching gain and shape.
Definition: Response.h:165
const double tick
virtual double waveform_start() const
void scale(Sequence< Val > &seq, Val scalar)
Scale (multiply) sequence values by scalar.
Definition: Waveform.h:146
WireCell::Configuration Gen::ElecResponse::default_configuration ( ) const
virtual

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

Reimplemented from WireCell::IConfigurable.

Definition at line 23 of file ElecResponse.cxx.

24 {
25  return m_cfg;
26 }
double Gen::ElecResponse::waveform_period ( ) const
virtual

Implements WireCell::IWaveform.

Definition at line 45 of file ElecResponse.cxx.

46 {
47  return m_cfg["tick"].asDouble();
48 }
const IWaveform::sequence_type & Gen::ElecResponse::waveform_samples ( ) const
virtual

Implements WireCell::IWaveform.

Definition at line 50 of file ElecResponse.cxx.

51 {
52  return m_wave;
53 }
double Gen::ElecResponse::waveform_start ( ) const
virtual

Implements WireCell::IWaveform.

Definition at line 40 of file ElecResponse.cxx.

41 {
42  return m_cfg["start"].asDouble();
43 }

Member Data Documentation

Configuration WireCell::Gen::ElecResponse::m_cfg
private

Definition at line 34 of file ElecResponse.h.

sequence_type WireCell::Gen::ElecResponse::m_wave
private

Definition at line 35 of file ElecResponse.h.


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