]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/STEERBase/AliITSPIDResponse.cxx
o Add parametrisations for light nuclei (Stefano Trogolo)
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliITSPIDResponse.cxx
CommitLineData
10d100d4 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/* $Id$ */
17
18//-----------------------------------------------------------------
19// ITS PID method # 1
20// Implementation of the ITS PID class
21// Very naive one... Should be made better by the detector experts...
22// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
23//-----------------------------------------------------------------
24#include "TMath.h"
567624b5 25#include "AliVTrack.h"
10d100d4 26#include "AliITSPIDResponse.h"
27#include "AliITSPidParams.h"
28#include "AliExternalTrackParam.h"
29
10d100d4 30ClassImp(AliITSPIDResponse)
31
15e979c9 32AliITSPIDResponse::AliITSPIDResponse(Bool_t isMC):
10d100d4 33 fRes(0.13),
34 fKp1(15.77),
35 fKp2(4.95),
36 fKp3(0.312),
37 fKp4(2.14),
38 fKp5(0.82)
39{
15e979c9 40 if(!isMC){
41 fBBtpcits[0]=0.73;
42 fBBtpcits[1]=14.68;
43 fBBtpcits[2]=0.905;
44 fBBtpcits[3]=1.2;
45 fBBtpcits[4]=6.6;
41cab740 46 fBBdeu[0]=76.43; // parameters for the deuteron - tpcits - value from PbPb 2010 run (S.Trogolo - July 2014)
47 fBBdeu[1]=-34.21;
48 fBBdeu[2]=113.2;
49 fBBdeu[3]=-18.12;
50 fBBdeu[4]=0.6019;
51 fBBtri[0]=13.34; // parameters for the triton - tpcits - value from PbPb 2010 run (S.Trogolo - July 2014)
52 fBBtri[1]=55.17;
53 fBBtri[2]=66.41;
54 fBBtri[3]=-6.601;
55 fBBtri[4]=-0.4134;
62ccfebf 56 fBBsa[0]=2.73198E7; //pure PHOBOS parameterization
88f46717 57 fBBsa[1]=6.92389;
58 fBBsa[2]=1.90088E-6;
59 fBBsa[3]=1.90088E-6;
60 fBBsa[4]=3.40644E-7;
62ccfebf 61 fBBsaHybrid[0]=1.43505E7; //PHOBOS+Polinomial parameterization
62 fBBsaHybrid[1]=49.3402;
63 fBBsaHybrid[2]=1.77741E-7;
64 fBBsaHybrid[3]=1.77741E-7;
65 fBBsaHybrid[4]=1.01311E-7;
66 fBBsaHybrid[5]=77.2777;
67 fBBsaHybrid[6]=33.4099;
68 fBBsaHybrid[7]=46.0089;
69 fBBsaHybrid[8]=-2.26583;
70 fBBsaElectron[0]=4.05799E6; //electrons in the ITS
88f46717 71 fBBsaElectron[1]=38.5713;
72 fBBsaElectron[2]=1.46462E-7;
73 fBBsaElectron[3]=1.46462E-7;
74 fBBsaElectron[4]=4.40284E-7;
8abeb05b 75 fResolSA[0]=1.; // 0 cluster tracks should not be used
88f46717 76 fResolSA[1]=0.25; // rough values for tracks with 1
77 fResolSA[2]=0.131; // value from pp 2010 run (L. Milano, 16-Jun-11)
78 fResolSA[3]=0.113; // value from pp 2010 run
8abeb05b 79 fResolSA[4]=0.104; // value from pp 2010 run
15e979c9 80 for(Int_t i=0; i<5;i++) fResolTPCITS[i]=0.13;
41cab740 81 fResolTPCITSDeu3[0]=0.06918; // deuteron resolution vs p
82 fResolTPCITSDeu3[1]=0.02498; // 3 ITS clusters for PId
83 fResolTPCITSDeu3[2]=1.1; // value from PbPb 2010 run (July 2014)
84 fResolTPCITSDeu4[0]=0.06756;// deuteron resolution vs p
85 fResolTPCITSDeu4[1]=0.02078; // 4 ITS clusters for PId
86 fResolTPCITSDeu4[2]=1.05; // value from PbPb 2010 run (July 2014)
87 fResolTPCITSTri3[0]=0.07239; // triton resolution vs p
88 fResolTPCITSTri3[1]=0.0192; // 3 ITS clusters for PId
89 fResolTPCITSTri3[2]=1.1; // value from PbPb 2010 run (July 2014)
90 fResolTPCITSTri4[0]=0.06083; // triton resolution
91 fResolTPCITSTri4[1]=0.02579; // 4 ITS clusters for PId
92 fResolTPCITSTri4[2]=1.15; // value from PbPb 2010 run (July 2014)
15e979c9 93 }else{
99daa709 94 fBBtpcits[0]=1.04;
95 fBBtpcits[1]=27.14;
96 fBBtpcits[2]=1.00;
97 fBBtpcits[3]=0.964;
98 fBBtpcits[4]=2.59;
62ccfebf 99 fBBsa[0]=2.02078E7; //pure PHOBOS parameterization
88f46717 100 fBBsa[1]=14.0724;
101 fBBsa[2]=3.84454E-7;
102 fBBsa[3]=3.84454E-7;
103 fBBsa[4]=2.43913E-7;
62ccfebf 104 fBBsaHybrid[0]=1.05381E7; //PHOBOS+Polinomial parameterization
105 fBBsaHybrid[1]=89.3933;
106 fBBsaHybrid[2]=2.4831E-7;
107 fBBsaHybrid[3]=2.4831E-7;
108 fBBsaHybrid[4]=7.80591E-8;
109 fBBsaHybrid[5]=62.9214;
110 fBBsaHybrid[6]=32.347;
111 fBBsaHybrid[7]=58.7661;
112 fBBsaHybrid[8]=-3.39869;
113 fBBsaElectron[0]=2.26807E6; //electrons in the ITS
88f46717 114 fBBsaElectron[1]=99.985;
115 fBBsaElectron[2]=0.000714841;
116 fBBsaElectron[3]=0.000259585;
117 fBBsaElectron[4]=1.39412E-7;
8abeb05b 118 fResolSA[0]=1.; // 0 cluster tracks should not be used
88f46717 119 fResolSA[1]=0.25; // rough values for tracks with 1
120 fResolSA[2]=0.126; // value from pp 2010 simulations (L. Milano, 16-Jun-11)
121 fResolSA[3]=0.109; // value from pp 2010 simulations
122 fResolSA[4]=0.097; // value from pp 2010 simulations
15e979c9 123 for(Int_t i=0; i<5;i++) fResolTPCITS[i]=0.13;
124 }
10d100d4 125}
126
56576f1e 127/*
10d100d4 128//_________________________________________________________________________
129AliITSPIDResponse::AliITSPIDResponse(Double_t *param):
9ebbddd4 130 fRes(param[0]),
10d100d4 131 fKp1(15.77),
132 fKp2(4.95),
133 fKp3(0.312),
134 fKp4(2.14),
135 fKp5(0.82)
136{
137 //
138 // The main constructor
139 //
6b4634a4 140 for (Int_t i=0; i<5;i++) {
141 fBBsa[i]=0.;
142 fBBtpcits[i]=0.;
143 fResolSA[i]=0.;
144 fResolTPCITS[i]=0.;
145 }
10d100d4 146}
56576f1e 147*/
10d100d4 148
8abeb05b 149//_________________________________________________________________________
15e979c9 150Double_t AliITSPIDResponse::BetheAleph(Double_t p, Double_t mass) const {
10d100d4 151 //
152 // returns AliExternalTrackParam::BetheBloch normalized to
153 // fgMIP at the minimum
154 //
15e979c9 155
10d100d4 156 Double_t bb=
157 AliExternalTrackParam::BetheBlochAleph(p/mass,fKp1,fKp2,fKp3,fKp4,fKp5);
9ebbddd4 158 return bb;
10d100d4 159}
160
8abeb05b 161//_________________________________________________________________________
41cab740 162Double_t AliITSPIDResponse::Bethe(Double_t p, Double_t mass, Bool_t isSA, Bool_t isNuclei) const {
163
15e979c9 164 //
165 // returns AliExternalTrackParam::BetheBloch normalized to
166 // fgMIP at the minimum
167 //
168
41cab740 169 // NEW: Parameterization for Deuteron and Triton energy loss, reproduced with a polynomial in fixed p range
170 // fBBdeu --> parameters for deuteron
171 // fBBtri --> parameters for triton
172
173
15e979c9 174 Double_t bg=p/mass;
175 Double_t beta = bg/TMath::Sqrt(1.+ bg*bg);
176 Double_t gamma=bg/beta;
62ccfebf 177 Double_t bb=1.;
178
15e979c9 179 Double_t par[5];
180 if(isSA){
41cab740 181 if(TMath::AreEqualAbs(mass,AliPID::ParticleMass(0),0.00001)){
88f46717 182 //if is an electron use a specific BB parameterization
183 //To be used only between 100 and 160 MeV/c
184 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBsaElectron[ip];
185 }else{
186 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBsa[ip];
187 }
15e979c9 188 }else{
41cab740 189 if(isNuclei){
190 if(TMath::AreEqualAbs(mass,AliPID::ParticleMass(5),0.002)) for(Int_t ip=0; ip<5;ip++) par[ip]=fBBdeu[ip];
191 if(TMath::AreEqualAbs(mass,AliPID::ParticleMass(6),0.001)) for(Int_t ip=0; ip<5;ip++) par[ip]=fBBtri[ip];
192 }
193 else{
194 for(Int_t ip=0; ip<5;ip++) par[ip]=fBBtpcits[ip];
195 }
15e979c9 196 }
41cab740 197
15e979c9 198 Double_t eff=1.0;
199 if(bg<par[2])
200 eff=(bg-par[3])*(bg-par[3])+par[4];
201 else
202 eff=(par[2]-par[3])*(par[2]-par[3])+par[4];
88f46717 203
15e979c9 204 if(gamma>=0. && beta>0.){
41cab740 205 if(isNuclei){
206 //Parameterization for deuteron between 0.4 - 1.5 GeV/c; triton between 0.58 - 1.65 GeV/c
207 bb=par[0] + par[1]/bg + par[2]/(bg*bg) + par[3]/(bg*bg*bg) + par[4]/(bg*bg*bg*bg);
208 }else{ //Parameterization for pion, kaon, proton, electron
209 bb=(par[1]+2.0*TMath::Log(gamma)-beta*beta)*(par[0]/(beta*beta))*eff;
210 }
15e979c9 211 }
41cab740 212
15e979c9 213 return bb;
214}
215
62ccfebf 216//_________________________________________________________________________
217Double_t AliITSPIDResponse::BetheITSsaHybrid(Double_t p, Double_t mass) const {
218 //
219 // returns AliExternalTrackParam::BetheBloch normalized to
220 // fgMIP at the minimum. The PHOBOS parameterization is used for beta*gamma>0.76.
221 // For beta*gamma<0.76 a polinomial function is used
222
223 Double_t bg=p/mass;
224 Double_t beta = bg/TMath::Sqrt(1.+ bg*bg);
225 Double_t gamma=bg/beta;
226 Double_t bb=1.;
227
228 Double_t par[9];
229 //parameters for pi, K, p
230 for(Int_t ip=0; ip<9;ip++) par[ip]=fBBsaHybrid[ip];
231 //if it is an electron the PHOBOS part of the parameterization is tuned for e
232 //in the range used for identification beta*gamma is >0.76 for electrons
233 //To be used only between 100 and 160 MeV/c
234 if(mass>0.0005 && mass<0.00052)for(Int_t ip=0; ip<5;ip++) par[ip]=fBBsaElectron[ip];
235
236 if(gamma>=0. && beta>0. && bg>0.1){
237 if(bg>0.76){//PHOBOS
238 Double_t eff=1.0;
239 if(bg<par[2])
240 eff=(bg-par[3])*(bg-par[3])+par[4];
241 else
242 eff=(par[2]-par[3])*(par[2]-par[3])+par[4];
243
244 bb=(par[1]+2.0*TMath::Log(gamma)-beta*beta)*(par[0]/(beta*beta))*eff;
245 }else{//Polinomial
246 bb=par[5] + par[6]/bg + par[7]/(bg*bg) + par[8]/(bg*bg*bg);
247 }
248 }
249 return bb;
250}
251
8abeb05b 252//_________________________________________________________________________
41cab740 253Double_t AliITSPIDResponse::GetResolution(Double_t bethe,
15e979c9 254 Int_t nPtsForPid,
41cab740 255 Bool_t isSA,
256 Double_t p,
257 AliPID::EParticleType type) const {
258 //
10d100d4 259 // Calculate expected resolution for truncated mean
260 //
41cab740 261 // NEW: Added new variables which are Double_t p and AliPID::EParticleType type
262 // AliPID::EParticleType type is used to set the correct resolution for the different particles
263 // default -> AliPID::EParticleType type = AliPID::kPion
264 // Double_t p is used for the resolution of deuteron and triton, because they are function of the momentum
265 // default -> Double_t p=0.
266
15e979c9 267 Float_t r;
41cab740 268 Float_t c=1.; //this is a correction factor used for the nuclei resolution, while for pion/kaon/proton/electron is 1.
269 Double_t par[3];
270
15e979c9 271 if(isSA) r=fResolSA[nPtsForPid];
41cab740 272 else{
273 if(AliPID::ParticleMass(type)>=AliPID::ParticleMass(5)){ //if mass >= mass_deu -->resolution for nuclei is selected
274 if(type==AliPID::kDeuteron){
275 if(nPtsForPid==3) for(Int_t j=0; j<3; j++) par[j] = fResolTPCITSDeu3[j];
276 if(nPtsForPid==4) for(Int_t j=0; j<3; j++) par[j] = fResolTPCITSDeu4[j];
277 c=par[2];
278 }
279 if(type==AliPID::kTriton){
280 if(nPtsForPid==3) for(Int_t j=0; j<3; j++) par[j] = fResolTPCITSTri3[j];
281 if(nPtsForPid==4) for(Int_t j=0; j<3; j++) par[j] = fResolTPCITSTri4[j];
282 c=par[2];
283 }
10d100d4 284
41cab740 285 r=par[0]+par[1]*p;
286 }
287 else r=fResolTPCITS[nPtsForPid];
288 }
15e979c9 289
41cab740 290 return r*bethe*c;
291}
15e979c9 292
293
8abeb05b 294//_________________________________________________________________________
b52bfc67 295void AliITSPIDResponse::GetITSProbabilities(Float_t mom, Double_t qclu[4], Double_t condprobfun[AliPID::kSPECIES], Bool_t isMC) const {
10d100d4 296 //
297 // Method to calculate PID probabilities for a single track
298 // using the likelihood method
299 //
300 const Int_t nLay = 4;
2ca1f4ee 301 const Int_t nPart= 4;
10d100d4 302
b52bfc67 303 static AliITSPidParams pars(isMC); // Pid parametrisation parameters
10d100d4 304
2ca1f4ee 305 Double_t itsProb[nPart] = {1,1,1,1}; // e, p, K, pi
10d100d4 306
307 for (Int_t iLay = 0; iLay < nLay; iLay++) {
2ca1f4ee 308 if (qclu[iLay] <= 50.)
10d100d4 309 continue;
310
311 Float_t dedx = qclu[iLay];
312 Float_t layProb = pars.GetLandauGausNorm(dedx,AliPID::kProton,mom,iLay+3);
313 itsProb[0] *= layProb;
314
315 layProb = pars.GetLandauGausNorm(dedx,AliPID::kKaon,mom,iLay+3);
10d100d4 316 itsProb[1] *= layProb;
317
318 layProb = pars.GetLandauGausNorm(dedx,AliPID::kPion,mom,iLay+3);
319 itsProb[2] *= layProb;
2ca1f4ee 320
321 layProb = pars.GetLandauGausNorm(dedx,AliPID::kElectron,mom,iLay+3);
322 itsProb[3] *= layProb;
10d100d4 323 }
324
325 // Normalise probabilities
326 Double_t sumProb = 0;
327 for (Int_t iPart = 0; iPart < nPart; iPart++) {
328 sumProb += itsProb[iPart];
329 }
2ca1f4ee 330 sumProb += itsProb[2]; // muon cannot be distinguished from pions
10d100d4 331
332 for (Int_t iPart = 0; iPart < nPart; iPart++) {
333 itsProb[iPart]/=sumProb;
334 }
2ca1f4ee 335 condprobfun[AliPID::kElectron] = itsProb[3];
897a0e31 336 condprobfun[AliPID::kMuon] = itsProb[2];
337 condprobfun[AliPID::kPion] = itsProb[2];
10d100d4 338 condprobfun[AliPID::kKaon] = itsProb[1];
339 condprobfun[AliPID::kProton] = itsProb[0];
340 return;
341}
15e979c9 342
567624b5 343//_________________________________________________________________________
344Double_t AliITSPIDResponse::GetNumberOfSigmas( const AliVTrack* track, AliPID::EParticleType type) const
345{
346 //
347 // number of sigmas
348 //
349 UChar_t clumap=track->GetITSClusterMap();
350 Int_t nPointsForPid=0;
351 for(Int_t i=2; i<6; i++){
352 if(clumap&(1<<i)) ++nPointsForPid;
353 }
354 Float_t mom=track->P();
355
356 //check for ITS standalone tracks
357 Bool_t isSA=kTRUE;
358 if( track->GetStatus() & AliVTrack::kTPCin ) isSA=kFALSE;
359
360 const Float_t dEdx=track->GetITSsignal();
361
362 //TODO: in case of the electron, use the SA parametrisation,
363 // this needs to be changed if ITS provides a parametrisation
364 // for electrons also for ITS+TPC tracks
365 return GetNumberOfSigmas(mom,dEdx,type,nPointsForPid,isSA || (type==AliPID::kElectron));
366}
367
368//_________________________________________________________________________
1d59271b 369Double_t AliITSPIDResponse::GetSignalDelta( const AliVTrack* track, AliPID::EParticleType type, Bool_t ratio/*=kFALSE*/) const
567624b5 370{
371 //
372 // Signal - expected
373 //
374 const Float_t mom=track->P();
375 const Double_t chargeFactor = TMath::Power(AliPID::ParticleCharge(type),2.);
376 Bool_t isSA=kTRUE;
377 if( track->GetStatus() & AliVTrack::kTPCin ) isSA=kFALSE;
378
379 const Float_t dEdx=track->GetITSsignal();
380
381 //TODO: in case of the electron, use the SA parametrisation,
382 // this needs to be changed if ITS provides a parametrisation
383 // for electrons also for ITS+TPC tracks
384
1d59271b 385 const Float_t bethe = Bethe(mom,AliPID::ParticleMassZ(type), isSA || (type==AliPID::kElectron))*chargeFactor;
386
387 Double_t delta=-9999.;
388 if (!ratio) delta=dEdx-bethe;
389 else if (bethe>1.e-20) delta=dEdx/bethe;
390
391 return delta;
567624b5 392}
393
8abeb05b 394//_________________________________________________________________________
395Int_t AliITSPIDResponse::GetParticleIdFromdEdxVsP(Float_t mom, Float_t signal, Bool_t isSA) const{
396 // method to get particle identity with simple cuts on dE/dx vs. momentum
397
398 Double_t massp=AliPID::ParticleMass(AliPID::kProton);
399 Double_t massk=AliPID::ParticleMass(AliPID::kKaon);
400 Double_t bethep=Bethe(mom,massp,isSA);
401 Double_t bethek=Bethe(mom,massk,isSA);
402 if(signal>(0.5*(bethep+bethek))) return AliPID::kProton;
403 Double_t masspi=AliPID::ParticleMass(AliPID::kPion);
404 Double_t bethepi=Bethe(mom,masspi,isSA);
405 if(signal>(0.5*(bethepi+bethek))) return AliPID::kKaon;
406 return AliPID::kPion;
407
408}