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