]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenFLUKAsource.cxx
Remove EVE/Reve/ sub-module.
[u/mrichter/AliRoot.git] / EVGEN / AliGenFLUKAsource.cxx
index 31abcdfb6d1d2178e60349a98ddbfdb370e02eab..eba987cff821ce1f0ee82a2fef673991448205a6 100644 (file)
 // Files can be chained. 
 // Author: andreas.morsch@cern.ch
 
-#include "TPDGCode.h"
-
 #include "AliGenFLUKAsource.h"
-#include "AliRun.h"
-
+#include <stdlib.h>
 
+#include <TDatabasePDG.h>
+#include <TPDGCode.h>
+#include <RVersion.h>
+#include <TChain.h>
 #include <TFile.h>
 #include <TTree.h>
-#include <TChain.h>
-#include <stdlib.h>
- ClassImp(AliGenFLUKAsource)
-     AliGenFLUKAsource::AliGenFLUKAsource()
-        :AliGenerator(-1)
+#include <TVirtualMC.h>
+
+#include "AliRun.h"
+
+ClassImp(AliGenFLUKAsource)
+
+AliGenFLUKAsource::AliGenFLUKAsource()
+    :AliGenerator(-1), 
+     fIkine(6),
+     fAgeMax(1.e-5), 
+     fAddWeight(1.),
+     fZshift(0.),
+     fFrac(0.),
+     fSourceId(-1),
+     fFileName(0),
+     fTreeChain(0),
+     fTreeFluka(0),
+     fIp(0.),
+     fIpp(0.),
+     fXi(0.),
+     fYi(0.),
+     fZi(0.),
+     fPx(0.),
+     fPy(0.),
+     fPz(0.),
+     fEkin(0.),
+     fZv(0.),
+     fRv(0.),
+     fItra(0.),
+     fIgas(0.),
+     fWgt(0.),
+     fEtag(0.),
+     fPtg(0.),
+     fAge(0.)
 {
     // Constructor
     fName="FLUKA";
     fTitle="FLUKA Boundary Source";
     // Read in all particle types by default
-    fIkine=6;
     // Set maximum admitted age of particles to 1.e-05 by default 
-    fAgeMax=1.e-05;
     // Do not add weight
-    fAddWeight=1.;
     // Shift the z-coordinate of the impact point by 4.5 cm only if it reads 
     // from  specific boundary source to the chamber (fZshift=4.5;),else there 
     // is no need to shift as it reads boundary source for the whole volume of 
     // the Muon Arm; the default value corresponds to boundary source for the
     // whole volume of the MUON Arm 
-    fZshift=0;
     // Set the default file 
-    fFileName="";
-
-    fTreeFluka=0;
     fTreeChain = new TChain("h1");
 //
 //  Read all particles
 }
 
 AliGenFLUKAsource::AliGenFLUKAsource(Int_t npart)
-    :AliGenerator(npart)
+    :AliGenerator(npart), 
+     fIkine(6),
+     fAgeMax(1.e-5), 
+     fAddWeight(1.),
+     fZshift(0.),
+     fFrac(0.),
+     fSourceId(-1),
+     fFileName(""),
+     fTreeChain(new TChain("h1")),
+     fTreeFluka(0),
+     fIp(0.),
+     fIpp(0.),
+     fXi(0.),
+     fYi(0.),
+     fZi(0.),
+     fPx(0.),
+     fPy(0.),
+     fPz(0.),
+     fEkin(0.),
+     fZv(0.),
+     fRv(0.),
+     fItra(0.),
+     fIgas(0.),
+     fWgt(0.),
+     fEtag(0.),
+     fPtg(0.),
+     fAge(0.)
 {
     // Constructor
     fName  = "FLUKA";
     fTitle = "FLUKA Boundary Source";
-    // Read in all particle types by default
-    fIkine=6;
-    // Set maximum admitted age of particles to 1.e-05 by default 
-    fAgeMax=1.e-05;
-    // Do not add weight
-    fAddWeight=1.;
-    // Shift the z-coordinate of the impact point by 4.5 cm only if it reads 
-    // from  specific boundary source to the chamber (fZshift=4.5;),else there 
-    // is no need to shift as it reads boundary source for the whole volume of 
-    // the Muon Arm; the default value corresponds to boundary source for the
-    // whole volume of the MUON Arm 
-    fZshift=0;
-    // Set the default file 
-    fFileName="";
-
-    fTreeFluka=0;
-    fTreeChain = new TChain("h1"); 
-    fSourceId=-1;
 }
 
-AliGenFLUKAsource::AliGenFLUKAsource(const AliGenFLUKAsource & FLUKAsource)
-{
-// copy constructor
-}
-
-
 //____________________________________________________________
 AliGenFLUKAsource::~AliGenFLUKAsource()
 {
@@ -151,9 +176,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;
@@ -224,8 +247,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);
 
 
@@ -246,7 +272,7 @@ void AliGenFLUKAsource::Generate()
        if (part==1 && iwgt>100) iwgt=100;
        Int_t nstack=0;
        for (j=0; j<iwgt; j++) {
-           SetTrack(fTrackIt,-1,part,p,origin,polar,fAge,kPPrimary,nt);
+           PushTrack(fTrackIt,-1,part,p,origin,polar,fAge,kPPrimary,nt);
            Rndm(random,2);
            phi=2*random[1]*TMath::Pi();
            Float_t pn1=p[0]*TMath::Sin(phi) - p[1]*TMath::Cos(phi);
@@ -275,13 +301,6 @@ void AliGenFLUKAsource::Generate()
 }
 
 
-AliGenFLUKAsource& AliGenFLUKAsource::operator=(const  AliGenFLUKAsource& rhs)
-{
-// Assignment operator
-    return *this;
-}
-
-