]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDpidESD.cxx
Removing wide clusters from the reconstruction (M.Ivanov)
[u/mrichter/AliRoot.git] / TRD / AliTRDpidESD.cxx
CommitLineData
b0f03c34 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 TRD PID class
bd50219c 18// Assigns the electron and pion liklihoods for each ESD track.
19// The AliTRDprobdist class is instantiated here.
20// The function MakePID(AliESD *event) calculates the probability
21// of having dedx and the probability of having timbin at a given
22// momentum (mom) and particle type k (0 for e) and (2 for pi)
23// from the precalculated timbin distributions.
24// Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de>
b0f03c34 25//-----------------------------------------------------------------
26
27#include "AliTRDpidESD.h"
28#include "AliESD.h"
29#include "AliESDtrack.h"
bd50219c 30#include "AliTRDprobdist.h"
b0f03c34 31
32ClassImp(AliTRDpidESD)
33
34//_________________________________________________________________________
35AliTRDpidESD::AliTRDpidESD(Double_t *param)
36{
37 //
38 // The main constructor
39 //
40 fMIP=param[0]; // MIP signal
41 fRes=param[1]; // relative resolution
42 fRange=param[2]; // PID "range" (in sigmas)
43}
44
eab5961e 45Double_t AliTRDpidESD::Bethe(Double_t bg)
46{
b0f03c34 47 //
eab5961e 48 // Parametrization of the Bethe-Bloch-curve
49 // The parametrization is the same as for the TPC and is taken from Lehrhaus.
b0f03c34 50 //
eab5961e 51
52 // This parameters have been adjusted to averaged values from GEANT
53 const Double_t kP1 = 7.17960e-02;
54 const Double_t kP2 = 8.54196;
55 const Double_t kP3 = 1.38065e-06;
56 const Double_t kP4 = 5.30972;
57 const Double_t kP5 = 2.83798;
58
59 // This parameters have been adjusted to Xe-data found in:
60 // Allison & Cobb, Ann. Rev. Nucl. Sci. (1980), 30, 253
61 //const Double_t kP1 = 0.76176E-1;
62 //const Double_t kP2 = 10.632;
63 //const Double_t kP3 = 3.17983E-6;
64 //const Double_t kP4 = 1.8631;
65 //const Double_t kP5 = 1.9479;
66
67 // Lower cutoff of the Bethe-Bloch-curve to limit step sizes
68 const Double_t kBgMin = 0.8;
69 const Double_t kBBMax = 6.83298;
70 //const Double_t kBgMin = 0.6;
71 //const Double_t kBBMax = 17.2809;
72 //const Double_t kBgMin = 0.4;
73 //const Double_t kBBMax = 82.0;
74
75 if (bg > kBgMin) {
76 Double_t yy = bg / TMath::Sqrt(1. + bg*bg);
77 Double_t aa = TMath::Power(yy,kP4);
78 Double_t bb = TMath::Power((1./bg),kP5);
79 bb = TMath::Log(kP3 + bb);
80 return ((kP2 - aa - bb)*kP1 / aa);
81 }
82 else {
83 return kBBMax;
84 }
85
b0f03c34 86}
87
88//_________________________________________________________________________
89Int_t AliTRDpidESD::MakePID(AliESD *event)
bd50219c 90{
91 //
92 // This function calculates the "detector response" PID probabilities
93 //
94 // The class AliTRDprobdist contains precalculated prob dis.
95 AliTRDprobdist *pd = new AliTRDprobdist();
96 // Double_t ebin[200], ppi[200], pel[200];
97 // pd->GetData(2,ebin,ppi,pel);
98 // for(Int_t ie=0; ie<10; ie++)
99 // printf(" %f %f %f \n", ebin[ie], ppi[ie], pel[ie]);
100
101 Int_t ntrk=event->GetNumberOfTracks();
102 for (Int_t i=0; i<ntrk; i++) {
103 AliESDtrack *t=event->GetTrack(i);
104 if ((t->GetStatus()&AliESDtrack::kTRDin)==0)
105 if ((t->GetStatus()&AliESDtrack::kTRDout)==0)
106 if ((t->GetStatus()&AliESDtrack::kTRDrefit)==0) continue;
107 // Int_t ns=AliESDtrack::kSPECIES;
108 Int_t ns=AliPID::kSPECIES;
109 Double_t p[10];
110 Double_t mom=t->GetP();
111 for (Int_t j=0; j<ns; j++) {
112 p[j]=1.;
113 for (Int_t ilayer=0; ilayer <6; ilayer++) {
114 Double_t dedx=t->GetTRDsignals(ilayer);
115 Int_t timbin=t->GetTRDTimBin(ilayer);
116 if (j==0 || j==2){
117 p[j]*= pd->GetProbability(j,mom,dedx);
118 p[j]*= pd->GetProbabilityT(j,mom,timbin);
119 p[j]*= 100;
120 }
121 } // loop over layers
122 } //loop over particle species
123 // printf(" %f %d %f %f %f \n", mom, timbin, p[0], p[1], p[2]);
124 if(p[0]) p[0]= p[0]/(p[0]+p[2]);
125 if(p[2]) p[2]= 1.-p[0];
126 t->SetTRDpid(p);
127 } //loop over track
128 delete pd;
129 return 0;
130}
131
132
133/*
134//_________________________________________________________________________
135MakePID(AliESD *event)
b0f03c34 136{
137 //
138 // This function calculates the "detector response" PID probabilities
139 //
b0f03c34 140 Int_t ntrk=event->GetNumberOfTracks();
141 for (Int_t i=0; i<ntrk; i++) {
142 AliESDtrack *t=event->GetTrack(i);
143 if ((t->GetStatus()&AliESDtrack::kTRDin)==0)
144 if ((t->GetStatus()&AliESDtrack::kTRDout)==0)
145 if ((t->GetStatus()&AliESDtrack::kTRDrefit)==0) continue;
bd50219c 146 // Int_t ns=AliESDtrack::kSPECIES;
304864ab 147 Int_t ns=AliPID::kSPECIES;
b0f03c34 148 Double_t p[10];
149 for (Int_t j=0; j<ns; j++) {
304864ab 150 Double_t mass=AliPID::ParticleMass(j);
bd50219c 151 Double_t mass=masses[j];
b0f03c34 152 Double_t mom=t->GetP();
153 Double_t dedx=t->GetTRDsignal()/fMIP;
bd50219c 154 Double_t bethe= AliTRDpidESD::Bethe(mom/mass);
b0f03c34 155 Double_t sigma=fRes*bethe;
156 if (TMath::Abs(dedx-bethe) > fRange*sigma) {
157 p[j]=TMath::Exp(-0.5*fRange*fRange)/sigma;
158 continue;
159 }
160 p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma;
161 }
162 t->SetTRDpid(p);
bd50219c 163 // if(i==50) printf("%f %f %f \n", p[0], p[1], p[2]);
b0f03c34 164 }
165 return 0;
166}
bd50219c 167
168*/
169
170
171