removed cell_pos
[u/mrichter/AliRoot.git] / PMD / AliPMDClustering.h
CommitLineData
deb0fc73 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
39class TNtuple;
40class TObjArray;
deb0fc73 41class AliPMDcluster;
42class AliPMDClustering
43{
44
45 protected:
46
a854e5de 47 static const double pi;
48 static const double sqrth; // sqrth = sqrt(3.)/2.
49 enum {
50 nmx=5184,
51 ndimx=72,
52 ndimy=72
53 };
deb0fc73 54
55 /*
56 nmx : # of cells in a supermodule
57 ndimx : maximum number of cells along x direction (origin at one corner)
58 ndimy : maximum number of cells along axis at 60 degrees with x axis
59 */
60
61 double d[ndimx][ndimy], clusters[5][5000];
62 int clno;
63
64 /*
65 d ---- energy deposited ( or ADC ) in each cell of the supermodule
66 clno --- number of clusters in a supermodule
67 A cell is defined in terms of two integers (i,j) giving the its location
68 clusters[0][i] --- x position of the cluster center
69 clusters[1][i] --- y position of the cluster center
70 clusters[2][i] --- total energy in the cluster
71 clusters[3][i] --- number of cells forming the cluster
72 ( possibly fractional )
73 clusters[4][i] --- cluster radius
74 One corner of the supermodule is chosen as the origin
75 */
76
77
78 int iord[2][nmx], infocl[2][ndimx][ndimy], infcl[3][nmx];
79 double coord[2][ndimx][ndimy];
80
81 /*
82 iord --- ordered list of i and j according to decreasing energy dep.
83 infocl --- cellwise information on the cluster to which the cell
84 belongs and whether it has largest energy dep. or not
85 ( now redundant - probably )
86 infcl --- cluster information [0][i] -- cluster number
87 [1][i] -- i of the cell
88 [2][i] -- j of the cell
89 coord --- x and y coordinates of center of each cell
90 */
91
92 Int_t fMessage;
93
94 public:
95 AliPMDClustering();
96 virtual ~AliPMDClustering();
97
98 void DoClust(int, int, double [][72], TObjArray *);
99 int crclust(double, double, int, int);
100 void refclust(int, int, int);
101 double ranmar();
102 void order(int);
103 double Dist(double, double, double, double);
104 void gaussfit(int, int, double &, double &, double &, double &, double &,
105 double &, double &);
deb0fc73 106 void SetMessage(Int_t);
107
108 ClassDef(AliPMDClustering,1)
109};
110#endif