]>
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 | ||
16 | /* | |
17 | $Log$ | |
f1f30542 | 18 | Revision 1.4 2000/12/21 16:24:06 morsch |
19 | Coding convention clean-up | |
20 | ||
675e9664 | 21 | Revision 1.3 2000/11/30 07:12:50 alibrary |
22 | Introducing new Rndm and QA classes | |
23 | ||
65fb704d | 24 | Revision 1.2 2000/10/02 15:17:54 morsch |
25 | Unused includes removed. | |
26 | ||
6c2f0383 | 27 | Revision 1.1 2000/06/09 20:24:00 morsch |
28 | Same class as previously in AliSimpleGen.cxx | |
29 | All coding rule violations except RS3 corrected (AM) | |
30 | ||
790bbabf | 31 | */ |
32 | ||
675e9664 | 33 | |
34 | ||
35 | // Simple particle gun. | |
36 | // Momentum, phi and theta of the partice as well as the particle type can be set. | |
37 | // andreas.morsch@cern.ch | |
790bbabf | 38 | //Begin_Html |
39 | /* | |
40 | <img src="picts/AliGeneratorClass.gif"> | |
41 | </pre> | |
42 | <br clear=left> | |
43 | <font size=+2 color=red> | |
44 | <p>The responsible person for this module is | |
45 | <a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>. | |
46 | </font> | |
47 | <pre> | |
48 | */ | |
49 | //End_Html | |
50 | // // | |
51 | /////////////////////////////////////////////////////////////////// | |
52 | ||
53 | #include "AliGenFixed.h" | |
54 | #include "AliRun.h" | |
790bbabf | 55 | #include "AliPDG.h" |
790bbabf | 56 | |
57 | ClassImp(AliGenFixed) | |
58 | ||
59 | //_____________________________________________________________________________ | |
60 | AliGenFixed::AliGenFixed() | |
61 | :AliGenerator() | |
62 | { | |
63 | // | |
64 | // Default constructor | |
65 | // | |
66 | fIpart = 0; | |
f1f30542 | 67 | fExplicit = kFALSE; |
790bbabf | 68 | } |
69 | ||
70 | //_____________________________________________________________________________ | |
71 | AliGenFixed::AliGenFixed(Int_t npart) | |
72 | :AliGenerator(npart) | |
73 | { | |
74 | // | |
75 | // Standard constructor | |
76 | // | |
77 | fName="Fixed"; | |
78 | fTitle="Fixed Particle Generator"; | |
79 | // Generate Proton by default | |
80 | fIpart=kProton; | |
81 | } | |
82 | ||
83 | //_____________________________________________________________________________ | |
84 | void AliGenFixed::Generate() | |
85 | { | |
86 | // | |
87 | // Generate one trigger | |
88 | // | |
89 | Float_t polar[3]= {0,0,0}; | |
f1f30542 | 90 | if(!fExplicit) { |
91 | fP[0] = fPMin*TMath::Cos(fPhiMin)*TMath::Sin(fThetaMin); | |
92 | fP[1] = fPMin*TMath::Sin(fPhiMin)*TMath::Sin(fThetaMin); | |
93 | fP[2] = fPMin*TMath::Cos(fThetaMin); | |
94 | } | |
790bbabf | 95 | Int_t i, nt; |
96 | // | |
f1f30542 | 97 | for(i=0;i<fNpart;i++) |
98 | gAlice->SetTrack(fTrackIt,-1,fIpart,fP,fOrigin.GetArray(),polar,0,kPPrimary,nt); | |
99 | ||
790bbabf | 100 | } |
101 | ||
102 | //_____________________________________________________________________________ | |
103 | void AliGenFixed::SetSigma(Float_t sx, Float_t sy, Float_t sz) | |
104 | { | |
105 | // | |
106 | // Set the interaction point sigma | |
107 | // | |
108 | printf("Vertex smearing not implemented for fixed generator\n"); | |
109 | } |