1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Revision 1.10 2000/12/21 15:30:18 fca
19 Correcting coding convention violations
21 Revision 1.9 2000/10/04 10:08:01 fca
22 Correction of minor typing mistakes
24 Revision 1.8 2000/10/02 21:28:14 fca
25 Removal of useless dependecies via forward declarations
27 Revision 1.7 2000/07/12 08:56:25 fca
28 Coding convention correction and warning removal
30 Revision 1.6 2000/07/11 18:24:59 fca
31 Coding convention corrections + few minor bug fixes
33 Revision 1.5 2000/06/08 13:34:50 fca
34 Better control of momentum range in GenBox
36 Revision 1.4 1999/09/29 09:24:29 fca
37 Introduction of the Copyright and cvs Log
41 ///////////////////////////////////////////////////////////////////
43 // Generate the final state of the interaction as the input //
44 // to the MonteCarlo //
48 <img src="picts/AliGeneratorClass.gif">
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>.
59 ///////////////////////////////////////////////////////////////////
61 #include "AliGenerator.h"
62 #include "TGenerator.h"
65 ClassImp(AliGenerator)
67 TGenerator* AliGenerator::fgMCEvGen=0;
69 //____________________________________________________________
70 AliGenerator::AliGenerator()
73 // Default constructor
75 if (gAlice->GetDebug()>0)
76 printf("\n AliGenerator Default Constructor\n\n");
78 gAlice->SetGenerator(this);
79 SetThetaRange(); ResetBit(kThetaRange);
80 SetPhiRange(); ResetBit(kPhiRange);
81 SetMomentumRange(); ResetBit(kMomentumRange);
82 SetPtRange(); ResetBit(kPtRange);
83 SetYRange(); ResetBit(kYRange);
89 fOrigin[0]=fOrigin[1]=fOrigin[2]=0;
90 fOsigma[0]=fOsigma[1]=fOsigma[2]=0;
92 fVMin[0]=fVMin[1]=fVMin[2]=0;
94 fVMax[0]=fVMax[1]=fVMax[2]=10000;
97 //____________________________________________________________
98 AliGenerator::AliGenerator(Int_t npart)
102 // Standard constructor
104 if (gAlice->GetDebug()>0)
105 printf("\n AliGenerator Constructor initializing number of particles \n\n");
106 gAlice->SetGenerator(this);
107 SetThetaRange(); ResetBit(kThetaRange);
108 SetPhiRange(); ResetBit(kPhiRange);
109 SetMomentumRange(); ResetBit(kMomentumRange);
110 SetPtRange(); ResetBit(kPtRange);
111 SetYRange(); ResetBit(kYRange);
116 fOrigin[0]=fOrigin[1]=fOrigin[2]=0;
117 fOsigma[0]=fOsigma[1]=fOsigma[2]=0;
119 fVMin[0]=fVMin[1]=fVMin[2]=0;
121 fVMax[0]=fVMax[1]=fVMax[2]=10000;
123 SetNumberParticles(npart);
126 //____________________________________________________________
127 AliGenerator::AliGenerator(const AliGenerator &gen) : TNamed(" "," ")
135 //____________________________________________________________
136 AliGenerator & AliGenerator::operator=(const AliGenerator &gen)
139 // Assignment operator
145 //____________________________________________________________
146 void AliGenerator::Copy(AliGenerator &/* gen */) const
149 // Copy *this onto gen
151 Fatal("Copy","Not implemented!\n");
154 //____________________________________________________________
155 AliGenerator::~AliGenerator()
165 void AliGenerator::Init()
168 // Dummy initialisation
172 //_______________________________________________________________________
173 void AliGenerator::SetOrigin(Float_t ox, Float_t oy, Float_t oz)
176 // Set the vertex for the generated tracks
183 //_______________________________________________________________________
184 void AliGenerator::SetOrigin(const TLorentzVector &o)
187 // Set the vertex for the generated tracks
194 //_______________________________________________________________________
195 void AliGenerator::SetSigma(Float_t sx, Float_t sy, Float_t sz)
198 // Set the spread of the vertex
205 //_______________________________________________________________________
206 void AliGenerator::SetMomentumRange(Float_t pmin, Float_t pmax)
209 // Set the momentum range for the generated particles
213 SetBit(kMomentumRange);
216 //_______________________________________________________________________
217 void AliGenerator::SetPtRange(Float_t ptmin, Float_t ptmax)
220 // Set the Pt range for the generated particles
227 //_______________________________________________________________________
228 void AliGenerator::SetPhiRange(Float_t phimin, Float_t phimax)
231 // Set the Phi range for the generated particles
233 fPhiMin = TMath::Pi()*phimin/180;
234 fPhiMax = TMath::Pi()*phimax/180; SetBit(kPhiRange);
237 //_______________________________________________________________________
238 void AliGenerator::SetYRange(Float_t ymin, Float_t ymax)
241 // Set the Rapidity range for the generated particles
248 //_______________________________________________________________________
249 void AliGenerator::SetVRange(Float_t vxmin, Float_t vxmax,
250 Float_t vymin, Float_t vymax,
251 Float_t vzmin, Float_t vzmax)
254 // Set the vertex range for the generated particles
256 fVMin[0]=vxmin; fVMin[1]=vymin; fVMin[2]=vzmin;
257 fVMax[0]=vxmax; fVMax[1]=vymax; fVMax[2]=vzmax;
258 SetBit(kVertexRange);
261 //_______________________________________________________________________
262 void AliGenerator::SetThetaRange(Float_t thetamin, Float_t thetamax)
265 // Set the theta range for the generated particles
267 fThetaMin = TMath::Pi()*thetamin/180;
268 fThetaMax = TMath::Pi()*thetamax/180; SetBit(kThetaRange);