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