CBAlgoShortestDist.h
Go to the documentation of this file.
1 /**
2  * \file CBAlgoShortestDist.h
3  *
4  * \ingroup CMTool
5  *
6  * \brief Class def header for a class CBAlgoShortestDist
7  *
8  * @author davidkaleko
9  */
10 
11 /** \addtogroup CMTool
12 
13  @{*/
14 #ifndef RECOTOOL_CBALGOSHORTESTDIST_H
15 #define RECOTOOL_CBALGOSHORTESTDIST_H
16 
19 
20 namespace cmtool {
21  /**
22  \class CBAlgoShortestDist
23  User defined class CBAlgoShortestDist ... these comments are used to generate
24  doxygen documentation!
25  */
27 
28  public:
29 
30  /// Default constructor
32 
33  /// Default destructor
34  virtual ~CBAlgoShortestDist(){};
35 
36  /// Overloaded (from CBoolAlgoBase) Bool function
37  virtual bool Bool(const ::cluster::ClusterParamsAlg &cluster1,
38  const ::cluster::ClusterParamsAlg &cluster2);
39 
40 
41  /// Method to set cut value in cm^2 for distance compatibility test
42  void SetSquaredDistanceCut(double d) { _max_2D_dist2 = d; }
43 
44  /// Method to set debug mode
45  void SetDebug(bool on) { _debug = on; }
46 
47  /// Set Minimum Number of Hits to consider Cluster
48  void SetMinHits(size_t n) { _minHits = n; }
49 
50  /**
51  Function to compute a distance between a 2D point (point_x, point_y) to a 2D finite line segment
52  (start_x, start_y) => (end_x, end_y).
53  */
54  double ShortestDistanceSquared(double point_x, double point_y,
55  double start_x, double start_y,
56  double end_x, double end_y ) const;
57 
58 
59 
60  protected:
61 
62  bool _debug; /// bool to suppress lots of output if you want
63 
64  size_t _minHits; /// Min Number of hits for cluster to be considered
65 
66  double _wire_2_cm, _time_2_cm; /// Conversion factors ogtten from GeometryUtilities
67 
68  double _min_distance_unit; /// minimum distance b/t start and end point of cluster to use it
69 
70  double _max_2D_dist2; /// max distance b/t clusters for comability, in cm^2 (the main param of this algo)
71 
72  };
73 
74 
75 } //end namespace cmtool
76 
77 #endif
78 /** @} */ // end of doxygen group
Class def header for algorithm classes for CMergeManager.
void SetDebug(bool on)
Method to set debug mode.
double ShortestDistanceSquared(double point_x, double point_y, double start_x, double start_y, double end_x, double end_y) const
void SetSquaredDistanceCut(double d)
Method to set cut value in cm^2 for distance compatibility test.
CBAlgoShortestDist()
Default constructor.
double _wire_2_cm
Min Number of hits for cluster to be considered.
virtual bool Bool(const ::cluster::ClusterParamsAlg &cluster1, const ::cluster::ClusterParamsAlg &cluster2)
Overloaded (from CBoolAlgoBase) Bool function.
virtual ~CBAlgoShortestDist()
Default destructor.
std::void_t< T > n
double _min_distance_unit
Conversion factors ogtten from GeometryUtilities.
void SetMinHits(size_t n)
Set Minimum Number of Hits to consider Cluster.
double _max_2D_dist2
minimum distance b/t start and end point of cluster to use it
Definition: cfalgo.cc:3
size_t _minHits
bool to suppress lots of output if you want