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 #include "fhiclcpp/ParameterSet.h"
12 
13 #include "TH2.h"
14 #include "TF2.h"
15 #include "TH1D.h"
16 #include <vector>
17 #include <string>
21 
22 
23 namespace corner { //<---Not sure if this is the right namespace
24 
26 
27  public:
28 
29  explicit CornerFinderAlg(fhicl::ParameterSet const& pset);
30 
31  void GrabWires( std::vector<recob::Wire> const& wireVec ,
32  geo::Geometry const&); //this one creates the histograms we want to use
33 
34 
35  void get_feature_points(std::vector<recob::EndPoint2D> &,
36  geo::Geometry const&); //here we get feature points with corner score
37 
38  void get_feature_points_LineIntegralScore(std::vector<recob::EndPoint2D> &,
39  geo::Geometry const&); //here we get feature points with LineIntegral score
40 
41  void get_feature_points_fast(std::vector<recob::EndPoint2D> &,
42  geo::Geometry const&); //here we get feature points with corner score
43 
44  float line_integral(TH2F const& hist, int x1, float y1, int x2, float y2, float threshold) const;
45 
46  TH2F const& GetWireDataHist(unsigned int) const;
47 
48  private:
49 
50  void InitializeGeometry(geo::Geometry const&);
51 
52  // Need to list the things we will take in from the .fcl file
53 
76 
77  // Making a vector of histograms
78  std::vector<TH2F> WireData_histos;
79  std::vector<TH1D> WireData_histos_ProjectionX;
80  std::vector<TH1D> WireData_histos_ProjectionY;
81  std::vector< std::tuple<int,TH2F,int,int> > WireData_trimmed_histos;
82  std::vector< std::vector<geo::WireID> > WireData_IDs;
83 
84  unsigned int event_number{};
85  unsigned int run_number{};
86 
87  void create_image_histo(TH2F const& h_wire_data, TH2F & h_conversion) const;
88  void create_derivative_histograms(TH2F const& h_conversion, TH2F & h_derivative_x, TH2F & h_derivative_y);
89  void create_cornerScore_histogram(TH2F const& h_derivative_x, TH2F const& h_derivative_y, TH2D & h_cornerScore);
90  std::vector<recob::EndPoint2D> perform_maximum_suppression(TH2D const& h_cornerScore,
91  std::vector<geo::WireID> wireIDs,
92  geo::View_t view,
93  TH2D & h_maxSuppress,
94  int startx=0,
95  int starty=0) const;
96 
97  void calculate_line_integral_score(TH2F const& h_wire_data,
98  std::vector<recob::EndPoint2D> const & corner_vector,
99  std::vector<recob::EndPoint2D> & corner_lineIntegralScore_vector,
100  TH2F & h_lineIntegralScore) const;
101 
102  void attach_feature_points(TH2F const& h_wire_data,
103  std::vector<geo::WireID> const& wireIDs,
104  geo::View_t view,
105  std::vector<recob::EndPoint2D>&,
106  int startx=0,int starty=0);
107  void attach_feature_points_LineIntegralScore(TH2F const& h_wire_data,
108  std::vector<geo::WireID> const& wireIDs,
109  geo::View_t view,
110  std::vector<recob::EndPoint2D>&);
111 
112 
114 
115  };//<---End of class CornerFinderAlg
116 
117 
118 }
119 
120 #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.
std::string string
Definition: nybbler.cc:12
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)
art framework interface to geometry description
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:196
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.