Fix for coverity defects
authorfprino <prino@to.infn.it>
Mon, 17 Mar 2014 16:48:39 +0000 (17:48 +0100)
committerfprino <prino@to.infn.it>
Mon, 17 Mar 2014 16:49:05 +0000 (17:49 +0100)
PWGHF/vertexingHF/AliAnalysisTaskSELc2V0bachelorTMVA.cxx
PWGHF/vertexingHF/AliRDHFCuts.cxx

index 4bbf24e..e47ec54 100644 (file)
@@ -1847,7 +1847,7 @@ Int_t AliAnalysisTaskSELc2V0bachelorTMVA::CallKFVertexing(AliAODRecoCascadeHF *c
            AliDebug(3, "Could not access MC info for second daughter of Lc");
          }
          else { // we can access safely the K0S mother in the MC
-           if( daughv01Lc->GetMother() ==  daughv02Lc->GetMother() && daughv01Lc->GetMother()>=0 ){  // This is a true cascade! bachelor and V0 come from the same mother
+           if( daughv01Lc && daughv02Lc && daughv01Lc->GetMother() ==  daughv02Lc->GetMother() && daughv01Lc->GetMother()>=0 ){  // This is a true cascade! bachelor and V0 come from the same mother
              //Printf("Lc: The mother has label %d", daughv01Lc->GetMother());
              AliAODMCParticle *motherLc = dynamic_cast<AliAODMCParticle*>(mcArray->At(daughv01Lc->GetMother()));
              Int_t pdgMum = 0, pdgBach = 0, pdgV0 = 0;
index ee0e8ec..438f3f6 100644 (file)
@@ -1050,7 +1050,7 @@ void AliRDHFCuts::PrintAll() const {
    }
    cout<<endl;
   }
-  fPidHF->PrintAll();
+  if(fPidHF) fPidHF->PrintAll();
   return;
 }