]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSpidESD2.cxx
Remove dependencies of PID code on AliITStrackV2, remove obslete AliITStrackV2Pid...
[u/mrichter/AliRoot.git] / ITS / AliITSpidESD2.cxx
CommitLineData
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
1fad94b4 16/* $Id$ */
17
e62c1aea 18//-----------------------------------------------------------------------//
19// ITS PID class --- method # 2 //
20// //
21// //
22//The PID is based on the likelihood of all the four ITS' layers, //
23//without using the truncated mean for the dE/dx. The response //
24//functions for each layer are convoluted Landau-Gaussian functions. //
25// Origin: Elena Bruna bruna@to.infn.it, Massimo Masera masera@to.infn.it//
26//-----------------------------------------------------------------------//
27
28#include "AliITSpidESD2.h"
af885e0f 29#include "AliESDEvent.h"
e62c1aea 30#include "AliESDtrack.h"
e62c1aea 31#include "AliITSLoader.h"
32#include "AliITSPident.h"
33#include "AliITSSteerPid.h"
34#include "AliLog.h"
35
36ClassImp(AliITSpidESD2)
37//_________________________________________________________________________
1919a678 38AliITSpidESD2::AliITSpidESD2():
39 AliITSpidESD(),
40 fSp(0)
41{
e62c1aea 42 // The main constructor
e62c1aea 43 fSp=new AliITSSteerPid();
44 fSp->InitLayer();
45}
1919a678 46
47
e62c1aea 48//_________________________________________________________________________
49AliITSpidESD2::~AliITSpidESD2(){
50 //destructor
51
52 if(fSp)delete fSp;
e62c1aea 53}
1919a678 54
55
e62c1aea 56//______________________________________________________________________
94631b2f 57AliITSpidESD2::AliITSpidESD2(const AliITSpidESD2 &ob) :AliITSpidESD(ob),
94631b2f 58fSp(ob.fSp)
59{
e62c1aea 60 // Copy constructor
e62c1aea 61}
62
1919a678 63
e62c1aea 64//______________________________________________________________________
94631b2f 65AliITSpidESD2& AliITSpidESD2::operator=(const AliITSpidESD2& ob ){
e62c1aea 66 // Assignment operator
94631b2f 67 this->~AliITSpidESD2();
68 new(this) AliITSpidESD2(ob);
e62c1aea 69 return *this;
70}
71
1919a678 72
73//______________________________________________________________________
74void AliITSpidESD2::GetITSpidSingleTrack(AliESDtrack* esdtr, Double_t condprobfun[]){
75 // Method to calculate PID probabilities for a single track
76
1919a678 77 Double_t momits=esdtr->GetP();
78 Double_t qclu[4];
79 esdtr->GetITSdEdxSamples(qclu);
80
81 Float_t qclucorr[8],nlay[8];
82 for(Int_t jj=0;jj<8;jj++){
83 if(jj<4 && qclu[jj]>0){
84 qclucorr[jj]=qclu[jj];
85 nlay[jj]=jj+2; // layers numbered from 0 to 5
86 }
87 else{
88 qclucorr[jj]=-1;
89 nlay[jj]=0;
90 }
91 }
92
93 Float_t prip=0.33;
94 Float_t prik=0.33;
95 Float_t pripi=0.33;
96 Float_t prie=0.;
e96abd41 97 AliITSPident mypid(momits,fSp,qclucorr,nlay,prip,prik,pripi,prie);
1919a678 98 condprobfun[0]=mypid.GetProdCondFunPi();//el --PID in the ITS does not distinguish among Pi,el,mu
99 condprobfun[1]=mypid.GetProdCondFunPi();//mu
100 condprobfun[2]=mypid.GetProdCondFunPi();//pi
101 condprobfun[3]=mypid.GetProdCondFunK();//kaon
102 condprobfun[4]=mypid.GetProdCondFunPro();//pro
103 return;
104}
105
e62c1aea 106
1919a678 107
108//_________________________________________________________________________
109Int_t AliITSpidESD2::MakePID(AliESDEvent *event){
e62c1aea 110 // This function calculates the "detector response" PID probabilities
1919a678 111
e62c1aea 112 Int_t ntrk=event->GetNumberOfTracks();
1919a678 113 const Int_t kns=AliPID::kSPECIES;
114 Double_t condprobfun[kns];
115
e62c1aea 116 for (Int_t i=0; i<ntrk; i++) {
117 AliESDtrack *esdtr=event->GetTrack(i);
1919a678 118 if ((esdtr->GetStatus()&AliESDtrack::kITSin )==0){
e62c1aea 119 if ((esdtr->GetStatus()&AliESDtrack::kITSout)==0) continue;
e62c1aea 120 }
1919a678 121 GetITSpidSingleTrack(esdtr,condprobfun);
e62c1aea 122 esdtr->SetITSpid(condprobfun);
1fad94b4 123 }
e62c1aea 124 return 0;
125}