SimpleFrame.cxx
Go to the documentation of this file.
2 
3 using namespace WireCell;
4 using namespace std;
5 
6 SimpleFrame::SimpleFrame(int ident, double time, const ITrace::vector& traces, double tick,
7  const Waveform::ChannelMaskMap& cmm)
8  : m_ident(ident), m_time(time), m_tick(tick)
9  , m_traces(new ITrace::vector(traces.begin(), traces.end()))
10  , m_cmm(cmm)
11 {
12 }
14  const Waveform::ChannelMaskMap& cmm)
15  : m_ident(ident), m_time(time), m_tick(tick)
16  , m_traces(traces)
17  , m_cmm(cmm)
18 {
19 }
21 {
22 
23 }
24 int SimpleFrame::ident() const { return m_ident; }
25 double SimpleFrame::time() const { return m_time; }
26 double SimpleFrame::tick() const { return m_tick; }
27 
29 
30 
32 {
33  return m_cmm;
34 }
35 
36 
38  : indices(0)
39  , summary(0)
40 {
41 }
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 }
51 
53 {
54  return m_frame_tags;
55 }
57 {
58  return m_trace_tags;
59 }
60 
62 {
63  return get_trace_info(tag).indices;
64 }
65 
67 {
68  return get_trace_info(tag).summary;
69 }
70 
72 {
73  m_frame_tags.push_back(tag);
74 }
75 
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 }
90 
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
STL namespace.
std::vector< pointer > vector
Definition: IData.h:21
const double tick
virtual const tag_list_t & frame_tags() const
Definition: SimpleFrame.cxx:52
void tag_frame(const tag_t &tag)
Definition: SimpleFrame.cxx:71
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:72
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
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:67
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
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
IFrame::tag_list_t m_trace_tags
Definition: SimpleFrame.h:56