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

#include <SimpleFrame.h>

Inheritance diagram for WireCell::SimpleFrame:
WireCell::IFrame WireCell::IData< IFrame >

Classes

struct  SimpleTraceInfo
 

Public Member Functions

 SimpleFrame (int ident, double time, const ITrace::vector &traces, double tick=0.5 *units::microsecond, const Waveform::ChannelMaskMap &cmm=Waveform::ChannelMaskMap())
 
 SimpleFrame (int ident, double time, ITrace::shared_vector traces, double tick=0.5 *units::microsecond, const Waveform::ChannelMaskMap &cmm=Waveform::ChannelMaskMap())
 
 ~SimpleFrame ()
 
virtual int ident () const
 Return an identifying number of this frame. More...
 
virtual double time () const
 
virtual double tick () const
 Return the digitization sample period. More...
 
virtual ITrace::shared_vector traces () const
 Return a vector of all traces ignoring any potential tag. More...
 
virtual Waveform::ChannelMaskMap masks () const
 Return all masks associated with this frame. More...
 
virtual const tag_list_tframe_tags () const
 
virtual const tag_list_ttrace_tags () const
 
virtual const trace_list_ttagged_traces (const tag_t &tag) const
 
virtual const trace_summary_ttrace_summary (const tag_t &tag) const
 
void tag_frame (const tag_t &tag)
 
void tag_traces (const tag_t &tag, const IFrame::trace_list_t &indices, const IFrame::trace_summary_t &summary=IFrame::trace_summary_t(0))
 
- Public Member Functions inherited from WireCell::IFrame
virtual ~IFrame ()
 
- Public Member Functions inherited from WireCell::IData< IFrame >
virtual ~IData ()
 

Private Member Functions

const SimpleTraceInfoget_trace_info (const IFrame::tag_t &tag) const
 

Private Attributes

int m_ident
 
double m_time
 
double m_tick
 
ITrace::shared_vector m_traces
 
Waveform::ChannelMaskMap m_cmm
 
IFrame::tag_list_t m_frame_tags
 
IFrame::tag_list_t m_trace_tags
 
std::map< IFrame::tag_t, SimpleTraceInfom_trace_info
 

Additional Inherited Members

- Public Types inherited from WireCell::IFrame
typedef std::string tag_t
 
typedef std::vector< tag_ttag_list_t
 
typedef std::vector< size_t > trace_list_t
 
typedef std::vector< double > trace_summary_t
 
- Public Types inherited from WireCell::IData< IFrame >
typedef IFrame value_type
 
typedef std::shared_ptr< const IFramepointer
 
typedef std::vector< pointervector
 
typedef std::shared_ptr< const vectorshared_vector
 

Detailed Description

A simple frame.

This is is nothing more than a bag of data.

Definition at line 15 of file SimpleFrame.h.

Constructor & Destructor Documentation

SimpleFrame::SimpleFrame ( int  ident,
double  time,
const ITrace::vector traces,
double  tick = 0.5*units::microsecond,
const Waveform::ChannelMaskMap cmm = Waveform::ChannelMaskMap() 
)

Definition at line 6 of file SimpleFrame.cxx.

9  , m_traces(new ITrace::vector(traces.begin(), traces.end()))
10  , m_cmm(cmm)
11 {
12 }
std::vector< pointer > vector
Definition: IData.h:21
ITrace::shared_vector m_traces
Definition: SimpleFrame.h:53
virtual double tick() const
Return the digitization sample period.
Definition: SimpleFrame.cxx:26
virtual ITrace::shared_vector traces() const
Return a vector of all traces ignoring any potential tag.
Definition: SimpleFrame.cxx:28
Waveform::ChannelMaskMap m_cmm
Definition: SimpleFrame.h:54
virtual int ident() const
Return an identifying number of this frame.
Definition: SimpleFrame.cxx:24
SimpleFrame::SimpleFrame ( int  ident,
double  time,
ITrace::shared_vector  traces,
double  tick = 0.5*units::microsecond,
const Waveform::ChannelMaskMap cmm = Waveform::ChannelMaskMap() 
)

Definition at line 13 of file SimpleFrame.cxx.

16  , m_traces(traces)
17  , m_cmm(cmm)
18 {
19 }
ITrace::shared_vector m_traces
Definition: SimpleFrame.h:53
virtual double tick() const
Return the digitization sample period.
Definition: SimpleFrame.cxx:26
virtual ITrace::shared_vector traces() const
Return a vector of all traces ignoring any potential tag.
Definition: SimpleFrame.cxx:28
Waveform::ChannelMaskMap m_cmm
Definition: SimpleFrame.h:54
virtual int ident() const
Return an identifying number of this frame.
Definition: SimpleFrame.cxx:24
SimpleFrame::~SimpleFrame ( )

Definition at line 20 of file SimpleFrame.cxx.

21 {
22 
23 }

Member Function Documentation

const IFrame::tag_list_t & SimpleFrame::frame_tags ( ) const
virtual

Implements WireCell::IFrame.

Definition at line 52 of file SimpleFrame.cxx.

53 {
54  return m_frame_tags;
55 }
IFrame::tag_list_t m_frame_tags
Definition: SimpleFrame.h:56
const SimpleFrame::SimpleTraceInfo & SimpleFrame::get_trace_info ( const IFrame::tag_t tag) const
private

Definition at line 42 of file SimpleFrame.cxx.

43 {
44  static SimpleTraceInfo empty;
45  auto const& it = m_trace_info.find(tag);
46  if (it == m_trace_info.end()) {
47  return empty;
48  }
49  return it->second;
50 }
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:92
std::map< IFrame::tag_t, SimpleTraceInfo > m_trace_info
Definition: SimpleFrame.h:63
int SimpleFrame::ident ( ) const
virtual

Return an identifying number of this frame.

Implements WireCell::IFrame.

Definition at line 24 of file SimpleFrame.cxx.

24 { return m_ident; }
Waveform::ChannelMaskMap SimpleFrame::masks ( ) const
virtual

Return all masks associated with this frame.

Reimplemented from WireCell::IFrame.

Definition at line 31 of file SimpleFrame.cxx.

32 {
33  return m_cmm;
34 }
Waveform::ChannelMaskMap m_cmm
Definition: SimpleFrame.h:54
void SimpleFrame::tag_frame ( const tag_t tag)

Definition at line 71 of file SimpleFrame.cxx.

72 {
73  m_frame_tags.push_back(tag);
74 }
IFrame::tag_list_t m_frame_tags
Definition: SimpleFrame.h:56
void SimpleFrame::tag_traces ( const tag_t tag,
const IFrame::trace_list_t indices,
const IFrame::trace_summary_t summary = IFrame::trace_summary_t(0) 
)

Definition at line 76 of file SimpleFrame.cxx.

78 {
79  auto& info = m_trace_info[tag];
80  info.indices = indices;
81  info.summary = summary;
82 
83  // Kind of dumb way to update this but we want to be able to
84  // return a reference to it later.
85  m_trace_tags.clear();
86  for (auto& it : m_trace_info) {
87  m_trace_tags.push_back(it.first);
88  }
89 }
constexpr std::array< std::size_t, geo::vect::dimension< Vector >)> indices()
Returns a sequence of indices valid for a vector of the specified type.
def summary(store)
Definition: info.py:119
std::map< IFrame::tag_t, SimpleTraceInfo > m_trace_info
Definition: SimpleFrame.h:63
IFrame::tag_list_t m_trace_tags
Definition: SimpleFrame.h:56
const IFrame::trace_list_t & SimpleFrame::tagged_traces ( const tag_t tag) const
virtual

Implements WireCell::IFrame.

Definition at line 61 of file SimpleFrame.cxx.

62 {
63  return get_trace_info(tag).indices;
64 }
const SimpleTraceInfo & get_trace_info(const IFrame::tag_t &tag) const
Definition: SimpleFrame.cxx:42
double SimpleFrame::tick ( ) const
virtual

Return the digitization sample period.

Implements WireCell::IFrame.

Definition at line 26 of file SimpleFrame.cxx.

26 { return m_tick; }
double SimpleFrame::time ( ) const
virtual

Return the reference time of the frame w.r.t. some global time. Note, each trace has a "tbin" counting number of ticks w.r.t. to this time where the trace starts. In general, tbin is not zero.

Implements WireCell::IFrame.

Definition at line 25 of file SimpleFrame.cxx.

25 { return m_time; }
const IFrame::trace_summary_t & SimpleFrame::trace_summary ( const tag_t tag) const
virtual

Implements WireCell::IFrame.

Definition at line 66 of file SimpleFrame.cxx.

67 {
68  return get_trace_info(tag).summary;
69 }
const SimpleTraceInfo & get_trace_info(const IFrame::tag_t &tag) const
Definition: SimpleFrame.cxx:42
IFrame::trace_summary_t summary
Definition: SimpleFrame.h:60
const IFrame::tag_list_t & SimpleFrame::trace_tags ( ) const
virtual

Implements WireCell::IFrame.

Definition at line 56 of file SimpleFrame.cxx.

57 {
58  return m_trace_tags;
59 }
IFrame::tag_list_t m_trace_tags
Definition: SimpleFrame.h:56
ITrace::shared_vector SimpleFrame::traces ( ) const
virtual

Return a vector of all traces ignoring any potential tag.

Implements WireCell::IFrame.

Definition at line 28 of file SimpleFrame.cxx.

28 { return m_traces; }
ITrace::shared_vector m_traces
Definition: SimpleFrame.h:53

Member Data Documentation

Waveform::ChannelMaskMap WireCell::SimpleFrame::m_cmm
private

Definition at line 54 of file SimpleFrame.h.

IFrame::tag_list_t WireCell::SimpleFrame::m_frame_tags
private

Definition at line 56 of file SimpleFrame.h.

int WireCell::SimpleFrame::m_ident
private

Definition at line 51 of file SimpleFrame.h.

double WireCell::SimpleFrame::m_tick
private

Definition at line 52 of file SimpleFrame.h.

double WireCell::SimpleFrame::m_time
private

Definition at line 52 of file SimpleFrame.h.

std::map<IFrame::tag_t, SimpleTraceInfo> WireCell::SimpleFrame::m_trace_info
private

Definition at line 63 of file SimpleFrame.h.

IFrame::tag_list_t WireCell::SimpleFrame::m_trace_tags
private

Definition at line 56 of file SimpleFrame.h.

ITrace::shared_vector WireCell::SimpleFrame::m_traces
private

Definition at line 53 of file SimpleFrame.h.


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