Ranges are fixed for QA
authorbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Jul 2008 15:35:09 +0000 (15:35 +0000)
committerbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Jul 2008 15:35:09 +0000 (15:35 +0000)
PMD/AliPMDClusterFinder.cxx
PMD/AliPMDClusteringV1.cxx
PMD/AliPMDClusteringV1.h
PMD/AliPMDClusteringV2.cxx
PMD/AliPMDQADataMakerRec.cxx
PMD/AliPMDQADataMakerSim.cxx
PMD/AliPMDRawStream.cxx
PMD/AliPMDcludata.cxx
PMD/AliPMDcludata.h

index d983f3b..23f555e 100644 (file)
@@ -269,6 +269,7 @@ void AliPMDClusterFinder::Digits2RecPoints(TTree *digitsTree,
 {
   // Converts digits to recpoints after running clustering
   // algorithm on CPV plane and PREshower plane
+  //
   // This algorithm is called during the reconstruction from digits
 
   Int_t    det = 0,smn = 0;
@@ -399,7 +400,7 @@ void AliPMDClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
   // Converts RAW data to recpoints after running clustering
   // algorithm on CPV and PREshower plane
   //
-  // This method is called at the time of reconstruction
+  // This method is called at the time of reconstruction from RAW data
 
 
     AliPMDddldata *pmdddl = 0x0;
@@ -473,12 +474,19 @@ void AliPMDClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
          Int_t row = pmdddl->GetRow();
          Int_t col = pmdddl->GetColumn();
          Int_t sig = pmdddl->GetSignal();
+
+         if(smn == -1)
+           {
+             AliError(Form("*MODULE NUMBER WRONG %d *",smn));
+             continue; 
+           }
          if(row < 0 || row > 48 || col < 0 || col > 96)
            {
              AliError(Form("*Row %d and Column NUMBER %d NOT Valid *",
                            row, col));
              continue; 
            }
+
          // Pedestal Subtraction
          Int_t   pedmeanrms = fCalibPed->GetPedMeanRms(det,smn,row,col);
          Int_t   pedrms1    = (Int_t) pedmeanrms%1000;
index c02599f..e03a864 100644 (file)
@@ -54,6 +54,7 @@
 #include "AliPMDClusteringV1.h"
 #include "AliLog.h"
 
+
 ClassImp(AliPMDClusteringV1)
 
 const Double_t AliPMDClusteringV1::fgkSqroot3by2=0.8660254;  // sqrt(3.)/2.
@@ -102,16 +103,18 @@ void AliPMDClusteringV1::DoClust(Int_t idet, Int_t ismn,
 
   AliPMDcluster *pmdcl = 0;
 
+  const float ktwobysqrt3 = 1.1547; // 2./sqrt(3.)
+  const Int_t kNmaxCell   = 19;     // # of cells surrounding a cluster center
+
   Int_t    i,  j, nmx1, incr, id, jd;
-  Int_t    celldataX[15], celldataY[15];
+  Int_t    celldataX[kNmaxCell], celldataY[kNmaxCell];
   Float_t  clusdata[6];
   Double_t cutoff, ave;
   Double_t edepcell[kNMX];
   
   
-  Double_t *cellenergy = new Double_t [11424];// Ajay
+  Double_t *cellenergy = new Double_t [11424];
   
-  const float ktwobysqrt3 = 1.1547; // 2./sqrt(3.)
 
   // ndimXr and ndimYr are different because of different module size
 
@@ -140,7 +143,6 @@ void AliPMDClusteringV1::DoClust(Int_t idet, Int_t ismn,
     {
       for (j = 0; j < kNDIMY; j++)
        {
-         fCellTrNo[i][j] = -1;
          edepcell[kk] = 0.;
          kk++;
        }
@@ -157,13 +159,11 @@ void AliPMDClusteringV1::DoClust(Int_t idet, Int_t ismn,
          
          if (ismn < 12)
            {
-             cellenergy[ij]    = celladc[jd][id];//Ajay
-             fCellTrNo[i][j]   = jd*10000+id;    // for association 
+             cellenergy[ij]    = celladc[jd][id];
            }
          else if (ismn >= 12 && ismn <= 23)
            {
-             cellenergy[ij]    = celladc[id][jd];//Ajay
-             fCellTrNo[i][j] = id*10000+jd;      // for association 
+             cellenergy[ij]    = celladc[id][jd];
            }
        }
     }
@@ -177,7 +177,7 @@ void AliPMDClusteringV1::DoClust(Int_t idet, Int_t ismn,
 
   Int_t iord1[kNMX];
   TMath::Sort((Int_t)kNMX,edepcell,iord1);// order the data
-  cutoff = fCutoff;                // cutoff to discard cells
+  cutoff = fCutoff;                       // cutoff to discard cells
   ave  = 0.;
   nmx1 = -1;
   for(i = 0;i < kNMX; i++)
@@ -222,6 +222,7 @@ void AliPMDClusteringV1::DoClust(Int_t idet, Int_t ismn,
       // 
       // Cluster X centroid is back transformed
       //
+
       if (ismn < 12)
        {
          clusdata[0] = cluX0 - (24-1) + cluY0/2.;
@@ -231,6 +232,7 @@ void AliPMDClusteringV1::DoClust(Int_t idet, Int_t ismn,
          clusdata[0] = cluX0 - (48-1) + cluY0/2.;
        }         
       
+
       clusdata[1]     = cluY0;
       clusdata[2]     = cluADC;
       clusdata[3]     = cluCELLS;
@@ -241,25 +243,29 @@ void AliPMDClusteringV1::DoClust(Int_t idet, Int_t ismn,
       // Cells associated with a cluster
       //
 
-      for (Int_t ihit = 0; ihit < 15; ihit++)
+      for (Int_t ihit = 0; ihit < kNmaxCell; ihit++)
        {
+         Int_t cellrow = pmdcludata->GetCellXY(ihit)/10000;
+         Int_t cellcol = pmdcludata->GetCellXY(ihit)%10000;
+
          if (ismn < 12)
            {
-             celldataX[ihit] = pmdcludata->GetCellXY(ihit)%10000;
-             celldataY[ihit] = pmdcludata->GetCellXY(ihit)/10000;
+             celldataX[ihit] = cellrow - (24-1) + int(cellcol/2.);
            }
          else if (ismn >= 12 && ismn <= 23)
            {
-             celldataX[ihit] = pmdcludata->GetCellXY(ihit)/10000;
-             celldataY[ihit] = pmdcludata->GetCellXY(ihit)%10000;
+             celldataX[ihit] = cellrow - (48-1) + int(cellcol/2.);
            }
+         
+         celldataY[ihit] = cellcol;
        }
+
+
       pmdcl = new AliPMDcluster(idet, ismn, clusdata, celldataX, celldataY);
       pmdcont->Add(pmdcl);
     }
   
   fPMDclucont->Delete();
-  
 }
 // ------------------------------------------------------------------------ //
 Int_t AliPMDClusteringV1::CrClust(Double_t ave, Double_t cutoff, Int_t nmx1,
@@ -269,7 +275,8 @@ Int_t AliPMDClusteringV1::CrClust(Double_t ave, Double_t cutoff, Int_t nmx1,
   // Finds out only the big patch by just searching the
   // connected cells
   //
-  Int_t i,j,k,id1,id2,icl, numcell, clust[2][5000];
+  const Int_t kndim = 4609;
+  Int_t i,j,k,id1,id2,icl, numcell, clust[2][kndim];
   Int_t jd1,jd2, icell, cellcount;
   static Int_t neibx[6]={1,0,-1,-1,0,1}, neiby[6]={0,1,1,0,-1,-1};
 
@@ -325,7 +332,7 @@ Int_t AliPMDClusteringV1::CrClust(Double_t ave, Double_t cutoff, Int_t nmx1,
          clust[0][numcell] = id1;
          clust[1][numcell] = id2;
          
-         for(i = 1; i < 5000; i++)
+         for(i = 1; i < kndim; i++)
            {
              clust[0][i]=0;
            }
@@ -354,7 +361,7 @@ Int_t AliPMDClusteringV1::CrClust(Double_t ave, Double_t cutoff, Int_t nmx1,
          // check adc count for neighbour's neighbours recursively and
          // if nonzero, add these to the cluster.
          // ---------------------------------------------------------------
-         for(i = 1; i < 5000;i++)
+         for(i = 1; i < kndim;i++)
            {
              if(clust[0][i] != 0)
                {
@@ -393,33 +400,28 @@ void AliPMDClusteringV1::RefClust(Int_t incr, Double_t edepcell[])
   // finds out the more refined clusters
   //
   
-
-
   AliPMDcludata *pmdcludata = 0;
-
-  Int_t *cellCount = 0x0;
-  Int_t **cellXY = 0x0;
-  const Int_t kdim = 4609;
-
-  Int_t    i12;
-  Int_t    i, j, k, i1, i2, id, icl,  itest;
-//  Int_t    ihld;
-  Int_t    ig, nsupcl,clno;
-  Int_t    t[kdim];
-  Int_t    ncl[kdim], iord[kdim], lev1[kdim], lev2[kdim];
-  Int_t    clxy[15];
+  
+  const Int_t kNmaxCell   = 19;    // # of cells surrounding a cluster center
+  
+  Int_t ndim = incr + 1;
+  
+  Int_t    *ncl  = 0x0;
+  Int_t    *clxy = 0x0;  
+  Int_t    i12, i22;
+  Int_t    i, j, k, i1, i2, id, icl,  itest,ihld, ig, nsupcl,clno, t1, t2;
   Float_t  clusdata[6];
-  Double_t x1, y1, z1, x2, y2, z2, dist,rr,sum;
-  Double_t x[kdim], y[kdim], z[kdim];
-  Double_t xc[kdim], yc[kdim], zc[kdim], cells[kdim], rc[kdim];
-
+  Double_t x1, y1, z1, x2, y2, z2, rr;
+  
+  ncl   = new Int_t [ndim];
+  clxy  = new Int_t [kNmaxCell];
+  
   // Initialisation  
-  for(i = 0; i<kdim; i++)
-    { 
-      t[i]         = -1;
-      ncl[i]       = -1;
+  for(i = 0; i<ndim; i++)
+    {
+      ncl[i]  = -1; 
       if (i < 6) clusdata[i] = 0.;
-      if (i < 15) clxy[i] = 0;
+      if (i < kNmaxCell) clxy[i]    = 0;
     }
 
   // clno counts the final clusters
@@ -438,10 +440,10 @@ void AliPMDClusteringV1::RefClust(Int_t incr, Double_t edepcell[])
        {
          nsupcl++;
        }
-      if (nsupcl > kdim) 
+      if (nsupcl > ndim) 
        {
          AliWarning("RefClust: Too many superclusters!");
-         nsupcl = kdim;
+         nsupcl = ndim;
          break;
        }
       ncl[nsupcl]++;
@@ -458,9 +460,9 @@ void AliPMDClusteringV1::RefClust(Int_t incr, Double_t edepcell[])
        {
          id++;
          icl++;
-         if (clno >= 5000) 
+         if (clno >= 4608) 
            {
-             AliWarning("RefClust: Too many clusters! more than 5000");
+             AliWarning("RefClust: Too many clusters! more than 4608");
              return;
            }
          clno++;
@@ -476,8 +478,9 @@ void AliPMDClusteringV1::RefClust(Int_t incr, Double_t edepcell[])
          clusdata[4] = 0.5;
          clusdata[5] = 0.0;
 
-         clxy[0] = fCellTrNo[i1][i2];            //association
-         for(Int_t icltr = 1; icltr < 15; icltr++)
+         clxy[0] = i1*10000 + i2;
+         
+         for(Int_t icltr = 1; icltr < kNmaxCell; icltr++)
            {
              clxy[icltr] = -1;
            }
@@ -488,9 +491,9 @@ void AliPMDClusteringV1::RefClust(Int_t incr, Double_t edepcell[])
        {
          id++;
          icl++;
-         if (clno >= 5000) 
+         if (clno >= 4608) 
            {
-             AliWarning("RefClust: Too many clusters! more than 5000");
+             AliWarning("RefClust: Too many clusters! more than 4608");
              return;
            }
          clno++;
@@ -501,17 +504,22 @@ void AliPMDClusteringV1::RefClust(Int_t incr, Double_t edepcell[])
          x1   = fCoord[0][i1][i2];
          y1   = fCoord[1][i1][i2];
          z1   = edepcell[i12];
-         clxy[0] = fCellTrNo[i1][i2];    //asso
+
+         clxy[0] = i1*10000 + i2;
+         
          id++;
          i1   = fInfcl[1][id];
          i2   = fInfcl[2][id];
 
-         Int_t i22 = i1 + i2*kNDIMX;
+         i22  = i1 + i2*kNDIMX;
          x2   = fCoord[0][i1][i2];
          y2   = fCoord[1][i1][i2];
          z2   = edepcell[i22];
-         clxy[1] = fCellTrNo[i1][i2];            //asso
-         for(Int_t icltr = 2; icltr < 15; icltr++)
+
+         clxy[1] = i1*10000 + i2;
+         
+
+         for(Int_t icltr = 2; icltr < kNmaxCell; icltr++)
            {
              clxy[icltr] = -1;
            }
@@ -527,8 +535,34 @@ void AliPMDClusteringV1::RefClust(Int_t incr, Double_t edepcell[])
        }
       else
        {
+         
+         Int_t    *iord, *tc, *t;
+         Double_t *x, *y, *z, *xc, *yc, *zc;
+
+         iord = new Int_t [ncl[i]+1];
+         tc   = new Int_t [ncl[i]+1];
+         t    = new Int_t [ncl[i]+1];
+         
+         x    = new Double_t [ncl[i]+1];
+         y    = new Double_t [ncl[i]+1];
+         z    = new Double_t [ncl[i]+1];
+         xc   = new Double_t [ncl[i]+1];
+         yc   = new Double_t [ncl[i]+1];
+         zc   = new Double_t [ncl[i]+1];
+         
+         for( k = 0; k < ncl[i]+1; k++)
+           {
+             iord[k] = -1;
+             t[k]    = -1;
+             tc[k]   = -1;
+             x[k]    = -1;
+             y[k]    = -1;
+             z[k]    = -1;
+             xc[k]   = -1;
+             yc[k]   = -1;
+             zc[k]   = -1;
+           }
          id++;
-         iord[0] = 0;
          // super-cluster of more than two cells - broken up into smaller
          // clusters gaussian centers computed. (peaks separated by > 1 cell)
          // Begin from cell having largest energy deposited This is first
@@ -540,9 +574,9 @@ void AliPMDClusteringV1::RefClust(Int_t incr, Double_t edepcell[])
          x[0]    = fCoord[0][i1][i2];
          y[0]    = fCoord[1][i1][i2];
          z[0]    = edepcell[i12];
-
-         t[0] = fCellTrNo[i1][i2];       //asso
+         t[0]    = i1*10000 + i2;
          
+
          iord[0] = 0;
          for(j = 1; j <= ncl[i]; j++)
            {
@@ -555,13 +589,12 @@ void AliPMDClusteringV1::RefClust(Int_t incr, Double_t edepcell[])
              x[j]    = fCoord[0][i1][i2];
              y[j]    = fCoord[1][i1][i2];
              z[j]    = edepcell[i12];
+             t[j]    = i1*10000 + i2;
 
-             t[j]    = fCellTrNo[i1][i2];            //asso
            }
          
          // arranging cells within supercluster in decreasing order
-
-/*       
+         
          for(j = 1;j <= ncl[i]; j++)
            {
              itest = 0;
@@ -579,317 +612,290 @@ void AliPMDClusteringV1::RefClust(Int_t incr, Double_t edepcell[])
                    }
                }
            }
-*/
-
-         Int_t imaxdim = ncl[i] + 1;
-         TMath::Sort(imaxdim,z,iord);// order the data
-
-
-         // compute the number of Gaussians and their centers ( first
-         // guess )
-         // centers must be separated by cells having smaller ener. dep.
-         // neighbouring centers should be either strong or well-separated
+         /* MODIFICATION PART STARTS (Tapan July 2008)
+            iord[0] is the cell with highest ADC in the crude-cluster
+            ig is the number of local maxima in the crude-cluster
+            For the higest peak we make ig=0 which means first local maximum.
+            Next we go down in terms of the ADC sequence and find out if any
+            more of the cells form local maxima. The definition of local 
+            maxima is that all its neighbours are of less ADC compared to it. 
+         */
          ig = 0;
          xc[ig] = x[iord[0]];
          yc[ig] = y[iord[0]];
          zc[ig] = z[iord[0]];
-         for(j = 1; j <= ncl[i]; j++)
+         tc[ig] = t[iord[0]];
+         Int_t ivalid = 0,  icount = 0;
+         
+         for(j=1;j<=ncl[i];j++)
            {
-             itest = -1;
-             x1    = x[iord[j]];
-             y1    = y[iord[j]];
-             for(k = 0; k <= ig; k++)
-               {
-                 x2 = xc[k]; 
-                 y2 = yc[k];
-                 rr = Distance(x1,y1,x2,y2);
-                 if(rr >= 1.1 && rr < 1.8 && z[iord[j]] > zc[k]/4.)itest++;
-                 if(rr >= 1.8 && rr < 2.1 && z[iord[j]] > zc[k]/10.)itest++;
-                 if( rr >= 2.1)itest++;
-               }
-             if(itest == ig)
+             x1  = x[iord[j]];
+             y1  = y[iord[j]]; 
+             z1  = z[iord[j]];
+             t1  = t[iord[j]];
+             rr=Distance(x1,y1,xc[ig],yc[ig]);
+             
+             // Check the cells which are outside the neighbours (rr>1.2)
+             if(rr>1.2 ) 
                {
-                 ig++;
-                 xc[ig] = x1;
-                 yc[ig] = y1;
-                 zc[ig] = z[iord[j]];
-               }
+                 ivalid=0;
+                 icount=0;
+                 for(Int_t j1=1;j1<j;j1++)
+                   {
+                     icount++;
+                     Float_t rr1=Distance(x1,y1,x[iord[j1]],y[iord[j1]]);              
+                     if(rr1>1.2) ivalid++;
+                   }
+                 if(ivalid == icount && z1>0.5*zc[ig])
+                   {
+                     ig++;
+                     xc[ig]=x1; 
+                     yc[ig]=y1; 
+                     zc[ig]=z1;
+                     tc[ig]=t1;
+                   }
+               }         
            }
-         GaussFit(ncl[i], ig, x[0], y[0] ,z[0], xc[0], yc[0], zc[0], rc[0]);
-         icl += ig+1;
+         
+         icl=icl+ig+1;
+         
+         //  We use simple Gaussian weighting. (Tapan Jan 2005)
          // compute the number of cells belonging to each cluster.
-         // cell is shared between several clusters ( if they are equidistant
-         // from it ) in the ratio of cluster energy deposition
-
-         Int_t jj = 15;
+         // cell can be shared between several clusters  
+         // in the ratio of cluster energy deposition
+         // To calculate: 
+         // (1) number of cells belonging to a cluster (ig) and 
+         // (2) total ADC of the cluster (ig) 
+         // (3) x and y positions of the cluster
+         
+         
+         Int_t *cellCount;
+         Int_t **cellXY;
+         
+         Int_t    *status;
+         Double_t *totaladc, *totaladc2, *ncell,*weight;
+         Double_t *xclust, *yclust, *sigxclust, *sigyclust;
+         Double_t *ax, *ay, *ax2, *ay2;
+         
+         
+         status    = new Int_t [ncl[i]+1];
+         cellXY    = new Int_t *[ncl[i]+1];
+         
          cellCount = new Int_t [ig+1];
-         cellXY = new Int_t *[jj];
-         for(Int_t ij = 0; ij < 15; ij++) cellXY[ij] = new Int_t [ig+1];
-
-         for(j = 0; j <= ig; j++)
+         totaladc  = new Double_t [ig+1];
+         totaladc2 = new Double_t [ig+1];
+         ncell     = new Double_t [ig+1];
+         weight    = new Double_t [ig+1];
+         xclust    = new Double_t [ig+1];
+         yclust    = new Double_t [ig+1];
+         sigxclust = new Double_t [ig+1];
+         sigyclust = new Double_t [ig+1];
+         ax        = new Double_t [ig+1];
+         ay        = new Double_t [ig+1];
+         ax2       = new Double_t [ig+1];
+         ay2       = new Double_t [ig+1];
+         
+         for(j = 0; j < ncl[i]+1; j++) 
            {
-             cellCount[j] = 0;
-             cells[j]     = 0.;
+             status[j]     = 0;
+             cellXY[j] = new Int_t[ig+1];
            }
+         //initialization
+         for(Int_t kcl = 0; kcl < ig+1; kcl++)
+           {
+             cellCount[kcl] = 0;
+             totaladc[kcl]  = 0.;
+             totaladc2[kcl] = 0.;
+             ncell[kcl]     = 0.;
+             weight[kcl]    = 0.;      
+             xclust[kcl]    = 0.; 
+             yclust[kcl]    = 0.;
+             sigxclust[kcl] = 0.; 
+             sigyclust[kcl] = 0.;
+             ax[kcl]        = 0.;      
+             ay[kcl]        = 0.;      
+             ax2[kcl]       = 0.;      
+             ay2[kcl]       = 0.;    
+             for(j = 0; j < ncl[i]+1; j++)
+               {
+                 cellXY[j][kcl] = 0;
+               }
+           }
+         Double_t sumweight, gweight; 
          
-         if(ig > 0)
+         for(j = 0;j <= ncl[i]; j++)
            {
-             for(j = 0; j <= ncl[i]; j++)
+             x1 = x[iord[j]];
+             y1 = y[iord[j]];
+             z1 = z[iord[j]];
+             t1 = t[iord[j]];
+             
+             for(Int_t kcl=0; kcl<=ig; kcl++)
                {
-                 lev1[j] = 0;
-                 lev2[j] = 0;
-                 for(k = 0; k <= ig; k++)
+                 x2 = xc[kcl];
+                 y2 = yc[kcl];
+                 rr = Distance(x1,y1,x2,y2);
+                 t2 = tc[kcl];           
+                 
+                 if(rr==0)
                    {
-                     dist = Distance(x[j], y[j], xc[k], yc[k]);
-                     if(dist < TMath::Sqrt(3.) )
-                       {
-                         //asso
-                         if (cellCount[k] < 15)
-                           {
-                             cellXY[cellCount[k]][k] = t[j];
-                           }
-                         cellCount[k]++;
-                         //
-                         lev1[0]++;
-                         i1       = lev1[0];
-                         lev1[i1] = k;
-                       }
-                     else
-                       {
-                         if(dist < 2.1)
-                           {
-                             lev2[0]++;
-                             i1       = lev2[0];
-                             lev2[i1] = k;
-                           }
-                       }
+                     ncell[kcl] = 1.;
+                     totaladc[kcl]  = z1;
+                     totaladc2[kcl]  = pow(z1,2);
+                     ax[kcl] =  x1 * z1;
+                     ay[kcl] =  y1 * z1;
+                     ax2[kcl]=  0.;
+                     ay2[kcl]=  0.;
+                     status[j] = 1;
                    }
-                 if(lev1[0] != 0)
+               }
+           }
+         
+         for(j = 0; j <= ncl[i]; j++)
+           {
+             Int_t   maxweight = 0;
+             Double_t     max  = 0.;
+             
+             if(status[j] == 0)
+               { 
+                 x1 = x[iord[j]]; 
+                 y1 = y[iord[j]];
+                 z1 = z[iord[j]];
+                 t1 = t[iord[j]];
+                 sumweight = 0.;
+
+                 for(Int_t kcl = 0; kcl <= ig; kcl++)
                    {
-                     if(lev1[0] == 1)
-                       {
-                         cells[lev1[1]]++;
-                       } 
-                     else 
+                     x2 = xc[kcl]; 
+                     y2 = yc[kcl]; 
+                     rr = Distance(x1,y1,x2,y2);
+                     gweight     = exp(-(rr*rr)/(2*(1.2*1.2)));
+                     weight[kcl] = zc[kcl] * gweight;
+                     sumweight   = sumweight + weight[kcl];
+                     
+                     if(weight[kcl] > max)
                        {
-                         sum=0.;
-                         for(k = 1; k <= lev1[0]; k++)
-                           {
-                             sum  += zc[lev1[k]];
-                           }
-                         for(k = 1; k <= lev1[0]; k++)
-                           {
-                             cells[lev1[k]] += zc[lev1[k]]/sum;
-                           }
+                         max       =  weight[kcl];
+                         maxweight =  kcl;
                        }
                    }
-                 else
+                 
+                 cellXY[cellCount[maxweight]][maxweight] = iord[j];
+                                 
+                 cellCount[maxweight]++;
+                 
+                 for(Int_t kcl = 0; kcl <= ig; kcl++)
                    {
-                     if(lev2[0] == 0)
+                     x2 = xc[kcl];
+                     y2 = yc[kcl];
+                     rr = Distance(x1,y1,x2,y2);
+                     t2 = tc[kcl];
+                     // For calculating weighted mean:
+                     // Weighted_mean = (\sum w_i x_i) / (\sum w_i)
+                     
+                     if(sumweight>0.)
                        {
-                         cells[lev2[1]]++;
-                       }
-                     else
-                       {
-                         sum=0.;
-                         for( k = 1; k <= lev2[0]; k++)
-                           {
-                             sum += zc[lev2[k]];
-                           }
-                         for(k = 1; k <= lev2[0]; k++)
-                           {
-                             cells[lev2[k]] +=  zc[lev2[k]]/sum;
-                           }
+                         totaladc[kcl] = totaladc[kcl] + z1*(weight[kcl]/sumweight);
+                         ncell[kcl]    = ncell[kcl]    + (weight[kcl]/sumweight);        
+                         ax[kcl]       = ax[kcl]       + (x1 * z1 *weight[kcl]/sumweight);
+                         ay[kcl]       = ay[kcl]       + (y1 * z1 *weight[kcl]/sumweight);
+                         
+                         // For calculating weighted sigma:
+                         // Wieghted_sigma= ((\sum w_i)/((\sum w_i)^2 - \sum (w_i^2))) \sum w_i (x_i - \Hat\mu)^2
+                         // I assume here x1,y1 are cluster centers, otherwise life becomes too difficult
+                         totaladc2[kcl] = totaladc2[kcl] +  pow((z1*(weight[kcl]/sumweight)),2);
+                         ax2[kcl] = ax2[kcl] + (z1 *weight[kcl]/sumweight) * pow((x1-x2),2);
+                         ay2[kcl] = ay2[kcl] + (z1 *weight[kcl]/sumweight) * pow((y1-y2),2);
                        }
                    }
                }
            }
          
-         // zero rest of the cell array
-         //asso
-         for( k = 0; k <= ig; k++)
-           {
-             for(Int_t icltr = cellCount[k]; icltr < 15; icltr++)
-               {
-                 cellXY[icltr][k] = -1;
-               }
-           }
-         //
-         
-         for(j = 0; j <= ig; j++)
+         for(Int_t kcl = 0; kcl <= ig; kcl++)
            {
-             clno++;
-             if (clno >= 5000) 
+
+             if(totaladc[kcl]>0){
+               if(totaladc[kcl]>0.)xclust[kcl] = (ax[kcl])/ totaladc[kcl];
+               if(totaladc[kcl]>0.)yclust[kcl] = (ay[kcl])/ totaladc[kcl];
+               
+               if(totaladc[kcl]>0.)sigxclust[kcl] = (totaladc[kcl]/(pow(totaladc[kcl],2)-totaladc2[kcl]))*ax2[kcl];
+               if(totaladc[kcl]>0.)sigyclust[kcl] = (totaladc[kcl]/(pow(totaladc[kcl],2)-totaladc2[kcl]))*ay2[kcl];
+             } 
+           
+             for(j = 0; j < cellCount[kcl]; j++) clno++; 
+             
+             if (clno >= 4608) 
                {
-                 AliWarning("RefClust: Too many clusters! more than 5000");
+                 AliWarning("RefClust: Too many clusters! more than 4608");
                  return;
                }
-             clusdata[0] = xc[j];
-             clusdata[1] = yc[j];
-             clusdata[2] = zc[j];
-             clusdata[4] = rc[j];
-             clusdata[5] = 0.0;
-             if(ig == 0)
+             clusdata[0] = xclust[kcl];
+             clusdata[1] = yclust[kcl];
+             clusdata[2] = totaladc[kcl];
+             clusdata[3] = ncell[kcl];
+             if(sigxclust[kcl] > sigyclust[kcl]) 
                {
-                 clusdata[3] = ncl[i];
+                 clusdata[4] = pow(sigxclust[kcl],0.5);
+                 clusdata[5] = pow(sigyclust[kcl],0.5);
                }
              else
                {
-                 clusdata[3] = cells[j];
+                 clusdata[4] = pow(sigyclust[kcl],0.5);
+                 clusdata[5] = pow(sigxclust[kcl],0.5);
                }
 
+             clxy[0] = tc[kcl];
 
-             for (Int_t ii=0; ii < 15; ii++)
+             Int_t Ncell=1;
+             for (Int_t ii = 0; ii < cellCount[kcl]; ii++)
                {
-                 clxy[ii] = cellXY[ii][j];
-               }  
+                 Float_t xx = x[cellXY[ii][kcl]];
+                 Float_t yy = y[cellXY[ii][kcl]];
+
+                 rr=Distance(xclust[kcl],yclust[kcl],xx,yy);
+                 // Natasha
+                 // We store only the nearest and nest-nearest neighbours
+                 if(rr<2.2) 
+                   {   
+                     clxy[Ncell] = t[cellXY[ii][kcl]];
+                     Ncell++;
+                   }
+               } 
+
              pmdcludata = new AliPMDcludata(clusdata,clxy);
              fPMDclucont->Add(pmdcludata);
            }
+         
+         delete [] iord;
+         delete [] tc;   
+         delete [] t;
+         delete [] x;
+         delete [] y;
+         delete [] z;
+         delete [] xc;
+         delete [] yc;
+         delete [] zc;
+         
          delete [] cellCount;
-         for(jj = 0; jj < 15; jj++)delete [] cellXY[jj];
-         delete [] cellXY;
-       }
-    }
-}
-// ------------------------------------------------------------------------ //
-void AliPMDClusteringV1::GaussFit(Int_t ncell, Int_t nclust, Double_t &x, 
-                                 Double_t &y ,Double_t &z, Double_t &xc, 
-                                 Double_t &yc, Double_t &zc, Double_t &rc)
-{
-  // Does gaussian fitting
-  //
-
-  const Int_t kdim = 4609;
-  Int_t i, j, i1, i2, novar, idd, jj;
-  Int_t neib[kdim][50];
-
-  Double_t sum, dx, dy, str, str1, aint, sum1, rr, dum;
-  Double_t x1, x2, y1, y2;
-  Double_t xx[kdim], yy[kdim], zz[kdim], xxc[kdim], yyc[kdim];
-  Double_t a[kdim], b[kdim], c[kdim], d[kdim], ha[kdim], hb[kdim];
-  Double_t hc[kdim], hd[kdim], zzc[kdim], rrc[kdim];
-  
-  TRandom rnd;
-  
-  str   = 0.;
-  str1  = 0.;
-  rr    = 0.3;
-  novar = 0;
-  j     = 0;  
-
-  for(i = 0; i <= ncell; i++)
-    {
-      xx[i] = *(&x+i);
-      yy[i] = *(&y+i);
-      zz[i] = *(&z+i);
-      str  += zz[i];
-    }
-  for(i=0; i<=nclust; i++)
-    {
-      xxc[i] = *(&xc+i);
-      yyc[i] = *(&yc+i);
-      zzc[i] = *(&zc+i);
-      str1  += zzc[i];
-      rrc[i] = 0.5;
-    }
-  for(i = 0; i <= nclust; i++)
-    {
-      zzc[i] = str/str1*zzc[i];
-      ha[i]  = xxc[i];
-      hb[i]  = yyc[i];
-      hc[i]  = zzc[i];
-      hd[i]  = rrc[i];
-      x1     = xxc[i];
-      y1     = yyc[i];
-    }
-  for(i = 0; i <= ncell; i++)
-    {
-      idd = 0;
-      x1  = xx[i];
-      y1  = yy[i];
-      for(j = 0; j <= nclust; j++)
-       {
-         x2 = xxc[j];
-         y2 = yyc[j];
-         if(Distance(x1,y1,x2,y2) <= 3.)
-           { 
-             idd++;
-             neib[i][idd] = j; 
-           }
-       }
-      neib[i][0] = idd;
-    }
-  sum = 0.;
-  for(i1 = 0; i1 <= ncell; i1++)
-    {
-      aint = 0.;
-      idd = neib[i1][0];
-      for(i2 = 1; i2 <= idd; i2++)
-       {
-         jj    = neib[i1][i2];
-         dx    = xx[i1] - xxc[jj];
-         dy    = yy[i1] - yyc[jj];
-         dum   = rrc[j]*rrc[jj] + rr*rr;
-         aint += exp(-(dx*dx+dy*dy)/dum)*zzc[idd]*rr*rr/dum;
-       }
-      sum += (aint - zz[i1])*(aint - zz[i1])/str;
-    } 
-  str1 = 0.;
-  for(i = 0; i <= nclust; i++)
-    {
-      a[i]  = xxc[i] + 0.6*(rnd.Uniform() - 0.5);
-      b[i]  = yyc[i] + 0.6*(rnd.Uniform() - 0.5);
-      c[i]  = zzc[i]*(1.+ ( rnd.Uniform() - 0.5)*0.2);
-      str1 += zzc[i];
-      d[i]  = rrc[i]*(1.+ ( rnd.Uniform() - 0.5)*0.1);
-      
-      if(d[i] < 0.25)
-       {
-         d[i]=0.25;
-       }
-    }
-  for(i = 0; i <= nclust; i++)
-    {
-      c[i] = c[i]*str/str1; 
-    }
-  sum1=0.;
-  
-  for(i1 = 0; i1 <= ncell; i1++)
-    {
-      aint = 0.;
-      idd = neib[i1][0];
-      for(i2 = 1; i2 <= idd; i2++)
-       {
-         jj    = neib[i1][i2];
-         dx    = xx[i1] - a[jj];
-         dy    = yy[i1] - b[jj];
-         dum   = d[jj]*d[jj]+rr*rr;
-         aint += exp(-(dx*dx+dy*dy)/dum)*c[i2]*rr*rr/dum;
+         for(Int_t jj = 0; jj < ncl[i]+1; jj++) delete [] cellXY[jj];
+         
+         delete [] status;
+         delete [] totaladc;
+         delete [] totaladc2;
+         delete [] ncell;
+         delete [] xclust;
+         delete [] yclust;
+         delete [] sigxclust;
+         delete [] sigyclust;
+         delete [] ax;
+         delete [] ay;
+         delete [] ax2;
+         delete [] ay2;
+         delete [] weight;
        }
-      sum1 += (aint - zz[i1])*(aint - zz[i1])/str;
     }
-
-    if(sum1 < sum)
-      {
-       for(i2 = 0; i2 <= nclust; i2++)
-       {
-         xxc[i2] = a[i2];
-         yyc[i2] = b[i2];
-         zzc[i2] = c[i2];
-         rrc[i2] = d[i2];
-         sum     = sum1;
-       }
-      }
-    for(j = 0; j <= nclust; j++)
-      {
-       *(&xc+j) = xxc[j];
-       *(&yc+j) = yyc[j];
-       *(&zc+j) = zzc[j];
-       *(&rc+j) = rrc[j];
-      }
+  delete [] ncl;
+  delete [] clxy;
 }
 // ------------------------------------------------------------------------ //
 Double_t AliPMDClusteringV1::Distance(Double_t x1, Double_t y1, 
index ed66738..2f43e27 100644 (file)
@@ -13,7 +13,7 @@
 //-----------------------------------------------------//
 // -- Author   : S.C. Phatak
 // -- Modified : B.K. Nandi, Ajay Dash
-//               S. Chattopadhyay
+//               T. Nayak, N. Sharma
 //
 #include "Rtypes.h"
 #include "AliPMDClustering.h"
@@ -35,9 +35,6 @@ class AliPMDClusteringV1: public AliPMDClustering
   Int_t    CrClust(Double_t ave, Double_t cutoff, Int_t nmx1,
                   Int_t iord1[], Double_t edepcell[]);
   void     RefClust(Int_t incr, Double_t edepcell[]);
-  void     GaussFit(Int_t ncell, Int_t nclust, Double_t &x,
-                   Double_t &y, Double_t &z, Double_t &xc,
-                   Double_t &yc, Double_t &zc, Double_t &rc);
   Double_t Distance(Double_t x1, Double_t y1,
                    Double_t x2, Double_t y2);
   void     SetEdepCut(Float_t decut);
@@ -55,15 +52,14 @@ class AliPMDClusteringV1: public AliPMDClustering
   };
 
   //Variables for association
-  Int_t    fCellTrNo[kNDIMX][kNDIMY];  // id x-y value of cells
   Int_t    fInfocl[2][kNDIMX][kNDIMY]; // cellwise information on the 
                                        // cluster to which the cell
   Int_t    fInfcl[3][kNMX];            // cluster information [0][i]
                                        // -- cluster number
   Double_t fCoord[2][kNDIMX][kNDIMY];
 
-  Float_t fCutoff; // Energy(ADC) cutoff per cell before clustering
+  Float_t  fCutoff; // Energy(ADC) cutoff per cell before clustering
 
-  ClassDef(AliPMDClusteringV1,4) // Does clustering for PMD
+  ClassDef(AliPMDClusteringV1,5) // Does clustering for PMD
 };
 #endif
index d30346c..fb08351 100644 (file)
@@ -98,12 +98,12 @@ void AliPMDClusteringV2::DoClust(Int_t idet, Int_t ismn,
   //
   AliPMDcluster *pmdcl = 0;
 
-  const float ktwobysqrt3 = 1.1547; // 2./sqrt(3.)
-
+  const Float_t ktwobysqrt3 = 1.1547; // 2./sqrt(3.)
+  const Int_t   kNmaxCell   = 19;     // # of cells surrounding a cluster center
   Int_t    i, j, nmx1, incr, id, jd;
   Int_t    ndimXr = 0;
   Int_t    ndimYr = 0;
-  Int_t    celldataX[15], celldataY[15];
+  Int_t    celldataX[kNmaxCell], celldataY[kNmaxCell];
   Float_t  clusdata[6];  
   Double_t cutoff, ave;
   Double_t edepcell[kNMX];
@@ -213,19 +213,15 @@ void AliPMDClusteringV2::DoClust(Int_t idet, Int_t ismn,
       //
       // Cells associated with a cluster
       //
-      for (Int_t ihit = 0; ihit < 15; ihit++)
+      for (Int_t ihit = 0; ihit < kNmaxCell; ihit++)
        {
          Int_t dummyXY = pmdcludata->GetCellXY(ihit);
         
          Int_t celldumY   = dummyXY%10000;
          Int_t celldumX   = dummyXY/10000;
-         //Float_t cellY    = (Float_t) (ktwobysqrt3*celldumY/10);
-         //Float_t cellX    = (Float_t) (celldumX/10 - (celldumY/2.)/10);
-           
           Float_t cellY    = (Float_t) celldumY/10;
          Float_t cellX    = (Float_t) celldumX/10;
 
-         
          // 
          // Cell X centroid is back transformed
          //
@@ -243,7 +239,7 @@ void AliPMDClusteringV2::DoClust(Int_t idet, Int_t ismn,
       pmdcl = new AliPMDcluster(idet, ismn, clusdata, celldataX, celldataY);
       pmdcont->Add(pmdcl);
     }
-  fPMDclucont->Clear();
+  fPMDclucont->Delete();
 }
 // ------------------------------------------------------------------------ //
 Int_t AliPMDClusteringV2::CrClust(Double_t ave, Double_t cutoff, Int_t nmx1,
@@ -386,12 +382,14 @@ Int_t AliPMDClusteringV2::CrClust(Double_t ave, Double_t cutoff, Int_t nmx1,
   // finds out the more refined clusters
 
   const Float_t ktwobysqrt3 = 1.1547;
+  const Int_t   kNmaxCell   = 19;
+
   AliPMDcludata *pmdcludata = 0;
 
   Int_t i12;
   Int_t    i, j, k, i1, i2, id, icl, itest, ihld;
   Int_t    ig, nsupcl, clno, clX,clY;
-  Int_t    clxy[15];
+  Int_t    clxy[kNmaxCell];
 
   Float_t  clusdata[6];
   Double_t x1, y1, z1, x2, y2, z2, rr;
@@ -485,7 +483,7 @@ Int_t AliPMDClusteringV2::CrClust(Double_t ave, Double_t cutoff, Int_t nmx1,
          clX = (Int_t)((fCoord[0][i1][i2] - clY/20.)*10);
          clxy[0] = clX*10000 + clY ;
 
-         for(Int_t icltr = 1; icltr < 15; icltr++)
+         for(Int_t icltr = 1; icltr < kNmaxCell; icltr++)
            {
              clxy[icltr] = -1;
            }
@@ -539,7 +537,7 @@ Int_t AliPMDClusteringV2::CrClust(Double_t ave, Double_t cutoff, Int_t nmx1,
          clX = (Int_t)((x2 - clY/20.)*10);
          clxy[1] = clX*10000 + clY ;
 
-         for(Int_t icltr = 2; icltr < 15; icltr++)
+         for(Int_t icltr = 2; icltr < kNmaxCell; icltr++)
            {
              clxy[icltr] = -1;
            }
@@ -660,8 +658,7 @@ Int_t AliPMDClusteringV2::CrClust(Double_t ave, Double_t cutoff, Int_t nmx1,
            clusdata[5] = rcs[j];
            if(ig == 0)
              {
-               clusdata[3] = ncl[i] + 1;//ajay
-               //clusdata[3] = ncl[i] ;
+               clusdata[3] = ncl[i] + 1;
              }
            else
              {
@@ -669,7 +666,7 @@ Int_t AliPMDClusteringV2::CrClust(Double_t ave, Double_t cutoff, Int_t nmx1,
              }
            // cell information
            Int_t ncellcls =  testncl[j];
-           if( ncellcls < 15 )
+           if( ncellcls < kNmaxCell )
              {
                for(Int_t kk = 1; kk <= ncellcls; kk++)
                  {
@@ -677,14 +674,10 @@ Int_t AliPMDClusteringV2::CrClust(Double_t ave, Double_t cutoff, Int_t nmx1,
                     clY = (Int_t)((ktwobysqrt3*y[ll])*10);
                    clX = (Int_t)((x[ll] - clY/20.)*10);
                    clxy[kk-1] = clX*10000 + clY ;
-                   
 
-                   //clX = (Int_t) x[ll]*10;
-                   //clY = (Int_t) y[ll]*10;
-                   //clxy[kk-1] = (Int_t) clX*10000 + clY ;
                    pp++;
                  }
-               for(Int_t icltr = ncellcls ; icltr < 15; icltr++)
+               for(Int_t icltr = ncellcls ; icltr < kNmaxCell; icltr++)
                  {
                    clxy[icltr] = -1;
                  }
@@ -780,7 +773,9 @@ void AliPMDClusteringV2::ClustDetails(Int_t ncell, Int_t nclust, Double_t x[],
          x1            = x[i];
          y1            = y[i];
          cluster[i][0] = 0;
+
          // distance <= 1 cell unit
+
          for(j = 0; j <= nclust; j++)
            {
              x2 = xc[j];
@@ -999,16 +994,13 @@ void AliPMDClusteringV2::ClustDetails(Int_t ncell, Int_t nclust, Double_t x[],
       
       // To get the cell position in a cluster
       testncl.Set(nclust+1);
-      //testindex.Set(ncell);
       testindex.Set(ncell+1);
-      cell[0][0] = ncell + 1;//ajay
-      //cell[0][0] = ncell;
+      cell[0][0] = ncell + 1;
       testncl[0] = cell[0][0];
       Int_t ll   = 0;
       for(Int_t ii = 1; ii <= ncell; ii++)
        {
          cell[0][ii]=ii;
-         //clustcell[0][ii]=1.;
          Int_t kk = cell[0][ii];
          testindex[ll] = kk;
          ll++;
@@ -1016,7 +1008,6 @@ void AliPMDClusteringV2::ClustDetails(Int_t ncell, Int_t nclust, Double_t x[],
       // final assignments
       xc[i]    = xcl[i];
       yc[i]    = ycl[i];
-      //zc[i]    = str[i];//ajay
       zc[i]    = sum;
       cells[i] = cln[i];
       rcl[i]   = r1;
index 6abec2f..92058fa 100644 (file)
@@ -74,62 +74,266 @@ AliPMDQADataMakerRec& AliPMDQADataMakerRec::operator = (const AliPMDQADataMakerR
 void AliPMDQADataMakerRec::InitRaws()
 {
   // create Raws histograms in Raws subdir
-                                                                                                                                           
-  TH1F * h0 = new TH1F("hPreDdl0Edep","DDL0 Energy Distribution PRE(PMD)", 100, 0, 2000);
-  h0->Sumw2();                                                                                                                           
-  Add2RawsList(h0, 0);                                                                                                             
 
-  TH1F * h1 = new TH1F("hPreDdl1Edep","DDL1 Energy Distribution PRE(PMD)", 100, 0, 2000);
-  h1->Sumw2();
-  Add2RawsList(h1, 1);                                                                                                             
 
-  TH1F * h2 = new TH1F("hPreDdl2Edep","DDL2 Energy Distribution PRE(PMD)", 100, 0, 2000);
-  h2->Sumw2();                                                                                                                           
-  Add2RawsList(h2, 2);                                                                                                             
+    // Preshower plane
+
+    TH1I * h0 = new TH1I("hPreEdepM0","ADC Distribution PRE - Module 0", 100, 0, 2000);
+    h0->Sumw2();
+    Add2RawsList(h0, 0); 
+
+    TH1I * h1 = new TH1I("hPreEdepM1","ADC Distribution PRE - Module 1", 100, 0, 2000);
+    h1->Sumw2();
+    Add2RawsList(h1, 1); 
 
-  TH1F * h3 = new TH1F("hPreDdl3Edep","DDL3 Energy Distribution PRE(PMD)", 100, 0, 2000);
-  h3->Sumw2();                                                                                                                       
-  Add2RawsList(h3, 3);                                                                                                             
+    TH1I * h2 = new TH1I("hPreEdepM2","ADC Distribution PRE - Module 2", 100, 0, 2000);
+    h2->Sumw2();
+    Add2RawsList(h2, 2); 
+    
+    TH1I * h3 = new TH1I("hPreEdepM3","ADC Distribution PRE - Module 3", 100, 0, 2000);
+    h3->Sumw2(); 
+    Add2RawsList(h3, 3); 
 
-  TH1F * h4 = new TH1F("hCpvDdl4Edep","DDL4 Energy Distribution CPV(PMD)", 100, 0, 2000);
-  h4->Sumw2();                                                                                                                           
-  Add2RawsList(h4, 4);                                                                                                             
+    TH1I * h4 = new TH1I("hPreEdepM4","ADC Distribution PRE - Module 4", 100, 0, 2000);
+    h4->Sumw2(); 
+    Add2RawsList(h4, 4); 
 
-  TH1F * h5 = new TH1F("hCpvDdl5Edep","DDL5 Energy Distribution CPV(PMD)", 100, 0, 2000);
-  h5->Sumw2();                                                                                                                           
-  Add2RawsList(h5, 5);                                                                                                             
+    TH1I * h5 = new TH1I("hPreEdepM5","ADC Distribution PRE - Module 5", 100, 0, 2000);
+    h5->Sumw2(); 
+    Add2RawsList(h5, 5); 
+
+    TH1I * h6 = new TH1I("hPreEdepM6","ADC Distribution PRE - Module 6", 100, 0, 2000);
+    h6->Sumw2(); 
+    Add2RawsList(h6, 6); 
+
+    TH1I * h7 = new TH1I("hPreEdepM7","ADC Distribution PRE - Module 7", 100, 0, 2000);
+    h7->Sumw2(); 
+    Add2RawsList(h7, 7); 
+
+    TH1I * h8 = new TH1I("hPreEdepM8","ADC Distribution PRE - Module 8", 100, 0, 2000);
+    h8->Sumw2(); 
+    Add2RawsList(h8, 8); 
+
+    TH1I * h9 = new TH1I("hPreEdepM9","ADC Distribution PRE - Module 9", 100, 0, 2000);
+    h9->Sumw2(); 
+    Add2RawsList(h9, 9); 
+
+    TH1I * h10 = new TH1I("hPreEdepM10","ADC Distribution PRE - Module 10", 100, 0, 2000);
+    h10->Sumw2(); 
+    Add2RawsList(h10, 10); 
+
+    TH1I * h11 = new TH1I("hPreEdepM11","ADC Distribution PRE - Module 11", 100, 0, 2000);
+    h11->Sumw2(); 
+    Add2RawsList(h11, 11); 
+
+    TH1I * h12 = new TH1I("hPreEdepM12","ADC Distribution PRE - Module 12", 100, 0, 2000);
+    h12->Sumw2(); 
+    Add2RawsList(h12, 12); 
+
+    TH1I * h13 = new TH1I("hPreEdepM13","ADC Distribution PRE - Module 13", 100, 0, 2000);
+    h13->Sumw2(); 
+    Add2RawsList(h13, 13); 
+
+    TH1I * h14 = new TH1I("hPreEdepM14","ADC Distribution PRE - Module 14", 100, 0, 2000);
+    h14->Sumw2(); 
+    Add2RawsList(h14, 14); 
+
+    TH1I * h15 = new TH1I("hPreEdepM15","ADC Distribution PRE - Module 15", 100, 0, 2000);
+    h15->Sumw2(); 
+    Add2RawsList(h15, 15); 
+
+    TH1I * h16 = new TH1I("hPreEdepM16","ADC Distribution PRE - Module 16", 100, 0, 2000);
+    h16->Sumw2(); 
+    Add2RawsList(h16, 16); 
+
+    TH1I * h17 = new TH1I("hPreEdepM17","ADC Distribution PRE - Module 17", 100, 0, 2000);
+    h17->Sumw2(); 
+    Add2RawsList(h17, 17); 
+
+    TH1I * h18 = new TH1I("hPreEdepM18","ADC Distribution PRE - Module 18", 100, 0, 2000);
+    h18->Sumw2(); 
+    Add2RawsList(h18, 18); 
+
+    TH1I * h19 = new TH1I("hPreEdepM19","ADC Distribution PRE - Module 19", 100, 0, 2000);
+    h19->Sumw2(); 
+    Add2RawsList(h19, 19); 
+
+    TH1I * h20 = new TH1I("hPreEdepM20","ADC Distribution PRE - Module 20", 100, 0, 2000);
+    h20->Sumw2(); 
+    Add2RawsList(h20, 20);
+    TH1I * h21 = new TH1I("hPreEdepM21","ADC Distribution PRE - Module 21", 100, 0, 2000);
+    h21->Sumw2(); 
+    Add2RawsList(h21, 21); 
+
+    TH1I * h22 = new TH1I("hPreEdepM22","ADC Distribution PRE - Module 22", 100, 0, 2000);
+    h22->Sumw2(); 
+    Add2RawsList(h22, 22); 
+
+    TH1I * h23 = new TH1I("hPreEdepM23","ADC Distribution PRE - Module 23", 100, 0, 2000);
+    h23->Sumw2(); 
+    Add2RawsList(h23, 23);
+
+    // CPV histos
+
+    TH1I * h24 = new TH1I("hCpvEdepM24","ADC Distribution CPV - Module 24", 100, 0, 2000);
+    h24->Sumw2();
+    Add2RawsList(h24, 24); 
+
+    TH1I * h25 = new TH1I("hCpvEdepM25","ADC Distribution CPV - Module 25", 100, 0, 2000);
+    h25->Sumw2(); 
+    Add2RawsList(h25, 25); 
+
+    TH1I * h26 = new TH1I("hCpvEdepM26","ADC Distribution CPV - Module 26", 100, 0, 2000);
+    h26->Sumw2(); 
+    Add2RawsList(h26, 26); 
+
+    TH1I * h27 = new TH1I("hCpvEdepM27","ADC Distribution CPV - Module 27", 100, 0, 2000);
+    h27->Sumw2(); 
+    Add2RawsList(h27, 27); 
+
+    TH1I * h28 = new TH1I("hCpvEdepM28","ADC Distribution CPV - Module 28", 100, 0, 2000);
+    h28->Sumw2(); 
+    Add2RawsList(h28, 28); 
+
+    TH1I * h29 = new TH1I("hCpvEdepM29","ADC Distribution CPV - Module 29", 100, 0, 2000);
+    h29->Sumw2(); 
+    Add2RawsList(h29, 29); 
+
+    TH1I * h30 = new TH1I("hCpvEdepM30","ADC Distribution CPV - Module 30", 100, 0, 2000);
+    h30->Sumw2(); 
+    Add2RawsList(h30, 30); 
+
+    TH1I * h31 = new TH1I("hCpvEdepM31","ADC Distribution CPV - Module 31", 100, 0, 2000);
+    h31->Sumw2(); 
+    Add2RawsList(h31, 31); 
+
+    TH1I * h32 = new TH1I("hCpvEdepM32","ADC Distribution CPV - Module 32", 100, 0, 2000);
+    h32->Sumw2();
+    Add2RawsList(h32, 32); 
+
+    TH1I * h33 = new TH1I("hCpvEdepM33","ADC Distribution CPV - Module 33", 100, 0, 2000);
+    h33->Sumw2();
+    Add2RawsList(h33, 33); 
+
+    TH1I * h34 = new TH1I("hCpvEdepM34","ADC Distribution CPV - Module 34", 100, 0, 2000);
+    h34->Sumw2(); 
+    Add2RawsList(h34, 34); 
+
+    TH1I * h35 = new TH1I("hCpvEdepM35","ADC Distribution CPV - Module 35", 100, 0, 2000);
+    h35->Sumw2(); 
+    Add2RawsList(h35, 35); 
+
+    TH1I * h36 = new TH1I("hCpvEdepM36","ADC Distribution CPV - Module 36", 100, 0, 2000);
+    h36->Sumw2(); 
+    Add2RawsList(h36, 36); 
+
+    TH1I * h37 = new TH1I("hCpvEdepM37","ADC Distribution CPV - Module 37", 100, 0, 2000);
+    h37->Sumw2(); 
+    Add2RawsList(h37, 37); 
+
+    TH1I * h38 = new TH1I("hCpvEdepM38","ADC Distribution CPV - Module 38", 100, 0, 2000);
+    h38->Sumw2(); 
+    Add2RawsList(h38, 38); 
+
+    TH1I * h39 = new TH1I("hCpvEdepM39","ADC Distribution CPV - Module 39", 100, 0, 2000);
+    h39->Sumw2(); 
+    Add2RawsList(h39, 39); 
+
+    TH1I * h40 = new TH1I("hCpvEdepM40","ADC Distribution CPV - Module 40", 100, 0, 2000);
+    h40->Sumw2(); 
+    Add2RawsList(h40, 40); 
+
+    TH1I * h41 = new TH1I("hCpvEdepM41","ADC Distribution CPV - Module 41", 100, 0, 2000);
+    h41->Sumw2();
+    Add2RawsList(h41, 41); 
+
+    TH1I * h42 = new TH1I("hCpvEdepM42","ADC Distribution CPV - Module 42", 100, 0, 2000);
+    h42->Sumw2(); 
+    Add2RawsList(h42, 42); 
+
+    TH1I * h43 = new TH1I("hCpvEdepM43","ADC Distribution CPV - Module 43", 100, 0, 2000);
+    h43->Sumw2(); 
+    Add2RawsList(h43, 43); 
+
+    TH1I * h44 = new TH1I("hCpvEdepM44","ADC Distribution CPV - Module 44", 100, 0, 2000);
+    h44->Sumw2(); 
+    Add2RawsList(h44, 44); 
+
+    TH1I * h45 = new TH1I("hCpvEdepM45","ADC Distribution CPV - Module 45", 100, 0, 2000);
+    h45->Sumw2();
+    Add2RawsList(h45, 45); 
+
+    TH1I * h46 = new TH1I("hCpvEdepM46","ADC Distribution CPV - Module 46", 100, 0, 2000);
+    h46->Sumw2(); 
+    Add2RawsList(h46, 46); 
+
+    TH1I * h47 = new TH1I("hCpvEdepM47","ADC Distribution CPV - Module 47", 100, 0, 2000);
+    h47->Sumw2(); 
+    Add2RawsList(h47, 47); 
+
+
+    // Y vs. X for PRE and CPV planes
+
+    TH2F * h48 = new TH2F("hPreXY","PRE plane",200,-100.,100.,200,-100.,100.);
+    Add2RawsList(h48, 48);
+    TH2F * h49 = new TH2F("hCpvXY","CPV plane",200,-100.,100.,200,-100.,100.);
+    Add2RawsList(h49, 49);
 
-  
 }
 //____________________________________________________________________________ 
 void AliPMDQADataMakerRec::InitRecPoints()
 {
   // create Reconstructed Points histograms in RecPoints subdir
-
-/*
+  
+  /*
     TH2F * h0 = new TH2F("hPreXY","RecPoints Y vs X PRE(PMD)", 100,-100.,100.,100,-100.,100.);
-  Add2RecPointsList(h0,0) ;
+    Add2RecPointsList(h0,0);
+    
     TH2F * h1 = new TH2F("hCpvXY","RecPoints Y vs X CPV(PMD)", 100,-100.,100.,100,-100.,100.);
-  Add2RecPointsList(h1,1) ;
-*/
+    Add2RecPointsList(h1,1);
+  */
 
-    TH1F * h0 = new TH1F("hPreClADC","Cluster ADC of PRE(PMD) plane",500,0.,5000.);
-    h0->Sumw2();
-    Add2RecPointsList(h0, 0)  ;
+    //  Ncell distribution in a cluster
+  
+  TH1F * h0 = new TH1F("hPreDdl0Ncell","PRE: Ddl0 Ncell in a cluster",50,0.,50.);
+  h0->Sumw2();
+  Add2RecPointsList(h0, 0);
 
-    TH1F * h1 = new TH1F("hCpvClADC","Cluster ADC of CPV(PMD) plane",500,0.,5000.);
-    h1->Sumw2();
-    Add2RecPointsList(h1, 1)  ;
-    
 
-    TH1I * h2 = new TH1I("hPreClMult","Cluster Multiplicity of PRE(PMD) plane",100,0.,10000.);
-    h2->Sumw2();
-    Add2RecPointsList(h2, 2)  ;
+  TH1F * h1 = new TH1F("hPreDdl1Ncell","PRE: Ddl1 Ncell in a cluster",50,0.,50.);
+  h1->Sumw2();
+  Add2RecPointsList(h1, 1);
+
+
+  TH1F * h2 = new TH1F("hPreDdl2Ncell","PRE: Ddl2 Ncell in a cluster",50,0.,50.);
+  h2->Sumw2();
+  Add2RecPointsList(h2, 2);
+
+
+  TH1F * h3 = new TH1F("hPreDdl3Ncell","PRE: Ddl3 Ncell in a cluster",50,0.,50.);
+  h3->Sumw2();
+  Add2RecPointsList(h3, 3);
+
+  TH1F * h4 = new TH1F("hPreDdl4Ncell","CPV: Ddl4 Ncell in a cluster",50,0.,50.);
+  h4->Sumw2();
+  Add2RecPointsList(h4, 4);
+
+  TH1F * h5 = new TH1F("hPreDdl5Ncell","CPV: Ddl5 Ncell in a cluster",50,0.,50.);
+  h5->Sumw2();
+  Add2RecPointsList(h5, 5);
+
+  // Correlation plot
+
+  TH2I *h6 = new TH2I("hPre10","Cluster - DDL1 vs DDL0", 100,0,200,100,0,200);
+  Add2RecPointsList(h6,6);
+
+  TH2I *h7 = new TH2I("hPre32","Cluster - DDL3 vs DDL2", 100,0,200,100,0,200);
+  Add2RecPointsList(h7,7);
+
+  TH2I *h8 = new TH2I("hCpv54","Cluster - DDL5 vs DDL4", 100,0,200,100,0,200);
+  Add2RecPointsList(h8,8);
 
-    TH1I * h3 = new TH1I("hCpvClMult","Cluster Multiplicity of CPV(PMD) plane",100,0.,10000.);
-    h3->Sumw2();
-    Add2RecPointsList(h3, 3)  ;
 
 
 }
@@ -139,22 +343,24 @@ void AliPMDQADataMakerRec::InitRecPoints()
 void AliPMDQADataMakerRec::InitESDs()
 {
   //Create histograms to controll ESD
-  TH1F * h0 = new TH1F("hPreClADC","Cluster ADC of PRE(PMD) plane",500,0.,5000.);
+
+  TH1F *h0 = new TH1F("hPreClADC","Cluster ADC of PRE plane",500,0.,10000.);
   h0->Sumw2();
   Add2ESDsList(h0, 0)  ;
 
-  TH1F * h1 = new TH1F("hCpvClADC","Cluster ADC of CPV(PMD) plane",500,0.,5000.);
+  TH1F *h1 = new TH1F("hCpvClADC","Cluster ADC of CPV plane",500,0.,10000.);
   h1->Sumw2();
   Add2ESDsList(h1, 1)  ;
 
-  TH1I * h2 = new TH1I("hPreClMult","Cluster Multiplicity of PRE(PMD) plane",100,0.,10000.);
+  TH2I *h2 = new TH2I("hPmdClMult","Cluster Multiplicity: PRE vs. CPVplane",100,0,1000,100,0,1000);
   h2->Sumw2();
   Add2ESDsList(h2, 2)  ;
 
-  TH1I * h3 = new TH1I("hCpvClMult","Cluster Multiplicity of CPV(PMD) plane",100,0.,10000.);
+/*
+  TH1I * h3 = new TH1I("hCpvClMult","Cluster Multiplicity of CPV plane",100,0.,1000.);
   h3->Sumw2();
   Add2ESDsList(h3, 3)  ;
+*/
 
 }
 
@@ -163,50 +369,95 @@ void AliPMDQADataMakerRec::MakeRaws(AliRawReader* rawReader)
 {
     //Fill prepared histograms with Raw digit properties
 
-    TObjArray pmdddlcont;
+    TObjArray *pmdddlcont = 0x0;
+    pmdddlcont = new TObjArray();
     AliPMDRawStream stream(rawReader);
     
+    AliPMDddldata *pmdddl = 0x0;
 
+    Int_t   iddl = -1;
+    Int_t   xpad = -1;
+    Int_t   ypad = -1;
+    Float_t xx, yy;
 
-    Int_t iddl = -1;
-    while ((iddl = stream.DdlData(&pmdddlcont)) >=0)
+    AliPMDUtility cc;
+
+    while ((iddl = stream.DdlData(pmdddlcont)) >=0)
     {
-       Int_t ientries = pmdddlcont.GetEntries();
+       Int_t ientries = pmdddlcont->GetEntries();
        //printf(" ======= DDLNO = %d ientries = %d \n", iddl, ientries);
+       
        for (Int_t ient = 0; ient < ientries; ient++)
-       {
-           AliPMDddldata *pmdddl = (AliPMDddldata*)pmdddlcont.UncheckedAt(ient);
-           //Int_t det = pmdddl->GetDetector();
-           //Int_t smn = pmdddl->GetSMN();
-           //Int_t mcm = pmdddl->GetMCM();
+         {
+             //AliPMDddldata *pmdddl = (AliPMDddldata*)pmdddlcont->UncheckedAt(ient);
+           pmdddl = (AliPMDddldata*)pmdddlcont->UncheckedAt(ient);
+
+           Int_t det = pmdddl->GetDetector();
+           Int_t smn = pmdddl->GetSMN();
+           Int_t mcm = pmdddl->GetMCM();
            //Int_t chno = pmdddl->GetChannel();
-           //Int_t row = pmdddl->GetRow();
-           //Int_t col = pmdddl->GetColumn();
+           Int_t row = pmdddl->GetRow();
+           Int_t col = pmdddl->GetColumn();
            Int_t sig = pmdddl->GetSignal();
-           //cout<<sig<<endl;
            
-           if (iddl == 0) GetRawsData(0)->Fill(sig); 
-           if (iddl == 1) GetRawsData(1)->Fill(sig); 
-           if (iddl == 2) GetRawsData(2)->Fill(sig); 
-           if (iddl == 3) GetRawsData(3)->Fill(sig); 
-           if (iddl == 4) GetRawsData(4)->Fill(sig); 
-           if (iddl == 5) GetRawsData(5)->Fill(sig); 
-           
-           
-       }
-       
-       pmdddlcont.Delete();
+           if (mcm == 0 || smn == -1) continue;
+
+           if (det == 0)
+           {
+               GetRawsData(smn)->Fill(sig);
+               if(smn < 12)
+               {
+                   xpad = col;
+                   ypad = row;
+               }
+               else if(smn >= 12 && smn < 24)
+               {
+                   xpad = row;
+                   ypad = col;
+               }
+               cc.RectGeomCellPos(smn,xpad,ypad,xx,yy);
+               GetRawsData(48)->Fill(xx,yy);
+           }
+           if (det == 1)
+           {
+               GetRawsData(24+smn)->Fill(sig);
+               if(smn < 12)
+               {
+                   xpad = col;
+                   ypad = row;
+               }
+               else if(smn >= 12 && smn < 24)
+               {
+                   xpad = row;
+                   ypad = col;
+               }
+
+               cc.RectGeomCellPos(smn,xpad,ypad,xx,yy);
+               GetRawsData(49)->Fill(xx,yy);
+
+           }
+
+         }
+
+       pmdddlcont->Delete();
     }
+
+    delete pmdddlcont;
+    pmdddlcont = 0x0;
+
 }
 //____________________________________________________________________________
 void AliPMDQADataMakerRec::MakeRecPoints(TTree * clustersTree)
 {
     // makes data from RecPoints
 
-    Int_t premul = 0, cpvmul = 0;
+    Int_t MultDdl0 = 0, MultDdl1 = 0, MultDdl2 = 0;
+    Int_t MultDdl3 = 0, MultDdl4 = 0, MultDdl5 = 0;
+
     AliPMDrecpoint1 * recpoint; 
 
-    TClonesArray * recpoints = new TClonesArray("AliPMDrecpoint1", 1000) ; 
+    TClonesArray * recpoints = 0x0;
+    recpoints = new TClonesArray("AliPMDrecpoint1", 1000) ; 
     
     TBranch * branch = clustersTree->GetBranch("PMDRecpoint") ;
     branch->SetAddress(&recpoints) ;
@@ -224,27 +475,59 @@ void AliPMDQADataMakerRec::MakeRecPoints(TTree * clustersTree)
            TIter next(recpoints) ; 
 
            while ( (recpoint = dynamic_cast<AliPMDrecpoint1 *>(next())) )
-           {
+             {
                //Float_t xpos = recpoint->GetClusX();
                //Float_t ypos = recpoint->GetClusY();
-               if(recpoint->GetDetector() == 0)
-               {
-                   GetRecPointsData(0)->Fill(recpoint->GetClusADC());
-                   premul++;
-               }
-               if(recpoint->GetDetector() == 1)
-               {
-                   GetRecPointsData(1)->Fill(recpoint->GetClusADC());
-                   cpvmul++;
-               }
-       
-           } 
+               //Int_t smn = recpoint->GetSMNumber();
+               
+                 if(recpoint->GetDetector() == 0)
+                 {
+                   if(recpoint->GetSMNumber() >= 0 && recpoint->GetSMNumber() < 6)
+                     {
+                       GetRecPointsData(0)->Fill(recpoint->GetClusCells());
+                       MultDdl0++;
+                     }
+                   if(recpoint->GetSMNumber() >= 6 && recpoint->GetSMNumber() < 12)
+                     {
+                       GetRecPointsData(1)->Fill(recpoint->GetClusCells());
+                       MultDdl1++;
+                     }
+                   if(recpoint->GetSMNumber() >= 12 && recpoint->GetSMNumber() < 18)
+                     {
+                       GetRecPointsData(2)->Fill(recpoint->GetClusCells());
+                       MultDdl2++;
+                     }
+                   if(recpoint->GetSMNumber() >= 18 && recpoint->GetSMNumber() < 24)
+                     {
+                       GetRecPointsData(3)->Fill(recpoint->GetClusADC());
+                       MultDdl3++;
+                     }
+                 }
 
+               if(recpoint->GetDetector() == 1)
+                 {
+                   if(recpoint->GetSMNumber() >= 0 && recpoint->GetSMNumber() < 6 || 
+                      recpoint->GetSMNumber() >= 18 && recpoint->GetSMNumber() < 24)
+                     {
+                       GetRecPointsData(4)->Fill(recpoint->GetClusCells());
+                       MultDdl4++;
+                     }
+                   if(recpoint->GetSMNumber() >= 6 && recpoint->GetSMNumber() < 18 )
+                     {
+                       GetRecPointsData(5)->Fill(recpoint->GetClusCells());
+                       MultDdl5++;
+                     }
+                 }
+             } 
        }
     }
+    
+    GetRecPointsData(6)->Fill(MultDdl0,MultDdl1);
+    GetRecPointsData(7)->Fill(MultDdl2,MultDdl3);
+    GetRecPointsData(8)->Fill(MultDdl4,MultDdl5);
+
+    delete recpoints;
 
-    GetRecPointsData(2)->Fill(premul);
-    GetRecPointsData(3)->Fill(cpvmul);
 }
 
 //____________________________________________________________________________
@@ -254,32 +537,33 @@ void AliPMDQADataMakerRec::MakeESDs(AliESDEvent * esd)
   // make QA data from ESDs
 
     Int_t premul = 0, cpvmul = 0;
-    for (Int_t icl = 0; icl < esd->GetNumberOfPmdTracks(); icl++)
+
+  for (Int_t icl = 0; icl < esd->GetNumberOfPmdTracks(); icl++)
     {
-       AliESDPmdTrack *pmdtr = esd->GetPmdTrack(icl);
-       
-       //Int_t   det   = pmdtr->GetDetector(); 
-       //Float_t clsX  = pmdtr->GetClusterX();
-       //Float_t clsY  = pmdtr->GetClusterY();
-       //Float_t clsZ  = pmdtr->GetClusterZ();
-       //Float_t ncell = pmdtr->GetClusterCells();
-       Float_t adc   = pmdtr->GetClusterADC();
-       //Float_t pid   = pmdtr->GetClusterPID();
-       
-       if (pmdtr->GetDetector() == 0)
+      AliESDPmdTrack *pmdtr = esd->GetPmdTrack(icl);
+      
+      //Int_t   det   = pmdtr->GetDetector(); 
+      //Float_t clsX  = pmdtr->GetClusterX();
+      //Float_t clsY  = pmdtr->GetClusterY();
+      //Float_t clsZ  = pmdtr->GetClusterZ();
+      //Float_t ncell = pmdtr->GetClusterCells();
+      Float_t adc   = pmdtr->GetClusterADC();
+      //Float_t pid   = pmdtr->GetClusterPID();
+
+      if (pmdtr->GetDetector() == 0)
        {
-           GetESDsData(0)->Fill(adc);
-           premul++;
+         GetESDsData(0)->Fill(adc);
+         premul++;
        }
-       if (pmdtr->GetDetector() == 1)
+      if (pmdtr->GetDetector() == 1)
        {
-           GetESDsData(1)->Fill(adc) ;
-           cpvmul++;
+         GetESDsData(1)->Fill(adc) ;
+         cpvmul++;
        }
     }
-
-    GetESDsData(2)->Fill(premul) ;
-    GetESDsData(3)->Fill(cpvmul) ;
+  
+  GetESDsData(2)->Fill(cpvmul,premul) ;
+  //GetESDsData(3)->Fill(cpvmul) ;  
 }
 
 //____________________________________________________________________________ 
index 7baf733..2fd2a87 100644 (file)
@@ -71,19 +71,19 @@ void AliPMDQADataMakerSim::InitHits()
 {
     // create Hits histograms in Hits subdir
 
-    TH1F *h0 = new TH1F("hPreHitsEdep","Hits energy distribution in PRE(PMD)", 100, 0., 2000.); 
+    TH1F *h0 = new TH1F("hPreHitsEdep","Hits energy distribution in (keV)PRE(PMD)", 500, 0., 500.); 
     h0->Sumw2() ;
     Add2HitsList(h0, 0) ;
 
-    TH1F *h1 = new TH1F("hCpvHitsEdep","Hits energy distribution in CPV(PMD)", 100, 0., 2000.); 
+    TH1F *h1 = new TH1F("hCpvHitsEdep","Hits energy distribution in (keV)CPV(PMD)", 500, 0., 500.); 
     h1->Sumw2() ;
     Add2HitsList(h1, 1) ;
 
-    TH1I *h2 = new TH1I("hPreHitsMult","Hits multiplicity distribution in PRE(PMD)", 500, 0, 10000) ; 
+    TH1I *h2 = new TH1I("hPreHitsMult","Hits multiplicity distribution in PRE(PMD)", 500, 0, 3000) ; 
     h2->Sumw2() ;
     Add2HitsList(h2, 2) ;
 
-    TH1I *h3 = new TH1I("hCpvHitsMult","Hits multiplicity distribution in PRE(PMD)", 500, 0, 10000) ; 
+    TH1I *h3 = new TH1I("hCpvHitsMult","Hits multiplicity distribution in PRE(PMD)", 500, 0, 3000) ; 
     h2->Sumw2() ;
     Add2HitsList(h3, 3) ;
 }
@@ -93,19 +93,19 @@ void AliPMDQADataMakerSim::InitSDigits()
 {
     // create SDigits histograms in SDigits subdir
 
-    TH1F *h0 = new TH1F("hPreSDigitsEdep","SDigits energy distribution in PRE(PMD)", 100, 0., 2000.);
+    TH1F *h0 = new TH1F("hPreSDigitsEdep","SDigits energy distribution in(keV) PRE(PMD)", 500, 0., 500.);
     h0->Sumw2();
     Add2SDigitsList(h0, 0);
 
-    TH1F *h1 = new TH1F("hCpvSDigitsEdep","SDigits energy distribution in CPV(PMD)", 100, 0., 2000.);
+    TH1F *h1 = new TH1F("hCpvSDigitsEdep","SDigits energy distribution in (keV)CPV(PMD)", 500, 0., 500.);
     h1->Sumw2();
     Add2SDigitsList(h1, 1);
 
-    TH1I *h2 = new TH1I("hPreSDigitsMult","SDigits multiplicity distribution in PRE(PMD)", 500, 0., 5000.);
+    TH1I *h2 = new TH1I("hPreSDigitsMult","SDigits multiplicity distribution in PRE(PMD)", 500, 0., 1000.);
     h2->Sumw2();
     Add2SDigitsList(h2, 2);
 
-    TH1I *h3 = new TH1I("hCpvSDigitsMult","SDigits multiplicity distribution in CPV(PMD)", 500, 0., 5000.);
+    TH1I *h3 = new TH1I("hCpvSDigitsMult","SDigits multiplicity distribution in CPV(PMD)", 500, 0., 1000.);
     h3->Sumw2();
     Add2SDigitsList(h3, 3);
 
@@ -124,11 +124,11 @@ void AliPMDQADataMakerSim::InitDigits()
     h1->Sumw2();
     Add2DigitsList(h1, 1);
 
-    TH1I *h2 = new TH1I("hPreDigitsMult","Digits multiplicity distribution in PRE(PMD)", 500, 0, 5000) ; 
+    TH1I *h2 = new TH1I("hPreDigitsMult","Digits multiplicity distribution in PRE(PMD)", 500, 0, 1000) ; 
     h2->Sumw2();
     Add2DigitsList(h2, 2);
 
-    TH1I *h3 = new TH1I("hCpvDigitsMult","Digits multiplicity distribution in CPV(PMD)", 500, 0, 5000);
+    TH1I *h3 = new TH1I("hCpvDigitsMult","Digits multiplicity distribution in CPV(PMD)", 500, 0, 1000);
     h3->Sumw2();
     Add2DigitsList(h3, 3);
 
@@ -140,22 +140,24 @@ void AliPMDQADataMakerSim::MakeHits(TClonesArray *hits)
     //make QA data from Hits
 
     Int_t premul = 0, cpvmul = 0;
-  
+    Float_t edepkev = 0.;
     TIter next(hits); 
     AliPMDhit * hit; 
-
+    
     while ( (hit = dynamic_cast<AliPMDhit *>(next())) )
-    {
+      {
        if (hit->Z() > 361.5)
-       {
-           GetHitsData(0)->Fill(hit->GetEnergy());
+         {
+           edepkev = (hit->GetEnergy())/1000.;
+           GetHitsData(0)->Fill(edepkev);
            premul++;
-       }
+         }
        else if (hit->Z() < 361.5)
-       {
-           GetHitsData(1)->Fill(hit->GetEnergy());
+         {
+           edepkev = (hit->GetEnergy())/1000.;
+           GetHitsData(1)->Fill(edepkev);
            cpvmul++;
-       }
+         }
     }
 
     if(premul <= 0)
@@ -218,6 +220,7 @@ void AliPMDQADataMakerSim::MakeSDigits(TClonesArray * sdigits)
     // makes data from SDigits
 
     Int_t cpvmul = 0, premul = 0;
+    Float_t edepkev = 0.;
 
     TIter next(sdigits) ; 
     AliPMDsdigit * sdigit ; 
@@ -225,13 +228,15 @@ void AliPMDQADataMakerSim::MakeSDigits(TClonesArray * sdigits)
     {
        if(sdigit->GetDetector() == 0)
        {
-           GetSDigitsData(0)->Fill( sdigit->GetCellEdep());
-           premul++;
+         edepkev = (sdigit->GetCellEdep())/1000.;
+         GetSDigitsData(0)->Fill(edepkev);
+         premul++;
        }
        if(sdigit->GetDetector() == 1)
        {
-           GetSDigitsData(1)->Fill( sdigit->GetCellEdep());
-           cpvmul++;
+         edepkev = (sdigit->GetCellEdep())/1000.;
+         GetSDigitsData(1)->Fill(edepkev);
+         cpvmul++;
        }
        
     } 
@@ -311,7 +316,6 @@ void AliPMDQADataMakerSim::MakeDigits(TTree * digitTree)
     {
        for (Int_t ient = 0; ient < branch->GetEntries(); ient++)
        {
-           
            branch->GetEntry(ient) ; 
            MakeDigits(digits) ; 
        }
index 46fd6ab..8408e4b 100644 (file)
@@ -248,6 +248,7 @@ Int_t AliPMDRawStream::DdlData(TObjArray *pmdddlcont)
 
              if (pbusid < 0 || pbusid > 50) return -1;
 
+
              ilowLimit = iuppLimit;
              iuppLimit = ilowLimit + rawdatalength;
 
@@ -270,7 +271,7 @@ Int_t AliPMDRawStream::DdlData(TObjArray *pmdddlcont)
                  parity = ComputeParity(data);
                  if (ibit != parity)
                    {
-                     AliWarning("ComputeParity:: Parity Error");
+                     AliWarning(Form("Parity Error:: Patch Bus %d Module %d",pbusid,imodule));
                      fRawReader->AddMajorErrorLog(kParityError);
                      return -1;
                    }
index cba0349..fdcb809 100644 (file)
@@ -22,7 +22,7 @@ ClassImp(AliPMDcludata)
 AliPMDcludata::AliPMDcludata()
 {
   // Default constructor
-  for (Int_t i = 0; i < 15; i++)
+  for (Int_t i = 0; i < 19; i++)
     {
       if(i < 6) fClusData[i] = 0.;
       fClXY[i] = 0;
@@ -33,12 +33,9 @@ AliPMDcludata::AliPMDcludata()
 AliPMDcludata::AliPMDcludata(Float_t *clusdata, Int_t *clxy)
 {
   // Constructor
-  for (Int_t i = 0; i < 6; i++)
-    {
-      fClusData[i] = clusdata[i];
-    }
-  for (Int_t i = 0; i < 15; i++)
+  for (Int_t i = 0; i < 19; i++)
     {
+      if (i < 6) fClusData[i] = clusdata[i];
       fClXY[i] = clxy[i];
     }
   
@@ -48,7 +45,7 @@ AliPMDcludata::AliPMDcludata(const AliPMDcludata &pmdcludata):
   TObject(pmdcludata)
 {
   //Copy Constructor 
-  for(Int_t i=0; i<15; i++)
+  for(Int_t i=0; i<19; i++)
     {
       if (i < 6) this->fClusData[i] = pmdcludata.fClusData[i];
       this->fClXY[i] = pmdcludata.fClXY[i];
@@ -61,7 +58,7 @@ AliPMDcludata & AliPMDcludata::operator=(const AliPMDcludata &pmdcludata)
   // Assignment operator 
   if(this != &pmdcludata)
     {
-      for(Int_t i=0; i<15; i++)
+      for(Int_t i=0; i<19; i++)
        {
          if (i < 6) this->fClusData[i] = pmdcludata.fClusData[i];
          this->fClXY[i] = pmdcludata.fClXY[i];
index 05f0ec8..86cabc2 100644 (file)
@@ -39,8 +39,8 @@ class AliPMDcludata : public TObject
 
 
   Float_t fClusData[6];       // Array containing cluster information
-  Int_t   fClXY[15];          // Array containing cell information 
+  Int_t   fClXY[19];          // Array containing cell information 
   
-  ClassDef(AliPMDcludata,2) // Keep Cluster information
+  ClassDef(AliPMDcludata,3) // Keep Cluster information
 };
 #endif