In clustering code the method name is changed, Bug fixed in AliPMDrechit, Initializat...
authorbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Jul 2009 16:57:36 +0000 (16:57 +0000)
committerbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Jul 2009 16:57:36 +0000 (16:57 +0000)
PMD/AliPMDClusteringV1.cxx
PMD/AliPMDClusteringV1.h
PMD/AliPMDClusteringV2.cxx
PMD/AliPMDClusteringV2.h
PMD/AliPMDrechit.cxx
PMD/AliPMDtracker.cxx

index 09aedb9..e5eeb12 100644 (file)
@@ -124,7 +124,7 @@ void AliPMDClusteringV1::DoClust(Int_t idet, Int_t ismn,
 
   // call the isolated cell search method
 
-  CalculateIsoCell(idet, ismn, celladc, pmdisocell);
+  FindIsoCell(idet, ismn, celladc, pmdisocell);
 
   // ndimXr and ndimYr are different because of different module size
 
@@ -270,18 +270,37 @@ void AliPMDClusteringV1::DoClust(Int_t idet, Int_t ismn,
          Int_t irow = celldataX[ihit];
          Int_t icol = celldataY[ihit];
 
-         if ((irow >= 0 && irow < 48) && (icol >= 0 && icol < 96))
+         if (ismn < 12)
            {
-             celldataTr[ihit]  = celltrack[irow][icol];
-             celldataPid[ihit] = cellpid[irow][icol];
-             celldataAdc[ihit] = (Float_t) celladc[irow][icol];
+             if ((irow >= 0 && irow < 96) && (icol >= 0 && icol < 48))
+               {
+                 celldataTr[ihit]  = celltrack[icol][irow];
+                 celldataPid[ihit] = cellpid[icol][irow];
+                 celldataAdc[ihit] = (Float_t) celladc[icol][irow];
+               }
+             else
+               {
+                 celldataTr[ihit]  = -1;
+                 celldataPid[ihit] = -1;
+                 celldataAdc[ihit] = -1;
+               }
            }
-         else
+         else if (ismn >= 12 && ismn < 24)
            {
-             celldataTr[ihit]  = -1;
-             celldataPid[ihit] = -1;
-             celldataAdc[ihit] = -1;
+             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,
@@ -808,30 +827,16 @@ void AliPMDClusteringV1::RefClust(Int_t incr, Double_t edepcell[])
                                  
                  cellCount[maxweight]++;
                  
-                 for(Int_t kcl = 0; kcl <= ig; kcl++)
-                   {
-                     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.)
-                       {
-                         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);
-                       }
-                   }
+                 x2 = xc[maxweight];
+                 y2 = yc[maxweight];
+                 totaladc[maxweight]  +=  z1;
+                 ax[maxweight]        +=  x1 * z1;
+                 ay[maxweight]        +=  y1 * z1;
+                 totaladc2[maxweight] +=  pow(z1,2);
+                 ax2[maxweight]       +=  z1 * pow((x1-x2),2);
+                 ay2[maxweight]       +=  z1 * pow((y1-y2),2);
+                 ncell[maxweight]++;
+
                }
            }
          
@@ -922,7 +927,7 @@ Double_t AliPMDClusteringV1::Distance(Double_t x1, Double_t y1,
   return TMath::Sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
 }
 // ------------------------------------------------------------------------ //
-void AliPMDClusteringV1::CalculateIsoCell(Int_t idet, Int_t ismn, Double_t celladc[][96], TObjArray *pmdisocell)
+void AliPMDClusteringV1::FindIsoCell(Int_t idet, Int_t ismn, Double_t celladc[][96], TObjArray *pmdisocell)
 {
   // Does isolated cell search for offline calibration
 
index 165a3d7..01b3d98 100644 (file)
@@ -39,8 +39,8 @@ class AliPMDClusteringV1: public AliPMDClustering
   void     RefClust(Int_t incr, Double_t edepcell[]);
   Double_t Distance(Double_t x1, Double_t y1,
                    Double_t x2, Double_t y2);
-  void     CalculateIsoCell(Int_t idet, Int_t ism,
-                           Double_t celladc[][96], TObjArray *pmdisocell);
+  void     FindIsoCell(Int_t idet, Int_t ism,
+                      Double_t celladc[][96], TObjArray *pmdisocell);
   void     SetEdepCut(Float_t decut);
   
  protected:
@@ -64,6 +64,6 @@ class AliPMDClusteringV1: public AliPMDClustering
 
   Float_t  fCutoff; // Energy(ADC) cutoff per cell before clustering
 
-  ClassDef(AliPMDClusteringV1,6) // Does clustering for PMD
+  ClassDef(AliPMDClusteringV1,7) // Does clustering for PMD
 };
 #endif
index dbbb09c..dd19978 100644 (file)
@@ -117,7 +117,7 @@ void AliPMDClusteringV2::DoClust(Int_t idet, Int_t ismn,
 
   // call the isolated cell search method
 
-  CalculateIsoCell(idet, ismn, celladc, pmdisocell);
+  FindIsoCell(idet, ismn, celladc, pmdisocell);
 
 
 
@@ -1069,7 +1069,7 @@ Double_t AliPMDClusteringV2::Distance(Double_t x1, Double_t y1,
   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)
+void AliPMDClusteringV2::FindIsoCell(Int_t idet, Int_t ismn, Double_t celladc[][96], TObjArray *pmdisocell)
 {
   // Does isolated cell search for offline calibration
 
index 339e358..4cce1fb 100644 (file)
@@ -41,7 +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     FindIsoCell(Int_t idet, Int_t ismn, Double_t celladc[][96], TObjArray *pmdisocell);
   void     SetEdepCut(Float_t decut);
   
  protected:
@@ -62,7 +62,7 @@ class AliPMDClusteringV2 : public AliPMDClustering
 
   Float_t fCutoff; // Energy(ADC) cutoff per cell before clustering
   
-  ClassDef(AliPMDClusteringV2,5) // Does clustering for PMD
+  ClassDef(AliPMDClusteringV2,6) // Does clustering for PMD
 };
 #endif
     
index 09f2b78..3440748 100644 (file)
@@ -79,7 +79,7 @@ AliPMDrechit& AliPMDrechit::operator=(const AliPMDrechit& source)
       fYcell = source.fYcell;
       fTrcell = source.fTrcell;
       fPidcell = source.fPidcell;
-      fAdccell = source.fPidcell;
+      fAdccell = source.fAdccell;
     }
   return *this;
 }
index a923a37..92eff59 100644 (file)
@@ -170,7 +170,8 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
       return;
     }
   branch1->SetAddress(&fRechits);  
-  
+
+  Int_t ncrhit = 0;
   Int_t   nmodules = (Int_t) branch->GetEntries();
   
   AliDebug(1,Form("Number of modules filled in treeR = %d",nmodules));
@@ -181,8 +182,6 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
       AliDebug(2,Form("Number of clusters per modules filled in treeR = %d"
                      ,nentries));
 
-      Int_t ncrhit = 0;
-
       for(Int_t ient = 0; ient < nentries+1; ient++)
        {
          fPMDrecpoint = (AliPMDrecpoint1*)fRecpoints->UncheckedAt(ient);
@@ -195,7 +194,7 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
          clusdata[4] = fPMDrecpoint->GetClusSigmaX();
          clusdata[5] = fPMDrecpoint->GetClusSigmaY();
          
-         if (clusdata[4] != -99. && clusdata[5] != -99.)
+         if (clusdata[4] < -90. && clusdata[5] < -90.)
            { 
              // extract the associated cell information
              branch1->GetEntry(ncrhit);