From 5c0368b8d81dcdd03bbc36014a9e2779cd75ea41 Mon Sep 17 00:00:00 2001 From: hristov Date: Fri, 6 Aug 2004 08:15:41 +0000 Subject: [PATCH 1/1] Protection added (T.Kuhr) --- EMCAL/AliEMCALRecPoint.cxx | 6 ++++-- TRD/AliTRDtracker.cxx | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/EMCAL/AliEMCALRecPoint.cxx b/EMCAL/AliEMCALRecPoint.cxx index c27080e2792..38ec13e4d33 100644 --- a/EMCAL/AliEMCALRecPoint.cxx +++ b/EMCAL/AliEMCALRecPoint.cxx @@ -499,6 +499,7 @@ void AliEMCALRecPoint::EvalPrimaries(TClonesArray * digits) for ( index = 0 ; index < GetDigitsMultiplicity() ; index++ ) { // all digits digit = dynamic_cast(digits->At( fDigitsList[index] )) ; Int_t nprimaries = digit->GetNprimary() ; + if ( nprimaries == 0 ) continue ; Int_t * newprimaryarray = new Int_t[nprimaries] ; Int_t ii ; for ( ii = 0 ; ii < nprimaries ; ii++) @@ -520,7 +521,7 @@ void AliEMCALRecPoint::EvalPrimaries(TClonesArray * digits) break ; } } // end of check - if ( !already) { // store it + if ( !already && (fMulTrack < fMaxTrack)) { // store it tempo[fMulTrack] = newprimary ; fMulTrack++ ; } // store it @@ -549,6 +550,7 @@ void AliEMCALRecPoint::EvalParents(TClonesArray * digits) for ( index = 0 ; index < GetDigitsMultiplicity() ; index++ ) { // all digits digit = dynamic_cast(digits->At( fDigitsList[index] )) ; Int_t nparents = digit->GetNiparent() ; + if ( nparents == 0 ) continue ; Int_t * newparentarray = new Int_t[nparents] ; Int_t ii ; for ( ii = 0 ; ii < nparents ; ii++) @@ -570,7 +572,7 @@ void AliEMCALRecPoint::EvalParents(TClonesArray * digits) break ; } } // end of check - if ( !already) { // store it + if ( !already && (fMulTrack < fMaxTrack)) { // store it tempo[fMulParent] = newparent ; fMulParent++ ; } // store it diff --git a/TRD/AliTRDtracker.cxx b/TRD/AliTRDtracker.cxx index f764263b841..bc654160406 100644 --- a/TRD/AliTRDtracker.cxx +++ b/TRD/AliTRDtracker.cxx @@ -594,7 +594,10 @@ Int_t AliTRDtracker::PropagateBack(AliESD* event) { continue; } Double_t xTOF0 = 371. ; - PropagateToOuterPlane(*track,xTOF0); + if (!PropagateToOuterPlane(*track,xTOF0)) { + delete track; + continue; + } // Double_t ymax=xtof*TMath::Tan(0.5*AliTRDgeometry::GetAlpha()); Double_t y=track->GetYat(xtof); -- 2.31.1