]>
Commit | Line | Data |
---|---|---|
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 | /* $Id$ */ | |
17 | ||
18 | // Library class for particle pt and y distributions used for | |
19 | // HMPID simulations. | |
20 | // To be used with AliGenParam. | |
21 | // The following particle typed can be simulated: | |
22 | // phi, lambda, k | |
23 | // | |
24 | // Author: Annalisa Mastroserio <Annalisa.Mastroserio@ba.infn.it> | |
25 | // | |
26 | // | |
27 | ||
28 | #include <TPDGCode.h> | |
29 | #include <TMath.h> | |
30 | #include <TRandom.h> | |
31 | #include <TString.h> | |
32 | ||
33 | #include "AliGenHMPIDlib.h" | |
34 | #include "AliLog.h" | |
35 | ||
36 | ClassImp(AliGenHMPIDlib) | |
37 | ||
38 | //--------------------------------------- | |
39 | // Pi Plus | |
40 | //--------------------------------------- | |
41 | Int_t AliGenHMPIDlib::IpPiPlus(TRandom *) | |
42 | { | |
43 | //PDG code | |
44 | return 211; | |
45 | } | |
46 | ||
47 | Double_t AliGenHMPIDlib::PtPiPlusFlat( const Double_t *, const Double_t *) | |
48 | { | |
49 | //PiPlus FLAT pt-distribution | |
50 | return 1; | |
51 | } | |
52 | ||
53 | Double_t AliGenHMPIDlib::PtPiPlusExp( const Double_t *x, const Double_t *) | |
54 | { | |
55 | //PiPlus EXP pt-distribution | |
56 | return x[0]*TMath::Exp(-x[0]/0.17); | |
57 | } | |
58 | ||
59 | Double_t AliGenHMPIDlib::YPiPlusFlat(const Double_t *,const Double_t *) | |
60 | { | |
61 | //PiPlus y-distribution | |
62 | return 1; | |
63 | } | |
64 | ||
65 | ||
66 | //--------------------------------------- | |
67 | // Pi Minus | |
68 | //--------------------------------------- | |
69 | Int_t AliGenHMPIDlib::IpPiMinus(TRandom *) | |
70 | { | |
71 | //PDG code | |
72 | return -211; | |
73 | } | |
74 | ||
75 | Double_t AliGenHMPIDlib::PtPiMinusFlat( const Double_t *, const Double_t *) | |
76 | { | |
77 | // PiMinus FLAT pt-distribution | |
78 | return 1; | |
79 | } | |
80 | ||
81 | Double_t AliGenHMPIDlib::PtPiMinusExp( const Double_t *x, const Double_t *) | |
82 | { | |
83 | //PiMinus EXP pt-distribution | |
84 | return x[0]*TMath::Exp(-x[0]/0.17); | |
85 | } | |
86 | ||
87 | Double_t AliGenHMPIDlib::YPiMinusFlat(const Double_t *,const Double_t *) | |
88 | { | |
89 | //PiMinus y-distribution | |
90 | return 1; | |
91 | } | |
92 | ||
93 | ||
94 | //-------------------------------------------- | |
95 | // K Plus | |
96 | //-------------------------------------------- | |
97 | Int_t AliGenHMPIDlib::IpKPlus(TRandom *) | |
98 | { | |
99 | //PDG code | |
100 | return 321; | |
101 | } | |
102 | ||
103 | Double_t AliGenHMPIDlib::PtKPlusFlat( const Double_t *, const Double_t *) | |
104 | { | |
105 | // K+ FLAT pt-distribution | |
106 | return 1; | |
107 | } | |
108 | ||
109 | Double_t AliGenHMPIDlib::PtKPlusExp( const Double_t *x, const Double_t *) | |
110 | { | |
111 | // K+ EXP pt-distribution | |
112 | return x[0]*TMath::Exp(-x[0]/0.17); | |
113 | } | |
114 | ||
115 | Double_t AliGenHMPIDlib::YKPlusFlat(const Double_t *,const Double_t *) | |
116 | { | |
117 | // K+ y-distribution | |
118 | return 1; | |
119 | } | |
120 | ||
121 | ||
122 | //----------------------------------------------- | |
123 | // K Minus | |
124 | //----------------------------------------------- | |
125 | Int_t AliGenHMPIDlib::IpKMinus(TRandom *) | |
126 | { | |
127 | //PDG code | |
128 | return -321; | |
129 | } | |
130 | ||
131 | Double_t AliGenHMPIDlib::PtKMinusFlat( const Double_t *, const Double_t *) | |
132 | { | |
133 | // K- FLAT pt-distribution | |
134 | return 1; | |
135 | } | |
136 | ||
137 | Double_t AliGenHMPIDlib::PtKMinusExp( const Double_t *x, const Double_t *) | |
138 | { | |
139 | // K- EXP pt-distribution | |
140 | return x[0]*TMath::Exp(-x[0]/0.17); | |
141 | } | |
142 | ||
143 | Double_t AliGenHMPIDlib::YKMinusFlat(const Double_t *,const Double_t *) | |
144 | { | |
145 | // K- y-distribution | |
146 | return 1; | |
147 | } | |
148 | ||
149 | ||
150 | //----------------------------------------------- | |
151 | // K0 short | |
152 | //----------------------------------------------- | |
153 | Int_t AliGenHMPIDlib::IpK0s(TRandom *) | |
154 | { | |
155 | //PDG code | |
156 | return 310; | |
157 | } | |
158 | ||
159 | Double_t AliGenHMPIDlib::PtK0sFlat( const Double_t *, const Double_t *) | |
160 | { | |
161 | // K0s FLAT pt-distribution | |
162 | return 1; | |
163 | } | |
164 | ||
165 | Double_t AliGenHMPIDlib::PtK0sExp( const Double_t *x, const Double_t *) | |
166 | { | |
167 | // K0s EXP pt-distribution | |
168 | return x[0]*TMath::Exp(-x[0]/0.17); | |
169 | } | |
170 | ||
171 | Double_t AliGenHMPIDlib::YK0sFlat(const Double_t *,const Double_t *) | |
172 | { | |
173 | // K0s y-distribution | |
174 | return 1; | |
175 | } | |
176 | ||
177 | ||
178 | //--------------------------------------------- | |
179 | // Phi(1020) | |
180 | //--------------------------------------------- | |
181 | Int_t AliGenHMPIDlib::IpPhi(TRandom *) | |
182 | { | |
183 | //PDG code | |
184 | return 333; | |
185 | } | |
186 | ||
187 | Double_t AliGenHMPIDlib::PtPhiFlat( const Double_t *, const Double_t *) | |
188 | { | |
189 | // Phi FLAT pt-distribution | |
190 | return 1; | |
191 | } | |
192 | ||
193 | Double_t AliGenHMPIDlib::PtPhiExp( const Double_t *x, const Double_t *) | |
194 | { | |
195 | //phi EXP pt-distribution | |
196 | return x[0]*TMath::Exp(-x[0]/0.17); | |
197 | } | |
198 | ||
199 | Double_t AliGenHMPIDlib::YPhiFlat(const Double_t *,const Double_t *) | |
200 | { | |
201 | //phi y-distribution | |
202 | return 1; | |
203 | } | |
204 | ||
205 | ||
206 | //------------------------------------------------------- | |
207 | // PROTON | |
208 | //------------------------------------------------------- | |
209 | Int_t AliGenHMPIDlib::IpProton(TRandom *) | |
210 | { | |
211 | //PDG code | |
212 | return 2122; | |
213 | } | |
214 | ||
215 | Double_t AliGenHMPIDlib::PtProtonFlat( const Double_t *, const Double_t *) | |
216 | { | |
217 | // ProtonFLAT pt-distribution | |
218 | ||
219 | return 1; | |
220 | } | |
221 | ||
222 | Double_t AliGenHMPIDlib::PtProtonExp( const Double_t *x, const Double_t *) | |
223 | { | |
224 | //Proton EXP pt-distribution | |
225 | return x[0]*TMath::Exp(-x[0]/0.17); | |
226 | } | |
227 | ||
228 | Double_t AliGenHMPIDlib::YProtonFlat(const Double_t *,const Double_t *) | |
229 | { | |
230 | //Proton y-distribution | |
231 | return 1; | |
232 | } | |
233 | ||
234 | ||
235 | //------------------------------------------------------- | |
236 | // PROTON-BAR | |
237 | //------------------------------------------------------- | |
238 | Int_t AliGenHMPIDlib::IpProtonBar(TRandom *) | |
239 | { | |
240 | //PDG code | |
241 | return -2122; | |
242 | } | |
243 | ||
244 | Double_t AliGenHMPIDlib::PtProtonBarFlat( const Double_t *, const Double_t *) | |
245 | { | |
246 | // ProtonBar FLAT pt-distribution | |
247 | ||
248 | return 1; | |
249 | } | |
250 | ||
251 | Double_t AliGenHMPIDlib::PtProtonBarExp( const Double_t *x, const Double_t *) | |
252 | { | |
253 | //ProtonBar EXP pt-distribution | |
254 | return x[0]*TMath::Exp(-x[0]/0.17); | |
255 | } | |
256 | ||
257 | Double_t AliGenHMPIDlib::YProtonBarFlat(const Double_t *,const Double_t *) | |
258 | { | |
259 | //ProtonBar y-distribution | |
260 | return 1; | |
261 | } | |
262 | ||
263 | ||
264 | //------------------------------------------------------- | |
265 | // LAMBDA | |
266 | //------------------------------------------------------- | |
267 | Int_t AliGenHMPIDlib::IpLambda(TRandom *) | |
268 | { | |
269 | //PDG code | |
270 | return 3122; | |
271 | } | |
272 | ||
273 | Double_t AliGenHMPIDlib::PtLambdaFlat( const Double_t *, const Double_t *) | |
274 | { | |
275 | // Lambda FLAT pt-distribution | |
276 | ||
277 | return 1; | |
278 | } | |
279 | ||
280 | Double_t AliGenHMPIDlib::PtLambdaExp( const Double_t *x, const Double_t *) | |
281 | { | |
282 | //Lambda EXP pt-distribution | |
283 | return x[0]*TMath::Exp(-x[0]/0.17); | |
284 | } | |
285 | ||
286 | Double_t AliGenHMPIDlib::YLambdaFlat(const Double_t *,const Double_t *) | |
287 | { | |
288 | //Lambda y-distribution | |
289 | return 1; | |
290 | } | |
291 | ||
292 | ||
293 | //------------------------------------------------------- | |
294 | // LAMBDA-BAR | |
295 | //------------------------------------------------------- | |
296 | Int_t AliGenHMPIDlib::IpLambdaBar(TRandom *) | |
297 | { | |
298 | //PDG code | |
299 | return -3122; | |
300 | } | |
301 | ||
302 | Double_t AliGenHMPIDlib::PtLambdaBarFlat( const Double_t *, const Double_t *) | |
303 | { | |
304 | // LambdaBar FLAT pt-distribution | |
305 | ||
306 | return 1; | |
307 | } | |
308 | ||
309 | Double_t AliGenHMPIDlib::PtLambdaBarExp( const Double_t *x, const Double_t *) | |
310 | { | |
311 | //LambdaBar EXP pt-distribution | |
312 | return x[0]*TMath::Exp(-x[0]/0.17); | |
313 | } | |
314 | ||
315 | Double_t AliGenHMPIDlib::YLambdaBarFlat(const Double_t *,const Double_t *) | |
316 | { | |
317 | //LambdaBar y-distribution | |
318 | return 1; | |
319 | } | |
320 | ||
321 | ||
322 | ||
323 | ||
324 | ||
325 | typedef Double_t (*GenFunc) (const Double_t*, const Double_t*); | |
326 | typedef Int_t (*GenFuncIp) (TRandom *); | |
327 | ||
328 | GenFunc AliGenHMPIDlib::GetPt(Int_t iPID, const char * sForm) const | |
329 | { | |
330 | // Return pointer to Pt parameterisation | |
331 | AliDebug(1,Form("PID: %i, form: %s",iPID,sForm)); | |
332 | TString type(sForm); | |
333 | ||
334 | switch(iPID) { | |
335 | ||
336 | case kPiPlus: | |
337 | if (type=="FLAT") return PtPiPlusFlat; | |
338 | else if(type=="EXP") return PtPiPlusExp; | |
339 | else { | |
340 | AliFatal(Form("Unknown Pt distribution form: %s",sForm)); return 0; | |
341 | } | |
342 | ||
343 | case kPiMinus: | |
344 | if (type=="FLAT") return PtPiMinusFlat; | |
345 | else if(type=="EXP") return PtPiMinusExp; | |
346 | else { | |
347 | AliFatal(Form("Unknown Pt distribution form: %s",sForm)); return 0; | |
348 | } | |
349 | ||
350 | case kKPlus: | |
351 | if (type=="FLAT") return PtKPlusFlat; | |
352 | else if(type=="EXP") return PtKPlusExp; | |
353 | else { | |
354 | AliFatal(Form("Unknown Pt distribution form: %s",sForm)); return 0; | |
355 | } | |
356 | ||
357 | case kKMinus: | |
358 | if (type=="FLAT") return PtKMinusFlat; | |
359 | else if(type=="EXP") return PtKMinusExp; | |
360 | else { | |
361 | AliFatal(Form("Unknown Pt distribution form: %s",sForm)); return 0; | |
362 | } | |
363 | ||
364 | ||
365 | case kK0Short: | |
366 | if (type=="FLAT") return PtK0sFlat; | |
367 | else if(type=="EXP") return PtK0sExp; | |
368 | else { | |
369 | AliFatal(Form("Unknown Pt distribution form: %s",sForm)); return 0; | |
370 | } | |
371 | ||
372 | ||
373 | case kPhi: | |
374 | if (type=="FLAT") return PtPhiFlat; | |
375 | else if(type=="EXP") return PtPhiExp; | |
376 | else { | |
377 | AliFatal(Form("Unknown Pt distribution form: %s",sForm)); return 0; | |
378 | } | |
379 | ||
380 | case kProton: | |
381 | if (type=="FLAT") return PtProtonFlat; | |
382 | else if(type=="EXP") return PtProtonExp; | |
383 | else { | |
384 | AliFatal(Form("Unknown Pt distribution form: %s",sForm)); return 0; | |
385 | } | |
386 | ||
387 | case kProtonBar: | |
388 | if (type=="FLAT") return PtProtonBarFlat; | |
389 | else if(type=="EXP") return PtProtonBarExp; | |
390 | else { | |
391 | AliFatal(Form("Unknown Pt distribution form: %s",sForm)); return 0; | |
392 | } | |
393 | ||
394 | case kLambda0: | |
395 | if (type=="FLAT") return PtLambdaFlat; | |
396 | else if(type=="EXP") return PtLambdaExp; | |
397 | else { | |
398 | AliFatal(Form("Unknown Pt distribution form: %s",sForm)); return 0; | |
399 | } | |
400 | ||
401 | case kLambda0Bar: | |
402 | if (type=="FLAT") return PtLambdaBarFlat; | |
403 | else if(type=="EXP") return PtLambdaBarExp; | |
404 | else { | |
405 | AliFatal(Form("Unknown Pt distribution form: %s",sForm)); return 0; | |
406 | } | |
407 | ||
408 | default : AliFatal(Form("Unknown particle type: %i",iPID)); return 0; | |
409 | }//switch | |
410 | } | |
411 | ||
412 | GenFunc AliGenHMPIDlib::GetY(Int_t iPID, const char *sForm) const | |
413 | { | |
414 | AliDebug(1,Form("PID: %i, form: %s",iPID,sForm)); | |
415 | ||
416 | switch (iPID) { | |
417 | ||
418 | case kPiPlus: return YPiPlusFlat; | |
419 | case kPiMinus: return YPiMinusFlat; | |
420 | case kKPlus: return YKPlusFlat; | |
421 | case kKMinus: return YKMinusFlat; | |
422 | case kK0Short: return YK0sFlat; | |
423 | case kPhi: return YPhiFlat; | |
424 | case kProton: return YProtonFlat; | |
425 | case kProtonBar: return YProtonBarFlat; | |
426 | case kLambda0: return YLambdaFlat; | |
427 | case kLambda0Bar: return YLambdaBarFlat; | |
428 | ||
429 | default : AliFatal(Form("Unknown particle type: %i",iPID)); return 0; | |
430 | ||
431 | }//switch | |
432 | } | |
433 | ||
434 | GenFuncIp AliGenHMPIDlib::GetIp(Int_t iPID, const char *sForm) const | |
435 | { | |
436 | // Return pointer to particle type parameterisation | |
437 | AliDebug(1,Form("PID: %i, form: %s",iPID,sForm)); ////////// | |
438 | ||
439 | switch (iPID){ | |
440 | ||
441 | case kPiPlus: return IpPiPlus; | |
442 | case kPiMinus: return IpPiMinus; | |
443 | case kKPlus: return IpKPlus; | |
444 | case kKMinus: return IpKMinus; | |
445 | case kK0Short: return IpK0s; | |
446 | case kPhi: return IpPhi; | |
447 | case kProton: return IpProton; | |
448 | case kProtonBar: return IpProtonBar; | |
449 | case kLambda0: return IpLambda; | |
450 | case kLambda0Bar: return IpLambdaBar; | |
451 | ||
452 | default : AliFatal(Form("Unknown particle type: %i",iPID)) return 0; | |
453 | } | |
454 | } | |
455 |