SumSlice.h
Go to the documentation of this file.
1 /* Note, this file should not be #include'd into WCT components
2  * directly but may be included into tests.
3 
4  Uniformly slice a frame by charge summation
5 
6  This file provides two variants.
7 
8  - SumSlicer :: a function node which produces an IFrameSlice
9 
10  - SumSlices :: a queuedout node which produces an ISlice
11 
12  The two have trace-offs.
13 
14  r: keeps context, makes DFP graph simpler, forces monolithic downstream/more memory/node
15 
16  s: the opposite
17 
18  Notes:
19 
20  - Any sample must be different than 0.0 to be considered for
21  addition to a slice but no other thresholding is done here (do it
22  in some other component).
23 
24 */
25 
26 #ifndef WIRECELLIMG_SUMSLICE
27 #define WIRECELLIMG_SUMSLICE
28 
33 
34 #include <string>
35 
36 namespace WireCell {
37  namespace Img {
38 
39  namespace Data {
40  // ISlice class is held temporarily as concrete.
41  class Slice;
42  }
43 
44  class SumSliceBase : public IConfigurable {
45  public:
46  SumSliceBase();
47  virtual ~SumSliceBase();
48 
49  // IConfigurable
50  virtual void configure(const WireCell::Configuration& cfg);
51  virtual WireCell::Configuration default_configuration() const;
52 
53  protected:
54 
55  typedef std::map<size_t, Data::Slice*> slice_map_t;
56  void slice(const IFrame::pointer& in, slice_map_t& sm);
57 
58  private:
59 
63  };
64 
65  class SumSlicer : public SumSliceBase, public IFrameSlicer {
66  public:
67  virtual ~SumSlicer();
68 
69  // IFrameSlicer
70  bool operator()(const input_pointer& in, output_pointer& out);
71  };
72 
73  class SumSlices : public SumSliceBase, public IFrameSlices {
74  public:
75  virtual ~SumSlices();
76 
77  // IFrameSlices
78  virtual bool operator()(const input_pointer& depo, output_queue& slices);
79 
80  };
81 
82  }
83 }
84 #endif
std::shared_ptr< const IFrame > pointer
Definition: IData.h:19
SlicingAlgorithm::Slice Slice
std::string string
Definition: nybbler.cc:12
std::map< size_t, Data::Slice * > slice_map_t
Definition: SumSlice.h:55
cfg
Definition: dbjson.py:29
std::deque< output_pointer > output_queue
std::shared_ptr< const IFrame > input_pointer
Definition: IFunctionNode.h:39
def configure(cfg)
Definition: cuda.py:34
std::shared_ptr< Interface > pointer
Definition: Interface.h:16
std::shared_ptr< const ISliceFrame > output_pointer
Definition: IFunctionNode.h:40
std::vector< TCSlice > slices
Definition: DataStructs.cxx:12
Definition: Main.h:22
Json::Value Configuration
Definition: Configuration.h:50
std::shared_ptr< const IFrame > input_pointer
IAnodePlane::pointer m_anode
Definition: SumSlice.h:60