- correct minor issues with forcred gamma decays, and speed up
[u/mrichter/AliRoot.git] / EVGEN / AliGenEMlib.h
1 #ifndef ALIGENEMLIB_H
2 #define ALIGENEMLIB_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id: AliGenEMlib.h 30052 2008-11-25 14:54:18Z morsch $ */
7
8 /////////////////////////////////////////////////////////////////////////////
9 //                                                                         //
10 // Implementation of AliGenEMlib for electron, di-electron, and photon     //
11 // cocktail calculations.                                                  //
12 // It is based on AliGenGSIlib.                                            //
13 //                                                                         //
14 // Responsible: R.Averbeck@gsi.de                                          //
15 //                                                                         //
16 /////////////////////////////////////////////////////////////////////////////
17
18 #include "AliGenLib.h"
19 class TRandom;
20
21 class AliGenEMlib :public AliGenLib {
22 public:
23     
24   enum Particle_t{kPromptRealGamma, kPromptVirtGamma, kThermRealGamma, kThermVirtGamma, kPizero, kEta, kRho, kOmega, kEtaprime, kPhi, kJpsi};
25   enum Centrality_t{kpp=0x0, k0005=0x1, k0510=0x2, k1020=0x3, k2030=0x4, k3040=0x5, k4050=0x6, k5060=0x7, k0010=0x8, k2040=0x9, k4060=0xA, k6080=0xB, k0020=0xC, k0040=0xD, k2080=0xE, k4080=0xF, kCentralities=0x10};
26   enum PtParamSet_t{kPizero7TeVpp=0x10, kPizeroEta7TeVpp=0x20, kPizero7TeVpplow=0x30, kPizeroEta7TeVpplow=0x40, kPizero7TeVpphigh=0x50, kPizeroEta7TeVpphigh=0x60, kPizero2760GeVpp=0x70, kPizeroEta2760GeVpp=0x80, kPizero2760GeVpplow=0x90, kPizeroEta2760GeVpplow=0xA0, kPizero2760GeVpphigh=0xB0, kPizeroEta2760GeVpphigh=0xC0, kPichargedPbPb=0xD0, kPizeroPbPb=0xE0, kPichargedPPb=0xF0 };
27   enum v2Sys_t{kLoV2Sys=-1, kNoV2Sys=0, kUpV2Sys=+1};
28   
29   AliGenEMlib() { } ;
30
31   static void SelectParams(Int_t ptSelect, Int_t centSelect=kpp, Int_t v2sys=kNoV2Sys) 
32   { fgSelectedPtParam=ptSelect; fgSelectedCentrality=centSelect; fgSelectedV2Systematic=v2sys; }
33
34     GenFunc   GetPt(Int_t param, const char * tname=0) const;
35     GenFunc   GetY(Int_t param, const char * tname=0) const;
36     GenFuncIp GetIp(Int_t param, const char * tname=0) const;    
37   GenFunc   GetV2(Int_t param, const char * tname=0) const;
38
39   //private:
40
41   // General functions
42
43   static Int_t fgSelectedPtParam; // selected pT parameter
44   static Int_t fgSelectedCentrality; // selected Centrality
45   static Int_t fgSelectedV2Systematic; // selected v2 systematics, usefully values: -1,0,1
46
47
48   static Double_t PtModifiedHagedornThermal(const Double_t pt, 
49                                             const Double_t c, 
50                                             const Double_t p0, 
51                                             const Double_t p1, 
52                                             const Double_t n,
53                                             const Double_t cT,
54                                             const Double_t T);
55
56
57  
58   static Double_t PtModifiedHagedornExp(const Double_t pt,
59                                         const Double_t c,
60                                         const Double_t p0,
61                                         const Double_t p1,
62                                         const Double_t p2,
63                                         const Double_t n); 
64
65
66   static Double_t PtModifiedHagedornExp2(const Double_t pt,
67                                            const Double_t c,
68                                            const Double_t a,
69                                            const Double_t b,
70                                            const Double_t p0,
71                                            const Double_t p1,
72                                            const Double_t d,
73                                            const Double_t n);
74
75
76   static Double_t PtTsallis(const Double_t pt,
77                             const Double_t m,
78                             const Double_t c,
79                             const Double_t T,
80                             const Double_t n);
81
82   static Double_t PtExponential(const Double_t *pt, const Double_t *param);
83   static Double_t PtModifiedHagedornPowerlaw(const Double_t *pt, const Double_t *param);
84   static Double_t IntegratedKrollWada(Double_t mh);
85
86   // prompt gamma
87   static Int_t    IpPromptRealGamma(TRandom *ran);
88   static Double_t PtPromptRealGamma(const Double_t *px, const Double_t *dummy);
89   static Double_t YPromptRealGamma(const Double_t *py, const Double_t *dummy);
90   static Double_t V2PromptRealGamma(const Double_t *px, const Double_t *dummy);
91
92   static Int_t    IpPromptVirtGamma(TRandom *ran);
93   static Double_t PtPromptVirtGamma(const Double_t *px, const Double_t *dummy);
94   static Double_t YPromptVirtGamma(const Double_t *py, const Double_t *dummy);
95   static Double_t V2PromptVirtGamma(const Double_t *px, const Double_t *dummy);
96
97   // thermal gamma
98   static Int_t    IpThermRealGamma(TRandom *ran);
99   static Double_t PtThermRealGamma(const Double_t *px, const Double_t *dummy);
100   static Double_t YThermRealGamma(const Double_t *py, const Double_t *dummy);
101   static Double_t V2ThermRealGamma(const Double_t *px, const Double_t *dummy);
102
103   static Int_t    IpThermVirtGamma(TRandom *ran);
104   static Double_t PtThermVirtGamma(const Double_t *px, const Double_t *dummy);
105   static Double_t YThermVirtGamma(const Double_t *py, const Double_t *dummy);
106   static Double_t V2ThermVirtGamma(const Double_t *px, const Double_t *dummy);
107
108   // Pizero
109     static Int_t    IpPizero(TRandom *ran);
110   static Double_t PtPizero(const Double_t *px, const Double_t *dummy);
111     static Double_t YPizero(const Double_t *py, const Double_t *dummy);
112   static Double_t V2Pizero(const Double_t *px, const Double_t *dummy);
113
114   // Eta
115     static Int_t    IpEta(TRandom *ran);
116   static Double_t PtEta(const Double_t *px, const Double_t *dummy);
117     static Double_t YEta(const Double_t *py, const Double_t *dummy);
118   static Double_t V2Eta(const Double_t *px, const Double_t *dummy);
119
120   // Rho
121     static Int_t    IpRho(TRandom *ran);
122   static Double_t PtRho(const Double_t *px, const Double_t *dummy);
123     static Double_t YRho(const Double_t *py, const Double_t *dummy);
124   static Double_t V2Rho(const Double_t *py, const Double_t *dummy);
125
126   // Omega
127     static Int_t    IpOmega(TRandom *ran);
128   static Double_t PtOmega(const Double_t *px, const Double_t *dummy);
129     static Double_t YOmega(const Double_t *py, const Double_t *dummy);
130   static Double_t V2Omega(const Double_t *py, const Double_t *dummy);
131
132   // Etaprime
133     static Int_t    IpEtaprime(TRandom *ran);
134   static Double_t PtEtaprime(const Double_t *px, const Double_t *dummy);
135     static Double_t YEtaprime(const Double_t *py, const Double_t *dummy);
136   static Double_t V2Etaprime(const Double_t *py, const Double_t *dummy);
137
138   // Phi
139     static Int_t    IpPhi(TRandom *ran);
140   static Double_t PtPhi(const Double_t *px, const Double_t *dummy);
141     static Double_t YPhi(const Double_t *py, const Double_t *dummy);
142   static Double_t V2Phi(const Double_t *py, const Double_t *dummy);
143
144   // Jpsi
145   static Int_t    IpJpsi(TRandom *ran);
146   static Double_t PtJpsi(const Double_t *px, const Double_t *dummy);
147   static Double_t YJpsi(const Double_t *py, const Double_t *dummy);
148   static Double_t V2Jpsi(const Double_t *py, const Double_t *dummy);
149
150   // General
151   //static Double_t PtFlat(const Double_t *px, const Double_t *dummy);
152     static Double_t YFlat(Double_t y);
153   static Double_t MtScal(Double_t pt, Int_t np);
154   static Double_t V2Param(const Double_t *px, const Double_t *param);
155   static Double_t V2Flat(const Double_t *px, const Double_t *param);
156   static Double_t KEtScal(Double_t pt, Int_t np);
157   static Double_t GetTAA(Int_t cent);
158
159   static Double_t CrossOverLc(const double a, const double b, const double x);
160   static Double_t CrossOverRc(const double a, const double b, const double x);
161
162   static const Double_t fgkV2param[16][15];          // parameters of pi v2
163   static const Double_t fgkRawPtOfV2Param[16][10];   // parameters of the raw pt spectrum of v2 analysys
164   static const Double_t fgkThermPtParam[16][2];      // parameters of thermal gamma pt
165   static const Double_t fgkHM[8];                    // particle masses
166   static const Double_t fgkMtFactor[2][8];           // mt scaling factor
167
168   ClassDef(AliGenEMlib,0)
169 };
170
171
172 #endif