]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVGEN/AliGenPMDlib.cxx
const added.
[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.3  2001/03/09 13:01:41  morsch
19 - enum constants for paramterisation type (particle family) moved to AliGen*lib.h
20 - use AliGenGSIlib::kUpsilon, AliGenPHOSlib::kEtaPrime to access the constants
21
22 Revision 1.2  2000/11/30 07:12:50  alibrary
23 Introducing new Rndm and QA classes
24
25 Revision 1.1  2000/09/08 15:37:58  morsch
26 pt and y-parameterisations for PMD physics simulation.
27 THIS VERSION IS JUST A TEMPLATE THE PT AND Y DISTRIBUTIONS HAVE TO BE CORRECTED !!!!.
28
29 */
30
31 #include "AliGenPMDlib.h"
32 #include "AliPDG.h"
33 #include "TMath.h"
34
35 ClassImp(AliGenPMDlib)
36 //
37 //  Neutral Pions
38
39 Double_t AliGenPMDlib::PtPi0(Double_t *px, Double_t *dummy)
40 {
41 //
42 //     PT-PARAMETERIZATION CDF, PRL 61(88) 1819
43 //     POWER LAW FOR PT > 500 MEV
44 //     MT SCALING BELOW (T=160 MEV)
45 //
46   const Double_t kp0 = 1.3;
47   const Double_t kxn = 8.28;
48   const Double_t kxlim=0.5;
49   const Double_t kt=0.160;
50   const Double_t kxmpi=0.139;
51   const Double_t kb=1.;
52   Double_t y, y1, xmpi2, ynorm, a;
53   Double_t x=*px;
54   //
55   y1=TMath::Power(kp0/(kp0+kxlim),kxn);
56   xmpi2=kxmpi*kxmpi;
57   ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+xmpi2)/kt));
58   a=ynorm/y1;
59   if (x > kxlim)
60     y=a*TMath::Power(kp0/(kp0+x),kxn);
61   else
62     y=kb*TMath::Exp(-sqrt(x*x+xmpi2)/kt);
63   return y*x;
64 }
65
66 //
67 // y-distribution
68 //
69 Double_t AliGenPMDlib::YPi0( Double_t *py, Double_t *dummy)
70 {
71   //
72   // y parametrisation for pi0
73   //
74     const Double_t ka1    = 4913.;
75     const Double_t ka2    = 1819.;
76     const Double_t keta1  = 0.22;
77     const Double_t keta2  = 3.66;
78     const Double_t kdeta1 = 1.47;
79     const Double_t kdeta2 = 1.51;
80     Double_t y=TMath::Abs(*py);
81     //
82     Double_t ex1 = (y-keta1)*(y-keta1)/(2*kdeta1*kdeta1);
83     Double_t ex2 = (y-keta2)*(y-keta2)/(2*kdeta2*kdeta2);
84     return ka1*TMath::Exp(-ex1)+ka2*TMath::Exp(-ex2);
85 }
86
87 //                 particle composition
88 //
89 Int_t AliGenPMDlib::IpPi0(TRandom *)
90 {
91 // Pi0
92     return kPi0;
93 }
94
95 //____________________________________________________________
96 //
97 // Mt-scaling
98
99 Double_t AliGenPMDlib::PtScal(Double_t pt, Int_t np)
100 {
101   //    SCALING EN MASSE PAR RAPPORT A PTPI
102   //    MASS PI,K,ETA,RHO,OMEGA,ETA',PHI
103   const Double_t khm[10] = {.13957,.493,.5488,.769,.7826,.958,1.02,0,0,0};
104   //     VALUE MESON/PI AT 5 GEV
105   const Double_t kfmax[10]={1.,0.3,0.55,1.0,1.0,1.0,1.0,0,0,0};
106   np--;
107   Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
108   Double_t fmax2=f5/kfmax[np];
109   // PIONS
110   Double_t ptpion=100.*PtPi0(&pt, (Double_t*) 0);
111   Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
112                                  (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ fmax2;
113   return fmtscal*ptpion;
114 }
115 //
116 // kaon
117 //
118 //                pt-distribution
119 //____________________________________________________________
120
121 Double_t AliGenPMDlib::PtEta( Double_t *px, Double_t *dummy)
122 {
123 // Kaon pT
124   return PtScal(*px,3);
125 }
126
127 // y-distribution
128 //____________________________________________________________
129 Double_t AliGenPMDlib::YEta( Double_t *py, Double_t *dummy)
130 {
131     //
132     // y parametrisation for etas
133     //
134     const Double_t ka1    = 4913.;
135     const Double_t ka2    = 1819.;
136     const Double_t keta1  = 0.22;
137     const Double_t keta2  = 3.66;
138     const Double_t kdeta1 = 1.47;
139     const Double_t kdeta2 = 1.51;
140     Double_t y=TMath::Abs(*py);
141     //
142     Double_t ex1 = (y-keta1)*(y-keta1)/(2*kdeta1*kdeta1);
143     Double_t ex2 = (y-keta2)*(y-keta2)/(2*kdeta2*kdeta2);
144     return ka1*TMath::Exp(-ex1)+ka2*TMath::Exp(-ex2);
145 }
146
147 //                 particle composition
148 //
149 Int_t AliGenPMDlib::IpEta(TRandom *)
150 {
151     return 221;
152 }
153
154
155 typedef Double_t (*GenFunc) (Double_t*,  Double_t*);
156 GenFunc AliGenPMDlib::GetPt(Int_t param,  const char* tname) const
157 {
158 // Return pointer to pT parameterisation
159     GenFunc func=NULL;
160     switch (param) 
161     {
162     case kPion:
163         func=PtPi0;
164         break;
165     case kEta:
166         func=PtEta;
167         break;
168     default:
169         func=0;
170         printf("<AliGenPMDlib::GetPt> unknown parametrisation\n");
171     }
172     return func;
173 }
174
175 GenFunc AliGenPMDlib::GetY(Int_t param, const char* tname) const
176 {
177 // Return pointer to y- parameterisation
178     GenFunc func=NULL;
179     switch (param) 
180     {
181     case kPion:
182         func=YPi0;
183         break;
184     case kEta:
185         func=YEta;
186         break;
187     default:
188         func=0;
189         printf("<AliGenPMDlib::GetY> unknown parametrisation\n");
190     }
191     return func;
192
193 }
194 typedef Int_t (*GenFuncIp) (TRandom *);
195 GenFuncIp AliGenPMDlib::GetIp(Int_t param,  const char* tname) const
196 {
197 // Return pointer to particle type parameterisation
198     GenFuncIp func=NULL;
199     switch (param) 
200     {
201     case kPion:
202         func=IpPi0;
203         break;
204     case kEta:
205         func=IpEta;
206         break;
207     default:
208         printf("<AliGenPMDlib::GetIp> unknown parametrisation\n");
209     }
210     return func;
211 }
212
213
214
215