]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALIGENERATOR_H | |
2 | #define ALIGENERATOR_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
8 | /////////////////////////////////////////////////////////// | |
9 | // // | |
10 | // Class to generate the particles for the MC // | |
11 | // The base class is empty // | |
12 | // // | |
13 | /////////////////////////////////////////////////////////// | |
14 | ||
15 | #include "TLorentzVector.h" | |
16 | #include "TArrayF.h" | |
17 | #include "TMCProcess.h" | |
18 | ||
19 | #include "AliRndm.h" | |
20 | class TGenerator; | |
21 | class AliStack; | |
22 | ||
23 | ||
24 | typedef enum { kNoSmear, kPerEvent, kPerTrack } VertexSmear_t; | |
25 | typedef enum { kExternal, kInternal} VertexSource_t; | |
26 | ||
27 | ||
28 | class AliGenerator : public TNamed, public AliRndm | |
29 | { | |
30 | ||
31 | public: | |
32 | AliGenerator(); | |
33 | AliGenerator(Int_t npart); | |
34 | AliGenerator(const AliGenerator &gen); | |
35 | virtual ~AliGenerator(); | |
36 | virtual void Init(); | |
37 | void Copy(AliGenerator &gen) const; | |
38 | virtual void SetOrigin(Float_t ox, Float_t oy, Float_t oz); | |
39 | virtual void SetOrigin(const TLorentzVector &o); | |
40 | virtual void SetSigma(Float_t sx, Float_t sy, Float_t sz); | |
41 | virtual void SetMomentumRange(Float_t pmin=0, Float_t pmax=1.e10); | |
42 | virtual void SetPtRange(Float_t ptmin=0, Float_t ptmax=1.e10); | |
43 | virtual void SetPhiRange(Float_t phimin=-180., Float_t phimax=180); | |
44 | virtual void SetYRange(Float_t ymin=-100, Float_t ymax=100); | |
45 | virtual void SetVRange(Float_t vxmin, Float_t vxmax, | |
46 | Float_t vymin, Float_t vymax, | |
47 | Float_t vzmin, Float_t vzmax); | |
48 | virtual void SetNumberParticles(Int_t npart=100) {fNpart=npart;} | |
49 | virtual Int_t NumberParticles() const {return fNpart;} | |
50 | virtual void SetThetaRange(Float_t thetamin=0, Float_t thetamax=180); | |
51 | virtual void Generate()=0; | |
52 | virtual void SetParentWeight(Float_t wgt) {fParentWeight=wgt;} | |
53 | virtual void SetChildWeight(Float_t wgt) {fChildWeight=wgt;} | |
54 | virtual void SetAnalog(Int_t flag=1) {fAnalog=flag;} | |
55 | virtual void SetVertexSmear(VertexSmear_t smear) {fVertexSmear = smear;} | |
56 | virtual void SetCutVertexZ(Float_t cut=999999.) {fCutVertexZ = cut;} | |
57 | virtual void SetVertexSource(VertexSource_t) {fVertexSource = kInternal;} | |
58 | virtual void SetTrackingFlag(Int_t flag=1) {fTrackIt=flag;} | |
59 | void Vertex(); | |
60 | void VertexExternal(); | |
61 | virtual void VertexInternal(); | |
62 | virtual void FinishRun(){;} | |
63 | ||
64 | virtual void SetMC(TGenerator *theMC) | |
65 | {if (!fgMCEvGen) fgMCEvGen =theMC;} | |
66 | ||
67 | AliGenerator & operator=(const AliGenerator &gen); | |
68 | ||
69 | // Getters | |
70 | ||
71 | virtual void GetOrigin(Float_t &ox, Float_t &oy, Float_t &oz) const | |
72 | {ox=fOrigin.At(0);oy=fOrigin.At(1);oz=fOrigin.At(2);} | |
73 | virtual void GetOrigin(TLorentzVector &o) const | |
74 | {o[0]=fOrigin.At(0);o[1]=fOrigin.At(1);o[2]=fOrigin.At(2);o[3]=0;} | |
75 | ||
76 | void SetStack (AliStack *stack) {fStack = stack;} | |
77 | AliStack* GetStack(){return fStack;} | |
78 | // Comminication with stack | |
79 | protected: | |
80 | virtual void SetTrack(Int_t done, Int_t parent, Int_t pdg, | |
81 | Float_t *pmom, Float_t *vpos, Float_t *polar, | |
82 | Float_t tof, TMCProcess mech, Int_t &ntr, | |
83 | Float_t weight = 1, Int_t is = 0); | |
84 | virtual void SetTrack(Int_t done, Int_t parent, Int_t pdg, | |
85 | Double_t px, Double_t py, Double_t pz, Double_t e, | |
86 | Double_t vx, Double_t vy, Double_t vz, Double_t tof, | |
87 | Double_t polx, Double_t poly, Double_t polz, | |
88 | TMCProcess mech, Int_t &ntr, Float_t weight = 1, Int_t is = 0); | |
89 | virtual void KeepTrack(Int_t itrack); | |
90 | virtual void SetHighWaterMark(Int_t nt); | |
91 | ||
92 | protected: | |
93 | static TGenerator* fgMCEvGen; //Pointer to the generator | |
94 | Float_t fThetaMin; //Minimum theta of generation in radians | |
95 | Float_t fThetaMax; //Maximum theta of generation in radians | |
96 | Float_t fPhiMin; //Minimum phi of generation in radians | |
97 | Float_t fPhiMax; //Maximum phi of generation in radians | |
98 | Float_t fPMin; //Minimum momentum of generation in GeV/c | |
99 | Float_t fPMax; //Minimum momentum of generation in GeV/c | |
100 | Float_t fPtMin; //Minimum transverse momentum | |
101 | Float_t fPtMax; //Maximum transverse momentum | |
102 | Float_t fYMin; //Minimum rapidity | |
103 | Float_t fYMax; //Maximum rapidity | |
104 | TArrayF fVMin; //Minimum Decaylength | |
105 | TArrayF fVMax; //Minimum Decaylength | |
106 | Int_t fNpart; //Maximum number of particles per event | |
107 | Float_t fParentWeight; //Parent Weight | |
108 | Float_t fChildWeight; //ChildWeight | |
109 | Int_t fAnalog; //Flag for anolog or pt-weighted generation | |
110 | // | |
111 | VertexSmear_t fVertexSmear; //Vertex Smearing mode | |
112 | VertexSource_t fVertexSource; //Vertex source (internal/external) | |
113 | Float_t fCutVertexZ; // Vertex cut in units of sigma_z | |
114 | Int_t fTrackIt; // if 1, Track final state particles | |
115 | TArrayF fOrigin; // Origin of event | |
116 | TArrayF fOsigma; // Sigma of the Origin of event | |
117 | TArrayF fVertex; //! Vertex of current event | |
118 | TArrayF fEventVertex; //!The current event vertex | |
119 | ||
120 | AliStack* fStack; //! Local pointer to stack | |
121 | /*************************************************************************/ | |
122 | enum {kThetaRange = BIT(14), | |
123 | kVertexRange = BIT(15), | |
124 | kPhiRange = BIT(16), | |
125 | kPtRange = BIT(17), | |
126 | kYRange = BIT(18), | |
127 | kMomentumRange = BIT(19) | |
128 | }; | |
129 | ClassDef(AliGenerator,2) // Base class for event generators | |
130 | }; | |
131 | ||
132 | #endif | |
133 | ||
134 | ||
135 | ||
136 | ||
137 | ||
138 | ||
139 | ||
140 | ||
141 | ||
142 | ||
143 | ||
144 | ||
145 | ||
146 |