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