LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
CornerFinderAlg.h
Go to the documentation of this file.
1 
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 trkf {
24  class BezierTrack;
25 }
26 
27 namespace corner { //<---Not sure if this is the right namespace
28 
30 
31  public:
32 
33  explicit CornerFinderAlg(fhicl::ParameterSet const& pset);
34  virtual ~CornerFinderAlg();
35 
36  void reconfigure(fhicl::ParameterSet const& pset);
37 
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);
53 
54  std::vector<float> line_integrals(trkf::BezierTrack&, size_t Steps, float threshold);
55 
56  TH2F const& GetWireDataHist(unsigned int);
57  TH2F const& GetConversionHist(unsigned int);
58  TH2F const& GetDerivativeXHist(unsigned int);
59  TH2F const& GetDerivativeYHist(unsigned int);
60  TH2D const& GetCornerScoreHist(unsigned int);
61  TH2D const& GetMaxSuppressHist(unsigned int);
62 
63  private:
64 
65  void CleanCornerFinderAlg();
66  void InitializeGeometry(geo::Geometry const&);
67 
68  // Need to list the things we will take in from the .fcl file
69 
70  std::string fCalDataModuleLabel;
71  std::string fConversion_algorithm;
72  std::string fConversion_func;
80  std::string fDerivative_method;
82  std::string fDerivative_BlurFunc;
92 
93  // Making a vector of histograms
94  std::vector<TH2F> WireData_histos;
95  std::vector<TH1D> WireData_histos_ProjectionX;
96  std::vector<TH1D> WireData_histos_ProjectionY;
97  std::vector< std::tuple<int,TH2F,int,int> > WireData_trimmed_histos;
98  std::vector< std::vector<geo::WireID> > WireData_IDs;
99  std::vector<TH2F> fConversion_histos;
100  std::vector<TH2F> fDerivativeX_histos;
101  std::vector<TH2F> fDerivativeY_histos;
102  std::vector<TH2D> fCornerScore_histos;
103  std::vector<TH2D> fMaxSuppress_histos;
104 
105  unsigned int event_number;
106  unsigned int run_number;
107 
108  void create_image_histo(TH2F const& h_wire_data, TH2F & h_conversion);
109  void create_derivative_histograms(TH2F const& h_conversion, TH2F & h_derivative_x, TH2F & h_derivative_y);
110  void create_cornerScore_histogram(TH2F const& h_derivative_x, TH2F const& h_derivative_y, TH2D & h_cornerScore);
111  size_t perform_maximum_suppression(TH2D const& h_cornerScore,
112  std::vector<recob::EndPoint2D> & corner_vector,
113  std::vector<geo::WireID> wireIDs,
114  geo::View_t view,
115  TH2D & h_maxSuppress,
116  int startx=0,
117  int starty=0);
118 
119  size_t calculate_line_integral_score( TH2F const& h_wire_data,
120  std::vector<recob::EndPoint2D> const & corner_vector,
121  std::vector<recob::EndPoint2D> & corner_lineIntegralScore_vector,
122  TH2F & h_lineIntegralScore);
123 
124  void attach_feature_points(TH2F const& h_wire_data,
125  std::vector<geo::WireID> wireIDs,
126  geo::View_t view,
127  std::vector<recob::EndPoint2D>&,
128  int startx=0,int starty=0);
129  void attach_feature_points_LineIntegralScore(TH2F const& h_wire_data,
130  std::vector<geo::WireID> wireIDs,
131  geo::View_t view,
132  std::vector<recob::EndPoint2D>&);
133 
134 
135  void create_smaller_histos(geo::Geometry const&);
136  void remove_duplicates(std::vector<recob::EndPoint2D>&);
137 
138  };//<---End of class CornerFinderAlg
139 
140 
141 }
142 
143 #endif //CORNERFINDERALG_H
std::string fDerivative_BlurFunc
std::vector< std::tuple< int, TH2F, int, int > > WireData_trimmed_histos
std::vector< TH2D > fMaxSuppress_histos
Float_t y1[n_points_granero]
Definition: compare.C:5
std::string fCornerScore_algorithm
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::vector< TH2D > fCornerScore_histos
std::vector< TH2F > fDerivativeX_histos
Float_t x1[n_points_granero]
Definition: compare.C:5
std::vector< TH2F > fDerivativeY_histos
std::string fCalDataModuleLabel
std::string fConversion_algorithm
Float_t y2[n_points_geant4]
Definition: compare.C:26
std::vector< TH1D > WireData_histos_ProjectionY
std::vector< TH2F > WireData_histos
std::string fDerivative_method
The geometry of one entire detector, as served by art.
Definition: Geometry.h:110
std::vector< std::vector< geo::WireID > > WireData_IDs
std::vector< TH1D > WireData_histos_ProjectionX
std::vector< TH2F > fConversion_histos
TH2F * hist
Definition: plot.C:136
Declaration of basic channel signal object.
Float_t x2[n_points_geant4]
Definition: compare.C:26
art framework interface to geometry description