1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 //////////////////////////////////////////////////////////////////////////
20 // HMPID class to perfom particle identification //
22 //////////////////////////////////////////////////////////////////////////
24 #include "AliHMPIDPid.h" //class header
25 #include "AliHMPIDParam.h" //class header
26 #include <AliESDtrack.h> //FindPid()
28 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29 AliHMPIDPid::AliHMPIDPid():TTask("HMPIDrec","HMPIDPid")
32 //init of data members
35 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
36 void AliHMPIDPid::FindPid(AliESDtrack *pTrk,Int_t nsp,Double_t *prob)
38 // Calculates probability to be a electron-muon-pion-kaon-proton
39 // from the given Cerenkov angle and momentum assuming no initial particle composition
40 // (i.e. apriory probability to be the particle of the given sort is the same for all sorts)
42 if(pTrk->GetHMPIDsignal()<=0){//HMPID does not find anything reasonable for this track, assign 0.2 for all species
43 for(Int_t iPart=0;iPart<nsp;iPart++) prob[iPart]=1.0/(Float_t)nsp;
47 Double_t pmod = pTrk->GetP();
49 Double_t *h = new Double_t [nsp];
51 for(Int_t iPart=0;iPart<nsp;iPart++){
52 Double_t mass = AliPID::ParticleMass(iPart);
53 Double_t cosThetaTh = TMath::Sqrt(mass*mass+pmod*pmod)/(AliHMPIDParam::Instance()->MeanIdxRad()*pmod);
54 if(cosThetaTh<1) //calculate the height of theoretical theta ckov on the gaus of experimental one
55 h[iPart] =TMath::Gaus(TMath::ACos(cosThetaTh),pTrk->GetHMPIDsignal(),TMath::Sqrt(pTrk->GetHMPIDchi2()),kTRUE);
56 else //beta < 1/ref. idx. => no light at all
58 hTot +=h[iPart]; //total height of all theoretical heights for normalization
61 Double_t hMin=TMath::Gaus(pTrk->GetHMPIDsignal()-4*TMath::Sqrt(pTrk->GetHMPIDchi2()),pTrk->GetHMPIDsignal(),TMath::Sqrt(pTrk->GetHMPIDchi2()),kTRUE);//5 sigma protection
63 for(Int_t iPart=0;iPart<nsp;iPart++) {//species loop to assign probabilities
64 if(hTot>hMin) prob[iPart]=h[iPart]/hTot;
65 else prob[iPart]=1.0/(Float_t)nsp; //all theoretical values are far away from experemental one
69 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++