Correction of minor typing mistakes
[u/mrichter/AliRoot.git] / STEER / AliGenerator.cxx
CommitLineData
4c039060 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$
ca3a341c 18Revision 1.8 2000/10/02 21:28:14 fca
19Removal of useless dependecies via forward declarations
20
94de3818 21Revision 1.7 2000/07/12 08:56:25 fca
22Coding convention correction and warning removal
23
8918e700 24Revision 1.6 2000/07/11 18:24:59 fca
25Coding convention corrections + few minor bug fixes
26
aee8290b 27Revision 1.5 2000/06/08 13:34:50 fca
28Better control of momentum range in GenBox
29
de6d59e3 30Revision 1.4 1999/09/29 09:24:29 fca
31Introduction of the Copyright and cvs Log
32
4c039060 33*/
34
fe4da5cc 35///////////////////////////////////////////////////////////////////
36// //
37// Generate the final state of the interaction as the input //
38// to the MonteCarlo //
39//
40//Begin_Html
41/*
1439f98e 42<img src="picts/AliGeneratorClass.gif">
fe4da5cc 43</pre>
44<br clear=left>
45<font size=+2 color=red>
46<p>The responsible person for this module is
47<a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
48</font>
49<pre>
50*/
51//End_Html
52// //
53///////////////////////////////////////////////////////////////////
54
55#include "AliGenerator.h"
56#include "AliRun.h"
57
58ClassImp(AliGenerator)
59
60TGenerator* AliGenerator::fgMCEvGen=0;
61
62//____________________________________________________________
63AliGenerator::AliGenerator()
64{
aee8290b 65 //
66 // Default constructor
67 //
de6d59e3 68 printf("\n AliGenerator Default Constructor\n\n");
4a3ba9d2 69
fe4da5cc 70 gAlice->SetGenerator(this);
de6d59e3 71 SetThetaRange(); ResetBit(kThetaRange);
72 SetPhiRange(); ResetBit(kPhiRange);
73 SetMomentumRange(); ResetBit(kMomentumRange);
74 SetPtRange(); ResetBit(kPtRange);
75 SetYRange(); ResetBit(kYRange);
fe4da5cc 76 SetNumberParticles();
4a3ba9d2 77 SetTrackingFlag();
de6d59e3 78
fe4da5cc 79 fOrigin.Set(3);
80 fOsigma.Set(3);
81 fOrigin[0]=fOrigin[1]=fOrigin[2]=0;
82 fOsigma[0]=fOsigma[1]=fOsigma[2]=0;
de6d59e3 83 fVMin.Set(3);
84 fVMin[0]=fVMin[1]=fVMin[2]=0;
85 fVMax.Set(3);
86 fVMax[0]=fVMax[1]=fVMax[2]=10000;
fe4da5cc 87}
88
89//____________________________________________________________
90AliGenerator::AliGenerator(Int_t npart)
91 : TNamed(" "," ")
92{
aee8290b 93 //
94 // Standard constructor
95 //
de6d59e3 96 printf("\n AliGenerator Constructor initializing number of particles \n\n");
fe4da5cc 97 gAlice->SetGenerator(this);
de6d59e3 98 SetThetaRange(); ResetBit(kThetaRange);
99 SetPhiRange(); ResetBit(kPhiRange);
100 SetMomentumRange(); ResetBit(kMomentumRange);
101 SetPtRange(); ResetBit(kPtRange);
102 SetYRange(); ResetBit(kYRange);
4a3ba9d2 103 SetTrackingFlag();
de6d59e3 104
fe4da5cc 105 fOrigin.Set(3);
106 fOsigma.Set(3);
107 fOrigin[0]=fOrigin[1]=fOrigin[2]=0;
108 fOsigma[0]=fOsigma[1]=fOsigma[2]=0;
109 fVMin.Set(3);
110 fVMin[0]=fVMin[1]=fVMin[2]=0;
111 fVMax.Set(3);
112 fVMax[0]=fVMax[1]=fVMax[2]=10000;
de6d59e3 113
114 SetNumberParticles(npart);
fe4da5cc 115}
116
aee8290b 117//____________________________________________________________
118AliGenerator::AliGenerator(const AliGenerator &gen) : TNamed(" "," ")
119{
120 //
121 // Copy constructor
122 //
123 gen.Copy(*this);
124}
125
126//____________________________________________________________
127AliGenerator & AliGenerator::operator=(const AliGenerator &gen)
128{
129 //
130 // Assignment operator
131 //
132 gen.Copy(*this);
133 return (*this);
134}
135
136//____________________________________________________________
8918e700 137void AliGenerator::Copy(AliGenerator &/* gen */) const
aee8290b 138{
139 //
140 // Copy *this onto gen
141 //
142 Fatal("Copy","Not implemented!\n");
143}
144
fe4da5cc 145//____________________________________________________________
146AliGenerator::~AliGenerator()
147{
aee8290b 148 //
149 // Destructor
150 //
fe4da5cc 151 fOrigin.Set(0);
152 fOsigma.Set(0);
153 delete fgMCEvGen;
154}
155
156void AliGenerator::Init()
157{
aee8290b 158 //
159 // Dummy initialisation
160 //
fe4da5cc 161}
162
94de3818 163//_______________________________________________________________________
164void AliGenerator::SetOrigin(Float_t ox, Float_t oy, Float_t oz)
165{
166 //
167 // Set the vertex for the generated tracks
168 //
169 fOrigin[0]=ox;
170 fOrigin[1]=oy;
171 fOrigin[2]=oz;
172}
173
174//_______________________________________________________________________
175void AliGenerator::SetOrigin(const TLorentzVector &o)
176{
177 //
178 // Set the vertex for the generated tracks
179 //
180 fOrigin[0]=o[0];
181 fOrigin[1]=o[1];
182 fOrigin[2]=o[2];
183}
184
185//_______________________________________________________________________
186void AliGenerator::SetSigma(Float_t sx, Float_t sy, Float_t sz)
187{
188 //
189 // Set the spread of the vertex
190 //
191 fOsigma[0]=sx;
192 fOsigma[1]=sy;
193 fOsigma[2]=sz;
194}
195
196//_______________________________________________________________________
197void AliGenerator::SetMomentumRange(Float_t pmin, Float_t pmax)
198{
199 //
200 // Set the momentum range for the generated particles
201 //
202 fPMin = pmin;
203 fPMax = pmax;
204 SetBit(kMomentumRange);
205}
206
207//_______________________________________________________________________
208void AliGenerator::SetPtRange(Float_t ptmin, Float_t ptmax)
209{
210 //
211 // Set the Pt range for the generated particles
212 //
213 fPtMin = ptmin;
214 fPtMax = ptmax;
215 SetBit(kPtRange);
216}
217
218//_______________________________________________________________________
219void AliGenerator::SetPhiRange(Float_t phimin, Float_t phimax)
220{
221 //
222 // Set the Phi range for the generated particles
223 //
224 fPhiMin = TMath::Pi()*phimin/180;
225 fPhiMax = TMath::Pi()*phimax/180; SetBit(kPhiRange);
226}
227
228//_______________________________________________________________________
ca3a341c 229void AliGenerator::SetYRange(Float_t ymin, Float_t ymax)
94de3818 230{
231 //
232 // Set the Rapidity range for the generated particles
233 //
234 fYMin=ymin;
235 fYMax=ymax;
236 SetBit(kYRange);
237}
238
239//_______________________________________________________________________
240void AliGenerator::SetVRange(Float_t vxmin, Float_t vxmax,
241 Float_t vymin, Float_t vymax,
242 Float_t vzmin, Float_t vzmax)
243{
244 //
245 // Set the vertex range for the generated particles
246 //
247 fVMin[0]=vxmin; fVMin[1]=vymin; fVMin[2]=vzmin;
248 fVMax[0]=vxmax; fVMax[1]=vymax; fVMax[2]=vzmax;
249 SetBit(kVertexRange);
250}
fe4da5cc 251
94de3818 252//_______________________________________________________________________
253void AliGenerator::SetThetaRange(Float_t thetamin, Float_t thetamax)
254{
255 //
256 // Set the theta range for the generated particles
257 //
258 fThetaMin = TMath::Pi()*thetamin/180;
259 fThetaMax = TMath::Pi()*thetamax/180; SetBit(kThetaRange);
260}