]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVGEN/AliGenGSIlib.cxx
fb923d3b83b1c1a9c5837eac638f0efd4b532404
[u/mrichter/AliRoot.git] / EVGEN / AliGenGSIlib.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.7  2000/05/02 08:12:13  morsch
19 Coding rule violations corrected.
20
21 Revision 1.6  1999/09/29 09:24:14  fca
22 Introduction of the Copyright and cvs Log
23
24 */
25
26 #include "AliGenGSIlib.h"
27 #include "AliRun.h"
28 #include "iostream.h"
29
30 ClassImp(AliGenGSIlib)
31
32   Bool_t AliGenGSIlib::fgDebug =kFALSE;
33 //                      Upsilon
34 //
35 //
36 //                  pt-distribution
37 //____________________________________________________________
38 Double_t AliGenGSIlib::PtUpsilonRitman( Double_t *px, Double_t *dummy )
39 {
40   // Upsilon pT
41   /*   AliGenMUONlib parametrisation
42   const Double_t kpt0 = 5.3;
43   const Double_t kxn  = 2.5;
44   Double_t x=*px;
45   //
46   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
47   return x/TMath::Power(pass1,kxn);
48   */
49   if (fgDebug) cout<<"Ritman Pt paramtrisation\n";
50   const Double_t kpt0 = 4.7;
51   const Double_t kxn  = 3.5;
52   Double_t x=*px;
53   //
54   Double_t pass1 = 1.+((x*x)/(kpt0*kpt0));
55   return x/TMath::Power(pass1,kxn);
56    
57 }
58 //
59 //                    y-distribution
60 //
61 //____________________________________________________________
62 Double_t AliGenGSIlib::YUpsilonRitman(Double_t *py, Double_t *dummy)
63 {
64
65     // Upsilon y
66
67 /*   original from AliGenMUON
68     const Double_t ky0 = 3.;
69     const Double_t kb=1.;
70     Double_t yu;
71     Double_t y=TMath::Abs(*py);
72     //
73     if (y < ky0)
74     yu=kb;
75     else
76     yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
77     return yu;
78     */
79   if (fgDebug) cout<<"Ritman Y paramtrisation\n";
80   return 0.003;  //GSI parametrisation 
81 }
82 //                 particle composition
83 //
84 Int_t AliGenGSIlib::IpUpsilonRitman()
85 {
86 // y composition
87   if (fgDebug) cout<<"Ritman Ip paramtrisation\n";
88   return 553;     
89 }
90
91
92 Double_t AliGenGSIlib::PtUpsilonKarel( Double_t *px, Double_t *dummy )
93 {
94   // Upsilon pT
95   //to implement
96   if (fgDebug) cout<<"Karel Pt paramtrisation\n";
97
98   return 0.;   
99 }
100 //
101 //                    y-distribution
102 //
103 //____________________________________________________________
104 Double_t AliGenGSIlib::YUpsilonKarel(Double_t *py, Double_t *dummy)
105 {
106   
107   // Upsilon y
108 //to implement
109   if (fgDebug) cout<<"Karel Y paramtrisation\n";
110   return 0.003;  //Karel parametrisation 
111 }
112
113 //                 particle composition
114 //
115
116 Int_t AliGenGSIlib::IpUpsilonKarel()
117 {
118   // y composition//
119   //to implement
120   if (fgDebug) cout<<"Karel Ip paramtrisation\n";
121   return 553;     
122 }
123
124
125
126 Double_t AliGenGSIlib::PtUpsilonMUON( Double_t *px, Double_t *dummy )
127 {
128 // Upsilon pT
129   const Double_t kpt0 = 5.3;
130   const Double_t kxn  = 2.5;
131   Double_t x=*px;
132   //
133   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
134   return x/TMath::Power(pass1,kxn);
135 }
136 //
137 //                    y-distribution
138 //
139 //____________________________________________________________
140 Double_t AliGenGSIlib::YUpsilonMUON(Double_t *py, Double_t *dummy)
141 {
142 // Upsilon y
143   const Double_t ky0 = 3.;
144   const Double_t kb=1.;
145   Double_t yu;
146   Double_t y=TMath::Abs(*py);
147   //
148   if (y < ky0)
149     yu=kb;
150   else
151     yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
152   return yu;
153 }
154 //                 particle composition
155 //
156 Int_t AliGenGSIlib::IpUpsilonMUON()
157 {
158 // y composition
159     return 553;
160 }
161
162
163 typedef Double_t (*GenFunc) (Double_t*,  Double_t*);
164
165 typedef Int_t (*GenFuncIp) ();
166
167
168
169 GenFunc AliGenGSIlib::GetPt(Param_t param, const char * tname)
170 {
171 // Return pointer to pT parameterisation
172   GenFunc func=0;
173   TString sname(tname);
174   switch (param) 
175     {
176     case upsilon_p:
177       if (sname=="MUON"){
178         func= PtUpsilonMUON;
179         break;
180       }
181       if (sname=="RITMAN"){
182         func=PtUpsilonRitman;
183         break;
184       }
185       if (sname=="KAREL"){
186         func=PtUpsilonKarel;
187         break;
188       }
189       break;
190        func=0;
191         printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
192     default:
193         func=0;
194         printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
195     }
196     return func;
197 }
198
199
200
201 GenFunc AliGenGSIlib::GetY(Param_t param, const char * tname)
202 {
203   // Return pointer to y- parameterisation
204    GenFunc func=0;
205     TString sname(tname);
206     switch (param) 
207     {
208     case upsilon_p:
209       if (sname=="MUON"){
210         func= YUpsilonMUON;
211         break;
212       }
213       if (sname=="RITMAN"){
214         func=YUpsilonRitman;
215         break;
216       }
217       if (sname=="KAREL"){
218         func=YUpsilonKarel;
219         break;
220       }
221       func=0;
222       printf("<AliGenGSIlib::GetY> unknown parametrisation\n");
223       break;
224     default:
225         func=0;
226         printf("<AliGenGSIlib::GetY> unknown parametrisation\n");
227     }
228     return func;
229 }
230
231
232
233 GenFuncIp AliGenGSIlib::GetIp(Param_t param, const char * tname)
234 {
235 // Return pointer to particle type parameterisation
236     GenFuncIp func=0;
237     TString sname(tname);
238     switch (param) 
239     {
240     case upsilon_p:
241       if (sname=="MUON"){
242         func=IpUpsilonMUON;
243         break;
244       }
245       if (sname=="RITMAN"){
246         func=IpUpsilonRitman;
247         break;
248       }
249       if (sname=="KAREL"){
250         func=IpUpsilonKarel;
251         break;
252       }
253       func=0;
254       printf("<AliGenGSIlib::GetIP> unknown parametrisation\n");
255       break;
256     default:
257         func=0;
258         printf("<AliGenGSIlib::GetIp> unknown parametrisation\n");
259     }
260     return func;
261 }
262
263
264
265
266
267
268
269
270
271
272
273
274