Fix for defect found by Coverity (Matus)
authorsma <sma@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 24 Feb 2011 10:58:46 +0000 (10:58 +0000)
committersma <sma@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 24 Feb 2011 10:58:46 +0000 (10:58 +0000)
PWG3/hfe/AliAnalysisTaskCheckV0tenderII.cxx

index 53437a5..d76b388 100644 (file)
@@ -483,8 +483,11 @@ void  AliAnalysisTaskCheckV0tenderII::ProcessBackground(AliESDv0 * const v0){
     ixM = PDGtoPIDv0(pdgM[0]) + 1;  
     if(ixM < 0) ixM = 5; 
   }
-  name = "h_" + type[PDGtoPIDv0(fpdgV0)] + "_Bg"; 
-  fCollMC->Fill(name, ixM, pt);
+  Int_t ix = PDGtoPIDv0(fpdgV0);
+  if(0 <= ix ){
+    name = "h_" + type[PDGtoPIDv0(fpdgV0)] + "_Bg"; 
+    fCollMC->Fill(name, ixM, pt);
+  }
   
   // now look at the daughter tracks