Reconstruction and PID using transition radiation photons: first implementation ...
[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
18// Very naive one... And the implementation is even poorer...
19// Should be made better by the detector experts...
20//-----------------------------------------------------------------
21
22#include "AliTRDpidESD.h"
23#include "AliESD.h"
24#include "AliESDtrack.h"
25
26ClassImp(AliTRDpidESD)
27
28//_________________________________________________________________________
29AliTRDpidESD::AliTRDpidESD(Double_t *param)
30{
31 //
32 // The main constructor
33 //
34 fMIP=param[0]; // MIP signal
35 fRes=param[1]; // relative resolution
36 fRange=param[2]; // PID "range" (in sigmas)
37}
38
eab5961e 39Double_t AliTRDpidESD::Bethe(Double_t bg)
40{
b0f03c34 41 //
eab5961e 42 // Parametrization of the Bethe-Bloch-curve
43 // The parametrization is the same as for the TPC and is taken from Lehrhaus.
b0f03c34 44 //
eab5961e 45
46 // This parameters have been adjusted to averaged values from GEANT
47 const Double_t kP1 = 7.17960e-02;
48 const Double_t kP2 = 8.54196;
49 const Double_t kP3 = 1.38065e-06;
50 const Double_t kP4 = 5.30972;
51 const Double_t kP5 = 2.83798;
52
53 // This parameters have been adjusted to Xe-data found in:
54 // Allison & Cobb, Ann. Rev. Nucl. Sci. (1980), 30, 253
55 //const Double_t kP1 = 0.76176E-1;
56 //const Double_t kP2 = 10.632;
57 //const Double_t kP3 = 3.17983E-6;
58 //const Double_t kP4 = 1.8631;
59 //const Double_t kP5 = 1.9479;
60
61 // Lower cutoff of the Bethe-Bloch-curve to limit step sizes
62 const Double_t kBgMin = 0.8;
63 const Double_t kBBMax = 6.83298;
64 //const Double_t kBgMin = 0.6;
65 //const Double_t kBBMax = 17.2809;
66 //const Double_t kBgMin = 0.4;
67 //const Double_t kBBMax = 82.0;
68
69 if (bg > kBgMin) {
70 Double_t yy = bg / TMath::Sqrt(1. + bg*bg);
71 Double_t aa = TMath::Power(yy,kP4);
72 Double_t bb = TMath::Power((1./bg),kP5);
73 bb = TMath::Log(kP3 + bb);
74 return ((kP2 - aa - bb)*kP1 / aa);
75 }
76 else {
77 return kBBMax;
78 }
79
b0f03c34 80}
81
82//_________________________________________________________________________
83Int_t AliTRDpidESD::MakePID(AliESD *event)
84{
85 //
86 // This function calculates the "detector response" PID probabilities
87 //
88 static const Double_t masses[]={
89 0.000511, 0.105658, 0.139570, 0.493677, 0.938272, 1.875613
90 };
91 Int_t ntrk=event->GetNumberOfTracks();
92 for (Int_t i=0; i<ntrk; i++) {
93 AliESDtrack *t=event->GetTrack(i);
94 if ((t->GetStatus()&AliESDtrack::kTRDin)==0)
95 if ((t->GetStatus()&AliESDtrack::kTRDout)==0)
96 if ((t->GetStatus()&AliESDtrack::kTRDrefit)==0) continue;
97 Int_t ns=AliESDtrack::kSPECIES;
98 Double_t p[10];
99 for (Int_t j=0; j<ns; j++) {
100 Double_t mass=masses[j];
101 Double_t mom=t->GetP();
102 Double_t dedx=t->GetTRDsignal()/fMIP;
103 Double_t bethe=Bethe(mom/mass);
104 Double_t sigma=fRes*bethe;
105 if (TMath::Abs(dedx-bethe) > fRange*sigma) {
106 p[j]=TMath::Exp(-0.5*fRange*fRange)/sigma;
107 continue;
108 }
109 p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma;
110 }
111 t->SetTRDpid(p);
112 }
113 return 0;
114}