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 "AliHMPIDRecon.h" //class header
27 #include <AliESDtrack.h> //FindPid()
28 #include <TRandom.h> //Resolution()
30 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31 AliHMPIDPid::AliHMPIDPid():TNamed("HMPIDrec","HMPIDPid")
34 //init of data members
37 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
38 Double_t AliHMPIDPIDResponse::CosTheta(Float_t mom, Int_t species) {
39 Double_t mass = AliPID::ParticleMass(species);
40 TMath::Sqrt(mass*mass+pmod*pmod)/(AliHMPIDParam::Instance()->MeanIdxRad()*pmod); // evaluate the theor. Theta Cherenkov
42 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
43 Double_t AliHMPIDPIDResponse::Resolution(Double_t thetaCerTh, AliESDtrack *pTrk)
45 AliHMPIDParam *pParam = AliHMPIDParam::Instance();
48 Float_t xRa,yRa,thRa,phRa;
49 pTrk->GetHMPIDtrk(xRa,yRa,thRa,phRa);
50 rec.SetTrack(xRa,yRa,thRa,phRa);
51 Double_t thetaMax = TMath::ACos(1./pParam->MeanIdxRad());
52 Int_t nPhots = (Int_t)(21.*TMath::Sin(thetaCerTh)*TMath::Sin(thetaCerTh)/(TMath::Sin(thetaMax)*TMath::Sin(thetaMax))+0.01);
54 Double_t sigmatot = 0;
56 for(Int_t iTrk=0;iTrk<nTrks;iTrk++) {
57 Double_t invSigma = 0;
59 for(Int_t j=0;j<nPhots;j++){
60 Double_t phi = gRandom->Rndm()*TMath::TwoPi();
61 TVector2 pos; pos=rec.TracePhot(thetaCerTh,phi);
62 if(!pParam->IsInside(pos.X(),pos.Y())) continue;
63 if(pParam->IsInDead(pos.X(),pos.Y())) continue;
64 Double_t sigma2 = pParam->Sigma2(thRa,phRa,thetaCerTh,phi);//photon candidate sigma^2
66 invSigma += 1./sigma2;
70 if(invSigma!=0) sigmatot += 1./TMath::Sqrt(invSigma);
72 return sigmatot/nTrks;