]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PMD/AliPMDClustering.h
89d89e85efe835ef1f899efad92a0708560b327b
[u/mrichter/AliRoot.git] / PMD / AliPMDClustering.h
1 #ifndef PMDClustering_H
2 #define PMDClustering_H
3 //-----------------------------------------------------//
4 //                                                     //
5 //  Header File : PMDClustering.h, Version 00          //
6 //                                                     //
7 //  Date   : September 26 2002                         //
8 //                                                     //
9 //  clustering code for alice pmd                      //
10 //                                                     //
11 //-----------------------------------------------------//
12 /* 
13    --------------------------------------------------------------------
14    Code developed by S. C. Phatak, Institute of Physics, 
15    Bhubaneswar 751 005 ( phatak@iopb.res.in ) Given the energy deposited
16    ( or ADC value ) in each cell of supermodule ( pmd or cpv ), the code
17    builds up superclusters and breaks them into clusters. The input is 
18    in array d[ndimx][ndimy] and cluster information is in array
19    clusters[5][5000]. integer clno gives total number of clusters in the 
20    supermodule.
21
22    d, clno  and clusters are the only global ( public ) variables. Others 
23    are local ( private ) to the code. 
24
25    At the moment, the data is read for whole detector ( all supermodules
26    and pmd as well as cpv. This will have to be modify later )
27
28    LAST UPDATE  :  October 23, 2002
29 -----------------------------------------------------------------------
30 */
31
32
33 #include <Riostream.h> // define cout stream
34 #include <stdlib.h>   // defines exit() functions
35 #include <time.h> // for time function
36 #include <math.h> // for mathematical functions
37 #include "Rtypes.h"
38
39 class TNtuple;
40 class TObjArray;
41 class AliPMDContainer;
42 class AliPMDcluster;
43 class AliPMDClustering
44 {
45   
46  protected:
47
48   static const double pi=3.141593;
49   static const double sqrth=0.8660254;  // sqrth = sqrt(3.)/2.
50   static const int nmx=5184;
51   static const int ndimx=72;
52   static const int ndimy=72;
53
54   /*
55     nmx : # of cells in a supermodule
56     ndimx : maximum number of cells along x direction (origin at one corner)
57     ndimy : maximum number of cells along axis at 60 degrees with x axis
58   */
59
60   double d[ndimx][ndimy], clusters[5][5000]; 
61   int clno;
62
63   /*
64     d ---- energy deposited ( or ADC ) in each cell of the supermodule
65     clno --- number of clusters in a supermodule
66     A cell is defined in terms of two integers (i,j) giving the its location
67     clusters[0][i] --- x position of the cluster center
68     clusters[1][i] --- y position of the cluster center
69     clusters[2][i] --- total energy in the cluster
70     clusters[3][i] --- number of cells forming the cluster 
71                        ( possibly fractional )
72     clusters[4][i] --- cluster radius
73     One corner of the supermodule is chosen as the origin
74   */
75
76
77   int iord[2][nmx], infocl[2][ndimx][ndimy], infcl[3][nmx];
78   double coord[2][ndimx][ndimy];
79
80   /* 
81      iord --- ordered list of i and j according to decreasing energy dep.
82      infocl --- cellwise information on the cluster to which the cell
83      belongs and whether it has largest energy dep. or not
84      ( now redundant - probably )
85      infcl ---  cluster information [0][i] -- cluster number
86      [1][i] -- i of the cell
87      [2][i] -- j of the cell
88      coord --- x and y coordinates of center of each cell
89   */
90
91   Int_t fMessage;
92
93  public:
94   AliPMDClustering();
95   virtual ~AliPMDClustering();
96   
97   void DoClust(int, int, double [][72], TObjArray *);
98   int crclust(double, double, int, int);
99   void refclust(int, int, int);
100   double ranmar();
101   void order(int);
102   double Dist(double, double, double, double);
103   void gaussfit(int, int, double &, double &, double &, double &, double &, 
104                 double &, double &);
105   void ConvertL2G(int, double, double, double &, double &);
106   void cell_pos(Int_t , Int_t , Int_t , Float_t &, Float_t &);
107   void SetMessage(Int_t);
108
109   ClassDef(AliPMDClustering,1)
110 };
111 #endif