From 6fca035d324b2279f84983a2dbfc58aa0a83b103 Mon Sep 17 00:00:00 2001 From: belikov Date: Thu, 10 Apr 2008 12:54:22 +0000 Subject: [PATCH] Bug fix: remapping the indices of tracks used for the primary vertex reconstruction --- STEER/AliESD.cxx | 26 ++++++++++++++++++++++++ STEER/AliESDEvent.cxx | 47 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) diff --git a/STEER/AliESD.cxx b/STEER/AliESD.cxx index 2d98ce5258c..faef82c3e70 100644 --- a/STEER/AliESD.cxx +++ b/STEER/AliESD.cxx @@ -330,6 +330,17 @@ Bool_t AliESD::RemoveTrack(Int_t rm) { Int_t used=0; + // Check if this track comes from the reconstructed primary vertex + if (fPrimaryVertex.GetStatus()) { + UShort_t *primIdx=fPrimaryVertex.GetIndices(); + Int_t n=fPrimaryVertex.GetNIndices(); + while (n--) { + Int_t idx=Int_t(primIdx[n]); + if (rm==idx) return kFALSE; + if (idx==last) used++; + } + } + // Check if this track comes from a reconstructed decay Int_t nv0=GetNumberOfV0s(); for (Int_t n=0; nGetStatus()) { + UShort_t *primIdx=fTPCVertex->GetIndices(); + Int_t n=fTPCVertex->GetNIndices(); + while (n--) { + Int_t idx=Int_t(primIdx[n]); + if (rm==idx) return kFALSE; + if (idx==last) used++; + } + } + if (fPrimaryVertex && fPrimaryVertex->GetStatus()) { + UShort_t *primIdx=fPrimaryVertex->GetIndices(); + Int_t n=fPrimaryVertex->GetNIndices(); + while (n--) { + Int_t idx=Int_t(primIdx[n]); + if (rm==idx) return kFALSE; + if (idx==last) used++; + } + } + // Check if this track comes from a reconstructed decay Int_t nv0=GetNumberOfV0s(); for (Int_t n=0; nGetStatus()) { + UShort_t *primIdx=fTPCVertex->GetIndices(); + Int_t n=fTPCVertex->GetNIndices(); + while (n--) { + Int_t idx=Int_t(primIdx[n]); + if (idx==last) { + primIdx[n]=Short_t(rm); + used--; + if (!used) return kTRUE; + } + } + } + if (fPrimaryVertex && fPrimaryVertex->GetStatus()) { + UShort_t *primIdx=fPrimaryVertex->GetIndices(); + Int_t n=fPrimaryVertex->GetNIndices(); + while (n--) { + Int_t idx=Int_t(primIdx[n]); + if (idx==last) { + primIdx[n]=Short_t(rm); + used--; + if (!used) return kTRUE; + } + } + } + // Remap the indices of the daughters of reconstructed decays for (Int_t n=0; n