]>
Commit | Line | Data |
---|---|---|
e62c1aea | 1 | /************************************************************************** |
2 | * Copyright(c) 2005-2007, 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 | // ITS PID method # 1 | |
18 | // Implementation of the ITS PID class | |
19 | // Very naive one... Should be made better by the detector experts... | |
20 | // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch | |
21 | //----------------------------------------------------------------- | |
22 | #include "AliITSpidESD.h" | |
23 | #include "AliITSpidESD1.h" | |
af885e0f | 24 | #include "AliESDEvent.h" |
e62c1aea | 25 | #include "AliESDtrack.h" |
26 | ||
27 | ClassImp(AliITSpidESD1) | |
28 | ||
94631b2f | 29 | AliITSpidESD1::AliITSpidESD1(): AliITSpidESD(), |
94631b2f | 30 | fRes(0), |
31 | fRange(0) | |
32 | { | |
e62c1aea | 33 | //Default constructor |
e62c1aea | 34 | } |
35 | //_________________________________________________________________________ | |
94631b2f | 36 | AliITSpidESD1::AliITSpidESD1(Double_t *param): AliITSpidESD(), |
25fee9b6 | 37 | fRes(param[0]), |
38 | fRange(param[1]) | |
e62c1aea | 39 | { |
40 | // | |
41 | // The main constructor | |
42 | // | |
e62c1aea | 43 | } |
44 | ||
45 | ||
46 | //_________________________________________________________________________ | |
af885e0f | 47 | Int_t AliITSpidESD1::MakePID(AliESDEvent *event) |
e62c1aea | 48 | { |
49 | // | |
50 | // This function calculates the "detector response" PID probabilities | |
51 | // | |
52 | Int_t ntrk=event->GetNumberOfTracks(); | |
53 | for (Int_t i=0; i<ntrk; i++) { | |
54 | AliESDtrack *t=event->GetTrack(i); | |
55 | if ((t->GetStatus()&AliESDtrack::kITSin )==0) | |
56 | if ((t->GetStatus()&AliESDtrack::kITSout)==0) continue; | |
57 | Double_t mom=t->GetP(); | |
25fee9b6 | 58 | Double_t dedx=t->GetITSsignal(); |
e62c1aea | 59 | Int_t ns=AliPID::kSPECIES; |
60 | Double_t p[10]; | |
61 | for (Int_t j=0; j<ns; j++) { | |
25fee9b6 | 62 | Double_t mass=AliPID::ParticleMass(j);//GeV/c^2 |
63 | Double_t bethe=AliITSpidESD::Bethe(mom,mass); | |
e62c1aea | 64 | Double_t sigma=fRes*bethe; |
65 | if (TMath::Abs(dedx-bethe) > fRange*sigma) { | |
66 | p[j]=TMath::Exp(-0.5*fRange*fRange)/sigma; | |
67 | continue; | |
68 | } | |
69 | p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma; | |
70 | } | |
71 | t->SetITSpid(p); | |
72 | } | |
73 | return 0; | |
74 | } |