1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //======================================================================
19 // AliGenPHOSlib class contains parameterizations of the
20 // pion, kaon, eta, omega, etaprime, phi and baryon (proton,
21 // antiproton, neutron and anti-neutron) particles for the
22 // study of the neutral background in PHOS detector.
23 // These parameterizations are used by the
25 // AliGenParam(npar, param, AliGenPHOSlib::GetPt(param),
26 // AliGenPHOSlib::GetY(param),
27 // AliGenPHOSlib::GetIp(param) )
28 // param represents the particle to be simulated :
29 // Pion, Kaon, Eta, Omega, Etaprime, Phi or Baryon
30 // Pt distributions are calculated from the transverse mass scaling
31 // with Pions, using the PtScal function taken from AliGenMUONlib
32 // version aliroot 3.01
34 // Gines MARTINEZ. Laurent APHECETCHE and Yves SCHUTZ
35 // GPS @ SUBATECH, Nantes , France (October 1999)
36 // http://www-subatech.in2p3.fr/~photons/subatech
37 // martinez@subatech.in2p3.fr
38 // Additional particle species simulation options has been added:
39 // Charged Pion, Charged Kaons, KLong Proton, Anti-Proton, Neutron,
40 // Anti-Neutron --> Changes made by Gustavo Conesa in November 2004
41 // Add flat Omega(782) distribution in Nov. 2010 by Renzhuo WAN
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(const Double_t *px, const 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( const Double_t *py, const 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-
107 Int_t AliGenPHOSlib::IpChargedPion(TRandom *ran)
109 // particle composition pi+, pi0, pi-
112 Float_t random = ran->Rndm();
114 if ( (2.*random) < 1. )
125 //======================================================================
126 // Pi 0 Flat Distribution
127 // Transverse momentum distribution PtPi0Flat
128 // Rapidity distribution YPi0Flat
129 // Particle distribution IdPi0Flat 111 (pi0)
132 Double_t AliGenPHOSlib::PtPi0Flat(const Double_t */*px*/, const Double_t *)
134 // Pion transverse momentum flat distribution
140 Double_t AliGenPHOSlib::YPi0Flat( const Double_t */*py*/, const Double_t *)
143 // pion y-distribution
148 Int_t AliGenPHOSlib::IpPi0Flat(TRandom *)
151 // particle composition pi0
156 //=============================================================
158 Double_t AliGenPHOSlib::PtScal(Double_t pt, Int_t np)
161 // Fonction for the calculation of the Pt distribution for a
162 // given particle np, from the pion Pt distribution using the
163 // mt scaling. This function was taken from AliGenMUONlib
164 // aliroot version 3.01, and was extended for baryons
165 // np = 1=>Pions 2=>Kaons 3=>Etas 4=>Omegas 5=>ETA' 6=>PHI
166 // 7=>BARYONS-BARYONBARS
168 // SCALING EN MASSE PAR RAPPORT A PTPI
169 // MASS 0=>PI, 1=>K, 2=>ETA, 3=>OMEGA, 4=>ETA',5=>PHI
170 const Double_t khm[10] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
171 // MASS 6=>BARYON-BARYONBAR
173 // VALUE MESON/PI AT 5 GEV
174 const Double_t kfmax[10]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
175 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
176 Double_t kfmax2=f5/kfmax[np];
178 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
179 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
180 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ kfmax2;
181 return fmtscal*ptpion;
185 //============================================================================
187 Double_t AliGenPHOSlib::PtKaon( const Double_t *px, const Double_t *)
191 //____________________________________________________________
193 return PtScal(*px,1); // 1==> Kaon in the PtScal function
196 Double_t AliGenPHOSlib::YKaon( const Double_t *py, const Double_t *)
199 //____________________________________________________________
201 const Double_t ka = 1000.;
202 const Double_t kdy = 4.;
205 Double_t y=TMath::Abs(*py);
207 Double_t ex = y*y/(2*kdy*kdy);
208 return ka*TMath::Exp(-ex);
211 Int_t AliGenPHOSlib::IpKaon(TRandom *ran)
213 // particle composition
216 Float_t random = ran->Rndm();
217 Float_t random2 = ran->Rndm();
229 return 130; // K^0 short
231 return 310; // K^0 long
236 Int_t AliGenPHOSlib::IpChargedKaon(TRandom *ran)
238 // particle composition
241 Float_t random = ran->Rndm();
251 Int_t AliGenPHOSlib::IpKaon0L(TRandom *)
253 // particle composition
256 return 130; // K^0 long
259 //============================================================================
260 //============================================================================
262 Double_t AliGenPHOSlib::PtEta( const Double_t *px, const Double_t *)
266 //____________________________________________________________
268 return PtScal(*px,2); // 2==> Eta in the PtScal function
271 Double_t AliGenPHOSlib::YEta( const Double_t *py, const Double_t *)
274 //____________________________________________________________
276 const Double_t ka = 1000.;
277 const Double_t kdy = 4.;
280 Double_t y=TMath::Abs(*py);
282 Double_t ex = y*y/(2*kdy*kdy);
283 return ka*TMath::Exp(-ex);
286 Int_t AliGenPHOSlib::IpEta(TRandom *)
288 // particle composition
295 //======================================================================
296 // Eta Flat Distribution
297 // Transverse momentum distribution PtEtaFlat
298 // Rapidity distribution YEtaFlat
299 // Particle distribution IdEtaFlat 111 (pi0)
302 Double_t AliGenPHOSlib::PtEtaFlat(const Double_t */*px*/, const Double_t *)
304 // Eta transverse momentum flat distribution
310 Double_t AliGenPHOSlib::YEtaFlat( const Double_t */*py*/, const Double_t *)
313 // pion y-distribution
318 Int_t AliGenPHOSlib::IpEtaFlat(TRandom *)
321 // particle composition eta
326 //============================================================================
327 //============================================================================
329 Double_t AliGenPHOSlib::PtOmega( const Double_t *px, const Double_t *)
333 //____________________________________________________________
335 return PtScal(*px,3); // 3==> Omega in the PtScal function
338 Double_t AliGenPHOSlib::YOmega( const Double_t *py, const Double_t *)
341 //____________________________________________________________
343 const Double_t ka = 1000.;
344 const Double_t kdy = 4.;
347 Double_t y=TMath::Abs(*py);
349 Double_t ex = y*y/(2*kdy*kdy);
350 return ka*TMath::Exp(-ex);
353 Int_t AliGenPHOSlib::IpOmega(TRandom *)
355 // particle composition
361 //============================================================================
362 //======================================================================
363 // Omega(782) Flat Distribution
364 // Transverse momentum distribution PtOmegaFlat
365 // Rapidity distribution YOmegaFlat
366 // Particle distribution IdOmegaFlat 223(0mega)
369 Double_t AliGenPHOSlib::PtOmegaFlat(const Double_t */*px*/, const Double_t *)
371 // omega transverse momentum flat distribution
377 Double_t AliGenPHOSlib::YOmegaFlat( const Double_t */*py*/, const Double_t *)
380 // omega y-distribution
385 Int_t AliGenPHOSlib::IpOmegaFlat(TRandom *)
388 // particle composition omega
395 //============================================================================
397 Double_t AliGenPHOSlib::PtEtaprime( const Double_t *px, const Double_t *)
401 //____________________________________________________________
403 return PtScal(*px,4); // 4==> Etaprime in the PtScal function
406 Double_t AliGenPHOSlib::YEtaprime( const Double_t *py, const Double_t *)
409 //____________________________________________________________
411 const Double_t ka = 1000.;
412 const Double_t kdy = 4.;
415 Double_t y=TMath::Abs(*py);
417 Double_t ex = y*y/(2*kdy*kdy);
418 return ka*TMath::Exp(-ex);
421 Int_t AliGenPHOSlib::IpEtaprime(TRandom *)
423 // particle composition
426 return 331; // Etaprime
429 //===================================================================
430 //============================================================================
432 Double_t AliGenPHOSlib::PtPhi( const Double_t *px, const Double_t *)
436 //____________________________________________________________
438 return PtScal(*px,5); // 5==> Phi in the PtScal function
441 Double_t AliGenPHOSlib::YPhi( const Double_t *py, const Double_t *)
444 //____________________________________________________________
446 const Double_t ka = 1000.;
447 const Double_t kdy = 4.;
450 Double_t y=TMath::Abs(*py);
452 Double_t ex = y*y/(2*kdy*kdy);
453 return ka*TMath::Exp(-ex);
456 Int_t AliGenPHOSlib::IpPhi(TRandom *)
458 // particle composition
464 //===================================================================
465 //============================================================================
466 // B A R Y O N S == protons, protonsbar, neutrons, and neutronsbars
467 Double_t AliGenPHOSlib::PtBaryon( const Double_t *px, const Double_t *)
471 //____________________________________________________________
473 return PtScal(*px,6); // 6==> Baryon in the PtScal function
476 Double_t AliGenPHOSlib::YBaryon( const Double_t *py, const Double_t *)
479 //____________________________________________________________
481 const Double_t ka = 1000.;
482 const Double_t kdy = 4.;
485 Double_t y=TMath::Abs(*py);
487 Double_t ex = y*y/(2*kdy*kdy);
488 return ka*TMath::Exp(-ex);
491 Int_t AliGenPHOSlib::IpBaryon(TRandom *ran)
493 // particle composition
496 Float_t random = ran->Rndm();
497 Float_t random2 = ran->Rndm();
503 return -2212; // pbar
511 return -2112; // n bar
516 Int_t AliGenPHOSlib::IpProton(TRandom *)
518 // particle composition
523 Int_t AliGenPHOSlib::IpAProton(TRandom *)
525 // particle composition
527 return -2212; // p bar
531 Int_t AliGenPHOSlib::IpNeutron(TRandom *)
533 // particle composition
538 Int_t AliGenPHOSlib::IpANeutron(TRandom *)
540 // particle composition
546 //===================================================================
548 typedef Double_t (*GenFunc) (const Double_t*, const Double_t*);
549 GenFunc AliGenPHOSlib::GetPt(Int_t param, const char* /*tname*/) const
551 // Return pinter to pT parameterisation
585 printf("<AliGenPHOSlib::GetPt> unknown parametrisationn");
590 GenFunc AliGenPHOSlib::GetY(Int_t param, const char* /*tname*/) const
592 // Return pointer to Y parameterisation
628 printf("<AliGenPHOSlib::GetY> unknown parametrisationn");
632 typedef Int_t (*GenFuncIp) (TRandom *);
633 GenFuncIp AliGenPHOSlib::GetIp(Int_t param, const char* /*tname*/) const
635 // Return pointer to particle composition
694 printf("<AliGenPHOSlib::GetIp> unknown parametrisationn");