fix coverity 24179,24125,24178, check nullness of casted pointers
authorgconesab <gustavo.conesa.balbastre@cern.ch>
Fri, 13 Jun 2014 09:11:04 +0000 (11:11 +0200)
committergconesab <gustavo.conesa.balbastre@cern.ch>
Fri, 13 Jun 2014 09:11:59 +0000 (11:11 +0200)
PWGGA/CaloTrackCorrelations/AliAnaParticleJetFinderCorrelation.cxx

index 5644c73..071940c 100755 (executable)
@@ -1024,6 +1024,7 @@ void  AliAnaParticleJetFinderCorrelation::MakeAnalysisFillAOD()
     //Double_t ptCorrect=0.;
     for(Int_t ijet = 0; ijet < nJets ; ijet++){
       jet = dynamic_cast<AliAODJet*>(aodRecJets->At(ijet));
+      if(!jet) continue;
       if(TMath::Abs(jet->Eta()) > (0.9 - fJetConeSize) ) continue;
       if(jet->EffectiveAreaCharged()<fJetAreaFraction*TMath::Pi()*fJetConeSize*fJetConeSize) continue;
       if(jet->Pt()<fJetMinPt) continue;
@@ -1167,6 +1168,7 @@ void  AliAnaParticleJetFinderCorrelation::MakeAnalysisFillHistograms()
     Double_t sumTrackPt=0;
     for(itrack = 0; itrack < nCTSTracks ; itrack++){
       aodtrack = dynamic_cast <AliAODTrack*>(GetCTSTracks()->At(itrack));
+      if(!aodtrack) continue;
       fhTrackPhiVsEta->Fill(aodtrack->Phi(),aodtrack->Eta());
       sumTrackPt+=aodtrack->Pt();
     }
@@ -1192,6 +1194,7 @@ void  AliAnaParticleJetFinderCorrelation::MakeAnalysisFillHistograms()
   Int_t itrk=0;
   for(Int_t ijet = 0; ijet < nJets ; ijet++){
     jettmp = dynamic_cast<AliAODJet*>(aodRecJets->At(ijet));
+    if(!jettmp) continue;
     fhJetPtBefore->Fill(jettmp->Pt());
     jetPttmp  = jettmp->Pt() - rhoEvent * jettmp->EffectiveAreaCharged();//<<---changed here