protection
authormverweij <marta.verweij@cern.ch>
Fri, 2 May 2014 13:55:57 +0000 (15:55 +0200)
committermverweij <marta.verweij@cern.ch>
Fri, 2 May 2014 13:55:57 +0000 (15:55 +0200)
PWG/EMCAL/AliAnalysisTaskEmcal.cxx

index 09c6c2ea0cf41752e77f5fb8380a36bfbaff3898..10f1a97115fed3ac18c9bec633db45c9dc18edc1 100644 (file)
@@ -353,10 +353,12 @@ Bool_t AliAnalysisTaskEmcal::FillGeneralHistograms()
     fHistEventsAfterSel->SetBinContent(fPtHardBin + 1, fHistEventsAfterSel->GetBinContent(fPtHardBin + 1) + 1);
     fHistTrialsAfterSel->SetBinContent(fPtHardBin + 1, fHistTrialsAfterSel->GetBinContent(fPtHardBin + 1) + fNTrials);
     fHistPtHard->Fill(fPtHard);
     fHistEventsAfterSel->SetBinContent(fPtHardBin + 1, fHistEventsAfterSel->GetBinContent(fPtHardBin + 1) + 1);
     fHistTrialsAfterSel->SetBinContent(fPtHardBin + 1, fHistTrialsAfterSel->GetBinContent(fPtHardBin + 1) + fNTrials);
     fHistPtHard->Fill(fPtHard);
-    fXsection = fPythiaHeader->GetXsection();
-    if(fXsection>0.) {
-      fHistXsection->Fill(fPtHardBin+1, fXsection);
-      fHistTrials->Fill(fPtHardBin+1, fPythiaHeader->Trials());
+    if(fPythiaHeader) {
+      fXsection = fPythiaHeader->GetXsection();
+      if(fXsection>0.) {
+       fHistXsection->Fill(fPtHardBin+1, fXsection);
+       fHistTrials->Fill(fPtHardBin+1, fPythiaHeader->Trials());
+      }
     }
   }
 
     }
   }