2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
19 //======================================================================
20 // AliGenPHOSlib class contains parameterizations of the
21 // pion, kaon, eta, omega, etaprime, phi and baryon (proton,
22 // antiproton, neutron and anti-neutron) particles for the
23 // study of the neutral background in PHOS detector.
24 // These parameterizations are used by the
26 // AliGenParam(npar, param, AliGenPHOSlib::GetPt(param),
27 // AliGenPHOSlib::GetY(param),
28 // AliGenPHOSlib::GetIp(param) )
29 // param represents the particle to be simulated :
30 // Pion, Kaon, Eta, Omega, Etaprime, Phi or Baryon
31 // Pt distributions are calculated from the transverse mass scaling
32 // with Pions, using the PtScal function taken from AliGenMUONlib
33 // version aliroot 3.01
35 // Gines MARTINEZ. Laurent APHECETCHE and Yves SCHUTZ
36 // GPS @ SUBATECH, Nantes , France (October 1999)
37 // http://www-subatech.in2p3.fr/~photons/subatech
38 // martinez@subatech.in2p3.fr
39 // Additional particle species simulation options has been added:
40 // Charged Pion, Charged Kaons, KLong Proton, Anti-Proton, Neutron,
41 // Anti-Neutron --> Changes made by Gustavo Conesa in November 2004
42 //======================================================================
47 #include "AliGenPHOSlib.h"
49 ClassImp(AliGenPHOSlib)
51 //======================================================================
53 // (From GetPt, GetY and GetIp as param = Pion)
54 // Transverse momentum distribution" PtPion
55 // Rapidity distribution YPion
56 // Particle distribution IdPion 111, 211 and -211 (pi0, pi+ and pi-)
58 Double_t AliGenPHOSlib::PtPion(Double_t *px, Double_t *)
60 // Pion transverse momentum distribtuion taken
61 // from AliGenMUONlib class, version 3.01 of aliroot
62 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
63 // POWER LAW FOR PT > 500 MEV
64 // MT SCALING BELOW (T=160 MEV)
66 const Double_t kp0 = 1.3;
67 const Double_t kxn = 8.28;
68 const Double_t kxlim=0.5;
69 const Double_t kt=0.160;
70 const Double_t kxmpi=0.139;
72 Double_t y, y1, kxmpi2, ynorm, a;
75 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
77 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+kxmpi2)/kt));
80 y=a*TMath::Power(kp0/(kp0+x),kxn);
82 y=kb*TMath::Exp(-sqrt(x*x+kxmpi2)/kt);
85 Double_t AliGenPHOSlib::YPion( Double_t *py, Double_t *)
88 // pion y-distribution
91 const Double_t ka = 7000.;
92 const Double_t kdy = 4.;
94 Double_t y=TMath::Abs(*py);
96 Double_t ex = y*y/(2*kdy*kdy);
97 return ka*TMath::Exp(-ex);
100 Int_t AliGenPHOSlib::IpPion(TRandom *ran)
102 // particle composition pi+, pi0, pi-
105 Float_t random = ran->Rndm();
107 if ( (3.*random) < 1. )
113 if ( (3.*random) >= 2.)
123 Int_t AliGenPHOSlib::IpChargedPion(TRandom *ran)
125 // particle composition pi+, pi0, pi-
128 Float_t random = ran->Rndm();
130 if ( (2.*random) < 1. )
141 //======================================================================
142 // Pi 0 Flat Distribution
143 // Transverse momentum distribution PtPi0Flat
144 // Rapidity distribution YPi0Flat
145 // Particle distribution IdPi0Flat 111 (pi0)
148 Double_t AliGenPHOSlib::PtPi0Flat(Double_t */*px*/, Double_t *)
150 // Pion transverse momentum flat distribution
156 Double_t AliGenPHOSlib::YPi0Flat( Double_t */*py*/, Double_t *)
159 // pion y-distribution
164 Int_t AliGenPHOSlib::IpPi0Flat(TRandom *)
167 // particle composition pi0
172 //=============================================================
174 Double_t AliGenPHOSlib::PtScal(Double_t pt, Int_t np)
177 // Fonction for the calculation of the Pt distribution for a
178 // given particle np, from the pion Pt distribution using the
179 // mt scaling. This function was taken from AliGenMUONlib
180 // aliroot version 3.01, and was extended for baryons
181 // np = 1=>Pions 2=>Kaons 3=>Etas 4=>Omegas 5=>ETA' 6=>PHI
182 // 7=>BARYONS-BARYONBARS
184 // SCALING EN MASSE PAR RAPPORT A PTPI
185 // MASS 1=>PI, 2=>K, 3=>ETA, 4=>OMEGA, 5=>ETA',6=>PHI
186 const Double_t khm[10] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
187 // MASS 7=>BARYON-BARYONBAR
189 // VALUE MESON/PI AT 5 GEV
190 const Double_t kfmax[10]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
192 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
193 Double_t kfmax2=f5/kfmax[np];
195 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
196 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
197 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ kfmax2;
198 return fmtscal*ptpion;
202 //============================================================================
204 Double_t AliGenPHOSlib::PtKaon( Double_t *px, Double_t *)
208 //____________________________________________________________
210 return PtScal(*px,2); // 2==> Kaon in the PtScal function
213 Double_t AliGenPHOSlib::YKaon( Double_t *py, Double_t *)
216 //____________________________________________________________
218 const Double_t ka = 1000.;
219 const Double_t kdy = 4.;
222 Double_t y=TMath::Abs(*py);
224 Double_t ex = y*y/(2*kdy*kdy);
225 return ka*TMath::Exp(-ex);
228 Int_t AliGenPHOSlib::IpKaon(TRandom *ran)
230 // particle composition
233 Float_t random = ran->Rndm();
234 Float_t random2 = ran->Rndm();
246 return 130; // K^0 short
248 return 310; // K^0 long
253 Int_t AliGenPHOSlib::IpChargedKaon(TRandom *ran)
255 // particle composition
258 Float_t random = ran->Rndm();
268 Int_t AliGenPHOSlib::IpKaon0L(TRandom *)
270 // particle composition
273 return 130; // K^0 long
276 //============================================================================
277 //============================================================================
279 Double_t AliGenPHOSlib::PtEta( Double_t *px, Double_t *)
283 //____________________________________________________________
285 return PtScal(*px,3); // 3==> Eta in the PtScal function
288 Double_t AliGenPHOSlib::YEta( Double_t *py, Double_t *)
291 //____________________________________________________________
293 const Double_t ka = 1000.;
294 const Double_t kdy = 4.;
297 Double_t y=TMath::Abs(*py);
299 Double_t ex = y*y/(2*kdy*kdy);
300 return ka*TMath::Exp(-ex);
303 Int_t AliGenPHOSlib::IpEta(TRandom *)
305 // particle composition
312 //======================================================================
313 // Eta Flat Distribution
314 // Transverse momentum distribution PtEtaFlat
315 // Rapidity distribution YEtaFlat
316 // Particle distribution IdEtaFlat 111 (pi0)
319 Double_t AliGenPHOSlib::PtEtaFlat(Double_t */*px*/, Double_t *)
321 // Eta transverse momentum flat distribution
327 Double_t AliGenPHOSlib::YEtaFlat( Double_t */*py*/, Double_t *)
330 // pion y-distribution
335 Int_t AliGenPHOSlib::IpEtaFlat(TRandom *)
338 // particle composition eta
343 //============================================================================
344 //============================================================================
346 Double_t AliGenPHOSlib::PtOmega( Double_t *px, Double_t *)
350 //____________________________________________________________
352 return PtScal(*px,4); // 4==> Omega in the PtScal function
355 Double_t AliGenPHOSlib::YOmega( Double_t *py, Double_t *)
358 //____________________________________________________________
360 const Double_t ka = 1000.;
361 const Double_t kdy = 4.;
364 Double_t y=TMath::Abs(*py);
366 Double_t ex = y*y/(2*kdy*kdy);
367 return ka*TMath::Exp(-ex);
370 Int_t AliGenPHOSlib::IpOmega(TRandom *)
372 // particle composition
378 //============================================================================
379 //============================================================================
381 Double_t AliGenPHOSlib::PtEtaprime( Double_t *px, Double_t *)
385 //____________________________________________________________
387 return PtScal(*px,5); // 5==> Etaprime in the PtScal function
390 Double_t AliGenPHOSlib::YEtaprime( Double_t *py, Double_t *)
393 //____________________________________________________________
395 const Double_t ka = 1000.;
396 const Double_t kdy = 4.;
399 Double_t y=TMath::Abs(*py);
401 Double_t ex = y*y/(2*kdy*kdy);
402 return ka*TMath::Exp(-ex);
405 Int_t AliGenPHOSlib::IpEtaprime(TRandom *)
407 // particle composition
410 return 331; // Etaprime
413 //===================================================================
414 //============================================================================
416 Double_t AliGenPHOSlib::PtPhi( Double_t *px, Double_t *)
420 //____________________________________________________________
422 return PtScal(*px,6); // 6==> Phi in the PtScal function
425 Double_t AliGenPHOSlib::YPhi( Double_t *py, Double_t *)
428 //____________________________________________________________
430 const Double_t ka = 1000.;
431 const Double_t kdy = 4.;
434 Double_t y=TMath::Abs(*py);
436 Double_t ex = y*y/(2*kdy*kdy);
437 return ka*TMath::Exp(-ex);
440 Int_t AliGenPHOSlib::IpPhi(TRandom *)
442 // particle composition
448 //===================================================================
449 //============================================================================
450 // B A R Y O N S == protons, protonsbar, neutrons, and neutronsbars
451 Double_t AliGenPHOSlib::PtBaryon( Double_t *px, Double_t *)
455 //____________________________________________________________
457 return PtScal(*px,7); // 7==> Baryon in the PtScal function
460 Double_t AliGenPHOSlib::YBaryon( Double_t *py, Double_t *)
463 //____________________________________________________________
465 const Double_t ka = 1000.;
466 const Double_t kdy = 4.;
469 Double_t y=TMath::Abs(*py);
471 Double_t ex = y*y/(2*kdy*kdy);
472 return ka*TMath::Exp(-ex);
475 Int_t AliGenPHOSlib::IpBaryon(TRandom *ran)
477 // particle composition
480 Float_t random = ran->Rndm();
481 Float_t random2 = ran->Rndm();
487 return -2212; // pbar
495 return -2112; // n bar
500 Int_t AliGenPHOSlib::IpProton(TRandom *)
502 // particle composition
507 Int_t AliGenPHOSlib::IpAProton(TRandom *)
509 // particle composition
511 return -2212; // p bar
515 Int_t AliGenPHOSlib::IpNeutron(TRandom *)
517 // particle composition
522 Int_t AliGenPHOSlib::IpANeutron(TRandom *)
524 // particle composition
530 //===================================================================
534 typedef Double_t (*GenFunc) (Double_t*, Double_t*);
535 GenFunc AliGenPHOSlib::GetPt(Int_t param, const char* /*tname*/) const
537 // Return pinter to pT parameterisation
568 printf("<AliGenPHOSlib::GetPt> unknown parametrisationn");
573 GenFunc AliGenPHOSlib::GetY(Int_t param, const char* /*tname*/) const
575 // Return pointer to Y parameterisation
608 printf("<AliGenPHOSlib::GetY> unknown parametrisationn");
612 typedef Int_t (*GenFuncIp) (TRandom *);
613 GenFuncIp AliGenPHOSlib::GetIp(Int_t param, const char* /*tname*/) const
615 // Return pointer to particle composition
671 printf("<AliGenPHOSlib::GetIp> unknown parametrisationn");