]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVGEN/AliGenFixed.cxx
Coding Rule violations corrected.
[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
803d1ab0 16/* $Id$ */
675e9664 17
18// Simple particle gun.
19// Momentum, phi and theta of the partice as well as the particle type can be set.
20// andreas.morsch@cern.ch
790bbabf 21//Begin_Html
22/*
23<img src="picts/AliGeneratorClass.gif">
24</pre>
25<br clear=left>
26<font size=+2 color=red>
27<p>The responsible person for this module is
28<a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
29</font>
30<pre>
31*/
32//End_Html
33// //
34///////////////////////////////////////////////////////////////////
35
116cbefd 36#include "TPDGCode.h"
37
790bbabf 38#include "AliGenFixed.h"
39#include "AliRun.h"
790bbabf 40
41ClassImp(AliGenFixed)
42
43//_____________________________________________________________________________
44AliGenFixed::AliGenFixed()
45 :AliGenerator()
46{
47 //
48 // Default constructor
49 //
50 fIpart = 0;
f1f30542 51 fExplicit = kFALSE;
790bbabf 52}
53
54//_____________________________________________________________________________
55AliGenFixed::AliGenFixed(Int_t npart)
56 :AliGenerator(npart)
57{
58 //
59 // Standard constructor
60 //
61 fName="Fixed";
62 fTitle="Fixed Particle Generator";
63 // Generate Proton by default
64 fIpart=kProton;
49c4fdc3 65 fExplicit = kFALSE;
790bbabf 66}
67
68//_____________________________________________________________________________
69void AliGenFixed::Generate()
70{
71 //
72 // Generate one trigger
73 //
74 Float_t polar[3]= {0,0,0};
f1f30542 75 if(!fExplicit) {
76 fP[0] = fPMin*TMath::Cos(fPhiMin)*TMath::Sin(fThetaMin);
77 fP[1] = fPMin*TMath::Sin(fPhiMin)*TMath::Sin(fThetaMin);
78 fP[2] = fPMin*TMath::Cos(fThetaMin);
79 }
790bbabf 80 Int_t i, nt;
81 //
f1f30542 82 for(i=0;i<fNpart;i++)
642f15cf 83 PushTrack(fTrackIt,-1,fIpart,fP,fOrigin.GetArray(),polar,0,kPPrimary,nt);
790bbabf 84}
85
86//_____________________________________________________________________________
198bb1c7 87void AliGenFixed::SetSigma(Float_t /*sx*/, Float_t /*sy*/, Float_t /*sz*/)
790bbabf 88{
89 //
90 // Set the interaction point sigma
91 //
92 printf("Vertex smearing not implemented for fixed generator\n");
93}