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