]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
2 coverity fixes and 1 compilation warning
authorjthaeder <jthaeder@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Mar 2013 16:07:21 +0000 (16:07 +0000)
committerjthaeder <jthaeder@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Mar 2013 16:07:21 +0000 (16:07 +0000)
PWGPP/TPC/AliPerformanceEff.cxx
PWGPP/TPC/AliPerformanceRes.cxx

index 35ab75e323f09e82af1f46095677641dafeab319..3167a2a0ee86f0ae5a0421ae20c94537c18b3d1d 100644 (file)
@@ -940,7 +940,7 @@ void AliPerformanceEff::Analyse()
   TH1::AddDirectory(kFALSE);
   TObjArray *aFolderObj = new TObjArray;
   if(!aFolderObj) return;
-  char title[256];
+  //  char title[256];
 
   //
   // efficiency vs pt
@@ -1415,15 +1415,16 @@ TH1D* AliPerformanceEff::AddHistoEff(Int_t axis, const Char_t *name, const Char_
   }
 
   EffHisto->GetAxis(4)->SetRange(1,0);                         //Reset Range
-  
-  recc->SetName(name);
-
-  recc->GetXaxis()->SetTitle(fEffHisto->GetAxis(axis)->GetTitle());
 
-  snprintf(title,256,"%s vs %s",vsTitle, fEffHisto->GetAxis(axis)->GetTitle());  
-  recc->SetTitle(title);
+  if (recc) { // Coverity fix
+    recc->SetName(name);
+    
+    recc->GetXaxis()->SetTitle(fEffHisto->GetAxis(axis)->GetTitle());
 
-  if (axis == 2 ) recc->SetBit(TH1::kLogX);
+    snprintf(title,256,"%s vs %s",vsTitle, fEffHisto->GetAxis(axis)->GetTitle());  
+    recc->SetTitle(title);
 
+    if (axis == 2 ) recc->SetBit(TH1::kLogX);
+  }
   return recc;
 }
index 6f9b941f9d8def4433aa62b91e27518a29b153b4..7d6afbd28982687d823a1e8e9f14aea098993969 100644 (file)
@@ -936,10 +936,11 @@ void AliPerformanceRes::Exec(AliMCEvent* const mcEvent, AliESDEvent *const esdEv
     vtxESD = esdEvent->GetPrimaryVertexTracks();
        if(vtxESD && (vtxESD->GetStatus()<=0)) return;
   }
-  else {
-    // TPC track vertex
-    vtxESD = esdEvent->GetPrimaryVertexTPC();
-  }
+  // Coverity - removed else branch as vtxESD is not further used in method
+  //  else {  
+  //    // TPC track vertex
+  //    vtxESD = esdEvent->GetPrimaryVertexTPC();
+  //  }