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

#include <ZSEndedTrace.h>

Inheritance diagram for WireCell::ZSEndedTrace:
WireCell::ITrace WireCell::IData< ITrace >

Public Member Functions

 ZSEndedTrace (int chid, int nbins=0)
 
void operator() (int tbin, float charge)
 used to fill. More...
 
virtual int channel () const
 
virtual int tbin () const
 
virtual const ChargeSequencecharge () const
 
- Public Member Functions inherited from WireCell::ITrace
virtual ~ITrace ()
 
- Public Member Functions inherited from WireCell::IData< ITrace >
virtual ~IData ()
 

Private Attributes

int m_chid
 
int m_nbins
 
std::map< int, float > m_chqmap
 
ChargeSequence m_charge
 

Additional Inherited Members

- Public Types inherited from WireCell::ITrace
typedef std::vector< float > ChargeSequence
 Sequential collection of charge. More...
 
- Public Types inherited from WireCell::IData< ITrace >
typedef ITrace value_type
 
typedef std::shared_ptr< const ITracepointer
 
typedef std::vector< pointervector
 
typedef std::shared_ptr< const vectorshared_vector
 

Detailed Description

This concrete trace is filled by time bin and charge.

It provides the results of the filling such that the ChargeSequence is trivially (exactly) zero suppressed but only at the ends. Any zeros bounded by non-zero charge are kept.

Definition at line 17 of file ZSEndedTrace.h.

Constructor & Destructor Documentation

ZSEndedTrace::ZSEndedTrace ( int  chid,
int  nbins = 0 
)

Definition at line 6 of file ZSEndedTrace.cxx.

Member Function Documentation

int ZSEndedTrace::channel ( ) const
virtual

Return the identifier number for the channel on which this trace was recorded.

Implements WireCell::ITrace.

Definition at line 19 of file ZSEndedTrace.cxx.

20 {
21  return m_chid;
22 }
const ZSEndedTrace::ChargeSequence & ZSEndedTrace::charge ( ) const
virtual

Return the contiguous adc/charge measurements on the channel starting at tbin.

Implements WireCell::ITrace.

Definition at line 29 of file ZSEndedTrace.cxx.

30 {
31  if (!m_charge.size()) {
32  int first_bin = m_chqmap.begin()->first;
33  int last_bin = m_chqmap.rbegin()->first;
34  m_charge.resize(last_bin-first_bin+1, 0);
35  for (auto mit : m_chqmap) {
36  m_charge[mit.first - first_bin] = mit.second;
37  }
38  }
39  return m_charge;
40 }
ChargeSequence m_charge
Definition: ZSEndedTrace.h:20
std::map< int, float > m_chqmap
Definition: ZSEndedTrace.h:19
void ZSEndedTrace::operator() ( int  tbin,
float  charge 
)

used to fill.

Definition at line 12 of file ZSEndedTrace.cxx.

13 {
14  bin = min(bin, m_nbins-1);
15  m_chqmap[bin] += charge;
16  m_charge.clear(); // invalidate;
17 }
virtual const ChargeSequence & charge() const
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
ChargeSequence m_charge
Definition: ZSEndedTrace.h:20
QTextStream & bin(QTextStream &s)
std::map< int, float > m_chqmap
Definition: ZSEndedTrace.h:19
int ZSEndedTrace::tbin ( ) const
virtual

Return the time bin relative to some absolute time (typically the start of the frame) at which the first ADC/charge in the trace was digitized (leading bin edge).

Implements WireCell::ITrace.

Definition at line 24 of file ZSEndedTrace.cxx.

25 {
26  return m_chqmap.begin()->first;
27 }
std::map< int, float > m_chqmap
Definition: ZSEndedTrace.h:19

Member Data Documentation

ChargeSequence WireCell::ZSEndedTrace::m_charge
mutableprivate

Definition at line 20 of file ZSEndedTrace.h.

int WireCell::ZSEndedTrace::m_chid
private

Definition at line 18 of file ZSEndedTrace.h.

std::map<int,float> WireCell::ZSEndedTrace::m_chqmap
private

Definition at line 19 of file ZSEndedTrace.h.

int WireCell::ZSEndedTrace::m_nbins
private

Definition at line 18 of file ZSEndedTrace.h.


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