/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /* $Id: AliAODpidUtil.cxx 38329 2010-01-17 19:17:24Z hristov $ */ //----------------------------------------------------------------- // Implementation of the combined PID class // For the AOD Class // containing information on the particle identification // Origin: Rosa Romita, GSI, r.romita@gsi.de //----------------------------------------------------------------- #include "AliLog.h" #include "AliPID.h" #include "AliAODpidUtil.h" #include "AliAODEvent.h" #include "AliAODTrack.h" #include "AliAODPid.h" #include "AliTRDPIDResponse.h" ClassImp(AliAODpidUtil) Int_t AliAODpidUtil::MakePID(AliAODTrack *track,Float_t TimeZeroTOF,Double_t *p) const { // // Calculate probabilities for all detectors, except if TPConly==kTRUE // and combine PID // // Option TPConly==kTRUE is used during reconstruction, // because ITS tracking uses TPC pid // HMPID and TRD pid are done in detector reconstructors // /* Float_t TimeZeroTOF = 0; if (subtractT0) TimeZeroTOF = event->GetT0(); */ Int_t ns=AliPID::kSPECIES; Double_t tpcPid[AliPID::kSPECIES]; MakeTPCPID(track,tpcPid); Double_t itsPid[AliPID::kSPECIES]; Double_t tofPid[AliPID::kSPECIES]; Double_t trdPid[AliPID::kSPECIES]; MakeITSPID(track,itsPid); MakeTOFPID(track, TimeZeroTOF,tofPid); //MakeHMPIDPID(track); MakeTRDPID(track,trdPid); for (Int_t j=0; jP(); AliAODPid *pidObj = track->GetDetPid(); if (pidObj) mom = pidObj->GetTPCmomentum(); Double_t dedx=pidObj->GetTPCsignal(); Bool_t mismatch=kTRUE; for (Int_t j=0; j fRange*sigma) { p[j]=TMath::Exp(-0.5*fRange*fRange)/sigma; } else { p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma; mismatch=kFALSE; } } if (mismatch) for (Int_t j=0; jP(); AliAODPid *pidObj = track->GetDetPid(); Double_t dedx=pidObj->GetITSsignal(); Bool_t mismatch=kTRUE; for (Int_t j=0; j fRange*sigma) { p[j]=TMath::Exp(-0.5*fRange*fRange)/sigma; } else { p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma; mismatch=kFALSE; } // Check for particles heavier than (AliPID::kSPECIES - 1) } if (mismatch) for (Int_t j=0; jGetDetPid(); pidObj->GetIntegratedTimes(time); for (Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++) { sigma[iPart] = fTOFResponse.GetExpectedSigma(track->P(),time[iPart],AliPID::ParticleMass(iPart)); } AliDebugGeneral("AliESDpid::MakeTOFPID",2, Form("Expected TOF signals [ps]: %f %f %f %f %f", time[AliPID::kElectron], time[AliPID::kMuon], time[AliPID::kPion], time[AliPID::kKaon], time[AliPID::kProton])); AliDebugGeneral("AliESDpid::MakeTOFPID",2, Form("Expected TOF std deviations [ps]: %f %f %f %f %f", sigma[AliPID::kElectron], sigma[AliPID::kMuon], sigma[AliPID::kPion], sigma[AliPID::kKaon], sigma[AliPID::kProton] )); Double_t tof = pidObj->GetTOFsignal() - TimeZeroTOF; Bool_t mismatch = kTRUE; for (Int_t j=0; j fRange*sig) { p[j] = TMath::Exp(-0.5*fRange*fRange)/sig; } else p[j] = TMath::Exp(-0.5*(tof-time[j])*(tof-time[j])/(sig*sig))/sig; // Check the mismatching Double_t mass = AliPID::ParticleMass(j); Double_t pm = fTOFResponse.GetMismatchProbability(track->P(),mass); if (p[j]>pm) mismatch = kFALSE; // Check for particles heavier than (AliPID::kSPECIES - 1) } if (mismatch) for (Int_t j=0; jGetDetPid(); Float_t *mom=pidObj->GetTRDmomentum(); Double_t *dedx=pidObj->GetTRDsignal(); Bool_t norm=kTRUE; fTRDResponse.GetResponse(pidObj->GetTRDnSlices(),dedx,mom,p,norm); return; }