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