]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVGEN/AliGenPMDlib.cxx
Set high water mark after last particle.
[u/mrichter/AliRoot.git] / EVGEN / AliGenPMDlib.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /*
17 $Log$
18 Revision 1.1  2000/09/08 15:37:58  morsch
19 pt and y-parameterisations for PMD physics simulation.
20 THIS VERSION IS JUST A TEMPLATE THE PT AND Y DISTRIBUTIONS HAVE TO BE CORRECTED !!!!.
21
22 */
23
24 #include "AliGenPMDlib.h"
25 #include "AliPDG.h"
26 #include "TMath.h"
27
28 ClassImp(AliGenPMDlib)
29 //
30 //  Neutral Pions
31
32 Double_t AliGenPMDlib::PtPi0(Double_t *px, Double_t *dummy)
33 {
34 //
35 //     PT-PARAMETERIZATION CDF, PRL 61(88) 1819
36 //     POWER LAW FOR PT > 500 MEV
37 //     MT SCALING BELOW (T=160 MEV)
38 //
39   const Double_t kp0 = 1.3;
40   const Double_t kxn = 8.28;
41   const Double_t kxlim=0.5;
42   const Double_t kt=0.160;
43   const Double_t kxmpi=0.139;
44   const Double_t kb=1.;
45   Double_t y, y1, xmpi2, ynorm, a;
46   Double_t x=*px;
47   //
48   y1=TMath::Power(kp0/(kp0+kxlim),kxn);
49   xmpi2=kxmpi*kxmpi;
50   ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+xmpi2)/kt));
51   a=ynorm/y1;
52   if (x > kxlim)
53     y=a*TMath::Power(kp0/(kp0+x),kxn);
54   else
55     y=kb*TMath::Exp(-sqrt(x*x+xmpi2)/kt);
56   return y*x;
57 }
58
59 //
60 // y-distribution
61 //
62 Double_t AliGenPMDlib::YPi0( Double_t *py, Double_t *dummy)
63 {
64   //
65   // y parametrisation for pi0
66   //
67     const Double_t ka1    = 4913.;
68     const Double_t ka2    = 1819.;
69     const Double_t keta1  = 0.22;
70     const Double_t keta2  = 3.66;
71     const Double_t kdeta1 = 1.47;
72     const Double_t kdeta2 = 1.51;
73     Double_t y=TMath::Abs(*py);
74     //
75     Double_t ex1 = (y-keta1)*(y-keta1)/(2*kdeta1*kdeta1);
76     Double_t ex2 = (y-keta2)*(y-keta2)/(2*kdeta2*kdeta2);
77     return ka1*TMath::Exp(-ex1)+ka2*TMath::Exp(-ex2);
78 }
79
80 //                 particle composition
81 //
82 Int_t AliGenPMDlib::IpPi0(TRandom *)
83 {
84 // Pi0
85     return kPi0;
86 }
87
88 //____________________________________________________________
89 //
90 // Mt-scaling
91
92 Double_t AliGenPMDlib::PtScal(Double_t pt, Int_t np)
93 {
94   //    SCALING EN MASSE PAR RAPPORT A PTPI
95   //    MASS PI,K,ETA,RHO,OMEGA,ETA',PHI
96   const Double_t khm[10] = {.13957,.493,.5488,.769,.7826,.958,1.02,0,0,0};
97   //     VALUE MESON/PI AT 5 GEV
98   const Double_t kfmax[10]={1.,0.3,0.55,1.0,1.0,1.0,1.0,0,0,0};
99   np--;
100   Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
101   Double_t fmax2=f5/kfmax[np];
102   // PIONS
103   Double_t ptpion=100.*PtPi0(&pt, (Double_t*) 0);
104   Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
105                                  (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ fmax2;
106   return fmtscal*ptpion;
107 }
108 //
109 // kaon
110 //
111 //                pt-distribution
112 //____________________________________________________________
113
114 Double_t AliGenPMDlib::PtEta( Double_t *px, Double_t *dummy)
115 {
116 // Kaon pT
117   return PtScal(*px,3);
118 }
119
120 // y-distribution
121 //____________________________________________________________
122 Double_t AliGenPMDlib::YEta( Double_t *py, Double_t *dummy)
123 {
124     //
125     // y parametrisation for etas
126     //
127     const Double_t ka1    = 4913.;
128     const Double_t ka2    = 1819.;
129     const Double_t keta1  = 0.22;
130     const Double_t keta2  = 3.66;
131     const Double_t kdeta1 = 1.47;
132     const Double_t kdeta2 = 1.51;
133     Double_t y=TMath::Abs(*py);
134     //
135     Double_t ex1 = (y-keta1)*(y-keta1)/(2*kdeta1*kdeta1);
136     Double_t ex2 = (y-keta2)*(y-keta2)/(2*kdeta2*kdeta2);
137     return ka1*TMath::Exp(-ex1)+ka2*TMath::Exp(-ex2);
138 }
139
140 //                 particle composition
141 //
142 Int_t AliGenPMDlib::IpEta(TRandom *)
143 {
144     return 221;
145 }
146
147
148 typedef Double_t (*GenFunc) (Double_t*,  Double_t*);
149 GenFunc AliGenPMDlib::GetPt(Param_t param,  const char* tname)
150 {
151 // Return pointer to pT parameterisation
152     GenFunc func=NULL;
153     switch (param) 
154     {
155     case Pion:
156         func=PtPi0;
157         break;
158     case Eta:
159         func=PtEta;
160         break;
161     default:
162         func=0;
163         printf("<AliGenPMDlib::GetPt> unknown parametrisation\n");
164     }
165     return func;
166 }
167
168 GenFunc AliGenPMDlib::GetY(Param_t param, const char* tname)
169 {
170 // Return pointer to y- parameterisation
171     GenFunc func=NULL;
172     switch (param) 
173     {
174     case Pion:
175         func=YPi0;
176         break;
177     case Eta:
178         func=YEta;
179         break;
180     default:
181         func=0;
182         printf("<AliGenPMDlib::GetY> unknown parametrisation\n");
183     }
184     return func;
185
186 }
187 typedef Int_t (*GenFuncIp) (TRandom *);
188 GenFuncIp AliGenPMDlib::GetIp(Param_t param,  const char* tname)
189 {
190 // Return pointer to particle type parameterisation
191     GenFuncIp func=NULL;
192     switch (param) 
193     {
194     case Pion:
195         func=IpPi0;
196         break;
197     case Eta:
198         func=IpEta;
199         break;
200     default:
201         printf("<AliGenPMDlib::GetIp> unknown parametrisation\n");
202     }
203     return func;
204 }
205
206
207
208