]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVGEN/AliGenFixed.cxx
Resolving the symbols in each library
[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.
0af12c00 20// If fExplicit is true the user set momentum vector is used,
21// otherwise it is calculated.
675e9664 22// andreas.morsch@cern.ch
790bbabf 23
116cbefd 24#include "TPDGCode.h"
25
790bbabf 26#include "AliGenFixed.h"
27#include "AliRun.h"
790bbabf 28
29ClassImp(AliGenFixed)
30
31//_____________________________________________________________________________
32AliGenFixed::AliGenFixed()
1c56e311 33 :AliGenerator(),
34 fIpart(0),
35 fExplicit(kFALSE)
790bbabf 36{
37 //
38 // Default constructor
39 //
045ebe41 40 for (Int_t i = 0; i < 3; i++) fP[i] = 0.;
41
790bbabf 42}
43
44//_____________________________________________________________________________
45AliGenFixed::AliGenFixed(Int_t npart)
1c56e311 46 :AliGenerator(npart),
47 fIpart(kProton),
48 fExplicit(kFALSE)
790bbabf 49{
50 //
51 // Standard constructor
52 //
53 fName="Fixed";
54 fTitle="Fixed Particle Generator";
045ebe41 55 for (Int_t i = 0; i < 3; i++) fP[i] = 0.;
790bbabf 56}
57
58//_____________________________________________________________________________
59void AliGenFixed::Generate()
60{
61 //
62 // Generate one trigger
63 //
64 Float_t polar[3]= {0,0,0};
f1f30542 65 if(!fExplicit) {
159fe911 66 fP[0] = fPMin * TMath::Cos(fPhiMin) * TMath::Sin(fThetaMin);
67 fP[1] = fPMin * TMath::Sin(fPhiMin) * TMath::Sin(fThetaMin);
68 fP[2] = fPMin * TMath::Cos(fThetaMin);
f1f30542 69 }
159fe911 70 Int_t i, j, nt;
790bbabf 71 //
9674ec64 72 Float_t o[3] = {0., 0., 0.};
21391258 73 Float_t time = 0.;
159fe911 74 if(fVertexSmear == kPerEvent) {
75 Vertex();
76 for (j = 0;j < 3; j++) o[j] = fVertex[j];
21391258 77 time = fTime;
159fe911 78 }
1c56e311 79
159fe911 80 for(i = 0; i < fNpart; i++)
21391258 81 PushTrack(fTrackIt, -1, fIpart, fP, o , polar, time, kPPrimary, nt);
790bbabf 82}
83