All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CornerFinderAlg.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file CornerFinderAlg.h
3 /// \brief algorithm to find feature 2D points
4 ///
5 /// \author
6 ////////////////////////////////////////////////////////////////////////
7 
8 #ifndef CORNERFINDERALG_H
9 #define CORNERFINDERALG_H
10 
11 namespace fhicl {
12  class ParameterSet;
13 }
14 
18 
19 namespace geo {
20  class Geometry;
21 }
22 
23 #include "TH2.h"
24 #include "TF2.h"
25 #include "TH1D.h"
26 
27 #include <string>
28 #include <tuple>
29 #include <vector>
30 
31 namespace corner { //<---Not sure if this is the right namespace
32 
34 
35  public:
36 
37  explicit CornerFinderAlg(fhicl::ParameterSet const& pset);
38 
39  void GrabWires( std::vector<recob::Wire> const& wireVec ,
40  geo::Geometry const&); //this one creates the histograms we want to use
41 
42 
43  void get_feature_points(std::vector<recob::EndPoint2D> &,
44  geo::Geometry const&); //here we get feature points with corner score
45 
46  void get_feature_points_LineIntegralScore(std::vector<recob::EndPoint2D> &,
47  geo::Geometry const&); //here we get feature points with LineIntegral score
48 
49  void get_feature_points_fast(std::vector<recob::EndPoint2D> &,
50  geo::Geometry const&); //here we get feature points with corner score
51 
52  float line_integral(TH2F const& hist, int x1, float y1, int x2, float y2, float threshold) const;
53 
54  TH2F const& GetWireDataHist(unsigned int) const;
55 
56  private:
57 
58  void InitializeGeometry(geo::Geometry const&);
59 
60  // Need to list the things we will take in from the .fcl file
61 
62  std::string fCalDataModuleLabel;
63  std::string fConversion_algorithm;
64  std::string fConversion_func;
72  std::string fDerivative_method;
74  std::string fDerivative_BlurFunc;
84 
85  // Making a vector of histograms
86  std::vector<TH2F> WireData_histos;
87  std::vector<TH1D> WireData_histos_ProjectionX;
88  std::vector<TH1D> WireData_histos_ProjectionY;
89  std::vector< std::tuple<int,TH2F,int,int> > WireData_trimmed_histos;
90  std::vector< std::vector<geo::WireID> > WireData_IDs;
91 
92  unsigned int event_number{};
93  unsigned int run_number{};
94 
95  void create_image_histo(TH2F const& h_wire_data, TH2F & h_conversion) const;
96  void create_derivative_histograms(TH2F const& h_conversion, TH2F & h_derivative_x, TH2F & h_derivative_y);
97  void create_cornerScore_histogram(TH2F const& h_derivative_x, TH2F const& h_derivative_y, TH2D & h_cornerScore);
98  std::vector<recob::EndPoint2D> perform_maximum_suppression(TH2D const& h_cornerScore,
99  std::vector<geo::WireID> wireIDs,
100  geo::View_t view,
101  TH2D & h_maxSuppress,
102  int startx=0,
103  int starty=0) const;
104 
105  void calculate_line_integral_score(TH2F const& h_wire_data,
106  std::vector<recob::EndPoint2D> const & corner_vector,
107  std::vector<recob::EndPoint2D> & corner_lineIntegralScore_vector,
108  TH2F & h_lineIntegralScore) const;
109 
110  void attach_feature_points(TH2F const& h_wire_data,
111  std::vector<geo::WireID> const& wireIDs,
112  geo::View_t view,
113  std::vector<recob::EndPoint2D>&,
114  int startx=0,int starty=0);
115  void attach_feature_points_LineIntegralScore(TH2F const& h_wire_data,
116  std::vector<geo::WireID> const& wireIDs,
117  geo::View_t view,
118  std::vector<recob::EndPoint2D>&);
119 
120 
122 
123  };//<---End of class CornerFinderAlg
124 
125 
126 }
127 
128 #endif //CORNERFINDERALG_H
std::string fDerivative_BlurFunc
std::vector< std::tuple< int, TH2F, int, int > > WireData_trimmed_histos
void create_image_histo(TH2F const &h_wire_data, TH2F &h_conversion) const
void create_cornerScore_histogram(TH2F const &h_derivative_x, TH2F const &h_derivative_y, TH2D &h_cornerScore)
std::string fCornerScore_algorithm
std::vector< recob::EndPoint2D > perform_maximum_suppression(TH2D const &h_cornerScore, std::vector< geo::WireID > wireIDs, geo::View_t view, TH2D &h_maxSuppress, int startx=0, int starty=0) const
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
void attach_feature_points(TH2F const &h_wire_data, std::vector< geo::WireID > const &wireIDs, geo::View_t view, std::vector< recob::EndPoint2D > &, int startx=0, int starty=0)
void create_smaller_histos(geo::Geometry const &)
std::string fCalDataModuleLabel
void InitializeGeometry(geo::Geometry const &)
std::string fConversion_algorithm
TH2F const & GetWireDataHist(unsigned int) const
void get_feature_points(std::vector< recob::EndPoint2D > &, geo::Geometry const &)
void create_derivative_histograms(TH2F const &h_conversion, TH2F &h_derivative_x, TH2F &h_derivative_y)
void get_feature_points_fast(std::vector< recob::EndPoint2D > &, geo::Geometry const &)
void calculate_line_integral_score(TH2F const &h_wire_data, std::vector< recob::EndPoint2D > const &corner_vector, std::vector< recob::EndPoint2D > &corner_lineIntegralScore_vector, TH2F &h_lineIntegralScore) const
void GrabWires(std::vector< recob::Wire > const &wireVec, geo::Geometry const &)
CornerFinderAlg(fhicl::ParameterSet const &pset)
void get_feature_points_LineIntegralScore(std::vector< recob::EndPoint2D > &, geo::Geometry const &)
std::vector< TH1D > WireData_histos_ProjectionY
float line_integral(TH2F const &hist, int x1, float y1, int x2, float y2, float threshold) const
std::vector< TH2F > WireData_histos
std::string fDerivative_method
The geometry of one entire detector, as served by art.
Definition: Geometry.h:181
Definition of data types for geometry description.
std::vector< std::vector< geo::WireID > > WireData_IDs
std::vector< TH1D > WireData_histos_ProjectionX
void attach_feature_points_LineIntegralScore(TH2F const &h_wire_data, std::vector< geo::WireID > const &wireIDs, geo::View_t view, std::vector< recob::EndPoint2D > &)
Declaration of basic channel signal object.