track number and pid propagated to clusters
authorbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 May 2009 15:49:30 +0000 (15:49 +0000)
committerbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 May 2009 15:49:30 +0000 (15:49 +0000)
19 files changed:
PMD/AliPMDClusterFinder.cxx
PMD/AliPMDClusterFinder.h
PMD/AliPMDClusteringV1.cxx
PMD/AliPMDClusteringV2.cxx
PMD/AliPMDEmpDiscriminator.cxx
PMD/AliPMDEmpDiscriminator.h
PMD/AliPMDclupid.cxx
PMD/AliPMDclupid.h
PMD/AliPMDcluster.cxx
PMD/AliPMDcluster.h
PMD/AliPMDrecdata.cxx [new file with mode: 0644]
PMD/AliPMDrecdata.h [new file with mode: 0644]
PMD/AliPMDrechit.cxx
PMD/AliPMDrechit.h
PMD/AliPMDtracker.cxx
PMD/AliPMDtracker.h
PMD/CMake_libPMDrec.txt
PMD/PMDrecLinkDef.h
PMD/libPMDrec.pkg

index 5a92759..603c1b8 100644 (file)
@@ -223,7 +223,6 @@ void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt)
 
       idet = det;
       ismn = smn;
-      //pmdclust->DoClust(idet,ismn,fCellADC,pmdisocell,pmdcont);
       pmdclust->DoClust(idet,ismn,fCellTrack,fCellPid,fCellADC,
                        pmdisocell,pmdcont);
 
@@ -252,8 +251,8 @@ void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt)
              Int_t celldataY = pmdcl->GetClusCellY(ihit);
              Int_t celldataTr = pmdcl->GetClusCellTrack(ihit);
              Int_t celldataPid   = pmdcl->GetClusCellPid(ihit);
-             AddRecHit(celldataX, celldataY, celldataTr, celldataPid);
-             //AddRecHit(celldataX, celldataY);
+             Float_t celldataAdc = pmdcl->GetClusCellAdc(ihit);
+             AddRecHit(celldataX, celldataY, celldataTr, celldataPid, celldataAdc);
            }
          branch2->Fill();
          ResetRechit();
@@ -371,7 +370,6 @@ void AliPMDClusterFinder::Digits2RecPoints(TTree *digitsTree,
 
          adc = adc1*gain;
 
-         //Int_t trno   = pmddigit->GetTrackNumber();
          fCellTrack[xpos][ypos] = pmddigit->GetTrackNumber();
          fCellPid[xpos][ypos] = pmddigit->GetTrackPid();
          fCellADC[xpos][ypos] = (Double_t) adc;
@@ -413,7 +411,8 @@ void AliPMDClusterFinder::Digits2RecPoints(TTree *digitsTree,
              Int_t celldataY = pmdcl->GetClusCellY(ihit);
              Int_t celldataTr = pmdcl->GetClusCellTrack(ihit);
              Int_t celldataPid   = pmdcl->GetClusCellPid(ihit);
-             AddRecHit(celldataX, celldataY, celldataTr, celldataPid);
+             Float_t celldataAdc = pmdcl->GetClusCellAdc(ihit);
+             AddRecHit(celldataX, celldataY, celldataTr, celldataPid, celldataAdc);
            }
          branch2->Fill();
          ResetRechit();
@@ -659,7 +658,6 @@ void AliPMDClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
          if (totAdcMod <= 0) continue;
 
 
-         //pmdclust->DoClust(idet,ismn,fCellADC,pmdisocell,pmdcont);
          pmdclust->DoClust(idet,ismn,fCellTrack,fCellPid,fCellADC,
                            pmdisocell,pmdcont);
 
@@ -688,8 +686,8 @@ void AliPMDClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
                  Int_t celldataY = pmdcl->GetClusCellY(ihit);
                  Int_t celldataTr = pmdcl->GetClusCellTrack(ihit);
                  Int_t celldataPid   = pmdcl->GetClusCellPid(ihit);
-                 AddRecHit(celldataX, celldataY, celldataTr, celldataPid);
-                 //AddRecHit(celldataX, celldataY);
+                 Float_t celldataAdc = pmdcl->GetClusCellAdc(ihit);
+                 AddRecHit(celldataX, celldataY, celldataTr, celldataPid, celldataAdc);
                }
              branch2->Fill();
              ResetRechit();
@@ -754,7 +752,7 @@ void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt, AliRawReader *rawReader)
 
   TObjArray pmdddlcont;
 
-  //AliPMDcluster *pmdcl  = 0x0;
+  AliPMDcluster *pmdcl  = 0x0;
   AliPMDisocell *pmdiso  = 0x0;
 
 
@@ -941,7 +939,6 @@ void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt, AliRawReader *rawReader)
              idet = 1;
            }
 
-         //pmdclust->DoClust(idet,ismn,fCellADC,pmdisocell,pmdcont);
          pmdclust->DoClust(idet,ismn,fCellTrack,fCellPid,fCellADC,
                            pmdisocell,pmdcont);
 
@@ -951,8 +948,7 @@ void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt, AliRawReader *rawReader)
 
          for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
            {
-             AliPMDcluster *pmdcl = 
-               (AliPMDcluster*)pmdcont->UncheckedAt(ient1);
+             pmdcl       = (AliPMDcluster*)pmdcont->UncheckedAt(ient1);
              idet        = pmdcl->GetDetector();
              ismn        = pmdcl->GetSMN();
              clusdata[0] = pmdcl->GetClusX();
@@ -971,8 +967,8 @@ void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt, AliRawReader *rawReader)
                  Int_t celldataY = pmdcl->GetClusCellY(ihit);
                  Int_t celldataTr = pmdcl->GetClusCellTrack(ihit);
                  Int_t celldataPid = pmdcl->GetClusCellPid(ihit);
-                 AddRecHit(celldataX, celldataY, celldataTr, celldataPid);
-                 //AddRecHit(celldataX, celldataY);
+                 Float_t celldataAdc = pmdcl->GetClusCellAdc(ihit);
+                 AddRecHit(celldataX, celldataY, celldataTr, celldataPid, celldataAdc);
                }
              branch2->Fill();
              ResetRechit();
@@ -1043,13 +1039,14 @@ void AliPMDClusterFinder::AddRecPoint(Int_t idet,Int_t ismn,Float_t *clusdata)
 }
 // ------------------------------------------------------------------------- //
 void AliPMDClusterFinder::AddRecHit(Int_t celldataX,Int_t celldataY,
-                                   Int_t celldataTr, Int_t celldataPid)
+                                   Int_t celldataTr, Int_t celldataPid,
+                                   Float_t celldataAdc)
 {
   // Add associated cell hits to the Reconstructed points
   //
   TClonesArray &lrechits = *fRechits;
   AliPMDrechit *newrechit;
-  newrechit = new AliPMDrechit(celldataX, celldataY, celldataTr, celldataPid);
+  newrechit = new AliPMDrechit(celldataX, celldataY, celldataTr, celldataPid, celldataAdc);
   new(lrechits[fNhit++]) AliPMDrechit(newrechit);
   delete newrechit;
 }
index 153efb3..1184c35 100644 (file)
@@ -39,7 +39,7 @@ class AliPMDClusterFinder : public TObject
   void SetCellEdepCut(Float_t ecut);
   void AddRecPoint(Int_t idet, Int_t ismn, Float_t * clusdata);
   void AddRecHit(Int_t celldataX, Int_t celldataY, Int_t celldataTr,
-                Int_t celldataPid);
+                Int_t celldataPid, Float_t celldataAdc);
   void ResetCellADC();
   void ResetRecpoint();
   void ResetRechit();
@@ -76,7 +76,7 @@ class AliPMDClusterFinder : public TObject
   Int_t    fCellTrack[fgkRow][fgkCol]; // Array containing individual cell tr
   Int_t    fCellPid[fgkRow][fgkCol]; // Array containing individual cell pid
 
-  ClassDef(AliPMDClusterFinder,13) // To run PMD clustering
+  ClassDef(AliPMDClusterFinder,14) // To run PMD clustering
 };
 #endif
 
index b96eb60..09aedb9 100644 (file)
@@ -113,6 +113,7 @@ void AliPMDClusteringV1::DoClust(Int_t idet, Int_t ismn,
   Int_t    i,  j, nmx1, incr, id, jd;
   Int_t    celldataX[kNmaxCell], celldataY[kNmaxCell];
   Int_t    celldataTr[kNmaxCell], celldataPid[kNmaxCell];
+  Float_t  celldataAdc[kNmaxCell];
   Float_t  clusdata[6];
   Double_t cutoff, ave;
   Double_t edepcell[kNMX];
@@ -273,16 +274,18 @@ void AliPMDClusteringV1::DoClust(Int_t idet, Int_t ismn,
            {
              celldataTr[ihit]  = celltrack[irow][icol];
              celldataPid[ihit] = cellpid[irow][icol];
+             celldataAdc[ihit] = (Float_t) celladc[irow][icol];
            }
          else
            {
-             celldataTr[ihit] = -1;
+             celldataTr[ihit]  = -1;
              celldataPid[ihit] = -1;
+             celldataAdc[ihit] = -1;
            }
        }
 
       pmdcl = new AliPMDcluster(idet, ismn, clusdata, celldataX, celldataY,
-                               celldataTr, celldataPid);
+                               celldataTr, celldataPid, celldataAdc);
       pmdcont->Add(pmdcl);
     }
   
index 7191a53..1a2b72f 100644 (file)
@@ -108,6 +108,7 @@ void AliPMDClusteringV2::DoClust(Int_t idet, Int_t ismn,
   Int_t    ndimYr = 0;
   Int_t    celldataX[kNmaxCell], celldataY[kNmaxCell];
   Int_t    celldataTr[kNmaxCell], celldataPid[kNmaxCell];
+  Float_t  celldataAdc[kNmaxCell];
   Float_t  clusdata[6];  
   Double_t cutoff, ave;
   Double_t edepcell[kNMX];
@@ -237,13 +238,14 @@ 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;
+         celldataY[ihit]   = (Int_t) (cellY + 0.5);
+         celldataTr[ihit]  = -1;
          celldataPid[ihit] = -1;
+         celldataAdc[ihit] = -1;
        }
 
       pmdcl = new AliPMDcluster(idet, ismn, clusdata, celldataX, celldataY,
-                               celldataTr, celldataPid);
+                               celldataTr, celldataPid, celldataAdc);
       pmdcont->Add(pmdcl);
     }
   fPMDclucont->Delete();
index 43dd22e..6b43c12 100644 (file)
@@ -31,7 +31,7 @@
 #include <TParticle.h>
 
 #include "AliLog.h"
-#include "AliPMDrecpoint1.h"
+#include "AliPMDrecdata.h"
 #include "AliPMDclupid.h"
 #include "AliPMDDiscriminator.h"
 #include "AliPMDEmpDiscriminator.h"
@@ -57,195 +57,48 @@ void AliPMDEmpDiscriminator::Discrimination(TObjArray *pmdcontin, TObjArray *pmd
   // Does Photon/Hadron discrimination
   // matching the clusters of CPV and PREshower plane
   //
-  const  Int_t kumperdet = 24;
-  static Int_t neibx[6]={1,0,-1,-1,0,1}, neiby[6]={0,1,1,0,-1,-1}; 
-  Int_t   det,smn;
-  Int_t   iprecount[24], icpvcount[24];
-  Float_t xpos,ypos;
-  Float_t adc, ncell, rad;
-  Float_t clusdata[6];
-
-  for(Int_t i = 0; i < kumperdet; i++)
-    {
-      iprecount[i] = 0;
-      icpvcount[i] = 0;
-    }
-  AliPMDrecpoint1  *pmdcl    = 0;
+
+  Int_t   det,smn, trno, trpid, mstatus;
+  Float_t clusdata[7];
+
+  AliPMDrecdata  *pmdcl    = 0;
   AliPMDclupid   *pmdclout = 0;
 
   Int_t nentries1 = pmdcontin->GetEntries();
 
   AliDebug(1,Form("Number of total clusters from CPV PRE = %d",nentries1));
-  for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
-    {
-      pmdcl = (AliPMDrecpoint1*)pmdcontin->UncheckedAt(ient1);
-
-      det   = pmdcl->GetDetector();
-      smn   = pmdcl->GetSMNumber();
-      if(det == 0) iprecount[smn]++;
-      if(det == 1) icpvcount[smn]++;
-    } // Entries of TObjArray loop
 
-  Int_t   idet, ismn;
-  Float_t edepcpv[48][96];
-  Int_t   statuscpv[48][96];
 
-  for(Int_t i = 0; i < kumperdet; i++) // unit module
+  for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
     {
-      // Initialisation of the ADC of CPV (1UM)
-      for (Int_t ix = 0; ix < 48;ix++)
-       {
-         for (Int_t iy = 0; iy < 96;iy++)
-           {
-             edepcpv[ix][iy]   = 0.;
-             statuscpv[ix][iy] = 0;
-           }
-       }
-      Int_t precounter   = iprecount[i];
-      Int_t cpvcounter   = icpvcount[i];
+      pmdcl = (AliPMDrecdata*)pmdcontin->UncheckedAt(ient1);
       
-      Float_t *xpadpre   = new Float_t[precounter];
-      Float_t *ypadpre   = new Float_t[precounter];
-      Float_t *adcpre    = new Float_t[precounter];
-      Float_t *ncellpre  = new Float_t[precounter];
-      Float_t *radpre    = new Float_t[precounter];
-      Int_t   *sortcoord = new Int_t[precounter];
-      Int_t   *clupidpre = new Int_t[precounter];
-
-      Float_t *xpadcpv   = new Float_t[cpvcounter];
-      Float_t *ypadcpv   = new Float_t[cpvcounter];
-      Float_t *adccpv    = new Float_t[cpvcounter];
-      Float_t *ncellcpv  = new Float_t[cpvcounter];
-      Float_t *radcpv    = new Float_t[cpvcounter];
-
-      Int_t ii = 0;
-      Int_t ij = 0;
-      for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
+      det         = pmdcl->GetDetector();
+      smn         = pmdcl->GetSMNumber();
+      trno        = pmdcl->GetClusTrackNo();
+      trpid       = pmdcl->GetClusTrackPid();
+      clusdata[0] = pmdcl->GetClusX();
+      clusdata[1] = pmdcl->GetClusY();
+      clusdata[2] = pmdcl->GetClusADC();
+      clusdata[3] = pmdcl->GetClusCells();
+      clusdata[4] = pmdcl->GetClusSigmaX();
+      clusdata[5] = pmdcl->GetClusSigmaY();
+
+      if (det == 0 && clusdata[2] > 300.)
        {
-         pmdcl = (AliPMDrecpoint1*)pmdcontin->UncheckedAt(ient1);
-         
-         det   = pmdcl->GetDetector();
-         smn   = pmdcl->GetSMNumber();
-         xpos  = pmdcl->GetClusX();
-         ypos  = pmdcl->GetClusY();
-         adc   = pmdcl->GetClusADC();
-         ncell = pmdcl->GetClusCells();
-         rad   = pmdcl->GetClusSigmaX();
-
-         if(det == 0 && smn == i)
-           {
-             xpadpre[ii]  = xpos;
-             ypadpre[ii]  = ypos;
-             adcpre[ii]   = adc;
-             ncellpre[ii] = ncell;
-             radpre[ii]   = rad;
-             ii++;
-           }
-         if(det == 1 && smn == i)
-           {
-             Int_t ix = (Int_t) (xpos+0.5);
-             Int_t iy = (Int_t) (ypos+0.5);
-             if(ix > 47) ix = 47;
-             if(iy > 95) iy = 95;
-             edepcpv[ix][iy] = adc;
-             xpadcpv[ij]  = xpos;
-             ypadcpv[ij]  = ypos;
-             adccpv[ij]   = adc;
-             ncellcpv[ij] = ncell;
-             radcpv[ij]   = rad;
-             ij++;
-           }
-       } // Entries of TObjArray loop
-      // sorts from lowest ADC to highest ADC
-      // and returns the coordinates
-      Bool_t jsort = false;
-      TMath::Sort(precounter,adcpre,sortcoord,jsort);
-
-      Int_t jjsort = 0;
-      for(Int_t jj=0; jj<precounter; jj++)
-       {
-         // PRE information
-         // PIDs for PRE clusters are 0(photon) and 1(hadron)
-
-         jjsort = sortcoord[jj];
-
-         Int_t ix = (Int_t) (xpadpre[jjsort]+0.5);
-         Int_t iy = (Int_t) (ypadpre[jjsort]+0.5);
-         if(ix > 47) ix = 47;
-         if(iy > 95) iy = 95;
-
-         for(Int_t jk=0; jk<6; jk++)
-           {
-             Int_t jd1 = ix + neibx[jk]; 
-             Int_t jd2 = iy + neiby[jk];
-             if(jd1 <0 ) jd1 = 0;
-             if(jd1 >47) jd1 = 47;
-             if(jd2 <0 ) jd2 = 0;
-             if(jd2 >47) jd2 = 47;
-             if(edepcpv[jd1][jd2] > 0.0 && statuscpv[jd1][jd2] == 0)
-               {
-                 statuscpv[jd1][jd2] = 1;
-                 clupidpre[jjsort]   = 1;
-                 break;
-               }
-           }
-
-         idet        = 0;
-         ismn        = i;
-         clusdata[0] = xpadpre[jjsort];
-         clusdata[1] = ypadpre[jjsort];
-         clusdata[2] = adcpre[jjsort];
-         clusdata[3] = ncellpre[jjsort];
-         clusdata[4] = radpre[jjsort];
-         //PH    clusdata[5] = (Float_t) clupidpre[jjsort];
-
-         // Temporary the cluster PID is set to 1 if the
-         // adc > 3MIP units which will be changed later on.
-
-         if (adcpre[jjsort] > 300.)
-           {
-             clusdata[5] = 1.0;
-           }
-         else
-           {
-             clusdata[5] = 0.0;
-           }
-         pmdclout = new AliPMDclupid(idet,ismn,clusdata);
-         pmdcontout->Add(pmdclout);
-       } // jj loop
-
-      for(Int_t jj=0; jj<cpvcounter; jj++)
+         clusdata[6] = 1;     // photon
+       }
+      else
        {
-         // CPV information
-         // PID for CPV clusters is 1
-
-         idet        = 1;
-         ismn        = i;
-         clusdata[0] = xpadcpv[jj];
-         clusdata[1] = ypadcpv[jj];
-         clusdata[2] = adccpv[jj];
-         clusdata[3] = ncellcpv[jj];
-         clusdata[4] = radcpv[jj];
-         clusdata[5] = 0.;
-
-         pmdclout = new AliPMDclupid(idet,ismn,clusdata);
-         pmdcontout->Add(pmdclout);
+         clusdata[6] = 8;     // hadron
        }
 
-      // delete all the pointers
-      delete [] xpadpre;
-      delete [] ypadpre;
-      delete [] adcpre;
-      delete [] ncellpre;
-      delete [] radpre;
-      delete [] sortcoord;
-      delete [] clupidpre;
-      delete [] xpadcpv;
-      delete [] ypadcpv;
-      delete [] adccpv;
-      delete [] ncellcpv;
-      delete [] radcpv;
-    } // i loop
+      mstatus = 0;             // at this moment matching is not done
+
+      pmdclout = new AliPMDclupid(det,smn,trno,trpid,mstatus,clusdata);
+      pmdcontout->Add(pmdclout);
+      
+    } // Entries of TObjArray loop
 
 }
 // -----------------------------------------------------------------------
index a17b24d..674dd2e 100644 (file)
@@ -17,7 +17,7 @@ class TObjArray;
 class TTree;
 class TNtuple;
 
-class AliPMDrecpoint1;
+class AliPMDrecdata;
 class AliPMDclupid;
 
 class AliPMDEmpDiscriminator : public AliPMDDiscriminator
@@ -31,7 +31,7 @@ class AliPMDEmpDiscriminator : public AliPMDDiscriminator
   void Discrimination(TObjArray *pmdcontin, TObjArray *pmdcontout);
 
 
-  ClassDef(AliPMDEmpDiscriminator,1) // To run PMD discrimination
+  ClassDef(AliPMDEmpDiscriminator,2) // To run PMD discrimination
 };
 #endif
 
index b30f6e1..3962790 100644 (file)
@@ -29,21 +29,28 @@ ClassImp(AliPMDclupid)
 
 AliPMDclupid::AliPMDclupid():
   fDet(0),
-  fSMN(0)
+  fSMN(0),
+  fTrNo(0),
+  fTrPid(0),
+  fMstatus(0)
 {
   // Default constructor
-  for (Int_t i = 0; i < 6; i++)
+  for (Int_t i = 0; i < 7; i++)
     {
       fClusData[i] = 0.;
     }
 }
 // ------------------------------------------------------------------ //
-AliPMDclupid::AliPMDclupid(Int_t idet, Int_t ismn, Float_t *clusdata):
+AliPMDclupid::AliPMDclupid(Int_t idet, Int_t ismn, Int_t trno, Int_t trpid,
+                          Int_t mstat, Float_t *clusdata):
   fDet(idet),
-  fSMN(ismn)
+  fSMN(ismn),
+  fTrNo(trno),
+  fTrPid(trpid),
+  fMstatus(mstat)
 {
   // Constructor
-  for (Int_t i = 0; i < 6; i++)
+  for (Int_t i = 0; i < 7; i++)
     {
       fClusData[i] = clusdata[i];
     }
@@ -51,7 +58,10 @@ AliPMDclupid::AliPMDclupid(Int_t idet, Int_t ismn, Float_t *clusdata):
 // ------------------------------------------------------------------ //
 AliPMDclupid::AliPMDclupid(AliPMDclupid *pmdclupid):
   fDet(0),
-  fSMN(0)
+  fSMN(0),
+  fTrNo(0),
+  fTrPid(0),
+  fMstatus(0)
 {
   *this = *pmdclupid;
 }
@@ -60,10 +70,13 @@ AliPMDclupid::AliPMDclupid(AliPMDclupid *pmdclupid):
 AliPMDclupid::AliPMDclupid(const AliPMDclupid &pmdclupid):
   TObject(pmdclupid),
   fDet(pmdclupid.fDet),
-  fSMN(pmdclupid.fSMN)
+  fSMN(pmdclupid.fSMN),
+  fTrNo(pmdclupid.fTrNo),
+  fTrPid(pmdclupid.fTrPid),
+  fMstatus(pmdclupid.fMstatus)
 {
   //Copy Constructor 
-  for(Int_t i=0; i<6; i++)
+  for(Int_t i=0; i<7; i++)
     {
       fClusData[i] = pmdclupid.fClusData[i];
     }
@@ -74,9 +87,12 @@ AliPMDclupid & AliPMDclupid::operator=(const AliPMDclupid &pmdclupid)
   // Assignment operator 
   if(this != &pmdclupid)
     {
-      fDet = pmdclupid.fDet;
-      fSMN = pmdclupid.fSMN;
-      for(Int_t i=0; i<6; i++)
+      fDet     = pmdclupid.fDet;
+      fSMN     = pmdclupid.fSMN;
+      fTrNo    = pmdclupid.fTrNo;
+      fTrPid   = pmdclupid.fTrPid;
+      fMstatus = pmdclupid.fMstatus;
+      for(Int_t i=0; i<7; i++)
        {
          fClusData[i] = pmdclupid.fClusData[i];
        }
@@ -99,6 +115,21 @@ Int_t AliPMDclupid::GetSMN() const
   return fSMN;
 }
 // ------------------------------------------------------------------ //
+Int_t AliPMDclupid::GetClusTrackNo() const
+{
+  return fTrNo;
+}
+// ------------------------------------------------------------------ //
+Int_t AliPMDclupid::GetClusTrackPid() const
+{
+  return fTrPid;
+}
+// ------------------------------------------------------------------ //
+Int_t AliPMDclupid::GetClusMatching() const
+{
+  return fMstatus;
+}
+// ------------------------------------------------------------------ //
 Float_t AliPMDclupid::GetClusX() const
 {
   return fClusData[0];
@@ -119,14 +150,19 @@ Float_t AliPMDclupid::GetClusCells() const
   return fClusData[3];
 }
 // ------------------------------------------------------------------ //
-Float_t AliPMDclupid::GetClusRadius() const
+Float_t AliPMDclupid::GetClusSigmaX() const
 {
   return fClusData[4];
 }
 // ------------------------------------------------------------------ //
-Float_t AliPMDclupid::GetClusPID() const
+Float_t AliPMDclupid::GetClusSigmaY() const
 {
   return fClusData[5];
 }
+// ------------------------------------------------------------------ //
+Float_t AliPMDclupid::GetClusPID() const
+{
+  return fClusData[6];
+}
 
 
index 30abc4b..a66243f 100644 (file)
@@ -20,7 +20,8 @@ class AliPMDclupid : public TObject
 {
  public:
   AliPMDclupid();
-  AliPMDclupid(Int_t idet, Int_t ismn, Float_t *clusdata);
+  AliPMDclupid(Int_t idet, Int_t ismn, Int_t trno, Int_t trpid,
+              Int_t mstat,Float_t *clusdata);
   AliPMDclupid(AliPMDclupid *pmdclupid);
   AliPMDclupid (const AliPMDclupid &pmdclupid);  // copy constructor
   AliPMDclupid &operator=(const AliPMDclupid &pmdclupid); // assignment op
@@ -29,26 +30,35 @@ class AliPMDclupid : public TObject
 
   Int_t   GetDetector() const;
   Int_t   GetSMN() const;
+  Int_t   GetClusTrackNo() const;
+  Int_t   GetClusTrackPid() const;
+  Int_t   GetClusMatching() const;
   Float_t GetClusX() const;
   Float_t GetClusY() const;
   Float_t GetClusADC() const;
   Float_t GetClusCells() const;
-  Float_t GetClusRadius() const;
+  Float_t GetClusSigmaX() const;
+  Float_t GetClusSigmaY() const;
   Float_t GetClusPID() const;
 
  protected:
 
   Int_t   fDet;          // Detector No (0:PRE, 1:CPV)
   Int_t   fSMN;          // Serial Module No.
-  Float_t fClusData[6];  // Array containing clupid information
+  Int_t   fTrNo;         // Track number from simulation
+  Int_t   fTrPid;        // Pid from simulation
+  Int_t   fMstatus;      // matching status
+  Float_t fClusData[7];  // Array containing clupid information
+
   /*
     fDet         : Det (0:PRE, 1:CPV), fSMN         : SerialModuleNo
     fClusData[0] : Cluster x         , fClusData[1] : Cluster y
     fClusData[2] : Cluster adc       , fClusData[3] : Cluster Cells
-    fClusData[4] : Cluster radius    , fClusData[5] : Cluster pid
+    fClusData[4] : Cluster sigmax    , fClusData[5] : Cluster sigmay
+    fClusData[6] : Cluster pid
   */
   
-  ClassDef(AliPMDclupid,2) // Keep Cluster information
+  ClassDef(AliPMDclupid,3) // Keep Cluster information
 };
 
 #endif
index decf8b6..bb3dcb3 100644 (file)
@@ -41,13 +41,15 @@ AliPMDcluster::AliPMDcluster():
       fClusCellDataY[i] = 0;
       fClusCellTrack[i] = -1;
       fClusCellPid[i]   = -1;
+      fClusCellAdc[i]   = 0;
     }
 
 }
 // --------------------------------------------------------------------- //
 AliPMDcluster::AliPMDcluster(Int_t idet, Int_t ismn, Float_t *clusdata,
                             Int_t *celldataX, Int_t *celldataY,
-                            Int_t *celltrack, Int_t *cellpid):
+                            Int_t *celltrack, Int_t *cellpid,
+                            Float_t *celladc):
   fDet(idet),
   fSMN(ismn)
 {
@@ -62,6 +64,7 @@ AliPMDcluster::AliPMDcluster(Int_t idet, Int_t ismn, Float_t *clusdata,
       fClusCellDataY[i] = celldataY[i];
       fClusCellTrack[i] = celltrack[i];
       fClusCellPid[i]   = cellpid[i];
+      fClusCellAdc[i]   = celladc[i];
     }
 
 }
@@ -90,6 +93,7 @@ AliPMDcluster::AliPMDcluster(const AliPMDcluster &pmdcluster):
       this->fClusCellDataY[i] = pmdcluster.fClusCellDataY[i];
       this->fClusCellTrack[i] = pmdcluster.fClusCellTrack[i];
       this->fClusCellPid[i]   = pmdcluster.fClusCellPid[i];
+      this->fClusCellAdc[i]   = pmdcluster.fClusCellAdc[i];
     }
 }
 // --------------------------------------------------------------------- //
@@ -111,6 +115,7 @@ AliPMDcluster & AliPMDcluster::operator=(const AliPMDcluster &pmdcluster)
          this->fClusCellDataY[i] = pmdcluster.fClusCellDataY[i];
          this->fClusCellTrack[i] = pmdcluster.fClusCellTrack[i];
          this->fClusCellPid[i]   = pmdcluster.fClusCellPid[i];
+         this->fClusCellAdc[i]   = pmdcluster.fClusCellAdc[i];
        }
     }
   return *this;
@@ -183,3 +188,8 @@ Int_t AliPMDcluster::GetClusCellPid(Int_t i) const
   return fClusCellPid[i];
 }
 // --------------------------------------------------------------------- //
+Float_t AliPMDcluster::GetClusCellAdc(Int_t i) const
+{
+  return fClusCellAdc[i];
+}
+// --------------------------------------------------------------------- //
index 763b81a..0ef9069 100644 (file)
@@ -21,7 +21,7 @@ class AliPMDcluster : public TObject
   AliPMDcluster();
   AliPMDcluster(Int_t idet, Int_t ismn, Float_t *clusdata,
                Int_t *celldataX, Int_t *celldataY,
-               Int_t *celltrack, Int_t *cellpid);
+               Int_t *celltrack, Int_t *cellpid, Float_t *celladc);
   AliPMDcluster(AliPMDcluster *pmdcluster);
   AliPMDcluster (const AliPMDcluster &pmdcluster);  // copy constructor
   AliPMDcluster &operator=(const AliPMDcluster &pmdcluster); // assignment op
@@ -40,6 +40,7 @@ class AliPMDcluster : public TObject
   Int_t   GetClusCellY(Int_t i) const;
   Int_t   GetClusCellTrack(Int_t i) const;
   Int_t   GetClusCellPid(Int_t i) const;
+  Float_t GetClusCellAdc(Int_t i) const;
 
  protected:
 
@@ -49,7 +50,7 @@ class AliPMDcluster : public TObject
   Int_t   fClusCellDataY[19]; // Array containing cell Y
   Int_t   fClusCellTrack[19]; // Array containing cell track no
   Int_t   fClusCellPid[19];   // Array containing cell pid
-
+  Float_t fClusCellAdc[19];   // Array containing cell adc
   Float_t fClusData[6];       // Array containing cluster information
 
   /*
@@ -59,7 +60,7 @@ class AliPMDcluster : public TObject
     fClusData[4] : Cluster SigmaX    , fClusData[5] : Cluster SigmaY
   */
   
-  ClassDef(AliPMDcluster,5) // Keep Cluster information
+  ClassDef(AliPMDcluster,6) // Keep Cluster information
 };
 
 #endif
diff --git a/PMD/AliPMDrecdata.cxx b/PMD/AliPMDrecdata.cxx
new file mode 100644 (file)
index 0000000..bb80d56
--- /dev/null
@@ -0,0 +1,153 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+//-----------------------------------------------------//
+//                                                     //
+//                                                     //
+//  Date   : May 27 2009                               //
+//                                                     //
+//                                                     //
+//-----------------------------------------------------//
+#include "Riostream.h"
+#include "Rtypes.h"
+#include "AliPMDrecdata.h"
+#include <stdio.h>
+
+ClassImp(AliPMDrecdata)
+
+AliPMDrecdata::AliPMDrecdata():
+  fDet(0),
+  fSMN(0),
+  fTrackNo(0),
+  fTrackPid(0)
+{
+  // Default constructor
+  for (Int_t i = 0; i < 6; i++)
+    {
+      fClusData[i] = 0.;
+    }
+}
+// ------------------------------------------------------------------------- //
+AliPMDrecdata::AliPMDrecdata(Int_t idet, Int_t ismn, Int_t trno,
+                            Int_t trpid, Float_t *clusdata):
+  fDet(idet),
+  fSMN(ismn),
+  fTrackNo(trno),
+  fTrackPid(trpid)
+{
+  // Constructor
+  for (Int_t i = 0; i < 6; i++)
+    {
+      fClusData[i] = clusdata[i];
+    }
+}
+// ------------------------------------------------------------------------- //
+AliPMDrecdata::AliPMDrecdata(AliPMDrecdata *pmdrecpoint):
+  fDet(0),
+  fSMN(0),
+  fTrackNo(0),
+  fTrackPid(0)
+{
+  *this = *pmdrecpoint;
+}
+
+// ------------------------------------------------------------------------- //
+AliPMDrecdata::AliPMDrecdata(const AliPMDrecdata &pmdrecpoint):
+  TObject(pmdrecpoint),
+  fDet(pmdrecpoint.fDet),
+  fSMN(pmdrecpoint.fSMN),
+  fTrackNo(pmdrecpoint.fTrackNo),
+  fTrackPid(pmdrecpoint.fTrackPid)
+{
+  //Copy Constructor 
+  for(Int_t i=0; i<6; i++)
+    {
+      fClusData[i] = pmdrecpoint.fClusData[i];
+    }
+}
+// ------------------------------------------------------------------------- //
+AliPMDrecdata & AliPMDrecdata::operator=(const AliPMDrecdata &pmdrecpoint)
+{
+  // Assignment operator 
+  if(this != &pmdrecpoint)
+    {
+      fDet      = pmdrecpoint.fDet;
+      fSMN      = pmdrecpoint.fSMN;
+      fTrackNo  = pmdrecpoint.fTrackNo;
+      fTrackPid = pmdrecpoint.fTrackPid;
+      for(Int_t i=0; i<6; i++)
+       {
+         fClusData[i] = pmdrecpoint.fClusData[i];
+       }
+    }
+  return *this;
+}
+// ------------------------------------------------------------------------- //
+AliPMDrecdata::~AliPMDrecdata()
+{
+  // Default destructor
+}
+// ------------------------------------------------------------------------- //
+Int_t AliPMDrecdata::GetDetector() const
+{
+  return fDet;
+}
+// ------------------------------------------------------------------------- //
+Int_t AliPMDrecdata::GetSMNumber() const
+{
+  return fSMN;
+}
+// ------------------------------------------------------------------------- //
+Int_t AliPMDrecdata::GetClusTrackNo() const
+{
+  return fTrackNo;
+}
+// ------------------------------------------------------------------------- //
+Int_t AliPMDrecdata::GetClusTrackPid() const
+{
+  return fTrackPid;
+}
+// ------------------------------------------------------------------------- //
+Float_t AliPMDrecdata::GetClusX() const
+{
+  return fClusData[0];
+}
+// ------------------------------------------------------------------------- //
+Float_t AliPMDrecdata::GetClusY() const
+{
+  return fClusData[1];
+}
+// ------------------------------------------------------------------------- //
+Float_t AliPMDrecdata::GetClusADC() const
+{
+  return fClusData[2];
+}
+// ------------------------------------------------------------------------- //
+Float_t AliPMDrecdata::GetClusCells() const
+{
+  return fClusData[3];
+}
+// ------------------------------------------------------------------------- //
+Float_t AliPMDrecdata::GetClusSigmaX() const
+{
+  return fClusData[4];
+}
+// ------------------------------------------------------------------------- //
+Float_t AliPMDrecdata::GetClusSigmaY() const
+{
+  return fClusData[5];
+}
+// ------------------------------------------------------------------------- //
+
+
diff --git a/PMD/AliPMDrecdata.h b/PMD/AliPMDrecdata.h
new file mode 100644 (file)
index 0000000..960b3a2
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef ALIPMDRECDATA_H
+#define ALIPMDRECDATA_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+//-----------------------------------------------------//
+//                                                     //
+//                                                     //
+//  Date   : May 27, 2009                              //
+//                                                     //
+//  Store reconstructed points, track no and trackpid  //
+//  corresponding to the cluster for PMD               //
+//                                                     //
+//-----------------------------------------------------//
+
+#include "Rtypes.h"
+#include "TObject.h"
+class TClonesArray;
+
+class AliPMDrecdata : public TObject
+{
+
+ public:
+  AliPMDrecdata();
+  AliPMDrecdata(Int_t idet, Int_t ismn, Int_t trno, Int_t trpid, Float_t *clusdata);
+  AliPMDrecdata(AliPMDrecdata *pmdrecdata);
+  AliPMDrecdata (const AliPMDrecdata &pmdrecdata);  // copy constructor
+  AliPMDrecdata &operator=(const AliPMDrecdata &pmdrecdata); // assignment op
+  
+  virtual ~AliPMDrecdata();
+
+  Int_t   GetDetector() const;
+  Int_t   GetSMNumber() const;
+  Int_t   GetClusTrackNo() const;
+  Int_t   GetClusTrackPid() const;
+  Float_t GetClusX() const;
+  Float_t GetClusY() const;
+  Float_t GetClusADC() const;
+  Float_t GetClusCells() const;
+  Float_t GetClusSigmaX() const;
+  Float_t GetClusSigmaY() const;
+  
+ protected:
+
+  Int_t   fDet;          // Detector No (0:PRE, 1:CPV)
+  Int_t   fSMN;          // Serial Module No.
+  Int_t   fTrackNo;      // Track number of the cluster
+  Int_t   fTrackPid;     // Cluster Track pid
+  Float_t fClusData[6];  // Array containing cluster information
+  /*
+    fDet         : Detector Number,  fSMN         : Serial Module Number
+    fClusData[0] : Cluster x      ,  fClusData[1] : Cluster y
+    fClusData[2] : Cluster adc    ,  fClusData[3] : Cluster Cells
+    fClusData[4] : Cluster SigmaX ,  fClusData[5] : Cluster SigmaY
+  */
+  
+  ClassDef(AliPMDrecdata,0) // keep reconstructed points info
+};
+
+#endif
index cf95757..09f2b78 100644 (file)
@@ -30,16 +30,19 @@ AliPMDrechit::AliPMDrechit():
   fXcell(0),
   fYcell(0),
   fTrcell(0),
-  fPidcell(0)
+  fPidcell(0),
+  fAdccell(0)
 {
   // Standard constructor
 }
 
-AliPMDrechit::AliPMDrechit(Int_t cellx, Int_t celly, Int_t celltr, Int_t cellpid):
+AliPMDrechit::AliPMDrechit(Int_t cellx, Int_t celly, Int_t celltr,
+                          Int_t cellpid, Float_t celladc):
   fXcell(cellx),
   fYcell(celly),
   fTrcell(celltr),
-  fPidcell(cellpid)
+  fPidcell(cellpid),
+  fAdccell(celladc)
 
 {
   // Constructor
@@ -48,7 +51,8 @@ AliPMDrechit::AliPMDrechit(AliPMDrechit *pmdrechit):
   fXcell(0),
   fYcell(0),
   fTrcell(0),
-  fPidcell(0)
+  fPidcell(0),
+  fAdccell(0)
 {
   *this = *pmdrechit;
 }
@@ -58,7 +62,8 @@ AliPMDrechit::AliPMDrechit(const AliPMDrechit& source):
   fXcell(source.fXcell),
   fYcell(source.fYcell),
   fTrcell(source.fTrcell),
-  fPidcell(source.fPidcell)
+  fPidcell(source.fPidcell),
+  fAdccell(source.fAdccell)
 
 {
   //Copy Constructor 
@@ -74,6 +79,7 @@ AliPMDrechit& AliPMDrechit::operator=(const AliPMDrechit& source)
       fYcell = source.fYcell;
       fTrcell = source.fTrcell;
       fPidcell = source.fPidcell;
+      fAdccell = source.fPidcell;
     }
   return *this;
 }
@@ -98,3 +104,7 @@ Int_t AliPMDrechit::GetCellPid() const
 {
   return fPidcell;
 }
+Float_t AliPMDrechit::GetCellAdc() const
+{
+  return fAdccell;
+}
index 2eac763..054f45c 100644 (file)
@@ -18,7 +18,8 @@ class AliPMDrechit : public TObject
 {
  public:
   AliPMDrechit();
-  AliPMDrechit(Int_t cellx, Int_t celly, Int_t celltr, Int_t cellpid);
+  AliPMDrechit(Int_t cellx, Int_t celly, Int_t celltr,
+              Int_t cellpid, Float_t celladc);
   AliPMDrechit(AliPMDrechit *pmdrechit);
   AliPMDrechit (const AliPMDrechit &alipmdrechit);  // copy constructor
   AliPMDrechit &operator=(const AliPMDrechit &alipmdrechit); // assignment op
@@ -29,14 +30,16 @@ class AliPMDrechit : public TObject
   Int_t   GetCellY() const;
   Int_t   GetCellTrack() const;
   Int_t   GetCellPid() const;
+  Float_t GetCellAdc() const;
   
  protected:
   Int_t   fXcell;         // x-position of the cell
   Int_t   fYcell;         // y-position of the cell
   Int_t   fTrcell;        // track no of the cell
   Int_t   fPidcell;       // track pid of the cell
+  Int_t   fAdccell;       // cell Adc
   
-  ClassDef(AliPMDrechit,3) // To keep cell hit information
+  ClassDef(AliPMDrechit,4) // To keep cell hit information
 };
 
 #endif
index 1c04d3e..6ef863d 100644 (file)
@@ -35,6 +35,8 @@
 #include "AliPMDcluster.h"
 #include "AliPMDclupid.h"
 #include "AliPMDrecpoint1.h"
+#include "AliPMDrecdata.h"
+#include "AliPMDrechit.h"
 #include "AliPMDUtility.h"
 #include "AliPMDDiscriminator.h"
 #include "AliPMDEmpDiscriminator.h"
@@ -49,6 +51,7 @@ ClassImp(AliPMDtracker)
 AliPMDtracker::AliPMDtracker():
   fTreeR(0),
   fRecpoints(new TClonesArray("AliPMDrecpoint1", 10)),
+  fRechits(new TClonesArray("AliPMDrechit", 10)),
   fPMDcontin(new TObjArray()),
   fPMDcontout(new TObjArray()),
   fPMDutil(new AliPMDUtility()),
@@ -71,6 +74,7 @@ AliPMDtracker:: AliPMDtracker(const AliPMDtracker & /* tracker */):
   TObject(/* tracker */),
   fTreeR(0),
   fRecpoints(NULL),
+  fRechits(NULL),
   fPMDcontin(NULL),
   fPMDcontout(NULL),
   fPMDutil(NULL),
@@ -104,6 +108,11 @@ AliPMDtracker::~AliPMDtracker()
     {
       fRecpoints->Clear();
     }
+  if (fRechits)
+    {
+      fRechits->Clear();
+    }
+
   if (fPMDcontin)
     {
       fPMDcontin->Delete();
@@ -135,7 +144,16 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
 
   Int_t   idet;
   Int_t   ismn;
+  Int_t   trackno, trackpid;
   Float_t clusdata[6];
+  
+  Int_t *irow;
+  Int_t *icol;
+  Int_t *itra;
+  Int_t *ipid;
+  Float_t *cadc;
+
+  AliPMDrechit *rechit = 0x0;
 
   TBranch *branch = fTreeR->GetBranch("PMDRecpoint");
   if (!branch)
@@ -144,6 +162,14 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
       return;
     }
   branch->SetAddress(&fRecpoints);  
+
+  TBranch *branch1 = fTreeR->GetBranch("PMDRechit");
+  if (!branch1)
+    {
+      AliError("PMDRechit branch not found");
+      return;
+    }
+  branch1->SetAddress(&fRechits);  
   
   Int_t   nmodules = (Int_t) branch->GetEntries();
   
@@ -154,6 +180,9 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
       Int_t nentries = fRecpoints->GetLast();
       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);
@@ -168,8 +197,38 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
          
          if (clusdata[4] != -99. && clusdata[5] != -99.)
            { 
-             fPMDclin = new AliPMDrecpoint1(idet,ismn,clusdata);
+             // extract the associated cell information
+             branch1->GetEntry(ncrhit); 
+             Int_t nenbr1 = fRechits->GetLast() + 1;
+
+             irow = new Int_t[nenbr1];
+             icol = new Int_t[nenbr1];
+             itra = new Int_t[nenbr1];
+             ipid = new Int_t[nenbr1];
+             cadc = new Float_t[nenbr1];
+
+             for (Int_t ient1 = 0; ient1 < nenbr1; ient1++)
+               {
+                 rechit = (AliPMDrechit*)fRechits->UncheckedAt(ient1);
+                 //irow[ient1] = rechit->GetCellX();
+                 //icol[ient1] = rechit->GetCellY();
+                 itra[ient1] = rechit->GetCellTrack();
+                 ipid[ient1] = rechit->GetCellPid();
+                 cadc[ient1] = rechit->GetCellAdc();
+               }
+             AssignTrPidToCluster(nenbr1, itra, ipid, cadc,
+                                  trackno, trackpid);
+
+             delete [] irow;
+             delete [] icol;
+             delete [] itra;
+             delete [] ipid;
+             delete [] cadc;
+
+             fPMDclin = new AliPMDrecdata(idet,ismn,trackno,trackpid,clusdata);
              fPMDcontin->Add(fPMDclin);
+
+             ncrhit++;
            }
        }
     }
@@ -179,9 +238,9 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
 
   const Float_t kzpos = 361.5;    // middle of the PMD
 
-  Int_t   det,smn;
+  Int_t   det,smn,trno,trpid,mstat;
   Float_t xpos,ypos;
-  Float_t adc, ncell, rad;
+  Float_t adc, ncell, radx, rady;
   Float_t xglobal = 0., yglobal = 0., zglobal = 0;
   Float_t pid;
 
@@ -195,11 +254,15 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
       
       det   = fPMDclout->GetDetector();
       smn   = fPMDclout->GetSMN();
+      trno  = fPMDclout->GetClusTrackNo();
+      trpid = fPMDclout->GetClusTrackPid();
+      mstat = fPMDclout->GetClusMatching();
       xpos  = fPMDclout->GetClusX();
       ypos  = fPMDclout->GetClusY();
       adc   = fPMDclout->GetClusADC();
       ncell = fPMDclout->GetClusCells();
-      rad   = fPMDclout->GetClusRadius();
+      radx  = fPMDclout->GetClusSigmaX();
+      rady  = fPMDclout->GetClusSigmaY();
       pid   = fPMDclout->GetClusPID();
       
       //
@@ -247,6 +310,76 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
 
 }
 //--------------------------------------------------------------------//
+void AliPMDtracker::AssignTrPidToCluster(Int_t nentry, Int_t *itra,
+                                        Int_t *ipid, Float_t *cadc,
+                                        Int_t &trackno, Int_t &trackpid)
+{
+  // assign the track number and the corresponding pid to a cluster
+  // split cluster part will be done at the time of calculating eff/pur
+
+  Int_t *phentry = new Int_t [nentry];
+  Int_t *trenergy = 0x0;
+  Int_t *sortcoord = 0x0;
+
+  Int_t ngtrack = 0;
+  for (Int_t i = 0; i < nentry; i++)
+    {
+      phentry[i] = -1;
+      if (ipid[i] == 22)
+       {
+         phentry[ngtrack] = i;
+         ngtrack++;
+       }
+    }
+
+  if (ngtrack == 0)
+    {
+      // hadron track
+      // no need of track number, set to -1
+      trackpid = 8;
+      trackno  = -1;
+    }
+  else if (ngtrack == 1)
+    {
+      // only one photon track
+      // track number set to photon track
+      trackpid = 1;
+      trackno  = itra[phentry[0]];
+    }
+  else if (ngtrack > 1)
+    {
+      // more than one photon track
+
+      trenergy  = new Int_t [ngtrack];
+      sortcoord = new Int_t [ngtrack];
+      for (Int_t i = 0; i < ngtrack; i++)
+       {
+         trenergy[i] = 0.;
+         for (Int_t j = 0; j < nentry; j++)
+           {
+             if (ipid[j] == 22 && itra[j] == itra[phentry[i]])
+               {
+                 trenergy[i] += cadc[j];
+               }
+           }
+       }
+
+      Bool_t jsort = true;
+      TMath::Sort(ngtrack,trenergy,sortcoord,jsort);
+
+      Int_t gtr = sortcoord[0];   
+      trackno  = itra[phentry[gtr]];   // highest adc track
+      trackpid = 1;
+
+      delete [] trenergy;
+      delete [] sortcoord;
+
+    }   // end of ngtrack > 1
+
+
+
+}
+//--------------------------------------------------------------------//
 void AliPMDtracker::SetVertex(Double_t vtx[3], Double_t evtx[3])
 {
   fXvertex = vtx[0];
index b666d66..945f347 100644 (file)
@@ -18,6 +18,8 @@ class TTree;
 class AliPMDcluster;
 class AliPMDclupid;
 class AliPMDrecpoint1;
+class AliPMDrecdata;
+class AliPMDrechit;
 class AliPMDUtility;
 class AliPMDDiscriminator;
 
@@ -36,6 +38,9 @@ class AliPMDtracker:public TObject
 
   void LoadClusters(TTree *treein);
   void Clusters2Tracks(AliESDEvent *event);
+  void AssignTrPidToCluster(Int_t nentry, Int_t *itra, Int_t *ipid,
+                           Float_t *cadc, Int_t &trackno, Int_t &trackpid);
+
   void SetVertex(Double_t vtx[3], Double_t evtx[3]);
   void ResetClusters();
 
@@ -43,12 +48,13 @@ class AliPMDtracker:public TObject
 
   TTree        *fTreeR;     // Reconstructed points
   TClonesArray *fRecpoints; // List of reconstructed points
+  TClonesArray *fRechits;   // List of cells associated with a cluster
   TObjArray    *fPMDcontin;
   TObjArray    *fPMDcontout;
 
   AliPMDUtility       *fPMDutil;
   AliPMDrecpoint1     *fPMDrecpoint;
-  AliPMDrecpoint1     *fPMDclin;
+  AliPMDrecdata       *fPMDclin;
   AliPMDclupid        *fPMDclout;
 
   Double_t fXvertex;        // X-vertex position
@@ -58,7 +64,7 @@ class AliPMDtracker:public TObject
   Double_t fSigmaY;         // Y-vertex error
   Double_t fSigmaZ;         // Z-vertex error
 
-  ClassDef(AliPMDtracker,4) // To run PMD clustering
+  ClassDef(AliPMDtracker,5) // To run PMD clustering
 };
 #endif
 
index d7c5cde..77aab5f 100644 (file)
@@ -1,7 +1,7 @@
 # -*- mode: cmake -*-
 
 set(SRCS
-AliPMDRecPoint.cxx AliPMDUtility.cxx AliPMDrecpoint1.cxx AliPMDrechit.cxx AliPMDcluster.cxx AliPMDClusteringV1.cxx AliPMDClusteringV2.cxx AliPMDclupid.cxx AliPMDEmpDiscriminator.cxx AliPMDClusterFinder.cxx AliPMDtracker.cxx AliPMDReconstructor.cxx AliPMDcludata.cxx AliPMDCalibPedestal.cxx AliPMDCalibGain.cxx AliPMDQADataMakerRec.cxx AliPMDisocell.cxx
+AliPMDRecPoint.cxx AliPMDUtility.cxx AliPMDrecpoint1.cxx AliPMDrechit.cxx AliPMDcluster.cxx AliPMDClusteringV1.cxx AliPMDClusteringV2.cxx AliPMDclupid.cxx AliPMDEmpDiscriminator.cxx AliPMDClusterFinder.cxx AliPMDtracker.cxx AliPMDReconstructor.cxx AliPMDcludata.cxx AliPMDCalibPedestal.cxx AliPMDCalibGain.cxx AliPMDQADataMakerRec.cxx AliPMDisocell.cxx AliPMDrecdata.cxx
 )
 
 # fill list of header files from list of source files
index e83e9b5..c685ef3 100644 (file)
@@ -27,4 +27,5 @@
 #pragma link C++ class  AliPMDCalibGain+;
 #pragma link C++ class  AliPMDQADataMakerRec+;
 #pragma link C++ class  AliPMDisocell+;
+#pragma link C++ class  AliPMDrecdata+;
 #endif
index 268fb6d..bd4c4b0 100644 (file)
@@ -1,7 +1,7 @@
 #-*- Mode: Makefile -*-
 # $Id$
 
-SRCS:= AliPMDRecPoint.cxx AliPMDUtility.cxx AliPMDrecpoint1.cxx AliPMDrechit.cxx AliPMDcluster.cxx AliPMDClusteringV1.cxx AliPMDClusteringV2.cxx AliPMDclupid.cxx AliPMDEmpDiscriminator.cxx AliPMDClusterFinder.cxx AliPMDtracker.cxx AliPMDReconstructor.cxx AliPMDcludata.cxx AliPMDCalibPedestal.cxx AliPMDCalibGain.cxx AliPMDQADataMakerRec.cxx AliPMDisocell.cxx
+SRCS:= AliPMDRecPoint.cxx AliPMDUtility.cxx AliPMDrecpoint1.cxx AliPMDrechit.cxx AliPMDcluster.cxx AliPMDClusteringV1.cxx AliPMDClusteringV2.cxx AliPMDclupid.cxx AliPMDEmpDiscriminator.cxx AliPMDClusterFinder.cxx AliPMDtracker.cxx AliPMDReconstructor.cxx AliPMDcludata.cxx AliPMDCalibPedestal.cxx AliPMDCalibGain.cxx AliPMDQADataMakerRec.cxx AliPMDisocell.cxx AliPMDrecdata.cxx
 
 HDRS:= $(SRCS:.cxx=.h) AliPMDClustering.h AliPMDDiscriminator.h AliPMDcludata.h