SignalROI.h
Go to the documentation of this file.
1 #ifndef WIRECELLSIGPROC_SignalROI_h
2 #define WIRECELLSIGPROC_SignalROI_h
3 
5 
6 #include <iostream>
7 #include <vector>
8 #include <list>
9 #include <map>
10 
11 
12 namespace WireCell{
13  namespace SigProc{
14  class SignalROI{
15  public:
16  SignalROI(int plane, int chid, int start_bin, int end_bin, const Waveform::realseq_t& signal);
17  SignalROI(SignalROI *roi);
18  ~SignalROI();
19  int get_start_bin(){return start_bin;}
20  int get_end_bin(){return end_bin;}
21 
24 
27 
28  int get_chid(){return chid;}
29  int get_plane(){return plane;}
30  std::vector<float>& get_contents(){return contents;}
31  std::vector<std::pair<int,int>> get_above_threshold(float th);
32  double get_average_heights();
33  double get_max_height();
34 
35  bool overlap(SignalROI *roi);
36  bool overlap(SignalROI *roi1, float th, float th1);
37 
38  private:
39  int plane;
40  int chid;
41  int start_bin;
42  int end_bin;
43 
46 
47 
48  std::vector<float> contents;
49  };
50 
51  typedef std::list<SignalROI*>SignalROIList;
52  typedef std::vector<SignalROI*> SignalROISelection;
53  typedef std::vector<SignalROISelection> SignalROIChSelection;
54  typedef std::vector<SignalROIList> SignalROIChList;
55  typedef std::map<SignalROI*, SignalROISelection> SignalROIMap;
56 
57  struct CompareRois{
58  bool operator() (SignalROI* roi1, SignalROI* roi2) const{
59  return roi1->get_start_bin() < roi2->get_start_bin();
60  }
61  };
62 
63  }
64 }
65 
66 #endif
Sequence< real_t > realseq_t
Definition: Waveform.h:31
std::vector< std::pair< int, int > > get_above_threshold(float th)
Definition: SignalROI.cxx:109
void set_ext_start_bin(int a)
Definition: SignalROI.h:25
std::list< SignalROI * > SignalROIList
Definition: SignalROI.h:51
std::vector< float > contents
Definition: SignalROI.h:48
std::vector< SignalROISelection > SignalROIChSelection
Definition: SignalROI.h:53
std::vector< float > & get_contents()
Definition: SignalROI.h:30
SignalROI(int plane, int chid, int start_bin, int end_bin, const Waveform::realseq_t &signal)
Definition: SignalROI.cxx:8
std::map< SignalROI *, SignalROISelection > SignalROIMap
Definition: SignalROI.h:55
std::vector< SignalROIList > SignalROIChList
Definition: SignalROI.h:54
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
bool overlap(SignalROI *roi)
Definition: SignalROI.cxx:80
Definition: Main.h:22
std::vector< SignalROI * > SignalROISelection
Definition: SignalROI.h:52