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