fixing coverity 16554 (M.Chojnacki)
authorbhippoly <bhippoly@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Apr 2011 19:58:35 +0000 (19:58 +0000)
committerbhippoly <bhippoly@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Apr 2011 19:58:35 +0000 (19:58 +0000)
PWG2/SPECTRA/AliAnalysisChargedHadronSpectraITSTruncatedMeanTask.cxx

index c2d0cc7..c9501e4 100644 (file)
@@ -870,9 +870,12 @@ void AliAnalysisChargedHadronSpectraITSTruncatedMeanTask::UserExec(Option_t *)
        
        if(fdovertexrescuts&&fMC)
        {
-               cout<<TMath::Abs(vertex->GetX()-mcXvertex)<<" "<<TMath::Abs(vertex->GetY()-mcYvertex)<<" "<<TMath::Abs(vertex->GetZ()-mcZvertex)<<endl;
-               if(TMath::Abs(vertex->GetX()-mcXvertex)>0.015||TMath::Abs(vertex->GetY()-mcYvertex)>0.015||TMath::Abs(vertex->GetZ()-mcZvertex)>0.15)
-                       isvxerteinZ=0;  
+               if(vertex)
+               {
+                       cout<<TMath::Abs(vertex->GetX()-mcXvertex)<<" "<<TMath::Abs(vertex->GetY()-mcYvertex)<<" "<<TMath::Abs(vertex->GetZ()-mcZvertex)<<endl;
+                       if(TMath::Abs(vertex->GetX()-mcXvertex)>0.015||TMath::Abs(vertex->GetY()-mcYvertex)>0.015||TMath::Abs(vertex->GetZ()-mcZvertex)>0.15)
+                               isvxerteinZ=0;
+               }               
        }  
        Float_t spdCorr=-1.0;
        if(isgoodvertex)