CBAlgoPolyShortestDist.h
Go to the documentation of this file.
1 /**
2  * \file CBAlgoPolyShortestDist.h
3  *
4  * \ingroup CMTool
5  *
6  * \brief Class def header for a class CBAlgoPolyShortestDist
7  *
8  * @author davidkaleko
9  */
10 
11 /** \addtogroup CMTool
12 
13  @{*/
14 #ifndef RECOTOOL_CBALGOPOLYSHORTESTDIST_H
15 #define RECOTOOL_CBALGOPOLYSHORTESTDIST_H
16 
17 #include <vector>
18 
21 
22 namespace cmtool {
23  /**
24  \class CBAlgoPolyShortestDist
25  User implementation for CBoolAlgoBase class
26  doxygen documentation!
27  */
29 
30  public:
31 
32  /// Default constructor
34 
35  /// Default destructor
37 
38  /**
39  Optional function: called at the beginning of 1st iteration. This is called per event.
40  */
41  virtual void EventBegin(const std::vector<cluster::ClusterParamsAlg> &clusters);
42 
43  /**
44  Optional function: called at the end of event ... after the last merging iteration is over.
45  */
46  //virtual void EventEnd();
47 
48  /**
49  Optional function: called at the beggining of each iteration over all pairs of clusters.
50  This provides all clusters' information in case the algorithm need them. Note this
51  is called per iteration which may be more than once per event.
52  */
53  //virtual void IterationBegin(const std::vector<cluster::ClusterParamsAlg> &clusters);
54 
55  /**
56  Optional function: called at the end of each iteration over all pairs of clusters.
57  */
58  //virtual void IterationEnd();
59 
60  /**
61  Core function: given the CPAN input, return whether a cluster should be
62  merged or not.
63  */
64  virtual bool Bool(const ::cluster::ClusterParamsAlg &cluster1,
65  const ::cluster::ClusterParamsAlg &cluster2);
66 
67  /**
68  Optional function: called after each Merge() function call by CMergeManager IFF
69  CMergeManager is run with verbosity level kPerMerging. Maybe useful for debugging.
70  */
71  virtual void Report();
72 
73  /// Function to reset the algorithm instance ... maybe implemented via child class
74  virtual void Reset();
75 
76  //both clusters must have > this # of hits to be considered for merging
77  void SetMinNumHits(size_t nhits) { _min_hits = nhits; }
78 
79  void SetMaxNumHits(int nhits) { _max_hits = nhits; }
80 
82 
83  void SetDebug(bool flag) { _debug = flag; }
84 
85  private:
86 
87 
89 
91 
92  bool _debug;
93 
94  double tmp_min_dist;
95  };
96 }
97 #endif
98 /** @} */ // end of doxygen group
Class def header for algorithm classes for CMergeManager.
virtual void Reset()
Function to reset the algorithm instance ... maybe implemented via child class.
virtual bool Bool(const ::cluster::ClusterParamsAlg &cluster1, const ::cluster::ClusterParamsAlg &cluster2)
virtual void EventBegin(const std::vector< cluster::ClusterParamsAlg > &clusters)
CBAlgoPolyShortestDist()
Default constructor.
virtual ~CBAlgoPolyShortestDist()
Default destructor.
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)