]>
Commit | Line | Data |
---|---|---|
8c6a71ab | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
16 | //----------------------------------------------------------------- | |
17 | // Implementation of the combined PID class | |
18 | // | |
19 | // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch | |
20 | //----------------------------------------------------------------- | |
21 | ||
22 | #include "AliESDpid.h" | |
23 | #include "AliESD.h" | |
24 | #include "AliESDtrack.h" | |
25 | ||
26 | ClassImp(AliESDpid) | |
27 | ||
28 | //_________________________________________________________________________ | |
29 | Int_t AliESDpid::MakePID(AliESD *event) | |
30 | { | |
31 | Int_t ntrk=event->GetNumberOfTracks(); | |
32 | for (Int_t i=0; i<ntrk; i++) { | |
33 | Int_t ns=AliESDtrack::kSPECIES; | |
34 | Double_t p[10]={1.,1.,1.,1.,1.,1.,1.,1.,1.,1.}; | |
4a78b8c5 | 35 | const Double_t eps=1e-13; |
8c6a71ab | 36 | |
37 | AliESDtrack *t=event->GetTrack(i); | |
38 | ||
39 | if ((t->GetStatus()&AliESDtrack::kITSpid )!=0) { | |
40 | Double_t d[10]; | |
41 | t->GetITSpid(d); | |
4a78b8c5 | 42 | Int_t j, ok=0; |
43 | for (j=0; j<ns; j++) if (d[j]>eps) ok=1; | |
44 | if (ok) | |
45 | for (j=0; j<ns; j++) p[j]*=d[j]; | |
8c6a71ab | 46 | } |
47 | ||
48 | if ((t->GetStatus()&AliESDtrack::kTPCpid )!=0) { | |
49 | Double_t d[10]; | |
50 | t->GetTPCpid(d); | |
4a78b8c5 | 51 | Int_t j, ok=0; |
52 | for (j=0; j<ns; j++) if (d[j]>eps) ok=1; | |
53 | if (ok) | |
54 | for (j=0; j<ns; j++) p[j]*=d[j]; | |
8c6a71ab | 55 | } |
56 | ||
c630aafd | 57 | if ((t->GetStatus()&AliESDtrack::kTRDpid )!=0) { |
58 | Double_t d[10]; | |
59 | t->GetTRDpid(d); | |
4a78b8c5 | 60 | Int_t j, ok=0; |
61 | for (j=0; j<ns; j++) if (d[j]>eps) ok=1; | |
62 | if (ok) | |
63 | for (j=0; j<ns; j++) p[j]*=d[j]; | |
c630aafd | 64 | } |
65 | ||
b4b3a4d6 | 66 | if (t->GetP()>0.7) // accept the TOF only for the high momenta |
4a78b8c5 | 67 | if ((t->GetStatus()&AliESDtrack::kTOFpid )!=0) { |
68 | Double_t d[10]; | |
69 | t->GetTOFpid(d); | |
70 | Int_t j, ok=0; | |
71 | for (j=0; j<ns; j++) if (d[j]>eps) ok=1; | |
72 | if (ok) | |
73 | for (j=0; j<ns; j++) p[j]*=d[j]; | |
74 | } | |
75 | ||
76 | if ((t->GetStatus()&AliESDtrack::kPHOSpid )!=0) { | |
77 | Double_t d[10]; | |
78 | t->GetPHOSpid(d); | |
79 | Int_t j, ok=0; | |
80 | for (j=0; j<ns; j++) if (d[j]>eps) ok=1; | |
81 | if (ok) | |
82 | for (j=0; j<ns; j++) p[j]*=d[j]; | |
83 | } | |
84 | ||
85 | if ((t->GetStatus()&AliESDtrack::kRICHpid )!=0) { | |
86 | Double_t d[10]; | |
87 | t->GetRICHpid(d); | |
88 | Int_t j, ok=0; | |
89 | for (j=0; j<ns; j++) if (d[j]>eps) ok=1; | |
90 | if (ok) | |
91 | for (j=0; j<ns; j++) p[j]*=d[j]; | |
92 | } | |
c630aafd | 93 | |
8c6a71ab | 94 | t->SetESDpid(p); |
95 | } | |
96 | return 0; | |
97 | } |