CBAlgoCenterOfMassSmall.h
Go to the documentation of this file.
1 /**
2  * \file CBAlgoCenterOfMassSmall.h
3  *
4  * \ingroup CMTool
5  *
6  * \brief Class def header for a class CBAlgoCenterOfMassSmall
7  *
8  * @author david caratelli
9  */
10 
11 /** \addtogroup CMTool
12 
13  @{*/
14 #ifndef RECOTOOL_CBALGOCENTEROFMASSSMALL_H
15 #define RECOTOOL_CBALGOCENTEROFMASSSMALL_H
16 
19 
20 namespace cmtool {
21  /**
22  \class CBAlgoCenterOfMassSmall
23  Designed mainly for small clusters (< 10 hits):
24  Find Cluster's center of mass weighing by Q
25  Then see if COM is in polygon/cone of a big cluster
26  If so -> merge
27  */
29 
30  public:
31 
32  /// Default constructor
34 
35  /// Default destructor
37 
38  /**
39  Core function: given the ClusterParamsAlg input, return whether a cluster should be
40  merged or not.
41  */
42  virtual bool Bool(const ::cluster::ClusterParamsAlg &cluster1,
43  const ::cluster::ClusterParamsAlg &cluster2);
44 
45  /// Function to reset the algorithm instance ... maybe implemented via child class
46  virtual void Reset(){}
47 
48  /// Function to report what's going on per merging iteration
49  virtual void Report();
50 
51  /// Function to set Debug mode of output
52  void SetDebug(bool on) { _debug = on; }
53 
54  /// Function to set Max hits for small clsuters
55  void SetMaxHitsSmallClus(size_t n) { _maxHits = n; }
56 
57  /// Function to set Max Distance for COM to be from start-end
58  void SetMaxDistance(double d) { _MaxDist = d; }
59 
60  /// Function to set Max Distance between COMs
62 
63  /// Use COM in Poly algo to decide merging
64  void UseCOMInPoly(bool on) { _COMinPolyAlg = on; }
65 
66  /// Use COM in Poly algo to decide merging
67  void UseCOMClose(bool on) { _COMsClose = on; }
68 
69  /// Use COM in Poly algo to decide merging
70  void UseCOMNearClus(bool on) { _COMNearClus = on; }
71 
72  /// Set Length Reach: How for out the cone extends as percent of cluster length
73  void SetLengthReach(double frac){ _lengthReach = frac; }
74 
75  double ShortestDistanceSquared(double point_x, double point_y,
76  double start_x, double start_y,
77  double end_x, double end_y ) const;
78 
79 
80  protected:
81 
82  bool _debug;
83  size_t _maxHits;
84  double _MaxDist; //Max distance between COM and start-end line of cluster
85  double _MaxCOMDistSquared; //Max distance^2 between COMs in cm^2
86  double _lengthReach; ///How four out - as percent of cluster length - cone will extend from start point
88  bool _COMsClose;
90  };
91 }
92 
93 #endif
94 /** @} */ // end of doxygen group
Class def header for algorithm classes for CMergeManager.
bool _COMinPolyAlg
How four out - as percent of cluster length - cone will extend from start point.
virtual bool Bool(const ::cluster::ClusterParamsAlg &cluster1, const ::cluster::ClusterParamsAlg &cluster2)
void SetMaxCOMDistance(double d)
Function to set Max Distance between COMs.
virtual void Report()
Function to report what&#39;s going on per merging iteration.
virtual void Reset()
Function to reset the algorithm instance ... maybe implemented via child class.
double ShortestDistanceSquared(double point_x, double point_y, double start_x, double start_y, double end_x, double end_y) const
std::void_t< T > n
void UseCOMClose(bool on)
Use COM in Poly algo to decide merging.
CBAlgoCenterOfMassSmall()
Default constructor.
void SetMaxDistance(double d)
Function to set Max Distance for COM to be from start-end.
void UseCOMInPoly(bool on)
Use COM in Poly algo to decide merging.
void SetDebug(bool on)
Function to set Debug mode of output.
void UseCOMNearClus(bool on)
Use COM in Poly algo to decide merging.
void SetMaxHitsSmallClus(size_t n)
Function to set Max hits for small clsuters.
void SetLengthReach(double frac)
Set Length Reach: How for out the cone extends as percent of cluster length.
virtual ~CBAlgoCenterOfMassSmall()
Default destructor.