]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGGA/CaloTrackCorrelations/AliAnaPhotonConvInCalo.cxx
fix coverity #24651 #24652
[u/mrichter/AliRoot.git] / PWGGA / CaloTrackCorrelations / AliAnaPhotonConvInCalo.cxx
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));