X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EVGEN%2FAliGenFixed.cxx;h=8dacf599896fedfc6a7a337d5bb9aa0e9f88644c;hb=dcc60657b357cc833961e5204d55578b6b38e753;hp=1f30d09b88d6efbe622c7116a4d45908df2eb0e5;hpb=f1f30542201135ec072e0d6922e26097c54b5198;p=u%2Fmrichter%2FAliRoot.git diff --git a/EVGEN/AliGenFixed.cxx b/EVGEN/AliGenFixed.cxx index 1f30d09b88d..8dacf599896 100644 --- a/EVGEN/AliGenFixed.cxx +++ b/EVGEN/AliGenFixed.cxx @@ -13,71 +13,46 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -Revision 1.4 2000/12/21 16:24:06 morsch -Coding convention clean-up - -Revision 1.3 2000/11/30 07:12:50 alibrary -Introducing new Rndm and QA classes - -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$ */ // 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 -//Begin_Html -/* - - -
- -

The responsible person for this module is -Andreas Morsch. - -

-*/
-//End_Html
-//                                                               //
-///////////////////////////////////////////////////////////////////
+
+#include "TPDGCode.h"
 
 #include "AliGenFixed.h"
 #include "AliRun.h"
-#include "AliPDG.h"
   
 ClassImp(AliGenFixed)
 
 //_____________________________________________________________________________
 AliGenFixed::AliGenFixed()
-  :AliGenerator()
+    :AliGenerator(), 
+     fIpart(0),
+     fExplicit(kFALSE)
 {
   //
   // Default constructor
   //
-  fIpart = 0;
-  fExplicit = kFALSE;
+    for (Int_t i = 0; i < 3; i++) fP[i] = 0.;
+    
 }
 
 //_____________________________________________________________________________
 AliGenFixed::AliGenFixed(Int_t npart)
-  :AliGenerator(npart)
+    :AliGenerator(npart),
+     fIpart(kProton),
+     fExplicit(kFALSE)
 {
   //
   // Standard constructor
   //
   fName="Fixed";
   fTitle="Fixed Particle Generator";
-  // Generate Proton by default
-  fIpart=kProton;
+  for (Int_t i = 0; i < 3; i++) fP[i] = 0.;
 }
 
 //_____________________________________________________________________________
@@ -88,22 +63,21 @@ void AliGenFixed::Generate()
   //
   Float_t polar[3]= {0,0,0};
   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);
+    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;
+  Int_t i, j, nt;
   //
-  for(i=0;iSetTrack(fTrackIt,-1,fIpart,fP,fOrigin.GetArray(),polar,0,kPPrimary,nt);
+  Float_t o[3] = {0., 0., 0.}; 
+  Float_t time = 0.;
+  if(fVertexSmear == kPerEvent) {
+      Vertex();
+      for (j = 0;j < 3; j++) o[j] = fVertex[j];
+      time = fTime;
+  }
   
+  for(i = 0; i < fNpart; i++) 
+    PushTrack(fTrackIt, -1, fIpart, fP, o , polar, time, kPPrimary, nt);
 }
   
-//_____________________________________________________________________________
-void AliGenFixed::SetSigma(Float_t sx, Float_t sy, Float_t sz)
-{
-  //
-  // Set the interaction point sigma
-  //
-  printf("Vertex smearing not implemented for fixed generator\n");
-}