]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Using the current particle momentum for the generation of transition radiation (Andrei)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 May 2007 18:37:31 +0000 (18:37 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 May 2007 18:37:31 +0000 (18:37 +0000)
TRD/AliTRDsim.cxx

index ce243350257ec48d99aa4b6a3098264880dd2659..1fa0cd67cf9b613341a0240bd52e071554f0c0b2 100644 (file)
@@ -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;