APRILContent
Algorithm of Particle Reconstruction for ILC - implementation with PandoraSDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations
MeanShift.h
Go to the documentation of this file.
1 
3 #ifndef MEANSHIFT_H
4 #define MEANSHIFT_H
5 
6 #include <vector>
7 
8 #include "Objects/CaloHit.h"
9 
10 //typedef std::vector<double> MSPoint;
11 
12 class MSPoint : public std::vector<double>
13 {
14 public:
15  MSPoint(const pandora::CaloHit* pCaloHit = NULL)
16  {
17  m_caloHit = pCaloHit;
18  }
19 
20  const pandora::CaloHit* m_caloHit;
21 };
22 
23 struct MSCluster
24 {
25  MSPoint mode;
26  std::vector<MSPoint> original_points;
27  std::vector<MSPoint> shifted_points;
28 };
29 
30 class MeanShift
31 {
32 public:
33  MeanShift(double kernelBandwidth = 0.1, double clusterEpsilon = 0.5, double shiftEpsilon = 0.00001);
34 
35  std::vector<MSCluster> cluster(const std::vector<MSPoint>&);
36 
37 private:
38  void shift_point(const MSPoint&, const std::vector<MSPoint>&, double, MSPoint&);
39  std::vector<MSPoint> meanshift(const std::vector<MSPoint>& points, double kernel_bandwidth, double shiftEpsilon);
40  std::vector<MSCluster> cluster(const std::vector<MSPoint>&, const std::vector<MSPoint>&, double clusterEpsilon);
41 
42  double m_kernelBandwidth;
43  double m_clusterEpsilon;
44  double m_shiftEpsilon;
45 };
46 
47 #endif // MEANSHIFT_H
Definition: MeanShift.h:30
Definition: MeanShift.h:12
Definition: MeanShift.h:23