]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coverity fix in AliITStrackU
authoramastros <amastros@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 May 2011 07:43:36 +0000 (07:43 +0000)
committeramastros <amastros@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 May 2011 07:43:36 +0000 (07:43 +0000)
AliITStrackerUpgrade::SearchClusters updated according to AliITStrackerSA.

ITS/UPGRADE/AliITStrackU.cxx
ITS/UPGRADE/AliITStrackerUpgrade.cxx

index 1e22bf7178d2dd2316e2c6ee27868b5fa3469869..a2f4ff015be36a0f127bc4c88ff8066720696f70 100755 (executable)
@@ -78,7 +78,8 @@ AliITStrackU::AliITStrackU(AliESDtrack& t,Bool_t c):
   // Copy a V2 track into a U track
   // -> to be checked
   //------------------------------------------------------------------
-
+ ResetIndexU();
+ ResetMarked();
   for(Int_t nlay=0;nlay<fgMaxNLayer;nlay++){
     fDy[nlay]=0; fDz[nlay]=0; fSigmaY[nlay]=0; fSigmaZ[nlay]=0; fSigmaYZ[nlay]=0;
     fClIndex[nlay]=-1; fNy[nlay]=0; fNz[nlay]=0; fNormQ[nlay]=0; fNormChi2[nlay]=1000;  
index edd8d6cbaf2a925dd0a9ab860b0f3e59a786b8d5..ed09c694cf34d336d2a83a98dca921633b074f2e 100644 (file)
@@ -403,7 +403,7 @@ Int_t AliITStrackerUpgrade::FindTracks(AliESDEvent* event,Bool_t useAllClusters)
 
       // loop on phi and lambda window size
       for(Int_t nloop=0;nloop<fNloop;nloop++){
-       Int_t nclTheLay=fCluLayer[theLay]->GetEntries();
+       Int_t nclTheLay=fCluLayer[theLay]->GetEntriesFast();
         while(nclTheLay--){
           ResetForFinding();
           Bool_t useRP=SetFirstPoint(theLay,nclTheLay,primaryVertex);
@@ -738,44 +738,39 @@ Int_t AliITStrackerUpgrade::SearchClusters(Int_t layer,Double_t phiwindow,Double
     fPhiEstimate=ChoosePoint(fi1,fi2,fPhic);
   }
 
-  Int_t ncl = fCluLayer[layer]->GetEntries();
-  AliDebug(2,Form(" Number of clusters %i in layer %i.",ncl,layer));
+
+  Double_t phiExpect=fPhiEstimate;
+  Double_t lamExpect=fLambdac;
+
+  Int_t ncl = fCluLayer[layer]->GetEntriesFast();
   for (Int_t index=0; index<ncl; index++) {
-    AliITSRecPointU *c = (AliITSRecPointU*)fCluLayer[layer]->At(index);
-    if (!c) continue;
-    if (c->GetQ()<=0) continue;
-    if(layer>1 && c->GetQ()<=fMinQ) continue;
-    
+
     AliITSclusterTable* arr = (AliITSclusterTable*)GetClusterCoord(layer,index);
-    
-    Double_t phi;
-    Double_t xT,yT;
-    xT=arr->GetX();
-    yT=arr->GetY();
-    phi=arr->GetPhi();
-    if (TMath::Abs(phi-fPhiEstimate)>phiwindow)
-      {
-        continue;
-      }
 
     Double_t lambda = arr->GetLambda();
-    if (TMath::Abs(lambda-fLambdac)>lambdawindow) continue;
+    if (TMath::Abs(lambda-lamExpect)>lambdawindow) continue;
+
+    Double_t phi = arr->GetPhi();
+    Double_t deltaPhi = phi-phiExpect;
+    if(deltaPhi>TMath::Pi()) deltaPhi-=2*TMath::Pi();
+    else if(deltaPhi<-TMath::Pi()) deltaPhi+=2*TMath::Pi();
+    if (TMath::Abs(deltaPhi)>phiwindow) continue;
 
     if(trs->GetNumberOfClustersU()==trs->GetMaxNumberOfClusters()) return 0;
     if(trs->GetNumberOfMarked(layer)==trs->GetMaxNMarkedPerLayer()) return 0;
     Int_t orind = arr->GetOrInd();
     trs->AddClusterU(layer,orind);
     trs->AddClusterMark(layer,index);
-       
     nc++;
     fLambdac=lambda;
     fPhiEstimate=phi;
 
     fPointc[0]=arr->GetX();
     fPointc[1]=arr->GetY();
+
   }
   return nc;
 }
 
 //________________________________________________________________