]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fix coverity #24651 #24652
authorgconesab <gustavo.conesa.balbastre@cern.ch>
Thu, 30 Oct 2014 13:08:32 +0000 (14:08 +0100)
committergconesab <gustavo.conesa.balbastre@cern.ch>
Thu, 30 Oct 2014 13:17:44 +0000 (14:17 +0100)
PWGGA/CaloTrackCorrelations/AliAnaElectron.cxx
PWGGA/CaloTrackCorrelations/AliAnaPhoton.cxx
PWGGA/CaloTrackCorrelations/AliAnaPhotonConvInCalo.cxx

index e7008ac2fdab6cbcfc9777a3998ad2d7448cf379..760a55b27f723649d749b8aa8672a051440f1698 100755 (executable)
@@ -1405,13 +1405,21 @@ void  AliAnaElectron::MakeAnalysisFillHistograms()
     if(GetReader()->ReadStack())
     {
       stack =  GetMCStack() ;
-      if ( !stack )       AliFatal("Stack not available, is the MC handler called? STOP");
+      if ( !stack )
+      {
+        AliFatal("Stack not available, is the MC handler called? STOP");
+        return;
+      }
     }
     else if(GetReader()->ReadAODMCParticles())
     {
       //Get the list of MC particles
       mcparticles = GetReader()->GetAODMCParticles();
-      if ( !mcparticles ) AliFatal("Standard MCParticles not available! STOP");
+      if ( !mcparticles )
+      {
+        AliFatal("Standard MCParticles not available! STOP");
+        return;
+      }
     }
   }// is data and MC
   
@@ -1470,7 +1478,7 @@ void  AliAnaElectron::MakeAnalysisFillHistograms()
       
       Float_t eprim   = 0;
       //Float_t ptprim  = 0;
-      if(GetReader()->ReadStack())
+      if( GetReader()->ReadStack() )
       {
         if(label >=  stack->GetNtrack())
         {
@@ -1489,22 +1497,15 @@ void  AliAnaElectron::MakeAnalysisFillHistograms()
         //ptprim  = primary->Pt();
         
       }
-      else if(GetReader()->ReadAODMCParticles())
+      else if( GetReader()->ReadAODMCParticles() )
       {
-        //Check which is the input
-        if(ph->GetInputFileIndex() == 0)
+        if(label >=  mcparticles->GetEntriesFast())
         {
-          if(!mcparticles) continue;
-          
-          if(label >=  mcparticles->GetEntriesFast())
-          {
-            AliDebug(1,Form("*** large label ***:  label %d, n tracks %d",label, mcparticles->GetEntriesFast()));
-            continue ;
-          }
-          //Get the particle
-          aodprimary = (AliAODMCParticle*) mcparticles->At(label);
-          
+          AliDebug(1,Form("*** large label ***:  label %d, n tracks %d",label, mcparticles->GetEntriesFast()));
+          continue ;
         }
+        //Get the particle
+        aodprimary = (AliAODMCParticle*) mcparticles->At(label);
         
         if(!aodprimary)
         {
index 63cb027ce06d3cfb1c1d9a05e94b1429f75af3bb..e7a5f5fb13df76dee26c7315ce2898b4e38f324b 100755 (executable)
@@ -348,7 +348,11 @@ void AliAnaPhoton::FillAcceptanceHistograms()
   if( GetReader()->ReadStack() )
   {
     stack = GetMCStack();
-    if(!stack ) return;
+    if( !stack )
+    {
+      AliFatal("Stack not available, is the MC handler called? STOP");
+      return;
+    }
     nprim = stack->GetNtrack();
   }
   
@@ -357,7 +361,11 @@ void AliAnaPhoton::FillAcceptanceHistograms()
   if( GetReader()->ReadAODMCParticles() )
   {
     mcparticles = GetReader()->GetAODMCParticles();
-    if( !mcparticles ) return;
+    if( !mcparticles )
+    {
+      AliFatal("Standard MCParticles not available!");
+      return;
+    }
     nprim = mcparticles->GetEntriesFast();
   }
   
index 1b69c759887540cf8802cb87dcf711a936d6fc08..761c41ffa7a9b6b73e6d60c0125d7eb98d5e2255 100755 (executable)
@@ -734,14 +734,20 @@ void  AliAnaPhotonConvInCalo::MakeAnalysisFillHistograms()
     {
       stack =  GetMCStack() ;
       if(!stack)
+      {
         AliFatal("Stack not available, is the MC handler called? STOP");
+        return;
+      }
     }
     else if(GetReader()->ReadAODMCParticles())
     {
       //Get the list of MC particles
       mcparticles = GetReader()->GetAODMCParticles();
       if(!mcparticles)
+      {
         AliFatal("Standard MCParticles not available!");
+        return;
+      }
     }
   }// is data and MC
   
@@ -804,22 +810,15 @@ void  AliAnaPhotonConvInCalo::MakeAnalysisFillHistograms()
         }
         else if(GetReader()->ReadAODMCParticles())
         {
-          //Check which is the input
-          if(ph->GetInputFileIndex() == 0)
+          if(label >=  mcparticles->GetEntriesFast())
           {
-            if(!mcparticles) continue;
-            
-            if(label >=  mcparticles->GetEntriesFast())
-            {
-              AliDebug(2,Form("*** large label ***:  label %d, n tracks %d",label, mcparticles->GetEntriesFast()));
-              continue ;
-            }
-            
-            //Get the particle
-            aodprimary = (AliAODMCParticle*) mcparticles->At(label);
-            
+            AliDebug(2,Form("*** large label ***:  label %d, n tracks %d",label, mcparticles->GetEntriesFast()));
+            continue ;
           }
           
+          //Get the particle
+          aodprimary = (AliAODMCParticle*) mcparticles->At(label);
+          
           if(!aodprimary)
           {
             AliDebug(2,Form("*** no primary ***:  label %d", label));