Introducing the interaction time into the aliroot generators. In case of gaussian...
[u/mrichter/AliRoot.git] / STEER / STEER / AliGenerator.h
CommitLineData
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
116cbefd 15#include <TArrayF.h>
16#include <TLorentzVector.h>
17#include <TMCProcess.h>
18
65fb704d 19#include "AliRndm.h"
eeb8ca4e 20
14248849 21class AliVertexGenerator;
116cbefd 22class AliCollisionGeometry;
d6eec420 23class AliGenEventHeader;
69a313ec 24class AliStack;
116cbefd 25class TGenerator;
26
69a313ec 27
fe4da5cc 28
0b910a04 29typedef enum { kNoSmear, kPerEvent, kPerTrack } VertexSmear_t;
30typedef enum { kExternal, kInternal, kContainer} VertexSource_t;
fe4da5cc 31
69a313ec 32
65fb704d 33class AliGenerator : public TNamed, public AliRndm
fe4da5cc 34{
35
fe4da5cc 36 public:
e7c989e4 37
fe4da5cc 38 AliGenerator();
39 AliGenerator(Int_t npart);
40 virtual ~AliGenerator();
41 virtual void Init();
94de3818 42 virtual void SetOrigin(Float_t ox, Float_t oy, Float_t oz);
43 virtual void SetOrigin(const TLorentzVector &o);
44 virtual void SetSigma(Float_t sx, Float_t sy, Float_t sz);
132427f0 45 virtual void SetSigmaZ(Float_t sz) {fOsigma[2] = sz;}
94de3818 46 virtual void SetMomentumRange(Float_t pmin=0, Float_t pmax=1.e10);
d48c5cd4 47 virtual void SetPtRange(Float_t ptmin=0, Float_t ptmax=1.e10);
05be135b 48 virtual void SetPhiRange(Float_t phimin = 0., Float_t phimax = 360.);
94de3818 49 virtual void SetYRange(Float_t ymin=-100, Float_t ymax=100);
fe4da5cc 50 virtual void SetVRange(Float_t vxmin, Float_t vxmax,
51 Float_t vymin, Float_t vymax,
94de3818 52 Float_t vzmin, Float_t vzmax);
fe4da5cc 53 virtual void SetNumberParticles(Int_t npart=100) {fNpart=npart;}
94de3818 54 virtual Int_t NumberParticles() const {return fNpart;}
55 virtual void SetThetaRange(Float_t thetamin=0, Float_t thetamax=180);
fe4da5cc 56 virtual void Generate()=0;
57 virtual void SetParentWeight(Float_t wgt) {fParentWeight=wgt;}
58 virtual void SetChildWeight(Float_t wgt) {fChildWeight=wgt;}
59 virtual void SetAnalog(Int_t flag=1) {fAnalog=flag;}
60 virtual void SetVertexSmear(VertexSmear_t smear) {fVertexSmear = smear;}
c34578e7 61 virtual void SetCutVertexZ(Float_t cut=999999.) {fCutVertexZ = cut;}
0b910a04 62 virtual void SetVertexSource(VertexSource_t source = kInternal) {fVertexSource = source;}
63 virtual void SetVertex(Float_t vx, Float_t vy, Float_t vz)
64 {fVertex[0] = vx; fVertex[1] = vy; fVertex[2] = vz;}
14248849 65 void SetVertexGenerator(AliVertexGenerator* vertexGenerator)
66 {fVertexGenerator = vertexGenerator; fVertexSource = kExternal; fVertexSmear = kPerEvent;}
f0831961 67 void SetPileUpTimeWindow(Float_t pileUpTimeW) {fPileUpTimeWindow = pileUpTimeW;}
21391258 68 virtual void SetTime(Float_t time)
69 {fTime = time;}
70 virtual void SetTimeOrigin(Float_t timeorig)
71 {fTimeOrigin = timeorig;}
f0831961 72
4a3ba9d2 73 virtual void SetTrackingFlag(Int_t flag=1) {fTrackIt=flag;}
f89cabfe 74 void Vertex();
75 void VertexExternal();
76 virtual void VertexInternal();
0b910a04 77 virtual void FinishRun();
a08cd31a 78 virtual void SetMC(TGenerator *theMC) {fMCEvGen =theMC;}
3d581b22 79 virtual TGenerator* GetMC() const {return fMCEvGen;}
d6eec420 80 virtual void AddHeader(AliGenEventHeader* /*header*/) {;}
81 virtual void SetContainer(AliGenerator* container) {fContainer = container;}
aee8290b 82
c9001868 83 // Getters
84
94de3818 85 virtual void GetOrigin(Float_t &ox, Float_t &oy, Float_t &oz) const
86 {ox=fOrigin.At(0);oy=fOrigin.At(1);oz=fOrigin.At(2);}
87 virtual void GetOrigin(TLorentzVector &o) const
88 {o[0]=fOrigin.At(0);o[1]=fOrigin.At(1);o[2]=fOrigin.At(2);o[3]=0;}
2c5b3727 89 // Stack
69a313ec 90 void SetStack (AliStack *stack) {fStack = stack;}
91 AliStack* GetStack(){return fStack;}
2c5b3727 92 // Collision Geometry
116cbefd 93 virtual Bool_t ProvidesCollisionGeometry() const {return kFALSE;}
94 virtual Bool_t NeedsCollisionGeometry() const {return kFALSE;}
39192f05 95 virtual AliCollisionGeometry* CollisionGeometry() const {return fCollisionGeometry;}
2c5b3727 96 virtual void SetCollisionGeometry(AliCollisionGeometry* geom) {fCollisionGeometry = geom;}
e7c989e4 97
98 virtual Float_t GetEnergyCMS() const { return fEnergyCMS; }
99 virtual void SetEnergyCMS(Float_t energy = 0) { fEnergyCMS = energy; }
100 virtual void GetProjectile(TString& tar, Int_t& a, Int_t& z) const
101 {tar = fProjectile; a = fAProjectile; z = fZProjectile;}
102 virtual void GetTarget(TString& tar, Int_t& a, Int_t& z) const
103 {tar = fTarget; a = fATarget; z = fZTarget;}
104 virtual void SetProjectile(TString proj="", Int_t a = 0, Int_t z = 0)
105 {fProjectile = proj; fAProjectile = a; fZProjectile = z;}
106 virtual void SetTarget(TString tar="", Int_t a = 0, Int_t z = 0)
107 {fTarget = tar; fATarget = a; fZTarget = z;}
108
69a313ec 109 protected:
642f15cf 110 virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg,
69a313ec 111 Float_t *pmom, Float_t *vpos, Float_t *polar,
98490ea9 112 Float_t tof, TMCProcess mech, Int_t &ntr,
47c8bcbe 113 Float_t weight = 1, Int_t is = 0);
642f15cf 114 virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg,
69a313ec 115 Double_t px, Double_t py, Double_t pz, Double_t e,
116 Double_t vx, Double_t vy, Double_t vz, Double_t tof,
117 Double_t polx, Double_t poly, Double_t polz,
98490ea9 118 TMCProcess mech, Int_t &ntr, Float_t weight = 1, Int_t is = 0);
69a313ec 119 virtual void KeepTrack(Int_t itrack);
120 virtual void SetHighWaterMark(Int_t nt);
e7c989e4 121
69a313ec 122 protected:
a08cd31a 123 TGenerator* fMCEvGen; //!Pointer to the generator
aee8290b 124 Float_t fThetaMin; //Minimum theta of generation in radians
125 Float_t fThetaMax; //Maximum theta of generation in radians
126 Float_t fPhiMin; //Minimum phi of generation in radians
127 Float_t fPhiMax; //Maximum phi of generation in radians
128 Float_t fPMin; //Minimum momentum of generation in GeV/c
129 Float_t fPMax; //Minimum momentum of generation in GeV/c
130 Float_t fPtMin; //Minimum transverse momentum
131 Float_t fPtMax; //Maximum transverse momentum
132 Float_t fYMin; //Minimum rapidity
133 Float_t fYMax; //Maximum rapidity
134 TArrayF fVMin; //Minimum Decaylength
135 TArrayF fVMax; //Minimum Decaylength
136 Int_t fNpart; //Maximum number of particles per event
137 Float_t fParentWeight; //Parent Weight
138 Float_t fChildWeight; //ChildWeight
69a313ec 139 Int_t fAnalog; //Flag for anolog or pt-weighted generation
aee8290b 140 //
f89cabfe 141 VertexSmear_t fVertexSmear; //Vertex Smearing mode
c34578e7 142 VertexSource_t fVertexSource; //Vertex source (internal/external)
f0831961 143 Float_t fCutVertexZ; //Vertex cut in units of sigma_z
144 Float_t fPileUpTimeWindow; //Time window for pile-up events
6df200c3 145 Int_t fTrackIt; // if 1, Track final state particles
14248849 146 AliVertexGenerator* fVertexGenerator; //! Generator for the vertex
f89cabfe 147 TArrayF fOrigin; // Origin of event
6df200c3 148 TArrayF fOsigma; // Sigma of the Origin of event
d6eec420 149 TArrayF fVertex; //! Vertex of current event
21391258 150
151 Float_t fTimeOrigin; // Time0 origin in a run or event sample
152 Float_t fTime; // Event time smeared around time0 origin using sigma vertex
c34578e7 153
d6eec420 154 AliStack* fStack; //! Local pointer to stack
155 AliGenerator* fContainer; //! Local pointer to container
156
2c5b3727 157 AliCollisionGeometry* fCollisionGeometry; //!Collision geometry
69a313ec 158 /*************************************************************************/
5e34a898 159 enum {kThetaRange = BIT(14),
160 kVertexRange = BIT(15),
69a313ec 161 kPhiRange = BIT(16),
5e34a898 162 kPtRange = BIT(17),
69a313ec 163 kYRange = BIT(18),
84631597 164 kMomentumRange = BIT(19),
165 kEtaRange = BIT(20)
5e34a898 166 };
93a2041b 167
e7c989e4 168 Float_t fEnergyCMS; // Centre of mass energy
169 Int_t fAProjectile; // Projectile A
170 Int_t fZProjectile; // Projectile Z
171 Int_t fATarget; // Target A
172 Int_t fZTarget; // Target Z
173 TString fProjectile; // Projectile
174 TString fTarget; // Target
175
93a2041b 176 private:
177 AliGenerator(const AliGenerator &gen);
178 AliGenerator & operator=(const AliGenerator &gen);
179
21391258 180 ClassDef(AliGenerator,5) // Base class for event generators
fe4da5cc 181};
182
183#endif
69a313ec 184
185
186
c34578e7 187
188
189
190
191
192
193
194
195
196
197