This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / STEER / AliGenerator.h
CommitLineData
fe4da5cc 1#ifndef ALIGENERATOR_H
2#define ALIGENERATOR_H
3///////////////////////////////////////////////////////////
4// //
5// Class to generate the particles for the MC //
6// The base class is empty //
7// //
8///////////////////////////////////////////////////////////
9
10#include "TNamed.h"
11#include "TArrayF.h"
12#include "TGenerator.h"
13
14typedef enum { none, perEvent, perTrack } VertexSmear_t;
15
16class AliGenerator : public TNamed
17{
18
19protected:
20 static TGenerator* fgMCEvGen;
21 Float_t fThetaMin; //Minimum theta of generation in radians
22 Float_t fThetaMax; //Maximum theta of generation in radians
23 Float_t fPhiMin; //Minimum phi of generation in radians
24 Float_t fPhiMax; //Maximum phi of generation in radians
25 Float_t fPMin; //Minimum momentum of generation in GeV/c
26 Float_t fPMax; //Minimum momentum of generation in GeV/c
27 Float_t fPtMin; //Minimum transverse momentum
28 Float_t fPtMax; //Maximum transverse momentum
29 Float_t fYMin; //Minimum rapidity
30 Float_t fYMax; //Maximum rapidity
31 TArrayF fVMin; //Minimum Decaylength
32 TArrayF fVMax; //Minimum Decaylength
33 Int_t fNpart; //Maximum number of particles per event
34 Float_t fParentWeight; //Parent Weight
35 Float_t fChildWeight; //ChildWeight
36 Int_t fAnalog; //Flaf for anolog or pt-weighted generation
37 //
38 VertexSmear_t fVertexSmear; //Vertex Smearing mode
39 TArrayF fOrigin; //Origin of event
40 TArrayF fOsigma; //Sigma of the Origin of event
41
42 public:
43 AliGenerator();
44 AliGenerator(Int_t npart);
45 virtual ~AliGenerator();
46 virtual void Init();
47 virtual void SetOrigin(Float_t ox, Float_t oy, Float_t oz)
48 {fOrigin[0]=ox;fOrigin[1]=oy;fOrigin[2]=oz;}
49 virtual void SetSigma(Float_t sx, Float_t sy, Float_t sz)
50 {fOsigma[0]=sx;fOsigma[1]=sy;fOsigma[2]=sz;}
51 virtual void SetMomentumRange(Float_t pmin=0, Float_t pmax=1.e10)
52 {fPMin = pmin; fPMax = pmax;}
53 virtual void SetPtRange(Float_t ptmin=0, Float_t ptmax=20.)
54 {fPtMin = ptmin; fPtMax = ptmax;}
55 virtual void SetPhiRange(Float_t phimin=-180., Float_t phimax=180)
56 {fPhiMin = TMath::Pi()*phimin/180;
57 fPhiMax = TMath::Pi()*phimax/180;}
58 virtual void SetYRange(Float_t ymin=-100, Float_t ymax=100)
59 {fYMin=ymin; fYMax=ymax;}
60 virtual void SetVRange(Float_t vxmin, Float_t vxmax,
61 Float_t vymin, Float_t vymax,
62 Float_t vzmin, Float_t vzmax)
63 {
64 fVMin[0]=vxmin; fVMin[1]=vymin; fVMin[2]=vzmin;
65 fVMax[0]=vxmax; fVMax[1]=vymax; fVMax[2]=vzmax;
66 }
67 virtual void SetNumberParticles(Int_t npart=100) {fNpart=npart;}
68 virtual Int_t NumberParticles() {return fNpart;}
69 virtual void SetThetaRange(Float_t thetamin=0, Float_t thetamax=180)
70 {fThetaMin = TMath::Pi()*thetamin/180;
71 fThetaMax = TMath::Pi()*thetamax/180;}
72 virtual void Generate()=0;
73 virtual void SetParentWeight(Float_t wgt) {fParentWeight=wgt;}
74 virtual void SetChildWeight(Float_t wgt) {fChildWeight=wgt;}
75 virtual void SetAnalog(Int_t flag=1) {fAnalog=flag;}
76 virtual void SetVertexSmear(VertexSmear_t smear) {fVertexSmear = smear;}
77 virtual void SetMC(TGenerator *theMC)
78 {if (!fgMCEvGen) fgMCEvGen =theMC;}
79 ClassDef(AliGenerator,1)
80};
81
82#endif