From f7043b9e052fe1db1fc9f6caad1d346b3b04b11f Mon Sep 17 00:00:00 2001 From: cholm Date: Tue, 26 Apr 2011 20:30:06 +0000 Subject: [PATCH] Minor things --- .../analysis2/AliForwarddNdetaTask.cxx | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/PWG2/FORWARD/analysis2/AliForwarddNdetaTask.cxx b/PWG2/FORWARD/analysis2/AliForwarddNdetaTask.cxx index d9e57605abf..8011c5d9cdf 100644 --- a/PWG2/FORWARD/analysis2/AliForwarddNdetaTask.cxx +++ b/PWG2/FORWARD/analysis2/AliForwarddNdetaTask.cxx @@ -243,10 +243,7 @@ AliForwarddNdetaTask::CentralityBin::End(TList* sums, fSumPrimary = static_cast(fSums->FindObject("truth")); - if (!fSumPrimary) { - AliWarning("No MC truth histogram found"); - } - else { + if (fSumPrimary) { #if 0 Int_t n = fSumPrimary->GetBinContent(0,0); #else @@ -263,9 +260,25 @@ AliForwarddNdetaTask::CentralityBin::End(TList* sums, SetHistogramAttributes(dndetaTruth, GetColor(), 30, "Monte-Carlo truth"); - + fOutput->Add(dndetaTruth); fOutput->Add(Rebin(dndetaTruth, rebin, cutEdges)); + + // Get analysis result, and form ratio + TH1D* dndeta = static_cast(fOutput->FindObject(Form("dndeta%s", + GetName()))); + if (!dndeta) { + AliWarning(Form("No dndeta%s in the list %s", + GetName(), fOutput->GetName())); + } + else { + TH1D* ratio = static_cast(dndeta->Clone("ratio")); + ratio->SetDirectory(0); + ratio->Divide(dndetaTruth); + + fOutput->Add(ratio); + fOutput->Add(Rebin(ratio, rebin, cutEdges)); + } } if (!IsAllBin()) return; -- 2.43.0