]>
Commit | Line | Data |
---|---|---|
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 | |
29 | ClassImp(AliGenFixed) | |
30 | ||
31 | //_____________________________________________________________________________ | |
32 | AliGenFixed::AliGenFixed() | |
1c56e311 | 33 | :AliGenerator(), |
34 | fIpart(0), | |
35 | fExplicit(kFALSE) | |
790bbabf | 36 | { |
37 | // | |
38 | // Default constructor | |
39 | // | |
790bbabf | 40 | } |
41 | ||
42 | //_____________________________________________________________________________ | |
43 | AliGenFixed::AliGenFixed(Int_t npart) | |
1c56e311 | 44 | :AliGenerator(npart), |
45 | fIpart(kProton), | |
46 | fExplicit(kFALSE) | |
790bbabf | 47 | { |
48 | // | |
49 | // Standard constructor | |
50 | // | |
51 | fName="Fixed"; | |
52 | fTitle="Fixed Particle Generator"; | |
790bbabf | 53 | } |
54 | ||
55 | //_____________________________________________________________________________ | |
56 | void AliGenFixed::Generate() | |
57 | { | |
58 | // | |
59 | // Generate one trigger | |
60 | // | |
61 | Float_t polar[3]= {0,0,0}; | |
f1f30542 | 62 | if(!fExplicit) { |
63 | fP[0] = fPMin*TMath::Cos(fPhiMin)*TMath::Sin(fThetaMin); | |
64 | fP[1] = fPMin*TMath::Sin(fPhiMin)*TMath::Sin(fThetaMin); | |
65 | fP[2] = fPMin*TMath::Cos(fThetaMin); | |
66 | } | |
790bbabf | 67 | Int_t i, nt; |
68 | // | |
1c56e311 | 69 | Float_t o[3]; |
70 | o[0] = fOrigin[0]; | |
71 | o[1] = fOrigin[1]; | |
72 | o[2] = fOrigin[2]; | |
73 | ||
74 | printf("Origin %f %f %f \n", o[0], o[1], o[2]); | |
75 | ||
76 | ||
f1f30542 | 77 | for(i=0;i<fNpart;i++) |
1c56e311 | 78 | PushTrack(fTrackIt,-1,fIpart,fP,o ,polar,0,kPPrimary,nt); |
790bbabf | 79 | } |
80 | ||
81 | //_____________________________________________________________________________ | |
198bb1c7 | 82 | void AliGenFixed::SetSigma(Float_t /*sx*/, Float_t /*sy*/, Float_t /*sz*/) |
790bbabf | 83 | { |
84 | // | |
85 | // Set the interaction point sigma | |
86 | // | |
87 | printf("Vertex smearing not implemented for fixed generator\n"); | |
88 | } |