]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenParam.h
Overlaps corrected, new shape of sectors
[u/mrichter/AliRoot.git] / EVGEN / AliGenParam.h
index 9e0b774f99dc9ff906195a9c8047186e3a428428..bbd61cebc653437502af3a4f6ab8b0c4dc80c286 100644 (file)
@@ -5,83 +5,94 @@
 
 /* $Id$ */
 
-#include "AliGenerator.h"
-#include "GenTypeDefs.h"
-#include <TArrayI.h>
+//
+// 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 AliDecayer;
 class AliPythia;
 class TParticle;
 class AliGenLib;
 class TF1;
 
+typedef enum { kAnalog, kNonAnalog} Weighting_t;
 //-------------------------------------------------------------
-class AliGenParam : public AliGenerator
+class AliGenParam : public AliGenMC
 {
- public:
+public:
     AliGenParam();
-    AliGenParam(Int_t npart, AliGenLib * Library, Param_t param, char* tname=0);
-    AliGenParam(Int_t npart, Param_t param, char* tname=0);
-    AliGenParam(Int_t npart, Param_t param,
-               Double_t (*PtPara)(Double_t*, Double_t*),
-               Double_t (*YPara )(Double_t*, Double_t*),
+    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*),
+             Double_t (*V2Para)(const Double_t*, const Double_t*),
                Int_t    (*IpPara)(TRandom*)           );
-    AliGenParam(const AliGenParam &Param);
      
     virtual ~AliGenParam();
+    virtual void GenerateN(Int_t ntimes);
     virtual void Generate();
     virtual void Init();
     // select particle type
-    virtual void SetParam(Param_t param=jpsi_p) {fParam=param;}
+    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 SetForceDecay(Decay_t decay=dimuon) {fForceDecay=decay;}
-    virtual void SetWeighting(Weighting_t flag=analog) {fAnalog=flag;} 
-    virtual void SetCutOnChild(Int_t flag=0) {fCutOnChild=flag;}
-    virtual void SetChildMomentumRange(Float_t pmin=0, Float_t pmax=1.e10)
-       {fChildPMin = pmin; fChildPMax = pmax;}
-    virtual void SetChildPtRange(Float_t ptmin=0, Float_t ptmax=20.)
-       {fChildPtMin = ptmin; fChildPtMax = ptmax;}
-    virtual void SetChildPhiRange(Float_t phimin=-180., Float_t phimax=180)
-       {fChildPhiMin = TMath::Pi()*phimin/180;
-       fChildPhiMax = TMath::Pi()*phimax/180;}
-    virtual void SetChildThetaRange(Float_t thetamin=0, Float_t thetamax=180)
-       {fChildThetaMin = TMath::Pi()*thetamin/180;
-       fChildThetaMax = TMath::Pi()*thetamax/180;}
-    virtual void SetDeltaPt(Float_t delta=0.01) {fDeltaPt=delta;}
+    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 SetForceGammaConversion(Bool_t force=kTRUE) {fForceConv = force;}
+    virtual void SetKeepParent(Bool_t keep=kTRUE){fKeepParent= keep;} //Store parent even if it does not have childs within cuts
+    virtual void SetKeepIfOneChildSelected(Bool_t keep=kTRUE){fKeepIfOneChildSelected = keep;} //Accept parent and child even if other children are not within cut.
     
-    AliGenParam & operator=(const AliGenParam & rhs);
- 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
+    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);
+
+    static TVector3 OrthogonalVector(TVector3 &inVec);
+    static void RotateVector(Double_t *pin, Double_t *pout, Double_t costheta, Double_t sintheta,
+                          Double_t cosphi, Double_t sinphi);
+    static double ScreenFunction1(double d);
+    static double ScreenFunction2(double d);
+    double RandomEnergyFraction(double Z, double E);
+    double RandomPolarAngle();
+    double RandomMass(Double_t mh);
+    Int_t VirtualGammaPairProduction(TClonesArray *particles, Int_t nPart);
+    Int_t ForceGammaConversion(TClonesArray *particles, Int_t nPart);
+  
+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
+  Double_t (*fV2ParaFunc )(const Double_t*, const Double_t*);//! Pointer to V2 parametrisation function
     TF1* fPtPara;              // Transverse momentum parameterisation
     TF1* fYPara;               // Rapidity parameterisation
-    Param_t     fParam;        // Parameterisation type 
+  TF1*        fV2Para;       // v2 parametrization
+  TF1*        fdNdPhi;       // Phi distribution depending on v2
+    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
-    Decay_t     fForceDecay;   // Decay channel forced
-    Int_t       fCutOnChild;   // Cuts on decay products (children)  are enabled/disabled
-    Float_t     fChildPtMin;   // Children minimum pT
-    Float_t     fChildPtMax;   // Children maximum pT
-    Float_t     fChildPMin;    // Children minimum p
-    Float_t     fChildPMax;    // Children maximum p
-    Float_t     fChildPhiMin;  // Children minimum phi
-    Float_t     fChildPhiMax;  // Children maximum phi
-    Float_t     fChildThetaMin;// Children minimum theta
-    Float_t     fChildThetaMax;// Children maximum theta
     Float_t     fDeltaPt;      // pT sampling in steps of fDeltaPt
-    TArrayI     fChildSelect;  // Children to be selected from decay products
+    Bool_t      fSelectAll;    // Flag for transportation of Background while using SetForceDecay()
     AliDecayer  *fDecayer;     // ! Pointer to pythia object for decays
- private:
-    // check if particle is selected as child
-    Bool_t ChildSelected(Int_t ip);
-    // all kinematic selection goes here
-    Bool_t KinematicSelection(TParticle *particle);
+    Bool_t      fForceConv;    //
+    Bool_t      fKeepParent;   //  Store parent even if it does not have childs within cuts
+    Bool_t      fKeepIfOneChildSelected; //Accept parent and child even if other children are not within cut.
+
+private:
+    AliGenParam(const AliGenParam &Param);
+    AliGenParam & operator=(const AliGenParam & rhs);
 
-  ClassDef(AliGenParam,1) // Generator using parameterised pt- and y-distribution
+    ClassDef(AliGenParam, 2) // Generator using parameterised pt- and y-distribution
 };
 #endif