SimpleFrame.h
Go to the documentation of this file.
1 #ifndef WIRECELL_SIMPLEFRAME
2 #define WIRECELL_SIMPLEFRAME
3 
4 #include "WireCellIface/IFrame.h"
5 #include "WireCellUtil/Units.h"
6 
7 #include <map>
8 
9 namespace WireCell {
10 
11  /** A simple frame.
12  *
13  * This is is nothing more than a bag of data.
14  */
15  class SimpleFrame : public IFrame {
16  public:
17 
18  SimpleFrame(int ident, double time, const ITrace::vector& traces,
19  double tick=0.5*units::microsecond,
21 
22  SimpleFrame(int ident, double time, ITrace::shared_vector traces,
23  double tick=0.5*units::microsecond,
25 
26  ~SimpleFrame();
27  virtual int ident() const;
28  virtual double time() const;
29  virtual double tick() const;
30 
31  virtual ITrace::shared_vector traces() const;
32  virtual Waveform::ChannelMaskMap masks() const;
33 
34  virtual const tag_list_t& frame_tags() const;
35  virtual const tag_list_t& trace_tags() const;
36  virtual const trace_list_t& tagged_traces(const tag_t& tag) const;
37  virtual const trace_summary_t& trace_summary(const tag_t& tag) const;
38 
39 
40  // Before this object is interned to a shared vector the
41  // creator may call the following non-const methods:
42 
43  // Add a frame tag.
44  void tag_frame(const tag_t& tag);
45 
46  // Tag a subset of traces with optional trace summary
47  void tag_traces(const tag_t& tag, const IFrame::trace_list_t& indices,
49 
50  private:
51  int m_ident;
52  double m_time, m_tick;
55 
57 
58  struct SimpleTraceInfo {
62  };
63  std::map<IFrame::tag_t, SimpleTraceInfo> m_trace_info;
64 
65  const SimpleTraceInfo& get_trace_info(const IFrame::tag_t& tag) const;
66  };
67 
68 }
69 
70 #endif
IFrame::tag_list_t m_frame_tags
Definition: SimpleFrame.h:56
virtual const trace_list_t & tagged_traces(const tag_t &tag) const
Definition: SimpleFrame.cxx:61
SimpleFrame(int ident, double time, const ITrace::vector &traces, double tick=0.5 *units::microsecond, const Waveform::ChannelMaskMap &cmm=Waveform::ChannelMaskMap())
Definition: SimpleFrame.cxx:6
void tag_traces(const tag_t &tag, const IFrame::trace_list_t &indices, const IFrame::trace_summary_t &summary=IFrame::trace_summary_t(0))
Definition: SimpleFrame.cxx:76
virtual const tag_list_t & trace_tags() const
Definition: SimpleFrame.cxx:56
static const double microsecond
Definition: Units.h:94
std::vector< pointer > vector
Definition: IData.h:21
virtual const tag_list_t & frame_tags() const
Definition: SimpleFrame.cxx:52
void tag_frame(const tag_t &tag)
Definition: SimpleFrame.cxx:71
std::map< std::string, ChannelMasks > ChannelMaskMap
Collect channel masks by some label.
Definition: Waveform.h:59
std::vector< double > trace_summary_t
Definition: IFrame.h:39
virtual double time() const
Definition: SimpleFrame.cxx:25
constexpr std::array< std::size_t, geo::vect::dimension< Vector >)> indices()
Returns a sequence of indices valid for a vector of the specified type.
ITrace::shared_vector m_traces
Definition: SimpleFrame.h:53
std::vector< tag_t > tag_list_t
Definition: IFrame.h:33
Definition: Main.h:22
const SimpleTraceInfo & get_trace_info(const IFrame::tag_t &tag) const
Definition: SimpleFrame.cxx:42
IFrame::trace_summary_t summary
Definition: SimpleFrame.h:60
virtual const trace_summary_t & trace_summary(const tag_t &tag) const
Definition: SimpleFrame.cxx:66
std::string tag_t
Definition: IFrame.h:28
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
def summary(store)
Definition: info.py:119
Waveform::ChannelMaskMap m_cmm
Definition: SimpleFrame.h:54
virtual int ident() const
Return an identifying number of this frame.
Definition: SimpleFrame.cxx:24
virtual Waveform::ChannelMaskMap masks() const
Return all masks associated with this frame.
Definition: SimpleFrame.cxx:31
std::vector< size_t > trace_list_t
Definition: IFrame.h:36
std::shared_ptr< const vector > shared_vector
Definition: IData.h:22
std::map< IFrame::tag_t, SimpleTraceInfo > m_trace_info
Definition: SimpleFrame.h:63
IFrame::tag_list_t m_trace_tags
Definition: SimpleFrame.h:56