]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVGEN/AliGenGSIlib.cxx
Changes in AddHit method
[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.3  2000/12/21 16:24:06  morsch
19 Coding convention clean-up
20
21 Revision 1.2  2000/11/30 07:12:50  alibrary
22 Introducing new Rndm and QA classes
23
24 Revision 1.1  2000/06/15 08:48:43  morsch
25 AliGenGSIlib with parametersations for GSI physics simulation added (YF, MI)
26
27 Revision 1.7  2000/05/02 08:12:13  morsch
28 Coding rule violations corrected.
29
30 Revision 1.6  1999/09/29 09:24:14  fca
31 Introduction of the Copyright and cvs Log
32
33 */
34
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
41 #include "TMath.h"
42 #include "TString.h"
43
44 #include "AliGenGSIlib.h"
45 #include "iostream.h"
46
47 ClassImp(AliGenGSIlib)
48
49   Bool_t AliGenGSIlib::fgDebug =kFALSE;
50 //                      Upsilon
51 //
52 //
53 //                  pt-distribution
54 //____________________________________________________________
55 Double_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 //____________________________________________________________
79 Double_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 //
101 Int_t AliGenGSIlib::IpUpsilonRitman(TRandom *)
102 {
103 // y composition
104   if (fgDebug) cout<<"Ritman Ip paramtrisation\n";
105   return 553;     
106 }
107
108
109 Double_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 //____________________________________________________________
121 Double_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
133 Int_t AliGenGSIlib::IpUpsilonKarel(TRandom *)
134 {
135   // y composition//
136   //to implement
137   if (fgDebug) cout<<"Karel Ip paramtrisation\n";
138   return 553;     
139 }
140
141
142
143 Double_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 //____________________________________________________________
157 Double_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 //
173 Int_t AliGenGSIlib::IpUpsilonMUON(TRandom *)
174 {
175 // y composition
176     return 553;
177 }
178
179
180 typedef Double_t (*GenFunc) (Double_t*,  Double_t*);
181
182 typedef Int_t (*GenFuncIp) (TRandom *);
183
184
185
186 GenFunc AliGenGSIlib::GetPt(Int_t param, const char * tname)
187 {
188 // Return pointer to pT parameterisation
189   GenFunc func=0;
190   TString sname(tname);
191   switch (param) 
192     {
193     case kUpsilon:
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
218 GenFunc AliGenGSIlib::GetY(Int_t param, const char * tname)
219 {
220   // Return pointer to y- parameterisation
221    GenFunc func=0;
222     TString sname(tname);
223     switch (param) 
224     {
225     case kUpsilon:
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
250 GenFuncIp AliGenGSIlib::GetIp(Int_t param, const char * tname)
251 {
252 // Return pointer to particle type parameterisation
253     GenFuncIp func=0;
254     TString sname(tname);
255     switch (param) 
256     {
257     case kUpsilon:
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