]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSVertexer3D.cxx
Fixes for Coverity defects
[u/mrichter/AliRoot.git] / ITS / AliITSVertexer3D.cxx
index b9460f1a0c8d9eaa4b4598abd404ad6cf0c382b9..e49a9b7ca80aec8a759b768864620737848a19a4 100644 (file)
@@ -33,7 +33,7 @@
 // p-p collisions
 ////////////////////////////////////////////////////////////////
 
-const Int_t    AliITSVertexer3D::fgkMaxNumOfClDefault = 500;
+const Int_t    AliITSVertexer3D::fgkMaxNumOfClDefault = 1000;
 
 ClassImp(AliITSVertexer3D)
 
@@ -128,7 +128,7 @@ AliESDVertex* AliITSVertexer3D::FindVertexForCurrentEvent(TTree *itsClusterTree)
       if(nolines>=2){
        rc=Prepare3DVertex(1);
        if(fPileupAlgo == 2 && rc == 0) FindVertex3DIterative();
-       else if(fPileupAlgo<2 && rc == 0) FindVertex3D(itsClusterTree);
+       else if(fPileupAlgo!=2 && rc == 0) FindVertex3D(itsClusterTree);
        if(rc!=0) fVert3D.SetNContributors(0); // exclude this vertex      
       }
     }
@@ -178,6 +178,7 @@ void AliITSVertexer3D::FindVertex3D(TTree *itsClusterTree){
     switch(fPileupAlgo){
     case 0: PileupFromZ(); break;
     case 1: FindOther3DVertices(itsClusterTree); break;
+    case 3: break; // no pileup algo  
     default: AliError("Wrong pileup algorithm"); break;
     }
     if(fNoVertices==1){
@@ -553,7 +554,7 @@ Int_t AliITSVertexer3D::FindTracklets(TTree *itsClusterTree, Int_t optCuts){
 
   Int_t nolines = 0;
   // Loop on modules of layer 1
-  Int_t firstL1 = AliITSgeomTGeo::GetModuleIndex(1,1,1);
+  Int_t firstL1 = TMath::Max(0,AliITSgeomTGeo::GetModuleIndex(1,1,1));
   Int_t lastL1 = AliITSgeomTGeo::GetModuleIndex(2,1,1)-1;
   for(Int_t modul1= firstL1; modul1<=lastL1;modul1++){   // Loop on modules of layer 1
     if(!fUseModule[modul1]) continue;
@@ -577,6 +578,7 @@ Int_t AliITSVertexer3D::FindTracklets(TTree *itsClusterTree, Int_t optCuts){
          Int_t ladmod=fLadders[ladder-1]+ladl2;
          if(ladmod>AliITSgeomTGeo::GetNLadders(2)) ladmod=ladmod-AliITSgeomTGeo::GetNLadders(2);
          Int_t modul2=AliITSgeomTGeo::GetModuleIndex(2,ladmod,k+1);
+         if(modul2<0)continue;
          if(!fUseModule[modul2]) continue;
          itsRec=rpcont->UncheckedGetClusters(modul2);
          Int_t nrecp2 = itsRec->GetEntries();