Protection for case where Rho task does not run
authormvl <marco.van.leeuwen@cern.ch>
Sun, 25 May 2014 12:20:55 +0000 (14:20 +0200)
committermvl <marco.van.leeuwen@cern.ch>
Sun, 25 May 2014 12:21:16 +0000 (14:21 +0200)
PWGJE/EMCALJetTasks/AliAnalysisTaskEmcalJetSample.cxx

index abeb7f2..eb9d1eb 100644 (file)
@@ -237,9 +237,10 @@ Bool_t AliAnalysisTaskEmcalJetSample::FillHistograms()
       Float_t ptLeading = fJetsCont->GetLeadingHadronPt(jet);
       fHistJetsPtLeadHad[fCentBin]->Fill(jet->Pt(), ptLeading);
 
-      Float_t corrPt = jet->Pt() - fJetsCont->GetRhoVal() * jet->Area();
-      fHistJetsCorrPtArea[fCentBin]->Fill(corrPt, jet->Area());
-      
+      if (fHistJetsCorrPtArea[fCentBin]) {
+       Float_t corrPt = jet->Pt() - fJetsCont->GetRhoVal() * jet->Area();
+       fHistJetsCorrPtArea[fCentBin]->Fill(corrPt, jet->Area());
+      }
       jet = fJetsCont->GetNextAcceptJet(); 
     }