1 /**************************************************************************
2 * Copyright(c) 2005-2007, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 //-----------------------------------------------------------------------//
17 // ITS PID class --- method # 2 //
20 //The PID is based on the likelihood of all the four ITS' layers, //
21 //without using the truncated mean for the dE/dx. The response //
22 //functions for each layer are convoluted Landau-Gaussian functions. //
23 // Origin: Elena Bruna bruna@to.infn.it, Massimo Masera masera@to.infn.it//
24 //-----------------------------------------------------------------------//
26 #include "AliITSpidESD2.h"
28 #include "AliESDtrack.h"
29 #include "AliITStrackV2.h"
30 #include "AliITSclusterV2.h"
31 #include "AliITStrackerMI.h"
32 #include "AliITSLoader.h"
33 #include "AliITSPident.h"
34 #include "AliITSSteerPid.h"
37 ClassImp(AliITSpidESD2)
38 //_________________________________________________________________________
39 AliITSpidESD2::AliITSpidESD2():AliITSpidESD()
41 // The main constructor
46 //_________________________________________________________________________
47 AliITSpidESD2::AliITSpidESD2(AliITStrackerMI* tracker,AliITSLoader* loader):AliITSpidESD()
49 // The main constructor
52 fSp=new AliITSSteerPid();
55 //_________________________________________________________________________
56 AliITSpidESD2::~AliITSpidESD2(){
62 //______________________________________________________________________
63 AliITSpidESD2::AliITSpidESD2(const AliITSpidESD2 &ob) :AliITSpidESD(ob) {
65 // Copies are not allowed. The method is protected to avoid misuse.
66 Error("AliITSpidESD2","Copy constructor not allowed\n");
69 //______________________________________________________________________
70 AliITSpidESD2& AliITSpidESD2::operator=(const AliITSpidESD2& /* ob */){
71 // Assignment operator
72 // Assignment is not allowed. The method is protected to avoid misuse.
73 Error("= operator","Assignment operator not allowed\n");
77 //_________________________________________________________________________
78 Int_t AliITSpidESD2::MakePID(AliESD *event)
82 // This function calculates the "detector response" PID probabilities
85 AliITStrackV2* track=0;
86 fLoader->LoadRecPoints();
87 TTree *cTree=fLoader->TreeR();
88 fTracker->LoadClusters(cTree);
90 Int_t ntrk=event->GetNumberOfTracks();
92 // for (Int_t i=0; i<ntrk; i++) {
93 for (Int_t i=0; i<ntrk; i++) {
94 AliESDtrack *esdtr=event->GetTrack(i);
95 if ((esdtr->GetStatus()&AliESDtrack::kITSin )==0)
96 if ((esdtr->GetStatus()&AliESDtrack::kITSout)==0) continue;
98 track = new AliITStrackV2(*esdtr);
99 Double_t dEdxsignal=track->GetdEdx();
100 track->GetExternalParameters(xr,par);
102 Float_t lamb=TMath::ATan(par[3]);
103 momits=1/(TMath::Abs(par[4])*TMath::Cos(lamb));
106 AliWarning("Null particle momentum in ITS");
109 Double_t snp=track->GetSnp();
110 Double_t tgl=track->GetTgl();
111 const Int_t kns=AliPID::kSPECIES;
112 Double_t condprobfun[kns];
113 for(Int_t ii=0;ii<kns;ii++)condprobfun[ii]=0;
114 Int_t cluindsdd1 = track->GetClusterIndex(3);
115 Int_t cluindsdd2 = track->GetClusterIndex(2);
116 Int_t cluindssd1 = track->GetClusterIndex(1);
117 Int_t cluindssd2 = track->GetClusterIndex(0);
118 Float_t q1,q1corr,q2,q2corr,q3,q3corr,q4,q4corr;
119 AliITSclusterV2* clu1=(AliITSclusterV2*)fTracker->GetCluster(cluindsdd1);
122 q1corr=q1*TMath::Sqrt((1-snp*snp)/(1+tgl*tgl));
129 AliITSclusterV2* clu2=(AliITSclusterV2*)fTracker->GetCluster(cluindsdd2);
132 q2corr=q2*TMath::Sqrt((1-snp*snp)/(1+tgl*tgl));
139 AliITSclusterV2* clu3=(AliITSclusterV2*)fTracker->GetCluster(cluindssd1);
142 q3corr=q3*TMath::Sqrt((1-snp*snp)/(1+tgl*tgl));
149 AliITSclusterV2* clu4=(AliITSclusterV2*)fTracker->GetCluster(cluindssd2);
152 q4corr=q4*TMath::Sqrt((1-snp*snp)/(1+tgl*tgl));
158 Float_t qlay[4]={q1corr,q2corr,q3corr,q4corr};
163 Double_t invPt=track->Get1Pt();
164 AliITSPident mypid(momits,invPt,dEdxsignal,fSp,qlay,prip,prik,pripi,prie);
165 condprobfun[0]=0.;//el
166 condprobfun[1]=0.;//mu
167 condprobfun[2]=mypid.GetProdCondFunPi();//pi
168 condprobfun[3]=mypid.GetProdCondFunK();//kaon
169 condprobfun[4]=mypid.GetProdCondFunPro();//pro
171 esdtr->SetITSpid(condprobfun);
175 fTracker->UnloadClusters();
176 fLoader->UnloadRecPoints();