From: jgrosseo Date: Wed, 27 Jun 2007 17:04:49 +0000 (+0000) Subject: bug fix in AliCorrection X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=82ac9fc4a79b532811c5b1dc17ae003d72e260f3;ds=sidebyside bug fix in AliCorrection added function that returns label of mother particle --- diff --git a/PWG0/AliCorrection.cxx b/PWG0/AliCorrection.cxx index 319d17e83d1..9ecbd3fc203 100644 --- a/PWG0/AliCorrection.cxx +++ b/PWG0/AliCorrection.cxx @@ -44,10 +44,10 @@ AliCorrection::AliCorrection(const Char_t* name, const Char_t* title) : TNamed(n Float_t binLimitsEta[] = {-2,-1.9,-1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,-1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0}; // Float_t binLimitsEta[] = { -7.0, -6.9, -6.8, -6.7, -6.6, -6.5, -6.4, -6.3, -6.2, -6.1, -6.0, -5.9, -5.8, -5.7, -5.6, -5.5, -5.4, -5.3, -5.2, -5.1, -5.0, -4.9, -4.8, -4.7, -4.6, -4.5, -4.4, -4.3, -4.2, -4.1, -4.0, -3.9, -3.8, -3.7, -3.6, -3.5, -3.4, -3.3, -3.2, -3.1, -3.0, -2.9, -2.8, -2.7, -2.6, -2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8, -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, -0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0 }; - TH3F* dummyBinning = new TH3F("","",14, binLimitsVtx, 40, binLimitsEta , 28, binLimitsPt); + TH3F* dummyBinning = new TH3F("dummyBinning","dummyBinning",14, binLimitsVtx, 40, binLimitsEta , 28, binLimitsPt); - fEventCorr = new AliCorrectionMatrix2D("EventCorrection", Form("%s EventCorrection", title), 14, binLimitsVtx, 22, binLimitsN); - fTrackCorr = new AliCorrectionMatrix3D("TrackCorrection", Form("%s TrackCorrection", title), dummyBinning); + fEventCorr = new AliCorrectionMatrix2D("EventCorrection", Form("%s EventCorrection", fTitle.Data()), 14, binLimitsVtx, 22, binLimitsN); + fTrackCorr = new AliCorrectionMatrix3D("TrackCorrection", Form("%s TrackCorrection", fTitle.Data()), dummyBinning); delete dummyBinning; diff --git a/PWG0/AliCorrectionMatrix2D.cxx b/PWG0/AliCorrectionMatrix2D.cxx index c650d6f4961..39659ce4e7c 100644 --- a/PWG0/AliCorrectionMatrix2D.cxx +++ b/PWG0/AliCorrectionMatrix2D.cxx @@ -56,9 +56,9 @@ AliCorrectionMatrix2D::AliCorrectionMatrix2D(const Char_t* name, const Char_t* t Bool_t oldStatus = TH1::AddDirectoryStatus(); TH1::AddDirectory(kFALSE); - fhMeas = new TH2F("measured", Form("%s measured",title), nBinX, Xmin, Xmax, nBinY, Ymin, Ymax); - fhGene = new TH2F("generated", Form("%s generated",title), nBinX, Xmin, Xmax, nBinY, Ymin, Ymax); - fhCorr = new TH2F("correction", Form("%s correction",title), nBinX, Xmin, Xmax, nBinY, Ymin, Ymax); + fhMeas = new TH2F("measured", Form("%s measured", GetTitle()), nBinX, Xmin, Xmax, nBinY, Ymin, Ymax); + fhGene = new TH2F("generated", Form("%s generated", GetTitle()), nBinX, Xmin, Xmax, nBinY, Ymin, Ymax); + fhCorr = new TH2F("correction", Form("%s correction", GetTitle()), nBinX, Xmin, Xmax, nBinY, Ymin, Ymax); TH1::AddDirectory(oldStatus); diff --git a/PWG0/AliCorrectionMatrix3D.cxx b/PWG0/AliCorrectionMatrix3D.cxx index 7d4c7411b58..d50d3894bef 100644 --- a/PWG0/AliCorrectionMatrix3D.cxx +++ b/PWG0/AliCorrectionMatrix3D.cxx @@ -113,9 +113,9 @@ AliCorrectionMatrix3D::AliCorrectionMatrix3D(const Char_t* name, const Char_t* t fhGene = (TH3F*)hBinning->Clone("generated"); fhCorr = (TH3F*)hBinning->Clone("correction"); - fhMeas->SetTitle(Form("%s measured",title) ); - fhGene->SetTitle(Form("%s generated",title )); - fhCorr->SetTitle(Form("%s correction",title)); + fhMeas->SetTitle(Form("%s measured", GetTitle())); + fhGene->SetTitle(Form("%s generated", GetTitle())); + fhCorr->SetTitle(Form("%s correction", GetTitle())); fhMeas->Reset(); fhGene->Reset(); diff --git a/PWG0/AliPWG0depHelper.cxx b/PWG0/AliPWG0depHelper.cxx index d721aba089e..3a7a097f7ae 100644 --- a/PWG0/AliPWG0depHelper.cxx +++ b/PWG0/AliPWG0depHelper.cxx @@ -80,35 +80,47 @@ TParticle* AliPWG0depHelper::FindPrimaryMother(AliStack* stack, Int_t label) // i.e. the primary that "caused" this particle // - Int_t nPrim = stack->GetNprimary(); - TParticle* mother = stack->Particle(label); - - if (!mother) - { - AliDebugGeneral("FindPrimaryMother", AliLog::kError, Form("UNEXPECTED: Could not retrieve particle with label %d.", label)); + Int_t motherLabel = FindPrimaryMotherLabel(stack, label); + if (motherLabel < 0) return 0; - } + + return stack->Particle(motherLabel); +} + +//____________________________________________________________________ +Int_t AliPWG0depHelper::FindPrimaryMotherLabel(AliStack* stack, Int_t label) +{ + // + // Finds the first mother among the primary particles of the particle identified by