From: hristov Date: Fri, 11 May 2007 18:37:31 +0000 (+0000) Subject: Using the current particle momentum for the generation of transition radiation (Andrei) X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=3bf98338adbf219167ab7a82e6b0b880f1664241;p=u%2Fmrichter%2FAliRoot.git Using the current particle momentum for the generation of transition radiation (Andrei) --- diff --git a/TRD/AliTRDsim.cxx b/TRD/AliTRDsim.cxx index ce243350257..1fa0cd67cf9 100644 --- a/TRD/AliTRDsim.cxx +++ b/TRD/AliTRDsim.cxx @@ -476,11 +476,13 @@ Int_t AliTRDsim::TrPhotons(Float_t p, Float_t mass // Link the MC stack and get info about parent electron TVirtualMCStack *stack = gMC->GetStack(); - TParticle *trGenerator = stack->GetCurrentTrack(); Int_t track = stack->GetCurrentTrackNumber(); - Double_t px = trGenerator->Px() / trGenerator->P(); - Double_t py = trGenerator->Py() / trGenerator->P(); - Double_t pz = trGenerator->Pz() / trGenerator->P(); + Double_t px,py,pz,ptot; + gMC->TrackMomentum(px,py,pz,ptot); + ptot = TMath::Sqrt(px*px+py*py+pz*pz); + px /= ptot; + py /= ptot; + pz /= ptot; // Current position of electron Double_t x;