Moving to double precision and introducing an additional security check
[u/mrichter/AliRoot.git] / EVGEN / AliGenFixed.cxx
CommitLineData
790bbabf 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
17$Log$
675e9664 18Revision 1.3 2000/11/30 07:12:50 alibrary
19Introducing new Rndm and QA classes
20
65fb704d 21Revision 1.2 2000/10/02 15:17:54 morsch
22Unused includes removed.
23
6c2f0383 24Revision 1.1 2000/06/09 20:24:00 morsch
25Same class as previously in AliSimpleGen.cxx
26All coding rule violations except RS3 corrected (AM)
27
790bbabf 28*/
29
675e9664 30
31
32// Simple particle gun.
33// Momentum, phi and theta of the partice as well as the particle type can be set.
34// andreas.morsch@cern.ch
790bbabf 35//Begin_Html
36/*
37<img src="picts/AliGeneratorClass.gif">
38</pre>
39<br clear=left>
40<font size=+2 color=red>
41<p>The responsible person for this module is
42<a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
43</font>
44<pre>
45*/
46//End_Html
47// //
48///////////////////////////////////////////////////////////////////
49
50#include "AliGenFixed.h"
51#include "AliRun.h"
790bbabf 52#include "AliPDG.h"
790bbabf 53
54ClassImp(AliGenFixed)
55
56//_____________________________________________________________________________
57AliGenFixed::AliGenFixed()
58 :AliGenerator()
59{
60 //
61 // Default constructor
62 //
63 fIpart = 0;
64}
65
66//_____________________________________________________________________________
67AliGenFixed::AliGenFixed(Int_t npart)
68 :AliGenerator(npart)
69{
70 //
71 // Standard constructor
72 //
73 fName="Fixed";
74 fTitle="Fixed Particle Generator";
75 // Generate Proton by default
76 fIpart=kProton;
77}
78
79//_____________________________________________________________________________
80void AliGenFixed::Generate()
81{
82 //
83 // Generate one trigger
84 //
85 Float_t polar[3]= {0,0,0};
86 Float_t p[3] = {fPMin*TMath::Cos(fPhiMin)*TMath::Sin(fThetaMin),
87 fPMin*TMath::Sin(fPhiMin)*TMath::Sin(fThetaMin),
88 fPMin*TMath::Cos(fThetaMin)};
89 Int_t i, nt;
90 //
91 for(i=0;i<fNpart;i++) {
65fb704d 92 gAlice->SetTrack(fTrackIt,-1,fIpart,p,fOrigin.GetArray(),polar,0,kPPrimary,nt);
790bbabf 93 }
94}
95
96//_____________________________________________________________________________
97void AliGenFixed::SetSigma(Float_t sx, Float_t sy, Float_t sz)
98{
99 //
100 // Set the interaction point sigma
101 //
102 printf("Vertex smearing not implemented for fixed generator\n");
103}