]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDtracker.cxx
single cell cluster is fixed
[u/mrichter/AliRoot.git] / PMD / AliPMDtracker.cxx
index 8e128b894fce97681c4cadbeae2144148887639d..279aaddd2f55b54ce101cffcee707b2c1d71666f 100644 (file)
@@ -40,6 +40,7 @@
 #include "AliPMDrecpoint1.h"
 #include "AliPMDUtility.h"
 #include "AliPMDDiscriminator.h"
+#include "AliPMDEmpDiscriminator.h"
 #include "AliPMDtracker.h"
 
 #include "AliESDPmdTrack.h"
@@ -53,7 +54,6 @@ AliPMDtracker::AliPMDtracker():
   fRecpoints(new TClonesArray("AliPMDrecpoint1", 1000)),
   fPMDcontin(new TObjArray()),
   fPMDcontout(new TObjArray()),
-  fPMDdiscriminator(new AliPMDDiscriminator()),
   fPMDutil(new AliPMDUtility()),
   fPMDrecpoint(0),
   fPMDclin(0),
@@ -107,7 +107,7 @@ void AliPMDtracker::Clusters2Tracks(AliESD *event)
 
   Int_t   idet;
   Int_t   ismn;
-  Float_t clusdata[5];
+  Float_t clusdata[6];
 
   TBranch *branch = fTreeR->GetBranch("PMDRecpoint");
   if (!branch)
@@ -117,11 +117,12 @@ void AliPMDtracker::Clusters2Tracks(AliESD *event)
     }
   branch->SetAddress(&fRecpoints);  
   
-  Int_t   nmodules = (Int_t) fTreeR->GetEntries();
+  Int_t   nmodules = (Int_t) branch->GetEntries();
+  
   AliDebug(1,Form("Number of modules filled in treeR = %d",nmodules));
   for (Int_t imodule = 0; imodule < nmodules; imodule++)
     {
-      fTreeR->GetEntry(imodule); 
+      branch->GetEntry(imodule); 
       Int_t nentries = fRecpoints->GetLast();
       AliDebug(2,Form("Number of clusters per modules filled in treeR = %d"
                      ,nentries));
@@ -134,25 +135,25 @@ void AliPMDtracker::Clusters2Tracks(AliESD *event)
          clusdata[1] = fPMDrecpoint->GetClusY();
          clusdata[2] = fPMDrecpoint->GetClusADC();
          clusdata[3] = fPMDrecpoint->GetClusCells();
-         clusdata[4] = fPMDrecpoint->GetClusRadius();
-         
-         fPMDclin = new AliPMDcluster(idet,ismn,clusdata);
+         clusdata[4] = fPMDrecpoint->GetClusSigmaX();
+         clusdata[5] = fPMDrecpoint->GetClusSigmaY();
+
+         fPMDclin = new AliPMDrecpoint1(idet,ismn,clusdata);
          fPMDcontin->Add(fPMDclin);
        }
     }
 
-  fPMDdiscriminator->Discrimination(fPMDcontin,fPMDcontout);
+  AliPMDDiscriminator *pmddiscriminator = new AliPMDEmpDiscriminator();
+  pmddiscriminator->Discrimination(fPMDcontin,fPMDcontout);
+
+  const Float_t kzpos = 361.5;    // middle of the PMD
 
-  const Float_t kzpos = 361.5;
-  Int_t   ism =0, ium=0;
   Int_t   det,smn;
   Float_t xpos,ypos;
-  Float_t xpad = 0, ypad = 0;
   Float_t adc, ncell, rad;
-  Float_t xglobal, yglobal;
+  Float_t xglobal = 0., yglobal = 0., zglobal = 0;
   Float_t pid;
 
-  Float_t zglobal = kzpos + (Float_t) fZvertex;
 
   Int_t nentries2 = fPMDcontout->GetEntries();
   AliDebug(1,Form("Number of clusters coming after discrimination = %d"
@@ -170,15 +171,10 @@ void AliPMDtracker::Clusters2Tracks(AliESD *event)
       rad   = fPMDclout->GetClusRadius();
       pid   = fPMDclout->GetClusPID();
       
-      //
-      // Now change the xpos and ypos to its original values
-      // for the unit modules which are earlier changed.
-      // xpad and ypad are the real positions.
       //
       /**********************************************************************
        *    det   : Detector, 0: PRE & 1:CPV                                *
-       *    smn   : Serial Module Number from which Super Module Number     *
-       *            and Unit Module Numbers are extracted                   *
+       *    smn   : Serial Module Number 0 to 23 for each plane             *
        *    xpos  : x-position of the cluster                               *
        *    ypos  : y-position of the cluster                               *
        *            THESE xpos & ypos are not the true xpos and ypos        *
@@ -186,49 +182,34 @@ void AliPMDtracker::Clusters2Tracks(AliESD *event)
        *    adc   : ADC contained in the cluster                            *
        *    ncell : Number of cells contained in the cluster                *
        *    rad   : radius of the cluster (1d fit)                          *
-       *    ism   : Supermodule number extracted from smn                   *
-       *    ium   : Unit module number extracted from smn                   *
-       *    xpad  : TRUE x-position of the cluster                          *
-       *    ypad  : TRUE y-position of the cluster                          *
        **********************************************************************/
       //
-      if(det == 0 || det == 1)
+
+      fPMDutil->RectGeomCellPos(smn,xpos,ypos,xglobal,yglobal);
+
+      if (det == 0)
+       {
+         zglobal = kzpos + 1.6; // PREshower plane
+       }
+      else if (det == 1)
        {
-         if(smn < 12)
-           {
-             ism  = smn/6;
-             ium  = smn - ism*6;
-             xpad = ypos;
-             ypad = xpos;
-           }
-         else if( smn >= 12 && smn < 24)
-           {
-             ism  = smn/6;
-             ium  = smn - ism*6;
-             xpad = xpos;
-             ypad = ypos;
-           }
+         zglobal = kzpos - 1.7; // CPV plane
        }
-     
-      fPMDutil->RectGeomCellPos(ism,ium,xpad,ypad,xglobal,yglobal);
-      fPMDutil->SetXYZ(xglobal,yglobal,zglobal);
-      fPMDutil->CalculateEtaPhi();
-      Float_t theta = fPMDutil->GetTheta();
-      Float_t phi   = fPMDutil->GetPhi();
 
       // Fill ESD
 
       AliESDPmdTrack *esdpmdtr = new  AliESDPmdTrack();
 
       esdpmdtr->SetDetector(det);
-      esdpmdtr->SetTheta(theta);
-      esdpmdtr->SetPhi(phi);
+      esdpmdtr->SetClusterX(xglobal);
+      esdpmdtr->SetClusterY(yglobal);
+      esdpmdtr->SetClusterZ(zglobal);
       esdpmdtr->SetClusterADC(adc);
+      esdpmdtr->SetClusterCells(ncell);
       esdpmdtr->SetClusterPID(pid);
 
       event->AddPmdTrack(esdpmdtr);
     }
-
 }
 //--------------------------------------------------------------------//
 void AliPMDtracker::SetVertex(Double_t vtx[3], Double_t evtx[3])