Fixes for bug #52499: Field polarities inconsistiency
[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"
af885e0f 27#include "AliESDEvent.h"
8c6a71ab 28#include "AliESDtrack.h"
29
30ClassImp(AliESDpid)
31
32//_________________________________________________________________________
af885e0f 33Int_t AliESDpid::MakePID(AliESDEvent *event)
8c6a71ab 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.};
43
44 AliESDtrack *t=event->GetTrack(i);
45
7a8614f3 46 if (t->IsOn(AliESDtrack::kITSpid)) {
8c6a71ab 47 Double_t d[10];
48 t->GetITSpid(d);
7a8614f3 49 for (Int_t j=0; j<ns; j++) p[j]*=d[j];
8c6a71ab 50 }
51
7a8614f3 52 if (t->IsOn(AliESDtrack::kTPCpid)) {
8c6a71ab 53 Double_t d[10];
54 t->GetTPCpid(d);
7a8614f3 55 for (Int_t j=0; j<ns; j++) p[j]*=d[j];
8c6a71ab 56 }
57
7a8614f3 58 if (t->IsOn(AliESDtrack::kTRDpid)) {
c630aafd 59 Double_t d[10];
60 t->GetTRDpid(d);
7a8614f3 61 for (Int_t j=0; j<ns; j++) p[j]*=d[j];
c630aafd 62 }
63
7a8614f3 64 if (t->IsOn(AliESDtrack::kTOFpid)) {
4a78b8c5 65 Double_t d[10];
66 t->GetTOFpid(d);
7a8614f3 67 for (Int_t j=0; j<ns; j++) p[j]*=d[j];
4a78b8c5 68 }
69
7a8614f3 70 if (t->IsOn(AliESDtrack::kHMPIDpid)) {
4a78b8c5 71 Double_t d[10];
f4b3bbb7 72 t->GetHMPIDpid(d);
7a8614f3 73 for (Int_t j=0; j<ns; j++) p[j]*=d[j];
4a78b8c5 74 }
c630aafd 75
8c6a71ab 76 t->SetESDpid(p);
77 }
7a8614f3 78
8c6a71ab 79 return 0;
80}