1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //-----------------------------------------------------------------
19 // Implementation of the combined PID class
20 // For the Event Summary Data Class
21 // produced by the reconstruction process
22 // and containing information on the particle identification
23 // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
24 //-----------------------------------------------------------------
26 #include "AliESDpid.h"
28 #include "AliESDtrack.h"
32 //_________________________________________________________________________
33 Int_t AliESDpid::MakePID(AliESD *event)
36 // Combine the information of various detectors
37 // to determine the Particle Identification
39 Int_t ntrk=event->GetNumberOfTracks();
40 for (Int_t i=0; i<ntrk; i++) {
41 Int_t ns=AliESDtrack::kSPECIES;
42 Double_t p[10]={1.,1.,1.,1.,1.,1.,1.,1.,1.,1.};
43 const Double_t keps=1e-13;
45 AliESDtrack *t=event->GetTrack(i);
47 if ((t->GetStatus()&AliESDtrack::kITSpid )!=0) {
51 for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
53 for (j=0; j<ns; j++) p[j]*=d[j];
56 if ((t->GetStatus()&AliESDtrack::kTPCpid )!=0) {
60 for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
62 for (j=0; j<ns; j++) p[j]*=d[j];
65 if ((t->GetStatus()&AliESDtrack::kTRDpid )!=0) {
69 for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
71 for (j=0; j<ns; j++) p[j]*=d[j];
74 if (t->GetP()>0.7) // accept the TOF only for the high momenta
75 if ((t->GetStatus()&AliESDtrack::kTOFpid )!=0) {
79 for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
81 for (j=0; j<ns; j++) p[j]*=d[j];
84 if ((t->GetStatus()&AliESDtrack::kPHOSpid )!=0) {
88 for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
90 for (j=0; j<ns; j++) p[j]*=d[j];
93 if ((t->GetStatus()&AliESDtrack::kRICHpid )!=0) {
97 for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
99 for (j=0; j<ns; j++) p[j]*=d[j];