]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixing Coverity 10992 (B.Hippolyte)
authorbhippoly <bhippoly@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 29 Apr 2011 09:56:55 +0000 (09:56 +0000)
committerbhippoly <bhippoly@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 29 Apr 2011 09:56:55 +0000 (09:56 +0000)
PWG2/SPECTRA/AliProtonSpectraCorrection.cxx

index 2d58cee2014434982f2ae7c5f21e6fb59e9b7332..e7ab1e11bbd18ab0a16cbf5294b97e04827ff191 100644 (file)
@@ -206,39 +206,41 @@ void AliProtonSpectraCorrection::FillCorrectionMaps(AliESDEvent *esd,
 
     //Protons
     //check the MC-level cuts
-    if (mcPart && fCFManagerProtons->CheckParticleCuts(AliCFManager::kPartGenCuts,
-                                            mcPart)) {
-      containerInput[0] = (Float_t)mcPart->Eta();
-      containerInput[1] = (Float_t)mcPart->Pt();
-      //fill the container for Gen-level selection
-      fCFManagerProtons->GetParticleContainer()->Fill(containerInput,
-                                                     kStepGenerated);
-      //check the Acceptance-level cuts
-      if (fCFManagerProtons->CheckParticleCuts(AliCFManager::kPartAccCuts,
+    if (mcPart){
+      if (fCFManagerProtons->CheckParticleCuts(AliCFManager::kPartGenCuts,
                                               mcPart)) {
-       //fill the container for Acceptance-level selection
+       containerInput[0] = (Float_t)mcPart->Eta();
+       containerInput[1] = (Float_t)mcPart->Pt();
+       //fill the container for Gen-level selection
        fCFManagerProtons->GetParticleContainer()->Fill(containerInput,
-                                                       kStepReconstructible);
-      }//acceptance cuts - protons
-    }//MC level cuts - protons
-
-    //Antiprotons
-    //check the MC-level cuts
-    if (fCFManagerAntiProtons->CheckParticleCuts(AliCFManager::kPartGenCuts,
+                                                       kStepGenerated);
+       //check the Acceptance-level cuts
+       if (fCFManagerProtons->CheckParticleCuts(AliCFManager::kPartAccCuts,
                                                 mcPart)) {
-      containerInput[0] = (Float_t)mcPart->Eta();
-      containerInput[1] = (Float_t)mcPart->Pt();
-      //fill the container for Gen-level selection
-      fCFManagerAntiProtons->GetParticleContainer()->Fill(containerInput,
-                                                         kStepGenerated);
-      //check the Acceptance-level cuts
-      if (fCFManagerAntiProtons->CheckParticleCuts(AliCFManager::kPartAccCuts,
+         //fill the container for Acceptance-level selection
+         fCFManagerProtons->GetParticleContainer()->Fill(containerInput,
+                                                         kStepReconstructible);
+       }//acceptance cuts - protons
+      }//MC level cuts - protons
+
+      //Antiprotons
+      //check the MC-level cuts
+      if (fCFManagerAntiProtons->CheckParticleCuts(AliCFManager::kPartGenCuts,
                                                   mcPart)) {
-       //fill the container for Acceptance-level selection
+       containerInput[0] = (Float_t)mcPart->Eta();
+       containerInput[1] = (Float_t)mcPart->Pt();
+       //fill the container for Gen-level selection
        fCFManagerAntiProtons->GetParticleContainer()->Fill(containerInput,
-                                                           kStepReconstructible);
-      }//acceptance cuts - antiprotons
-    }//MC level cuts - antiprotons
+                                                           kStepGenerated);
+       //check the Acceptance-level cuts
+       if (fCFManagerAntiProtons->CheckParticleCuts(AliCFManager::kPartAccCuts,
+                                                    mcPart)) {
+         //fill the container for Acceptance-level selection
+         fCFManagerAntiProtons->GetParticleContainer()->Fill(containerInput,
+                                                             kStepReconstructible);
+       }//acceptance cuts - antiprotons
+      }//MC level cuts - antiprotons
+    }//MC particle condition
   }//loop over MC particles