coverity, check if pointer was null
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 17 Dec 2012 10:27:41 +0000 (10:27 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 17 Dec 2012 10:27:41 +0000 (10:27 +0000)
PWGGA/CaloTrackCorrelations/AliAnaChargedParticles.cxx
PWGGA/CaloTrackCorrelations/AliAnaPi0EbE.cxx

index 228c105..9f49843 100755 (executable)
@@ -711,8 +711,8 @@ void  AliAnaChargedParticles::MakeAnalysisFillAOD()
     
     Bool_t bITSRefit    = (status & AliVTrack::kITSrefit) == AliVTrack::kITSrefit;
     Bool_t bConstrained = kFALSE;
-    if(aodTrack) bConstrained = aodTrack->IsGlobalConstrained();
-    else         bConstrained = (!esdTrack->HasPointOnITSLayer(0) && !esdTrack->HasPointOnITSLayer(1));
+    if     (aodTrack) bConstrained = aodTrack->IsGlobalConstrained();
+    else if(esdTrack) bConstrained = (!esdTrack->HasPointOnITSLayer(0) && !esdTrack->HasPointOnITSLayer(1));
     //printf("Track %d, pt %2.2f, eta %2.2f, phi %2.2f, SPDRefit %d, refit %d, dcaCons %2.2f\n",
     //       i, track->Pt(), track->Eta(), track->Phi(), bConstrained, bITSRefit, dcaCons);
     
index 434295b..6ac84cd 100755 (executable)
@@ -1942,7 +1942,7 @@ void  AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS()
         
         // Fill histograms to undertand pile-up before other cuts applied
         // Remember to relax time cuts in the reader
-        FillPileUpHistograms(mom.E(),cluster->GetTOF()*1e9);     
+        if(cluster)FillPileUpHistograms(mom.E(),cluster->GetTOF()*1e9);
         
         AliAODPWG4Particle pi0 = AliAODPWG4Particle(mom);