From f5f555636949bda1e356fd2beae1844a288aedd7 Mon Sep 17 00:00:00 2001 From: hristov Date: Tue, 20 Nov 2001 09:27:55 +0000 Subject: [PATCH] Possibility to investigate a primary of not yet loaded particle (I.Hrivnacova) --- STEER/AliStack.cxx | 9 +++++---- STEER/AliStack.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/STEER/AliStack.cxx b/STEER/AliStack.cxx index 9f6195285df..4acb9eeaebc 100644 --- a/STEER/AliStack.cxx +++ b/STEER/AliStack.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.15 2001/09/04 15:10:37 hristov +Additional protection is included to avoid some problems using Hijing + Revision 1.14 2001/08/30 09:44:06 hristov VertexSource_t added to avoid the warnings @@ -612,20 +615,18 @@ TParticle* AliStack::Particle(Int_t i) } //_____________________________________________________________________________ -Int_t AliStack::GetPrimary(Int_t id) const +Int_t AliStack::GetPrimary(Int_t id) { // // Return number of primary that has generated track // int current, parent; - TParticle *part; // parent=id; while (1) { current=parent; - part = (TParticle *)fParticleMap->At(current); - parent=part->GetFirstMother(); + parent=Particle(current)->GetFirstMother(); if(parent<0) return current; } } diff --git a/STEER/AliStack.h b/STEER/AliStack.h index 1a9a132c258..54d3f7ba9f2 100644 --- a/STEER/AliStack.h +++ b/STEER/AliStack.h @@ -63,7 +63,7 @@ class AliStack : public TObject Int_t CurrentTrack() const; TObjArray* Particles() const; TParticle* Particle(Int_t id); - Int_t GetPrimary(Int_t id) const; + Int_t GetPrimary(Int_t id); TTree* TreeK() const {return fTreeK;} protected: -- 2.43.0