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