// //
///////////////////////////////////////////////////////////
-#include "TLorentzVector.h"
-#include "TArrayF.h"
-#include "TGenerator.h"
+#include <TArrayF.h>
+#include <TLorentzVector.h>
+#include <TMCProcess.h>
+
+#include "AliRndm.h"
+
+class AliCollisionGeometry;
+class AliStack;
+
+class TGenerator;
+
+
typedef enum { kNoSmear, kPerEvent, kPerTrack } VertexSmear_t;
+typedef enum { kExternal, kInternal} VertexSource_t;
+
-class AliGenerator : public TNamed
+class AliGenerator : public TNamed, public AliRndm
{
public:
virtual void SetChildWeight(Float_t wgt) {fChildWeight=wgt;}
virtual void SetAnalog(Int_t flag=1) {fAnalog=flag;}
virtual void SetVertexSmear(VertexSmear_t smear) {fVertexSmear = smear;}
+ virtual void SetCutVertexZ(Float_t cut=999999.) {fCutVertexZ = cut;}
+ virtual void SetVertexSource(VertexSource_t) {fVertexSource = kInternal;}
virtual void SetTrackingFlag(Int_t flag=1) {fTrackIt=flag;}
-
+ void Vertex();
+ void VertexExternal();
+ virtual void VertexInternal();
+ virtual void FinishRun(){;}
+
virtual void SetMC(TGenerator *theMC)
{if (!fgMCEvGen) fgMCEvGen =theMC;}
{ox=fOrigin.At(0);oy=fOrigin.At(1);oz=fOrigin.At(2);}
virtual void GetOrigin(TLorentzVector &o) const
{o[0]=fOrigin.At(0);o[1]=fOrigin.At(1);o[2]=fOrigin.At(2);o[3]=0;}
-
-protected:
- static TGenerator* fgMCEvGen; // Pointer to the generator
+ // Stack
+ void SetStack (AliStack *stack) {fStack = stack;}
+ AliStack* GetStack(){return fStack;}
+ // Collision Geometry
+ virtual Bool_t ProvidesCollisionGeometry() const {return kFALSE;}
+ virtual Bool_t NeedsCollisionGeometry() const {return kFALSE;}
+ virtual AliCollisionGeometry* CollisionGeometry() {return fCollisionGeometry;}
+ virtual void SetCollisionGeometry(AliCollisionGeometry* geom) {fCollisionGeometry = geom;}
+ protected:
+ virtual void SetTrack(Int_t done, Int_t parent, Int_t pdg,
+ Float_t *pmom, Float_t *vpos, Float_t *polar,
+ Float_t tof, TMCProcess mech, Int_t &ntr,
+ Float_t weight = 1, Int_t is = 0);
+ virtual void SetTrack(Int_t done, Int_t parent, Int_t pdg,
+ Double_t px, Double_t py, Double_t pz, Double_t e,
+ Double_t vx, Double_t vy, Double_t vz, Double_t tof,
+ Double_t polx, Double_t poly, Double_t polz,
+ TMCProcess mech, Int_t &ntr, Float_t weight = 1, Int_t is = 0);
+ virtual void KeepTrack(Int_t itrack);
+ virtual void SetHighWaterMark(Int_t nt);
+
+ protected:
+ static TGenerator* fgMCEvGen; //Pointer to the generator
Float_t fThetaMin; //Minimum theta of generation in radians
Float_t fThetaMax; //Maximum theta of generation in radians
Float_t fPhiMin; //Minimum phi of generation in radians
Int_t fNpart; //Maximum number of particles per event
Float_t fParentWeight; //Parent Weight
Float_t fChildWeight; //ChildWeight
- Int_t fTrackit; // Track the generated final state particle if 1
- Int_t fAnalog; //Flaf for anolog or pt-weighted generation
+ Int_t fAnalog; //Flag for anolog or pt-weighted generation
//
- VertexSmear_t fVertexSmear; //Vertex Smearing mode
- Int_t fTrackIt; // if 1 Track final state particles
- TArrayF fOrigin; //Origin of event
- TArrayF fOsigma; //Sigma of the Origin of event
-
- enum {kThetaRange=1, kVertexRange=2, kPhiRange=4, kPtRange=8,
- kYRange=32, kMomentumRange=16};
+ VertexSmear_t fVertexSmear; //Vertex Smearing mode
+ VertexSource_t fVertexSource; //Vertex source (internal/external)
+ Float_t fCutVertexZ; // Vertex cut in units of sigma_z
+ Int_t fTrackIt; // if 1, Track final state particles
+ TArrayF fOrigin; // Origin of event
+ TArrayF fOsigma; // Sigma of the Origin of event
+ TArrayF fVertex; //! Vertex of current event
+ TArrayF fEventVertex; //!The current event vertex
- ClassDef(AliGenerator,1) // Base class for event generators
+ AliStack* fStack; //! Local pointer to stack
+ AliCollisionGeometry* fCollisionGeometry; //!Collision geometry
+ /*************************************************************************/
+ enum {kThetaRange = BIT(14),
+ kVertexRange = BIT(15),
+ kPhiRange = BIT(16),
+ kPtRange = BIT(17),
+ kYRange = BIT(18),
+ kMomentumRange = BIT(19)
+ };
+ ClassDef(AliGenerator,3) // Base class for event generators
};
#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+