]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliESDpid.cxx
A few little fixes (A. De Caro)
[u/mrichter/AliRoot.git] / STEER / AliESDpid.cxx
index f8ebca81fb31a17dec85bed8863956fb3b4e6654..2a065e9a3a38fb450e23b98651c43b17d09b8521 100644 (file)
@@ -237,7 +237,7 @@ void AliESDpid::MakeTOFPID(AliESDtrack *track, Float_t /*timeZeroTOF*/) const
   track->SetTOFpid(p);
 
   if (heavy) track->ResetStatus(AliESDtrack::kTOFpid);    
-  if (!CheckTOFMatching(track)) track->SetStatus(AliESDtrack::kTOFmismatch);    
+  if (!CheckTOFMatching(track)) track->SetStatus(AliESDtrack::kTOFmismatch);
   
 }
 //_________________________________________________________________________
@@ -307,11 +307,11 @@ Bool_t AliESDpid::CheckTOFMatching(AliESDtrack *track) const{
     Double_t exptimes[5];
     track->GetIntegratedTimes(exptimes);
     
-    Float_t dedx = track->GetTPCsignal();
-    Float_t time = track->GetTOFsignal();
-    
     Float_t p = track->P();
     
+    Float_t dedx = track->GetTPCsignal();
+    Float_t time = track->GetTOFsignal() - fTOFResponse.GetStartTime(p);
+    
     Double_t ptpc[3];
     track->GetInnerPxPyPz(ptpc);
     Float_t momtpc=TMath::Sqrt(ptpc[0]*ptpc[0] + ptpc[1]*ptpc[1] + ptpc[2]*ptpc[2]);
@@ -324,7 +324,7 @@ Bool_t AliESDpid::CheckTOFMatching(AliESDtrack *track) const{
            Float_t dedxExp = fTPCResponse.GetExpectedSignal(momtpc,type);
            Float_t resolutionTPC = fTPCResponse.GetExpectedSigma(momtpc,track->GetTPCsignalN(),type);
            
-           if(TMath::Abs(dedx - dedxExp) < fRange * resolutionTPC){
+           if(TMath::Abs(dedx - dedxExp) < fRangeTOFMismatch * resolutionTPC){
                status = kTRUE;
            }
        }
@@ -356,11 +356,11 @@ void AliESDpid::SetTOFResponse(AliESDEvent *event,EStartTimeType_t option){
 
     Bool_t flagT0TOF=kFALSE;
     Bool_t flagT0T0=kFALSE;
-    Float_t startTime[fTOFResponse.GetNmomBins()];
-    Float_t startTimeRes[fTOFResponse.GetNmomBins()];
+    Float_t *startTime = new Float_t[fTOFResponse.GetNmomBins()];
+    Float_t *startTimeRes = new Float_t[fTOFResponse.GetNmomBins()];
 
-    Float_t estimatedT0event[fTOFResponse.GetNmomBins()];
-    Float_t estimatedT0resolution[fTOFResponse.GetNmomBins()];
+    Float_t *estimatedT0event = new Float_t[fTOFResponse.GetNmomBins()];
+    Float_t *estimatedT0resolution = new Float_t[fTOFResponse.GetNmomBins()];
     for(Int_t i=0;i<fTOFResponse.GetNmomBins();i++){
       estimatedT0event[i]=0.0;
       estimatedT0resolution[i]=0.0;
@@ -545,4 +545,8 @@ void AliESDpid::SetTOFResponse(AliESDEvent *event,EStartTimeType_t option){
        fTOFResponse.SetT0event(estimatedT0event);
        fTOFResponse.SetT0resolution(estimatedT0resolution);
     }
+    delete [] startTime;
+    delete [] startTimeRes;
+    delete [] estimatedT0event;
+    delete [] estimatedT0resolution;
 }