Coverity 16550
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 May 2011 12:31:10 +0000 (12:31 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 May 2011 12:31:10 +0000 (12:31 +0000)
ANALYSIS/AliEPSelectionTask.cxx

index ad1714f..580e6f1 100644 (file)
@@ -367,7 +367,10 @@ void AliEPSelectionTask::SetPhiDistribution(char* infilename, char* listname)
   TFile f(infilename);
   TObject* list = f.Get(listname);
   fPhiDist = (TH1F*)list->FindObject("fHOutPhi");
-  if (!fPhiDist) cout << "Phi Distribution not found!!!" << endl;
+  if (!fPhiDist) {
+    cout << "Phi Distribution not found!!!" << endl;
+    return;
+  }
   
   Bool_t emptybins;
 
@@ -411,7 +414,7 @@ Double_t AliEPSelectionTask::GetPhiWeight(AliESDtrack* track)
 {
   Double_t phiweight=1;
   
-  if (fUsePhiWeight) {
+  if (fUsePhiWeight && fPhiDist && track) {
     Double_t nParticles = fPhiDist->Integral();
     Double_t nPhibins = fPhiDist->GetNbinsX();