]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PMD/AliPMDClustering.h
a51cbb576c1dd18cd6f5afc8a3d75ca3df620a97
[u/mrichter/AliRoot.git] / PMD / AliPMDClustering.h
1 #ifndef ALIPMDCLUSTERING_H
2 #define ALIPMDCLUSTERING_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5 //-----------------------------------------------------//
6 //                                                     //
7 //  Header File : PMDClustering.h, Version 00          //
8 //                                                     //
9 //  Date   : September 26 2002                         //
10 //                                                     //
11 //  clustering code for alice pmd                      //
12 //                                                     //
13 //-----------------------------------------------------//
14 /* --------------------------------------------------------------------
15    Code developed by S. C. Phatak, Institute of Physics,
16    Bhubaneswar 751 005 ( phatak@iopb.res.in ) Given the energy deposited
17    ( or ADC value ) in each cell of supermodule ( pmd or cpv ), the code
18    builds up superclusters and breaks them into clusters. The input is 
19    in array d[ndimx][ndimy] and cluster information is in array
20    clusters[5][5000]. integer clno gives total number of clusters in the
21    supermodule.
22    d, clno  and clusters are the only global ( public ) variables. Others
23    are local ( private ) to the code.
24    At the moment, the data is read for whole detector ( all supermodules
25    and pmd as well as cpv. This will have to be modify later )
26    LAST UPDATE  :  October 23, 2002
27 -----------------------------------------------------------------------*/
28 #include "Rtypes.h"
29
30 class TNtuple;
31 class TObjArray;
32 class AliPMDcluster;
33 class AliPMDClustering
34 {
35
36  public:
37   AliPMDClustering();
38   virtual ~AliPMDClustering();
39
40   void DoClust(Int_t idet, Int_t ismn, Double_t celladc[][96],
41                TObjArray *pmdcont);
42   void Order();
43
44   Int_t CrClust(Double_t ave, Double_t cutoff, Int_t nmx1);
45   void RefClust(Int_t incr);
46   void GaussFit(Int_t ncell, Int_t nclust, Double_t &x,
47                 Double_t &y, Double_t &z, Double_t &xc,
48                 Double_t &yc, Double_t &zc, Double_t &rc);
49   Double_t Distance(Double_t x1, Double_t y1,
50                     Double_t x2, Double_t y2);
51   Double_t Ranmar() const;
52   void SetEdepCut(Float_t decut);
53   void SetDebug(Int_t idebug);
54
55  protected:
56
57   static const Double_t fgkSqroot3by2;  // fgkSqroot3by2 = sqrt(3.)/2.
58   /*enum {
59     kNMX   = 4608,
60     kNDIMX = 48,
61     kNDIMY = 96
62   };*/
63   /*
64     Proposed changes inNMX, kNDIMX and kNDIMY by S. C. Phatak to account
65     for rectangular ( vs rhomboid ) geometry.
66     To keep the clustering functional, we define a rhomboid which
67     superscribes the rectangle. So we need to pad up dummy cells in x
68     direction. The number of these cells is 96/2-1=47 in each row ( value
69     of x ). For first two rows, all dummy cells are to the left. For
70     every two rows add one cell to right and subtract one from left.
71     So previous (i,j) values go over to ( i',j) i'=i+(96-j)/2-1
72     Note we use C++ convention so i and j run from 0 to 47 or 95.
73   */
74
75   enum {
76     kNMX    = 9120,
77     kNDIMX  = 95,
78     kNDIMY  = 96,
79     kNDIMXr = 48,
80     kNDIMYr = 96
81   };
82   /*
83     kNMX   : # of cells in a supermodule
84     kNDIMX : maximum number of cells along x direction (origin at one corner)
85     kNDIMY : maximum number of cells along axis at 60 degrees with x axis
86   */
87
88   Double_t fEdepCell[kNDIMX][kNDIMY]; //energy(ADC) in each cell of the supermodule
89   Double_t fClusters[5][5000]; // Cluster informations
90   Int_t    fClno;   // number of clusters in a supermodule
91
92   /*
93     clusters[0][i] --- x position of the cluster center
94     clusters[1][i] --- y position of the cluster center
95     clusters[2][i] --- total energy in the cluster
96     clusters[3][i] --- number of cells forming the cluster
97                        ( possibly fractional )
98     clusters[4][i] --- cluster radius
99   */
100
101   Int_t    fIord[2][kNMX]; // ordered list of i and j according to decreasing energy dep.
102   Int_t    fInfocl[2][kNDIMX][kNDIMY]; // cellwise information on the cluster to which the cell
103   Int_t    fInfcl[3][kNMX]; // cluster information [0][i] -- cluster number
104   Double_t fCoord[2][kNDIMX][kNDIMY];
105
106   /*
107     fIord --- ordered list of i and j according to decreasing energy dep.
108     fInfocl --- cellwise information on the cluster to which the cell
109     belongs and whether it has largest energy dep. or not
110     ( now redundant - probably )
111     fInfcl ---  cluster information [0][i] -- cluster number
112     [1][i] -- i of the cell
113     [2][i] -- j of the cell
114     coord --- x and y coordinates of center of each cell
115   */
116
117   Int_t fDebug;    // Switch for debug (1:Print, 0:Noprint)
118   Float_t fCutoff; // Energy(ADC) cutoff per cell before clustering
119
120   ClassDef(AliPMDClustering,3) // Does clustering for PMD
121 };
122 #endif