]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenFixed.cxx
Information about trigger jets added.
[u/mrichter/AliRoot.git] / EVGEN / AliGenFixed.cxx
index b18eb0378f8774d60096b7d7d1324a75500e7b01..923678aa415917676a952808e115191baa961905 100644 (file)
 
 /*
 $Log$
+Revision 1.6  2001/07/27 17:09:36  morsch
+Use local SetTrack, KeepTrack and SetHighWaterMark methods
+to delegate either to local stack or to stack owned by AliRun.
+(Piotr Skowronski, A.M.)
+
+Revision 1.5  2001/02/24 11:41:59  morsch
+SetGun allows specify completely the particle kinematics and position in one go. (FCA)
+
+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.
 
@@ -24,11 +38,11 @@ All coding rule violations except RS3 corrected (AM)
 
 */
 
-///////////////////////////////////////////////////////////////////
-//                                                               //
-//    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">
@@ -58,6 +72,7 @@ AliGenFixed::AliGenFixed()
   // Default constructor
   //
   fIpart = 0;
+  fExplicit = kFALSE;
 }
 
 //_____________________________________________________________________________
@@ -71,6 +86,7 @@ AliGenFixed::AliGenFixed(Int_t npart)
   fTitle="Fixed Particle Generator";
   // Generate Proton by default
   fIpart=kProton;
+  fExplicit = kFALSE;
 }
 
 //_____________________________________________________________________________
@@ -80,14 +96,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++) 
+    SetTrack(fTrackIt,-1,fIpart,fP,fOrigin.GetArray(),polar,0,kPPrimary,nt);
 }
   
 //_____________________________________________________________________________