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