Public Member Functions | Private Attributes | List of all members
WireCell::SigProc::NominalChannelResponse Class Reference

#include <NominalChannelResponse.h>

Inheritance diagram for WireCell::SigProc::NominalChannelResponse:
WireCell::IChannelResponse WireCell::IConfigurable WireCell::IComponent< IChannelResponse > WireCell::IComponent< IConfigurable > WireCell::Interface WireCell::Interface

Public Member Functions

 NominalChannelResponse (double gain=14 *WireCell::units::mV/WireCell::units::fC, double shaping=2 *WireCell::units::us, const Binning &binning=Binning(100, 0, 10 *WireCell::units::us))
 
virtual ~NominalChannelResponse ()
 
virtual const Waveform::realseq_tchannel_response (int channel_ident) const
 
virtual Binning channel_response_binning () const
 Return the binning that the channel_response follows. More...
 
virtual void configure (const WireCell::Configuration &config)
 Accept a configuration. More...
 
virtual WireCell::Configuration default_configuration () const
 Optional, override to return a hard-coded default configuration. More...
 
- Public Member Functions inherited from WireCell::IChannelResponse
virtual ~IChannelResponse ()
 
- Public Member Functions inherited from WireCell::IComponent< IChannelResponse >
virtual ~IComponent ()
 
- Public Member Functions inherited from WireCell::Interface
virtual ~Interface ()
 
- Public Member Functions inherited from WireCell::IConfigurable
virtual ~IConfigurable ()
 
- Public Member Functions inherited from WireCell::IComponent< IConfigurable >
virtual ~IComponent ()
 

Private Attributes

double m_gain
 
double m_shaping
 
Binning m_bins
 
Waveform::realseq_t m_cr
 

Additional Inherited Members

- Public Types inherited from WireCell::IComponent< IChannelResponse >
typedef std::shared_ptr< IChannelResponsepointer
 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
 
- 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...
 

Detailed Description

Definition at line 14 of file NominalChannelResponse.h.

Constructor & Destructor Documentation

SigProc::NominalChannelResponse::NominalChannelResponse ( double  gain = 14*WireCell::units::mV/WireCell::units::fC,
double  shaping = 2*WireCell::units::us,
const Binning binning = Binning(100, 0, 10*WireCell::units::us) 
)
SigProc::NominalChannelResponse::~NominalChannelResponse ( )
virtual

Definition at line 21 of file NominalChannelResponse.cxx.

22 {
23 }

Member Function Documentation

const Waveform::realseq_t & SigProc::NominalChannelResponse::channel_response ( int  channel_ident) const
virtual

Provide the channel response for the given channel ID number. Note the binning of the returned waveform should be coordinated through configuration.

Implements WireCell::IChannelResponse.

Definition at line 52 of file NominalChannelResponse.cxx.

53 {
54  return m_cr;
55 }
Binning SigProc::NominalChannelResponse::channel_response_binning ( ) const
virtual

Return the binning that the channel_response follows.

Implements WireCell::IChannelResponse.

Definition at line 57 of file NominalChannelResponse.cxx.

void SigProc::NominalChannelResponse::configure ( const WireCell::Configuration config)
virtual

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 36 of file NominalChannelResponse.cxx.

37 {
38  m_gain = get(cfg,"gain",m_gain);
39  m_shaping = get(cfg,"shaping",m_shaping);
40  int nbins = get(cfg,"nbins", m_bins.nbins());
41  double tmin = get(cfg,"tmin",m_bins.min());
42  double tmax = get(cfg,"tmax",m_bins.max());
43  Response::ColdElec ce(m_gain, m_shaping);
44  m_bins = Binning(nbins, tmin, tmax);
45  m_cr = ce.generate(m_bins);
46  if (m_cr.empty()) {
47  THROW(ValueError() << errmsg{"Failed to generate any nominal channel response"});
48  }
49 }
boost::error_info< struct tag_errmsg, std::string > errmsg
Definition: Exceptions.h:54
cfg
Definition: dbjson.py:29
double max() const
Definition: Binning.h:52
double min() const
Definition: Binning.h:47
#define THROW(e)
Definition: Exceptions.h:25
int nbins() const
Definition: Binning.h:42
WireCell::Configuration SigProc::NominalChannelResponse::default_configuration ( ) const
virtual

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

Reimplemented from WireCell::IConfigurable.

Definition at line 25 of file NominalChannelResponse.cxx.

26 {
28  cfg["gain"] = m_gain;
29  cfg["shaping"] = m_shaping;
30  cfg["nbins"] = m_bins.nbins();
31  cfg["tmin"] = m_bins.min();
32  cfg["tmax"] = m_bins.max();
33  return cfg;
34 }
cfg
Definition: dbjson.py:29
double max() const
Definition: Binning.h:52
double min() const
Definition: Binning.h:47
Json::Value Configuration
Definition: Configuration.h:50
int nbins() const
Definition: Binning.h:42

Member Data Documentation

Binning WireCell::SigProc::NominalChannelResponse::m_bins
private

Definition at line 32 of file NominalChannelResponse.h.

Waveform::realseq_t WireCell::SigProc::NominalChannelResponse::m_cr
private

Definition at line 34 of file NominalChannelResponse.h.

double WireCell::SigProc::NominalChannelResponse::m_gain
private

Definition at line 31 of file NominalChannelResponse.h.

double WireCell::SigProc::NominalChannelResponse::m_shaping
private

Definition at line 31 of file NominalChannelResponse.h.


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