]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliESDpid.cxx
AliHMPIDDigitN no longer needed
[u/mrichter/AliRoot.git] / STEER / AliESDpid.cxx
index 1b92e349a048e50f1540b05baa4f368a40e96e04..693116d2ca895b434b345809679655f4d0c9b83c 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/* $Id$ */
+
 //-----------------------------------------------------------------
 //           Implementation of the combined PID class
-//
+//           For the Event Summary Data Class
+//           produced by the reconstruction process
+//           and containing information on the particle identification
 //      Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
 //-----------------------------------------------------------------
 
@@ -28,23 +32,62 @@ ClassImp(AliESDpid)
 //_________________________________________________________________________
 Int_t AliESDpid::MakePID(AliESD *event)
 {
+  //
+  // Combine the information of various detectors
+  // to determine the Particle Identification
+  //
   Int_t ntrk=event->GetNumberOfTracks();
   for (Int_t i=0; i<ntrk; i++) {
-    Int_t ns=AliESDtrack::kSPECIES;
+    Int_t ns=AliPID::kSPECIES;
     Double_t p[10]={1.,1.,1.,1.,1.,1.,1.,1.,1.,1.};
+    const Double_t keps=1e-13;
 
     AliESDtrack *t=event->GetTrack(i);
 
     if ((t->GetStatus()&AliESDtrack::kITSpid )!=0) {
       Double_t d[10];
       t->GetITSpid(d);
-      for (Int_t j=0; j<ns; j++) p[j]*=d[j];
+      Int_t j, ok=0;
+      for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
+      if (ok) 
+      for (j=0; j<ns; j++) p[j]*=d[j];
     }
 
     if ((t->GetStatus()&AliESDtrack::kTPCpid )!=0) {
       Double_t d[10];
       t->GetTPCpid(d);
-      for (Int_t j=0; j<ns; j++) p[j]*=d[j];
+      Int_t j, ok=0;
+      for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
+      if (ok) 
+      for (j=0; j<ns; j++) p[j]*=d[j];
+    }
+
+    if ((t->GetStatus()&AliESDtrack::kTRDpid )!=0) {
+      Double_t d[10];
+      t->GetTRDpid(d);
+      Int_t j, ok=0;
+      for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
+      if (ok) 
+      for (j=0; j<ns; j++) p[j]*=d[j];
+    }
+
+    if (t->GetP()>0.7) // accept the TOF only for the high momenta
+    if ((t->GetStatus()&AliESDtrack::kTOFpid )!=0) {
+      Double_t d[10];
+      t->GetTOFpid(d);
+      Int_t j, ok=0;
+      for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
+      if (ok) 
+      for (j=0; j<ns; j++) p[j]*=d[j];
+    }
+
+    if ((t->GetStatus()&AliESDtrack::kHMPIDpid )!=0) {
+      Double_t d[10];
+      t->GetHMPIDpid(d);
+      Int_t j, ok=0;
+      for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
+      if (ok) 
+      for (j=0; j<ns; j++) p[j]*=d[j];
     }
 
     t->SetESDpid(p);