]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
isolated cell search algo is added
authorbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 May 2009 16:10:59 +0000 (16:10 +0000)
committerbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 May 2009 16:10:59 +0000 (16:10 +0000)
PMD/AliPMDClusteringV2.cxx
PMD/AliPMDClusteringV2.h

index 1a2b72fc6c229be9b6e72b942868e6e2a4677493..dbbb09cc9a577ef1a5eefedff1893cc44a972a6e 100644 (file)
@@ -44,6 +44,7 @@
 
 #include "AliPMDcludata.h"
 #include "AliPMDcluster.h"
+#include "AliPMDisocell.h"
 #include "AliPMDClustering.h"
 #include "AliPMDClusteringV2.h"
 #include "AliLog.h"
@@ -114,6 +115,12 @@ void AliPMDClusteringV2::DoClust(Int_t idet, Int_t ismn,
   Double_t edepcell[kNMX];
 
 
+  // call the isolated cell search method
+
+  CalculateIsoCell(idet, ismn, celladc, pmdisocell);
+
+
+
   if (ismn < 12)
     {
       ndimXr = 96;
@@ -239,9 +246,23 @@ void AliPMDClusteringV2::DoClust(Int_t idet, Int_t ismn,
              celldataX[ihit] = (Int_t) ((cellX - (48-1) + cellY/2.) + 0.5 );
            }     
          celldataY[ihit]   = (Int_t) (cellY + 0.5);
-         celldataTr[ihit]  = -1;
-         celldataPid[ihit] = -1;
-         celldataAdc[ihit] = -1;
+
+         Int_t irow = celldataX[ihit];
+         Int_t icol = celldataY[ihit];
+
+         if ((irow >= 0 && irow < 48) && (icol >= 0 && icol < 96))
+           {
+             celldataTr[ihit]  = celltrack[irow][icol];
+             celldataPid[ihit] = cellpid[irow][icol];
+             celldataAdc[ihit] = (Float_t) celladc[irow][icol];
+           }
+         else
+           {
+             celldataTr[ihit]  = -1;
+             celldataPid[ihit] = -1;
+             celldataAdc[ihit] = -1;
+           }
+
        }
 
       pmdcl = new AliPMDcluster(idet, ismn, clusdata, celldataX, celldataY,
@@ -1046,6 +1067,54 @@ Double_t AliPMDClusteringV2::Distance(Double_t x1, Double_t y1,
                                      Double_t x2, Double_t y2)
 {
   return TMath::Sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
+}
+// ------------------------------------------------------------------------ //
+void AliPMDClusteringV2::CalculateIsoCell(Int_t idet, Int_t ismn, Double_t celladc[][96], TObjArray *pmdisocell)
+{
+  // Does isolated cell search for offline calibration
+
+  AliPMDisocell *isocell = 0;
+
+  const Int_t kMaxRow = 48;
+  const Int_t kMaxCol = 96;
+  const Int_t kCellNeighbour = 6;
+
+  Int_t id1, jd1;
+
+  Int_t neibx[6] = {1,0,-1,-1,0,1};
+  Int_t neiby[6] = {0,1,1,0,-1,-1};
+
+
+  for(Int_t irow = 0; irow < kMaxRow; irow++)
+    {
+      for(Int_t icol = 0; icol < kMaxCol; icol++)
+       {
+         if(celladc[irow][icol] > 0)
+           {
+             Int_t isocount = 0;
+             for(Int_t ii = 0; ii < kCellNeighbour; ii++)
+               {
+                 id1 = irow + neibx[ii];
+                 jd1 = icol + neiby[ii];
+                 Float_t adc = (Float_t) celladc[id1][jd1];
+                 if(adc == 0.)
+                   {
+                     isocount++;
+                     if(isocount == kCellNeighbour)
+                       {
+                         Float_t cadc = (Float_t) celladc[irow][icol];
+
+                         isocell = new AliPMDisocell(idet,ismn,irow,icol,cadc);
+                         pmdisocell->Add(isocell);
+                         
+                       }
+                   }
+               }  // neigh cell cond.
+           }
+       }
+    }
+
+
 }
 // ------------------------------------------------------------------------ //
 void AliPMDClusteringV2::SetEdepCut(Float_t decut)
index cbb4287d721d863fd42a4aa47589b83d3ff30e02..339e358ada510898b5c4c12dfcd649ba9f9dd5bb 100644 (file)
@@ -41,6 +41,7 @@ class AliPMDClusteringV2 : public AliPMDClustering
                        Double_t rcl[], Double_t rcs[], Double_t cells[],
                        TArrayI &testncl, TArrayI &testindex);
   Double_t Distance(Double_t x1, Double_t y1, Double_t x2, Double_t y2);
+  void     CalculateIsoCell(Int_t idet, Int_t ismn, Double_t celladc[][96], TObjArray *pmdisocell);
   void     SetEdepCut(Float_t decut);
   
  protected:
@@ -61,7 +62,7 @@ class AliPMDClusteringV2 : public AliPMDClustering
 
   Float_t fCutoff; // Energy(ADC) cutoff per cell before clustering
   
-  ClassDef(AliPMDClusteringV2,4) // Does clustering for PMD
+  ClassDef(AliPMDClusteringV2,5) // Does clustering for PMD
 };
 #endif