Hough2P.h
Go to the documentation of this file.
1 ///
2 /// \brief Perform a "2 point" Hough transform on a collection of hits
3 /// \authors messier@indiana.edu, mibaird@indiana.edu
4 /// \date
5 ///
6 #ifndef HOUGH_HOUGH2P_H
7 #define HOUGH_HOUGH2P_H
8 #include <cmath>
9 #include <vector>
10 #include "RecoBase/HoughResult.h"
11 namespace rb { class HitList; }
12 class TH2F;
13
14 namespace hough {
15  class IslandsTH2;
16
17  /// Hough transform based on 2-point combinations
18  class Hough2P {
19  public:
20  ///
21  /// \brief Construct the 2-point Hough transform
22  ///
23  /// The transform proceeds by considering all paris of points that
24  /// occur within a cut off distance (rsqr) of each other. For each
25  /// pair an ellipse is filled in Hough space weighted by the
26  /// quality of the line fit to the two spatial points. The
27  /// algorithm is largely derived from
28  ///
29  /// "Real-time line detection through an improved Hough transform
30  /// voting scheme", L.A.F. Fernandes, M.M. Oliveira / Pattern
31  /// Recognition 41 (2008) 299-314
32  ///
33  /// \param v - Which detector view? geo::kX or geo::kY
34  /// \param rhosz - Size of rho bins (cm)
35  /// \param thetasz - Size of theta bins (degrees)
36  /// \param rhosm - Number of bins to use in smoothing rho
37  /// \param thetasm - Number of bins to use in smoothing theta
38  /// \param rsqr - Cut on distance between two points
39  /// \param pco - Number of sigma above average peak height for threshold (peak cut-off)
40  ///
42  double rhosz,
43  double thetasz,
44  int rhosm,
45  int thetasm,
46  double rsqr,
47  double pco);
48  ~Hough2P();
49
50  /// Make the Hough map for the hit list h.
51  /// \param h - The list of hits (can be mixed X and Y view hits)
52  void Map(const rb::HitList& h);
53
54  private:
55  void BuildMap(double xlo, double xhi,
56  double ylo, double yhi);
57  void RhoTheta(double x1, double y1,
58  double x2, double y2,
59  double* rho, double* theta,
60  double* sigmarho, double* sigmatheta);
61  void SmoothMap();
62  void FindPeaks();
63
64  public:
65  // Configuration data
66  geo::View_t fView; ///< Which detector view?
67  double fRhoSz; ///< Size of rho bins (cm)
68  double fThetaSz; ///< Size of theta bins (degrees)
69  int fXwinSz; ///< Smoothing size (bins) in x
70  int fYwinSz; ///< Smoothing size (bins) in y
71  double fSigma; ///< Assumed location error on points (cm)
72  double fRsqr; ///< Distance^2 cut on points (cm^2)
73  double fPco; ///< Number of sigma abouve average peak height to use as cutoff
74  public:
75  // Data used in / resulting from calculations
76  TH2F* fHspaceW; ///< Hough transform
77  IslandsTH2* fHspaceI; ///< Islands for x view
78  rb::HoughResult fH; ///< Results of Hough transformation;
79  };
80 }
81
82 #endif
83 ////////////////////////////////////////////////////////////////////////
geo::View_t fView
Which detector view?
Definition: Hough2P.h:66
double fRsqr
Distance^2 cut on points (cm^2)
Definition: Hough2P.h:72
int fYwinSz
Smoothing size (bins) in y.
Definition: Hough2P.h:70
Perform a "2 point" Hough transform on a collection of hits.
Definition: Hough2P.cxx:20
Float_t y1[n_points_granero]
Definition: compare.C:5
double fThetaSz
Size of theta bins (degrees)
Definition: Hough2P.h:68
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
IslandsTH2 * fHspaceI
Islands for x view.
Definition: Hough2P.h:77
Float_t x1[n_points_granero]
Definition: compare.C:5
std::vector< DAQHit > HitList
Definition: HitList.h:15
TH2F * fHspaceW
Hough transform.
Definition: Hough2P.h:76
Hough transform based on 2-point combinations.
Definition: Hough2P.h:18
Just the essential information required for track fitting.
Definition: HitList.h:40
double fRhoSz
Size of rho bins (cm)
Definition: Hough2P.h:67
Perform a "2 point" Hough transform on a collection of hits.
Data resulting from a Hough transform on the cell hit positions.
rb::HoughResult fH
Results of Hough transformation;.
Definition: Hough2P.h:78
int fXwinSz
Smoothing size (bins) in x.
Definition: Hough2P.h:69
double fSigma
Assumed location error on points (cm)
Definition: Hough2P.h:71
double fPco
Number of sigma abouve average peak height to use as cutoff.
Definition: Hough2P.h:73
Summary from a Hough transform applied to a group of cell hits.
Definition: HoughResult.h:35