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 //-----------------------------------------------------------------//
18 // Implementation of the TOF PID class //
19 // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch //
21 //-----------------------------------------------------------------//
26 #include "AliTOFPIDResponse.h"
28 ClassImp(AliTOFPIDResponse)
30 //_________________________________________________________________________
31 AliTOFPIDResponse::AliTOFPIDResponse():
33 fPmax(0), // zero at 0.5 GeV/c for pp
45 //_________________________________________________________________________
46 AliTOFPIDResponse::AliTOFPIDResponse(Double_t *param):
48 fPmax(0), // zero at 0.5 GeV/c for pp
52 // The main constructor
56 //fPmax=TMath::Exp(-0.5*3*3)/fSigma; // ~3 sigma at 0.5 GeV/c for PbPb
67 //_________________________________________________________________________
69 AliTOFPIDResponse::GetMismatchProbability(Double_t p, Double_t mass) const {
71 // Returns the probability of mismatching
72 // assuming 1/(p*beta)^2 scaling
74 const Double_t km=0.5; // "reference" momentum (GeV/c)
76 Double_t ref2=km*km*km*km/(km*km + mass*mass);// "reference" (p*beta)^2
77 Double_t p2beta2=p*p*p*p/(p*p + mass*mass);
79 return fPmax*ref2/p2beta2;
81 //_________________________________________________________________________
82 Double_t AliTOFPIDResponse::GetExpectedSigma(Float_t mom, Float_t time, Float_t mass) const {
84 // Return the expected sigma of the PID signal for the specified
86 // If the operation is not possible, return a negative value.
89 Double_t dpp=fPar[0] + fPar[1]*mom + fPar[2]*mass/mom; //mean relative pt resolution;
92 Double_t sigma = dpp*time/(1.+ mom*mom/(mass*mass));
94 Int_t index = GetMomBin(mom);
96 Double_t t0res = fT0resolution[index];
98 return TMath::Sqrt(sigma*sigma + fPar[3]*fPar[3]/mom/mom + fSigma*fSigma + t0res*t0res);
101 //_________________________________________________________________________
102 Double_t AliTOFPIDResponse::GetExpectedSigma(Float_t mom, Float_t time, AliPID::EParticleType type) const {
104 // Return the expected sigma of the PID signal for the specified
106 // If the operation is not possible, return a negative value.
109 Double_t mass = AliPID::ParticleMassZ(type);
110 Double_t dpp=fPar[0] + fPar[1]*mom + fPar[2]*mass/mom; //mean relative pt resolution;
113 Double_t sigma = dpp*time/(1.+ mom*mom/(mass*mass));
115 Int_t index = GetMomBin(mom);
117 Double_t t0res = fT0resolution[index];
119 return TMath::Sqrt(sigma*sigma + fPar[3]*fPar[3]/mom/mom + fSigma*fSigma + t0res*t0res);
122 //_________________________________________________________________________
123 Double_t AliTOFPIDResponse::GetExpectedSignal(const AliVTrack* track,AliPID::EParticleType type) const {
125 // Return the expected signal of the PID signal for the particle type
126 // If the operation is not possible, return a negative value.
129 track->GetIntegratedTimes(expt);
130 if (type<=AliPID::kProton) return expt[type];
132 Double_t p = track->P();
133 Double_t massZ = AliPID::ParticleMassZ(type);
134 return expt[0]/p*massZ*TMath::Sqrt(1.+p*p/massZ/massZ);
137 //_________________________________________________________________________
138 Int_t AliTOFPIDResponse::GetMomBin(Float_t p) const{
140 // Returns the momentum bin index
144 while(p > fPCutMin[i] && i < fNmomBins) i++;
149 //_________________________________________________________________________
150 void AliTOFPIDResponse::SetMomBoundary(){
152 // Set boundaries for momentum bins
167 //_________________________________________________________________________
168 Float_t AliTOFPIDResponse::GetStartTime(Float_t mom) const {
170 // Returns event_time value as estimated by TOF combinatorial algorithm
173 Int_t ibin = GetMomBin(mom);
174 return GetT0bin(ibin);
177 //_________________________________________________________________________
178 Float_t AliTOFPIDResponse::GetStartTimeRes(Float_t mom) const {
180 // Returns event_time resolution as estimated by TOF combinatorial algorithm
183 Int_t ibin = GetMomBin(mom);
184 return GetT0binRes(ibin);
187 //_________________________________________________________________________
188 Int_t AliTOFPIDResponse::GetStartTimeMask(Float_t mom) const {
190 // Returns event_time mask
193 Int_t ibin = GetMomBin(mom);
194 return GetT0binMask(ibin);