X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PWG0%2FAliCorrectionMatrix.cxx;h=7cf9901d7cb201ccc8e769196928805ced3072f2;hb=dffe2c067c8fa30cd88339fb9e9ab000e5389b6c;hp=990a1d4d001b77a3c1c17eee713ae1a388c069a9;hpb=dd367a14cefc8d755fdb5ae2e86bbfa1b784eadb;p=u%2Fmrichter%2FAliRoot.git diff --git a/PWG0/AliCorrectionMatrix.cxx b/PWG0/AliCorrectionMatrix.cxx index 990a1d4d001..7cf9901d7cb 100644 --- a/PWG0/AliCorrectionMatrix.cxx +++ b/PWG0/AliCorrectionMatrix.cxx @@ -160,12 +160,6 @@ void AliCorrectionMatrix::Divide() // divides generated by measured to get the correction // -// if (!fhCorr) { -// fhCorr = (TH1*)fhGene->Clone("correction"); -// fhCorr->SetTitle(Form("%s correction",GetTitle())); -// fhCorr->Reset(); -// } - if (!fhMeas || !fhGene || !fhCorr) { AliDebug(AliLog::kError, "measured or generated histograms not available"); return; @@ -359,10 +353,13 @@ void AliCorrectionMatrix::SetCorrectionToUnity() if (!fhCorr) return; - for (Int_t x=1; x<=fhCorr->GetNbinsX(); ++x) - for (Int_t y=1; y<=fhCorr->GetNbinsY(); ++y) - for (Int_t z=1; z<=fhCorr->GetNbinsZ(); ++z) + for (Int_t x=0; x<=fhCorr->GetNbinsX()+1; ++x) + for (Int_t y=0; y<=fhCorr->GetNbinsY()+1; ++y) + for (Int_t z=0; z<=fhCorr->GetNbinsZ()+1; ++z) + { fhCorr->SetBinContent(x, y, z, 1); + fhCorr->SetBinError(x, y, z, 0); + } } //____________________________________________________________________ @@ -375,3 +372,17 @@ void AliCorrectionMatrix::Scale(Double_t factor) fhMeas->Scale(factor); fhGene->Scale(factor); } + +//____________________________________________________________________ +void AliCorrectionMatrix::ResetErrorsOnCorrections() +{ + // set the errors on the correction matrix to 0 + + if (!fhCorr) + return; + + for (Int_t x=0; x<=fhCorr->GetNbinsX()+1; ++x) + for (Int_t y=0; y<=fhCorr->GetNbinsY()+1; ++y) + for (Int_t z=0; z<=fhCorr->GetNbinsZ()+1; ++z) + fhCorr->SetBinError(x, y, z, 0); +}