]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenParam.h
Possibility to force transport of all particles.
[u/mrichter/AliRoot.git] / EVGEN / AliGenParam.h
index d3dadc144578337a031102e0653af23348641826..37a42ad308e75ffadd60bb8ca2f64634ee46fd25 100644 (file)
@@ -1,53 +1,75 @@
+#ifndef ALIGENPARAM_H
+#define ALIGENPARAM_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
 
-#ifndef AliGenParam_H
-#define AliGenParam_H
-#include "AliGenerator.h"
-#include "AliPythia.h"
-#include "TNamed.h"
-#include "TF1.h"
-#include "TArrayF.h"
-#include "TArrayI.h"
-#include "TTree.h"
-#include "TMCParticle.h"
+/* $Id$ */
 
+//
+// Class to generate particles from using parametrized pT and y distributions.
+// Distributions are obtained from pointer to object of type AliGenLib.
+// (For example AliGenMUONlib)
+//
+// andreas.morsch@cern.ch
+//
+
+#include "AliGenMC.h"
+
+class AliPythia;
+class TParticle;
+class AliGenLib;
+class TF1;
+
+typedef enum { kAnalog, kNonAnalog} Weighting_t;
 //-------------------------------------------------------------
-class AliGenParam : public AliGenerator
+class AliGenParam : public AliGenMC
 {
-protected:
-  Double_t (*fPtParaFunc)(Double_t*, Double_t*); //! Pointer to Pt parametrisation function
-  Double_t (*fYParaFunc )(Double_t*, Double_t*); //! Pointer to Y parametrisation function
-  Int_t    (*fIpParaFunc )();    //! Pointer to particle type parametrisation function
-    TF1* fPtPara;
-    TF1* fYPara;
-    Param_t     fParam;
-    Float_t     fdNdy0;
-    Float_t     fYWgt;
-    Float_t     fPtWgt;
-    Weighting_t fAnalog;       //Flaf for anolog or pt-weighted generation
-    Float_t     fBias;
-    Int_t       fTrials;
-    Decay_t     fForceDecay;
-    TArrayI   fChildSelect;
-    AliPythia *fPythia;
- private:
-    // check if particle is selected as child
-    Bool_t ChildSelected(Int_t ip);
-    // all kinematic selection goes here
-    Bool_t KinematicSelection(TMCParticle *particle);
  public:
-  AliGenParam();
-  AliGenParam(Int_t npart, Param_t param);
-//                Double_t (*PtPara)(Double_t*, Double_t*),
-//                Double_t (*YPara )(Double_t*, Double_t*));
-  virtual ~AliGenParam();
-  virtual void Generate();
-  virtual void Init();
-  // select particle type
-  virtual void SetParam(Param_t param=jpsi_p) {fParam=param;}
-  // force decay type
-  virtual void ForceDecay(Decay_t decay=dimuon) {fForceDecay=decay;}
-  virtual void SetWeighting(Weighting_t flag=analog) {fAnalog=flag;}   
-  ClassDef(AliGenParam,1) // Generator using parameterised pt- and y-distribution
+    AliGenParam();
+    AliGenParam(Int_t npart, const AliGenLib * Library, Int_t param,   const char*  tname = 0);
+    AliGenParam(Int_t npart, Int_t param, const char* tname = 0, const char*  name  = 0);
+    AliGenParam(Int_t npart, Int_t param,
+               Double_t (*PtPara)(const Double_t*, const Double_t*),
+               Double_t (*YPara )(const Double_t*, const Double_t*),
+               Int_t    (*IpPara)(TRandom*)           );
+     
+    virtual ~AliGenParam();
+    virtual void Generate();
+    virtual void Init();
+    // select particle type
+    virtual void SetParam(Int_t param) {fParam = param;}
+    //Setting the flag for Background transportation while using SetForceDecay()
+    void SetSelectAll(Bool_t selectall) {fSelectAll = selectall;}
+    // force decay type
+    virtual void SetWeighting(Weighting_t flag = kAnalog) {fAnalog = flag;}    
+    virtual void SetDeltaPt(Float_t delta=0.01) {fDeltaPt = delta;}
+    virtual void SetDecayer(AliDecayer* decayer) {fDecayer = decayer;}
+    virtual void Draw(const char * opt);
+    TF1 *  GetPt() { return fPtPara;}
+    TF1 *  GetY() {return fYPara;}
+    Float_t GetRelativeArea(Float_t ptMin, Float_t ptMax, Float_t yMin, Float_t yMax, Float_t phiMin, Float_t phiMax);
+
+ protected:
+    Double_t (*fPtParaFunc)(const Double_t*, const Double_t*); //! Pointer to Pt parametrisation function
+    Double_t (*fYParaFunc )(const Double_t*, const Double_t*); //! Pointer to Y parametrisation function
+    Int_t    (*fIpParaFunc )(TRandom*);    //! Pointer to particle type parametrisation function
+    TF1* fPtPara;              // Transverse momentum parameterisation
+    TF1* fYPara;               // Rapidity parameterisation
+    Int_t       fParam;        // Parameterisation type 
+    Float_t     fdNdy0;        // central multiplicity per event
+    Float_t     fYWgt;         // Y-weight
+    Float_t     fPtWgt;        // Pt-weight
+    Float_t     fBias;         // Biasing factor
+    Int_t       fTrials;       // Number of trials
+    Float_t     fDeltaPt;      // pT sampling in steps of fDeltaPt
+    Bool_t      fSelectAll;    // Flag for transportation of Background while using SetForceDecay()
+    AliDecayer  *fDecayer;     // ! Pointer to pythia object for decays
+
+ private:
+    AliGenParam(const AliGenParam &Param);
+    AliGenParam & operator=(const AliGenParam & rhs);
+
+    ClassDef(AliGenParam, 2) // Generator using parameterised pt- and y-distribution
 };
 #endif