Fix for report #72089 changes to AliTOFPIDResponse to be commited in STEER (Roberto)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Sep 2010 14:39:51 +0000 (14:39 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Sep 2010 14:39:51 +0000 (14:39 +0000)
STEER/AliTOFPIDResponse.cxx
STEER/AliTOFPIDResponse.h

index ec8e40b..f92d7ef 100644 (file)
@@ -33,6 +33,9 @@ AliTOFPIDResponse::AliTOFPIDResponse():
   fPmax(0),         // zero at 0.5 GeV/c for pp
   fTime0(0)
 {
+  // Reset T0 info
+  ResetT0info();
+  SetMomBoundary();
 }
 //_________________________________________________________________________
 AliTOFPIDResponse::AliTOFPIDResponse(Double_t *param):
@@ -46,6 +49,10 @@ AliTOFPIDResponse::AliTOFPIDResponse(Double_t *param):
   //
 
   //fPmax=TMath::Exp(-0.5*3*3)/fSigma; // ~3 sigma at 0.5 GeV/c for PbPb 
+
+  // Reset T0 info
+  ResetT0info();
+  SetMomBoundary();
 }
 //_________________________________________________________________________
 Double_t 
@@ -69,12 +76,37 @@ Double_t AliTOFPIDResponse::GetExpectedSigma(Float_t mom, Float_t time, Float_t
   // If the operation is not possible, return a negative value.
   //
 
-  Double_t dpp = 0.01;      //mean relative pt resolution;
-  if (mom>0.5) dpp = 0.01*mom;
+  Double_t dpp=0.018*mass/mom;      //mean relative pt resolution;
 
  
   Double_t sigma = dpp*time/(1.+ mom*mom/(mass*mass));
+  
+  Int_t index = GetMomBin(mom);
+
+  Double_t t0res = fT0resolution[index];
+
+  return TMath::Sqrt(sigma*sigma + 50.0*50.0/mom/mom + fSigma*fSigma + t0res*t0res);
 
-  return TMath::Sqrt(sigma*sigma + fSigma*fSigma);
 }
+//_________________________________________________________________________
+Int_t AliTOFPIDResponse::GetMomBin(Float_t p) const{
+  Int_t i=0;
+  while(p > fPCutMin[i] && i < fNmomBins) i++;
+  if(i > 0) i--;
 
+  return i;
+}
+//_________________________________________________________________________
+void AliTOFPIDResponse::SetMomBoundary(){
+  fPCutMin[0] = 0.3;
+  fPCutMin[1] = 0.5;
+  fPCutMin[2] = 0.6;
+  fPCutMin[3] = 0.7;
+  fPCutMin[4] = 0.8;
+  fPCutMin[5] = 0.9;
+  fPCutMin[6] = 1;
+  fPCutMin[7] = 1.2;
+  fPCutMin[8] = 1.5;
+  fPCutMin[9] = 2;
+  fPCutMin[10] = 3;  
+}
index ea6dc04..2c65381 100644 (file)
@@ -30,12 +30,32 @@ public:
 
   Double_t GetMismatchProbability(Double_t p,Double_t mass) const;
 
+  void     SetT0event(Float_t *t0event){for(Int_t i=0;i < fNmomBins;i++) fT0event[i] = t0event[i];};
+  void     SetT0resolution(Float_t *t0resolution){for(Int_t i=0;i < fNmomBins;i++) fT0resolution[i] = t0resolution[i];};
+  //  void     LoadT0infoFromESD(Option_t *option){}; // to be added
+  void     ResetT0info(){ for(Int_t i=0;i < fNmomBins;i++){ fT0event[i] = 0.0; fT0resolution[i] = 0.0;} };
+  void     SetMomBoundary();
+  Int_t    GetMomBin(Float_t p) const;
+  Int_t    GetNmomBins(){return fNmomBins;};
+  Float_t  GetMinMom(Int_t ibin){if(ibin >=0 && ibin <= fNmomBins) return fPCutMin[ibin]; else return 0.0;};
+  Float_t  GetMaxMom(Int_t ibin){if(ibin >=0 && ibin <= fNmomBins) return fPCutMin[ibin+1]; else return 0.0;};
+  void     SetT0bin(Int_t ibin,Float_t t0bin){if(ibin >=0 && ibin <= fNmomBins) fT0event[ibin] = t0bin;};
+  void     SetT0binRes(Int_t ibin,Float_t t0binRes){if(ibin >=0 && ibin <= fNmomBins) fT0resolution[ibin] = t0binRes;};
+  Float_t  GetT0bin(Int_t ibin){if(ibin >=0 && ibin <= fNmomBins) return fT0event[ibin]; else return 0.0;};
+  Float_t  GetT0binRes(Int_t ibin){if(ibin >=0 && ibin <= fNmomBins) return fT0resolution[ibin]; else return 0.0;};
+
  private:
   Double_t fSigma;        // intrinsic TOF resolution
   Double_t fPmax;         // "maximal" probability of mismathing (at ~0.5 GeV/c)
   Double_t fTime0;        // time zero
 
-  ClassDef(AliTOFPIDResponse,1)   // TOF PID class
+  // About event time (t0) info
+  static const Int_t fNmomBins = 10; // number of momentum bin 
+  Float_t fT0event[fNmomBins];    // t0 (best, T0, T0-TOF, ...) of the event as a function of p 
+  Float_t fT0resolution[fNmomBins]; // t0 (best, T0, T0-TOF, ...) resolution as a function of p 
+  Float_t fPCutMin[fNmomBins+1]; // min values for p bins
+  
+  ClassDef(AliTOFPIDResponse,2)   // TOF PID class
 };
 
 #endif