]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVGEN/AliGenParam.h
All paramatrisation libraries derive from the pure virtual base class AliGenLib.
[u/mrichter/AliRoot.git] / EVGEN / AliGenParam.h
1 #ifndef ALIGENPARAM_H
2 #define ALIGENPARAM_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 #include "AliGenerator.h"
9 #include "GenTypeDefs.h"
10 #include <TArrayI.h>
11
12 class AliPythia;
13 class TParticle;
14 class AliGenLib;
15 class TF1;
16
17 //-------------------------------------------------------------
18 class AliGenParam : public AliGenerator
19 {
20  public:
21     AliGenParam();
22     AliGenParam(Int_t npart, AliGenLib * Library, Param_t param, char* tname=0);
23     AliGenParam(Int_t npart, Param_t param, char* tname=0);
24     AliGenParam(Int_t npart, Param_t param,
25                 Double_t (*PtPara)(Double_t*, Double_t*),
26                 Double_t (*YPara )(Double_t*, Double_t*),
27                 Int_t    (*IpPara)()                      );
28     AliGenParam(const AliGenParam &Param);
29      
30     virtual ~AliGenParam();
31     virtual void Generate();
32     virtual void Init();
33     // select particle type
34     virtual void SetParam(Param_t param=jpsi_p) {fParam=param;}
35     // force decay type
36     virtual void SetForceDecay(Decay_t decay=dimuon) {fForceDecay=decay;}
37     virtual void SetWeighting(Weighting_t flag=analog) {fAnalog=flag;}  
38     virtual void SetCutOnChild(Int_t flag=0) {fCutOnChild=flag;}
39     virtual void SetChildMomentumRange(Float_t pmin=0, Float_t pmax=1.e10)
40         {fChildPMin = pmin; fChildPMax = pmax;}
41     virtual void SetChildPtRange(Float_t ptmin=0, Float_t ptmax=20.)
42         {fChildPtMin = ptmin; fChildPtMax = ptmax;}
43     virtual void SetChildPhiRange(Float_t phimin=-180., Float_t phimax=180)
44         {fChildPhiMin = TMath::Pi()*phimin/180;
45         fChildPhiMax = TMath::Pi()*phimax/180;}
46     virtual void SetChildThetaRange(Float_t thetamin=0, Float_t thetamax=180)
47         {fChildThetaMin = TMath::Pi()*thetamin/180;
48         fChildThetaMax = TMath::Pi()*thetamax/180;}
49     virtual void SetDeltaPt(Float_t delta=0.01) {fDeltaPt=delta;}
50     
51     AliGenParam & operator=(const AliGenParam & rhs);
52  protected:
53     Double_t (*fPtParaFunc)(Double_t*, Double_t*); //! Pointer to Pt parametrisation function
54     Double_t (*fYParaFunc )(Double_t*, Double_t*); //! Pointer to Y parametrisation function
55     Int_t    (*fIpParaFunc )();    //! Pointer to particle type parametrisation function
56     TF1* fPtPara;              // Transverse momentum parameterisation
57     TF1* fYPara;               // Rapidity parameterisation
58     Param_t     fParam;        // Parameterisation type 
59     Float_t     fdNdy0;        // central multiplicity per event
60     Float_t     fYWgt;         // Y-weight
61     Float_t     fPtWgt;        // Pt-weight
62     Weighting_t fAnalog;       // Flag for anolog or pt-weighted generation
63     Float_t     fBias;         // Biasing factor
64     Int_t       fTrials;       // Number of trials
65     Decay_t     fForceDecay;   // Decay channel forced
66     Int_t       fCutOnChild;   // Cuts on decay products (children)  are enabled/disabled
67     Float_t     fChildPtMin;   // Children minimum pT
68     Float_t     fChildPtMax;   // Children maximum pT
69     Float_t     fChildPMin;    // Children minimum p
70     Float_t     fChildPMax;    // Children maximum p
71     Float_t     fChildPhiMin;  // Children minimum phi
72     Float_t     fChildPhiMax;  // Children maximum phi
73     Float_t     fChildThetaMin;// Children minimum theta
74     Float_t     fChildThetaMax;// Children maximum theta
75     Float_t     fDeltaPt;      // pT sampling in steps of fDeltaPt
76     TArrayI     fChildSelect;  // Children to be selected from decay products
77     AliPythia   *fPythia;      // Pointer to pythia object for decays
78  private:
79     // check if particle is selected as child
80     Bool_t ChildSelected(Int_t ip);
81     // all kinematic selection goes here
82     Bool_t KinematicSelection(TParticle *particle);
83
84   ClassDef(AliGenParam,1) // Generator using parameterised pt- and y-distribution
85 };
86 #endif
87
88
89
90
91
92
93
94
95
96