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