ISlice.h
Go to the documentation of this file.
1 /**
2 
3 A slice associates an IChannel with a value representing activity over
4 some time span.
5 
6 The time span of the slice is given in the WCT system of units.
7 Typically it is some multiple of sampling ticks, but need not be.
8 
9 The slice also caries an "ident" which definition is
10 application-dependent.
11 
12 */
13 
14 #ifndef WIRECELL_ISLICE
15 #define WIRECELL_ISLICE
16 
17 #include "WireCellIface/IData.h"
18 #include "WireCellIface/IFrame.h"
19 
20 #include <unordered_map>
21 
22 namespace WireCell {
23 
24  class ISlice : public IData<ISlice> {
25  public:
26  virtual ~ISlice();
27 
28  // The type for the value of the per channel metric (aka charge)
29  typedef float value_t;
30 
31  // A sample is a channels value in the time slice.
32  typedef std::pair<IChannel::pointer, value_t> pair_t;
33  typedef std::unordered_map<IChannel::pointer, value_t> map_t;
34 
35  // Pointer back to IFrame from which this ISlice was created.
36  virtual IFrame::pointer frame() const = 0;
37 
38  // Return a opaque numerical identifier of this time slice
39  // unique in some broader context.
40  virtual int ident() const = 0;
41 
42  // Return the start time of this time slice relative to frame's time
43  virtual double start() const = 0;
44 
45  // Return the time span of this slice
46  virtual double span() const = 0;
47 
48  // The activity in the form of a channel/value map;
49  virtual map_t activity() const = 0;
50 
51  };
52 }
53 
54 #endif
std::shared_ptr< const IFrame > pointer
Definition: IData.h:19
virtual IFrame::pointer frame() const =0
std::pair< IChannel::pointer, value_t > pair_t
Definition: ISlice.h:32
virtual int ident() const =0
virtual double start() const =0
virtual map_t activity() const =0
std::unordered_map< IChannel::pointer, value_t > map_t
Definition: ISlice.h:33
float value_t
Definition: ISlice.h:29
Definition: Main.h:22
virtual double span() const =0