]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenFixed.cxx
Moving to the new VMC naming convention
[u/mrichter/AliRoot.git] / EVGEN / AliGenFixed.cxx
index b18eb0378f8774d60096b7d7d1324a75500e7b01..37e57cbb1a00527840b4fd686da2e626840e1b9d 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.2  2000/10/02 15:17:54  morsch
-Unused includes removed.
-
-Revision 1.1  2000/06/09 20:24:00  morsch
-Same class as previously in AliSimpleGen.cxx
-All coding rule violations except RS3 corrected (AM)
+/* $Id$ */
 
-*/
-
-///////////////////////////////////////////////////////////////////
-//                                                               //
-//    Generate the final state of the interaction as the input   //
-//    to the MonteCarlo                                          //
-//
+// Simple particle gun. 
+// Momentum, phi and theta of the partice as well as the particle type can be set.
+// andreas.morsch@cern.ch
 //Begin_Html
 /*
 <img src="picts/AliGeneratorClass.gif">
@@ -44,9 +33,10 @@ All coding rule violations except RS3 corrected (AM)
 //                                                               //
 ///////////////////////////////////////////////////////////////////
 
+#include "TPDGCode.h"
+
 #include "AliGenFixed.h"
 #include "AliRun.h"
-#include "AliPDG.h"
   
 ClassImp(AliGenFixed)
 
@@ -58,6 +48,7 @@ AliGenFixed::AliGenFixed()
   // Default constructor
   //
   fIpart = 0;
+  fExplicit = kFALSE;
 }
 
 //_____________________________________________________________________________
@@ -71,6 +62,7 @@ AliGenFixed::AliGenFixed(Int_t npart)
   fTitle="Fixed Particle Generator";
   // Generate Proton by default
   fIpart=kProton;
+  fExplicit = kFALSE;
 }
 
 //_____________________________________________________________________________
@@ -80,14 +72,15 @@ void AliGenFixed::Generate()
   // Generate one trigger
   //
   Float_t polar[3]= {0,0,0};
-  Float_t p[3] = {fPMin*TMath::Cos(fPhiMin)*TMath::Sin(fThetaMin),
-                 fPMin*TMath::Sin(fPhiMin)*TMath::Sin(fThetaMin),
-                 fPMin*TMath::Cos(fThetaMin)};
+  if(!fExplicit) {
+    fP[0] = fPMin*TMath::Cos(fPhiMin)*TMath::Sin(fThetaMin);
+    fP[1] = fPMin*TMath::Sin(fPhiMin)*TMath::Sin(fThetaMin);
+    fP[2] = fPMin*TMath::Cos(fThetaMin);
+  }
   Int_t i, nt;
   //
-  for(i=0;i<fNpart;i++) {
-    gAlice->SetTrack(fTrackIt,-1,fIpart,p,fOrigin.GetArray(),polar,0,kPPrimary,nt);
-  }
+  for(i=0;i<fNpart;i++) 
+    PushTrack(fTrackIt,-1,fIpart,fP,fOrigin.GetArray(),polar,0,kPPrimary,nt);
 }
   
 //_____________________________________________________________________________