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