]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenFixed.cxx
Updates to RAW package. Used during the Computing DC.
[u/mrichter/AliRoot.git] / EVGEN / AliGenFixed.cxx
index 321d195e1a43bf60c42553cbbe0ecebd061f9fc6..4fab8afbf460b0c7a9ccbd3af87e9e95fa279a28 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-*/
+/* $Id$ */
 
-///////////////////////////////////////////////////////////////////
-//                                                               //
-//    Generate the final state of the interaction as the input   //
-//    to the MonteCarlo                                          //
-//
-//Begin_Html
-/*
-<img src="picts/AliGeneratorClass.gif">
-</pre>
-<br clear=left>
-<font size=+2 color=red>
-<p>The responsible person for this module is
-<a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
-</font>
-<pre>
-*/
-//End_Html
-//                                                               //
-///////////////////////////////////////////////////////////////////
+// Simple particle gun. 
+// Momentum, phi and theta of the partice as well as the particle type can be set.
+// If fExplicit is true the user set momentum vector is used,
+// otherwise it is calculated.
+// andreas.morsch@cern.ch
+
+#include "TPDGCode.h"
 
 #include "AliGenFixed.h"
 #include "AliRun.h"
-#include "AliConst.h"
-#include "AliPDG.h"
-#include "TF1.h"
   
 ClassImp(AliGenFixed)
 
@@ -53,6 +36,7 @@ AliGenFixed::AliGenFixed()
   // Default constructor
   //
   fIpart = 0;
+  fExplicit = kFALSE;
 }
 
 //_____________________________________________________________________________
@@ -66,6 +50,7 @@ AliGenFixed::AliGenFixed(Int_t npart)
   fTitle="Fixed Particle Generator";
   // Generate Proton by default
   fIpart=kProton;
+  fExplicit = kFALSE;
 }
 
 //_____________________________________________________________________________
@@ -75,18 +60,19 @@ 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,"Primary",nt);
-  }
+  for(i=0;i<fNpart;i++) 
+    PushTrack(fTrackIt,-1,fIpart,fP,fOrigin.GetArray(),polar,0,kPPrimary,nt);
 }
   
 //_____________________________________________________________________________
-void AliGenFixed::SetSigma(Float_t sx, Float_t sy, Float_t sz)
+void AliGenFixed::SetSigma(Float_t /*sx*/, Float_t /*sy*/, Float_t /*sz*/)
 {
   //
   // Set the interaction point sigma