From 38c1fcd3ee32a55b3bbfc3aeec941fc8484897ec Mon Sep 17 00:00:00 2001 From: hristov Date: Fri, 27 May 2005 08:27:09 +0000 Subject: [PATCH] Additional protection --- RICH/AliRICHClusterFinder.cxx | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/RICH/AliRICHClusterFinder.cxx b/RICH/AliRICHClusterFinder.cxx index fa8fb709d49..9c243c97651 100644 --- a/RICH/AliRICHClusterFinder.cxx +++ b/RICH/AliRICHClusterFinder.cxx @@ -150,15 +150,22 @@ void AliRICHClusterFinder::FindClusterContribs(AliRICHCluster *pCluster) }//loop on digits to sort Tid if (contribs[pindex[3*pCluster->Size()-1]]!=-1) { + Int_t thecontrib = contribs[pindex[3*pCluster->Size()-1]]; + if (thecontribGetNtrack()){ + //PH the opposite should not happen - TParticle* particle = pStack->Particle(contribs[pindex[3*pCluster->Size()-1]]); - Int_t code = particle->GetPdgCode(); - Double_t charge = 0; - if(particle->GetPDG()) charge=particle->GetPDG()->Charge(); - AliDebug(1,Form(" charge of particle %f",charge)); - if(code==50000050) iNckovs++; - if(code==50000051) iNfeeds++; - if(charge!=0) iNmips++; + TParticle* particle = pStack->Particle(thecontrib); + if (particle) { + //PH the opposite should not happen + Int_t code = particle->GetPdgCode(); + Double_t charge = 0; + if(particle->GetPDG()) charge=particle->GetPDG()->Charge(); + AliDebug(1,Form(" charge of particle %f",charge)); + if(code==50000050) iNckovs++; + if(code==50000051) iNfeeds++; + if(charge!=0) iNmips++; + } + } } pCluster->CFM(iNckovs,iNfeeds,iNmips); -- 2.31.1