* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.2 2000/10/02 15:17:54 morsch
-Unused includes removed.
+/* $Id$ */
-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)
+// 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
-*/
-
-///////////////////////////////////////////////////////////////////
-// //
-// 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
-// //
-///////////////////////////////////////////////////////////////////
+#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;
}
//_____________________________________________________________________________
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;
}
//_____________________________________________________________________________
// 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)};
- Int_t i, nt;
+ 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, j, nt;
//
- for(i=0;i<fNpart;i++) {
- gAlice->SetTrack(fTrackIt,-1,fIpart,p,fOrigin.GetArray(),polar,0,kPPrimary,nt);
+ Float_t o[3] = {0., 0., 0.};
+ if(fVertexSmear == kPerEvent) {
+ Vertex();
+ for (j = 0;j < 3; j++) o[j] = fVertex[j];
}
-}
-//_____________________________________________________________________________
-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");
+ for(i = 0; i < fNpart; i++)
+ PushTrack(fTrackIt, -1, fIpart, fP, o , polar, 0, kPPrimary, nt);
}
+