]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenFLUKAsource.cxx
MC-dependent part of AliRun extracted in AliMC (F.Carminati)
[u/mrichter/AliRoot.git] / EVGEN / AliGenFLUKAsource.cxx
index 266312a03cf8fdaade3fd2383210576c68b7c661..c99ef8ee3aa5fe7c1265c1b83cc17947a8872b6e 100644 (file)
 // Files can be chained. 
 // Author: andreas.morsch@cern.ch
 
+#include <RVersion.h>
 #include "TPDGCode.h"
+#include "TDatabasePDG.h"
+#include <TVirtualMC.h>
 
 #include "AliGenFLUKAsource.h"
 #include "AliRun.h"
@@ -154,9 +157,7 @@ void AliGenFLUKAsource::Generate()
     Float_t prwn;
     Float_t wgt, fwgt;
     Float_t phi;
-    char name[100];
-    Float_t amass, charge, tlife;
-    Int_t itrtyp;
+    Float_t amass;
     Int_t iwgt;
     Int_t i, j, part, nt;
     static Int_t irwn=0;
@@ -227,8 +228,11 @@ void AliGenFLUKAsource::Generate()
        part=kIfluge[int(ifip)-1];      
 //
 // Calculate momentum from kinetic energy and mass of the particle
-       gMC->Gfpart(part, name, itrtyp,  
-                   amass, charge, tlife); 
+#if ROOT_VERSION_CODE > 197895
+        amass = gMC->ParticleMass(part);
+#else
+       amass = (TDatabasePDG::Instance())->GetParticle(part)->Mass();
+#endif
        prwn=fEkin*sqrt(1. + 2.*amass/fEkin);