]> git.uio.no Git - u/mrichter/AliRoot.git/blob - JETAN/AliKMeansClustering.h
Counting the number of assigned clusters (< 2 sigma)
[u/mrichter/AliRoot.git] / JETAN / AliKMeansClustering.h
1 #ifndef ALIKMEANSCLUSTERING_H
2 #define ALIKMEANSCLUSTERING_H
3  
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 // Implemenatation of the K-Means Clustering Algorithm
8 // http://en.wikipedia.org/wiki/K-means_clustering
9 // This particular implementation is the so called Soft K-means algorithm.
10 // It has been modified to work on the cylindrical topology in eta-phi space.
11 //
12 // Author: Andreas Morsch (CERN)
13 // andreas.morsch@cern.ch
14
15 #include <TObject.h>
16  
17 class AliKMeansClustering : public TObject
18 {
19  public:
20   AliKMeansClustering()          {}
21   virtual ~AliKMeansClustering() {}
22   
23   static Int_t SoftKMeans (Int_t k, Int_t n, Double_t* x, Double_t* y, Double_t* mx, Double_t* my , Double_t* rk );
24   static Int_t SoftKMeans2(Int_t k, Int_t n, Double_t* x, Double_t* y, Double_t* mx, Double_t* my , Double_t* sigma2, 
25                           Double_t* rk );
26   static Int_t SoftKMeans3(Int_t k, Int_t n, Double_t* x, Double_t* y, Double_t* mx, Double_t* my , 
27                            Double_t* sigmax2, Double_t* sigmay2, Double_t* rk );
28   static void  OptimalInit(Int_t k, Int_t n, Double_t* x, Double_t* y, Double_t* mx, Double_t* my);
29   static void  SetBeta(Double_t beta) {fBeta = beta;}
30   static Double_t d(Double_t mx, Double_t my, Double_t x, Double_t y);
31   static Int_t NTwoSigma(Int_t k, Int_t n, Double_t* x, Double_t* y, Double_t* mx, Double_t* my, 
32                                 Double_t* sigma2x, Double_t* sigma2y);
33 protected:
34   static Double_t fBeta;
35   
36   ClassDef(AliKMeansClustering, 1)
37 };
38  
39 #endif