]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliESDpid.cxx
for non-miscalibrated digits, set an ad-hoc conversion factor fAdC->fToT to have...
[u/mrichter/AliRoot.git] / STEER / AliESDpid.cxx
CommitLineData
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
4f679a16 16/* $Id$ */
17
8c6a71ab 18//-----------------------------------------------------------------
19// Implementation of the combined PID class
4f679a16 20// For the Event Summary Data Class
21// produced by the reconstruction process
22// and containing information on the particle identification
8c6a71ab 23// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
24//-----------------------------------------------------------------
25
26#include "AliESDpid.h"
27#include "AliESD.h"
28#include "AliESDtrack.h"
29
30ClassImp(AliESDpid)
31
32//_________________________________________________________________________
33Int_t AliESDpid::MakePID(AliESD *event)
34{
4f679a16 35 //
36 // Combine the information of various detectors
37 // to determine the Particle Identification
38 //
8c6a71ab 39 Int_t ntrk=event->GetNumberOfTracks();
40 for (Int_t i=0; i<ntrk; i++) {
304864ab 41 Int_t ns=AliPID::kSPECIES;
8c6a71ab 42 Double_t p[10]={1.,1.,1.,1.,1.,1.,1.,1.,1.,1.};
4f679a16 43 const Double_t keps=1e-13;
8c6a71ab 44
45 AliESDtrack *t=event->GetTrack(i);
46
47 if ((t->GetStatus()&AliESDtrack::kITSpid )!=0) {
48 Double_t d[10];
49 t->GetITSpid(d);
4a78b8c5 50 Int_t j, ok=0;
4f679a16 51 for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
4a78b8c5 52 if (ok)
53 for (j=0; j<ns; j++) p[j]*=d[j];
8c6a71ab 54 }
55
56 if ((t->GetStatus()&AliESDtrack::kTPCpid )!=0) {
57 Double_t d[10];
58 t->GetTPCpid(d);
4a78b8c5 59 Int_t j, ok=0;
4f679a16 60 for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
4a78b8c5 61 if (ok)
62 for (j=0; j<ns; j++) p[j]*=d[j];
8c6a71ab 63 }
64
c630aafd 65 if ((t->GetStatus()&AliESDtrack::kTRDpid )!=0) {
66 Double_t d[10];
67 t->GetTRDpid(d);
4a78b8c5 68 Int_t j, ok=0;
4f679a16 69 for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
4a78b8c5 70 if (ok)
71 for (j=0; j<ns; j++) p[j]*=d[j];
c630aafd 72 }
73
b4b3a4d6 74 if (t->GetP()>0.7) // accept the TOF only for the high momenta
4a78b8c5 75 if ((t->GetStatus()&AliESDtrack::kTOFpid )!=0) {
76 Double_t d[10];
77 t->GetTOFpid(d);
78 Int_t j, ok=0;
4f679a16 79 for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
4a78b8c5 80 if (ok)
81 for (j=0; j<ns; j++) p[j]*=d[j];
82 }
83
f4b3bbb7 84 if ((t->GetStatus()&AliESDtrack::kHMPIDpid )!=0) {
4a78b8c5 85 Double_t d[10];
f4b3bbb7 86 t->GetHMPIDpid(d);
4a78b8c5 87 Int_t j, ok=0;
4f679a16 88 for (j=0; j<ns; j++) if (d[j]>keps) ok=1;
4a78b8c5 89 if (ok)
90 for (j=0; j<ns; j++) p[j]*=d[j];
91 }
c630aafd 92
8c6a71ab 93 t->SetESDpid(p);
94 }
95 return 0;
96}