LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
CornerFinderAlg.h
Go to the documentation of this file.
1 
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 "TF2.h"
24 #include "TH1D.h"
25 #include "TH2.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  explicit CornerFinderAlg(fhicl::ParameterSet const& pset);
37 
38  void GrabWires(std::vector<recob::Wire> const& wireVec,
39  geo::Geometry const&); //this one creates the histograms we want to use
40 
41  void get_feature_points(std::vector<recob::EndPoint2D>&,
42  geo::Geometry const&); //here we get feature points with corner score
43 
44  void get_feature_points_LineIntegralScore(
45  std::vector<recob::EndPoint2D>&,
46  geo::Geometry const&); //here we get feature points with LineIntegral score
47 
48  void get_feature_points_fast(
49  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  const;
54 
55  TH2F const& GetWireDataHist(unsigned int) const;
56 
57  private:
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,
97  TH2F& h_derivative_x,
98  TH2F& h_derivative_y);
99  void create_cornerScore_histogram(TH2F const& h_derivative_x,
100  TH2F const& h_derivative_y,
101  TH2D& h_cornerScore);
102  std::vector<recob::EndPoint2D> perform_maximum_suppression(TH2D const& h_cornerScore,
103  std::vector<geo::WireID> wireIDs,
104  geo::View_t view,
105  TH2D& h_maxSuppress,
106  int startx = 0,
107  int starty = 0) const;
108 
109  void calculate_line_integral_score(
110  TH2F const& h_wire_data,
111  std::vector<recob::EndPoint2D> const& corner_vector,
112  std::vector<recob::EndPoint2D>& corner_lineIntegralScore_vector,
113  TH2F& h_lineIntegralScore) const;
114 
115  void attach_feature_points(TH2F const& h_wire_data,
116  std::vector<geo::WireID> const& wireIDs,
117  geo::View_t view,
118  std::vector<recob::EndPoint2D>&,
119  int startx = 0,
120  int starty = 0);
121  void attach_feature_points_LineIntegralScore(TH2F const& h_wire_data,
122  std::vector<geo::WireID> const& wireIDs,
123  geo::View_t view,
124  std::vector<recob::EndPoint2D>&);
125 
126  void create_smaller_histos(geo::Geometry const&);
127 
128  }; //<---End of class CornerFinderAlg
129 
130 }
131 
132 #endif //CORNERFINDERALG_H
std::string fDerivative_BlurFunc
std::vector< std::vector< geo::WireID > > WireData_IDs
Float_t y1[n_points_granero]
Definition: compare.C:5
std::vector< std::tuple< int, TH2F, int, int > > WireData_trimmed_histos
std::string fCornerScore_algorithm
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Float_t x1[n_points_granero]
Definition: compare.C:5
std::string fCalDataModuleLabel
std::string fConversion_algorithm
Float_t y2[n_points_geant4]
Definition: compare.C:26
parameter set interface
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:181
Definition of data types for geometry description.
std::vector< TH1D > WireData_histos_ProjectionX
TH2F * hist
Definition: plot.C:134
Declaration of basic channel signal object.
Float_t x2[n_points_geant4]
Definition: compare.C:26
Namespace collecting geometry-related classes utilities.