X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=EVGEN%2FAliGenMUONlib.cxx;h=97c850d6ea284fe7680a584577b0a39e050c4c34;hp=fcfe4a9f245ae9f5b988211b149b1545ea9dbf78;hb=d90f80fd55e22844a9085896dfea81e86a9b9fbb;hpb=753690b0a7c82619849a6494ce1c79a3580c9595 diff --git a/EVGEN/AliGenMUONlib.cxx b/EVGEN/AliGenMUONlib.cxx index fcfe4a9f245..97c850d6ea2 100644 --- a/EVGEN/AliGenMUONlib.cxx +++ b/EVGEN/AliGenMUONlib.cxx @@ -1,54 +1,77 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/* +$Log$ +Revision 1.6 1999/09/29 09:24:14 fca +Introduction of the Copyright and cvs Log + +*/ + #include "AliGenMUONlib.h" #include "AliRun.h" ClassImp(AliGenMUONlib) // // Pions -Double_t AliGenMUONlib::PtPion(Double_t *px, Double_t *) +Double_t AliGenMUONlib::PtPion(Double_t *px, Double_t *dummy) { // // PT-PARAMETERIZATION CDF, PRL 61(88) 1819 // POWER LAW FOR PT > 500 MEV // MT SCALING BELOW (T=160 MEV) // - const Double_t p0 = 1.3; - const Double_t xn = 8.28; - const Double_t xlim=0.5; - const Double_t t=0.160; - const Double_t xmpi=0.139; - const Double_t b=1.; + const Double_t kp0 = 1.3; + const Double_t kxn = 8.28; + const Double_t kxlim=0.5; + const Double_t kt=0.160; + const Double_t kxmpi=0.139; + const Double_t kb=1.; Double_t y, y1, xmpi2, ynorm, a; Double_t x=*px; // - y1=TMath::Power(p0/(p0+xlim),xn); - xmpi2=xmpi*xmpi; - ynorm=b*(TMath::Exp(-sqrt(xlim*xlim+xmpi2)/t)); + y1=TMath::Power(kp0/(kp0+kxlim),kxn); + xmpi2=kxmpi*kxmpi; + ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+xmpi2)/kt)); a=ynorm/y1; - if (x > xlim) - y=a*TMath::Power(p0/(p0+x),xn); + if (x > kxlim) + y=a*TMath::Power(kp0/(kp0+x),kxn); else - y=b*TMath::Exp(-sqrt(x*x+xmpi2)/t); + y=kb*TMath::Exp(-sqrt(x*x+xmpi2)/kt); return y*x; } // // y-distribution // -Double_t AliGenMUONlib::YPion( Double_t *py, Double_t *) +Double_t AliGenMUONlib::YPion( Double_t *py, Double_t *dummy) { - const Double_t a = 7000.; - const Double_t dy = 4.; +// Pion y + const Double_t ka = 7000.; + const Double_t kdy = 4.; Double_t y=TMath::Abs(*py); // - Double_t ex = y*y/(2*dy*dy); - return a*TMath::Exp(-ex); + Double_t ex = y*y/(2*kdy*kdy); + return ka*TMath::Exp(-ex); } // particle composition // Int_t AliGenMUONlib::IpPion() { - AliMC* pMC = AliMC::GetMC(); +// Pion composition Float_t random[1]; - pMC->Rndm(random,1); + gMC->Rndm(random,1); if (random[0] < 0.5) { return 211; } else { @@ -64,16 +87,16 @@ Double_t AliGenMUONlib::PtScal(Double_t pt, Int_t np) { // SCALING EN MASSE PAR RAPPORT A PTPI // MASS PI,K,ETA,RHO,OMEGA,ETA',PHI - const Double_t hm[10] = {.13957,.493,.5488,.769,.7826,.958,1.02,0,0,0}; + const Double_t khm[10] = {.13957,.493,.5488,.769,.7826,.958,1.02,0,0,0}; // VALUE MESON/PI AT 5 GEV - const Double_t fmax[10]={1.,0.3,0.55,1.0,1.0,1.0,1.0,0,0,0}; + const Double_t kfmax[10]={1.,0.3,0.55,1.0,1.0,1.0,1.0,0,0,0}; np--; - Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+hm[np]*hm[np])+2.0)),12.3); - Double_t fmax2=f5/fmax[np]; + Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3); + Double_t fmax2=f5/kfmax[np]; // PIONS Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0); Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/ - (sqrt(pt*pt+hm[np]*hm[np])+2.0)),12.3)/ fmax2; + (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ fmax2; return fmtscal*ptpion; } // @@ -81,32 +104,34 @@ Double_t AliGenMUONlib::PtScal(Double_t pt, Int_t np) // // pt-distribution //____________________________________________________________ -Double_t AliGenMUONlib::PtKaon( Double_t *px, Double_t *) +Double_t AliGenMUONlib::PtKaon( Double_t *px, Double_t *dummy) { +// Kaon pT return PtScal(*px,2); } // y-distribution //____________________________________________________________ -Double_t AliGenMUONlib::YKaon( Double_t *py, Double_t *) +Double_t AliGenMUONlib::YKaon( Double_t *py, Double_t *dummy) { - const Double_t a = 1000.; - const Double_t dy = 4.; +// Kaon y + const Double_t ka = 1000.; + const Double_t kdy = 4.; Double_t y=TMath::Abs(*py); // - Double_t ex = y*y/(2*dy*dy); - return a*TMath::Exp(-ex); + Double_t ex = y*y/(2*kdy*kdy); + return ka*TMath::Exp(-ex); } // particle composition // Int_t AliGenMUONlib::IpKaon() { - AliMC* pMC = AliMC::GetMC(); +// Kaon composition Float_t random[1]; - pMC->Rndm(random,1); + gMC->Rndm(random,1); if (random[0] < 0.5) { return 321; } else { @@ -119,35 +144,38 @@ Int_t AliGenMUONlib::IpKaon() // // pt-distribution //____________________________________________________________ -Double_t AliGenMUONlib::PtJpsi( Double_t *px, Double_t *) +Double_t AliGenMUONlib::PtJpsi( Double_t *px, Double_t *dummy) { - const Double_t pt0 = 4.; - const Double_t xn = 3.6; +// J/Psi pT + const Double_t kpt0 = 4.; + const Double_t kxn = 3.6; Double_t x=*px; // - Double_t pass1 = 1.+(x/pt0)*(x/pt0); - return x/TMath::Power(pass1,xn); + Double_t pass1 = 1.+(x/kpt0)*(x/kpt0); + return x/TMath::Power(pass1,kxn); } // // y-distribution //____________________________________________________________ -Double_t AliGenMUONlib::YJpsi(Double_t *py, Double_t *) +Double_t AliGenMUONlib::YJpsi(Double_t *py, Double_t *dummy) { - const Double_t y0 = 4.; - const Double_t b=1.; +// J/psi y + const Double_t ky0 = 4.; + const Double_t kb=1.; Double_t yj; Double_t y=TMath::Abs(*py); // - if (y < y0) - yj=b; + if (y < ky0) + yj=kb; else - yj=b*TMath::Exp(-(y-y0)*(y-y0)/2); + yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2); return yj; } // particle composition // Int_t AliGenMUONlib::IpJpsi() { +// J/Psi composition return 443; } @@ -156,36 +184,39 @@ Int_t AliGenMUONlib::IpJpsi() // // pt-distribution //____________________________________________________________ -Double_t AliGenMUONlib::PtUpsilon( Double_t *px, Double_t * ) +Double_t AliGenMUONlib::PtUpsilon( Double_t *px, Double_t *dummy ) { - const Double_t pt0 = 5.3; - const Double_t xn = 2.5; +// Upsilon pT + const Double_t kpt0 = 5.3; + const Double_t kxn = 2.5; Double_t x=*px; // - Double_t pass1 = 1.+(x/pt0)*(x/pt0); - return x/TMath::Power(pass1,xn); + Double_t pass1 = 1.+(x/kpt0)*(x/kpt0); + return x/TMath::Power(pass1,kxn); } // // y-distribution // //____________________________________________________________ -Double_t AliGenMUONlib::YUpsilon(Double_t *py, Double_t *) +Double_t AliGenMUONlib::YUpsilon(Double_t *py, Double_t *dummy) { - const Double_t y0 = 3.; - const Double_t b=1.; +// Upsilon y + const Double_t ky0 = 3.; + const Double_t kb=1.; Double_t yu; Double_t y=TMath::Abs(*py); // - if (y < y0) - yu=b; + if (y < ky0) + yu=kb; else - yu=b*TMath::Exp(-(y-y0)*(y-y0)/2); + yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2); return yu; } // particle composition // Int_t AliGenMUONlib::IpUpsilon() { +// y composition return 553; } @@ -195,20 +226,23 @@ Int_t AliGenMUONlib::IpUpsilon() // // pt-distribution (by scaling of pion distribution) //____________________________________________________________ -Double_t AliGenMUONlib::PtPhi( Double_t *px, Double_t *) +Double_t AliGenMUONlib::PtPhi( Double_t *px, Double_t *dummy) { +// Phi pT return PtScal(*px,7); } // y-distribution -Double_t AliGenMUONlib::YPhi( Double_t *px, Double_t *) +Double_t AliGenMUONlib::YPhi( Double_t *px, Double_t *dummy) { - Double_t *dummy; - return YJpsi(px,dummy); +// Phi y + Double_t *dum=0; + return YJpsi(px,dum); } // particle composition // Int_t AliGenMUONlib::IpPhi() { +// Phi composition return 41; } @@ -218,29 +252,31 @@ Int_t AliGenMUONlib::IpPhi() // // pt-distribution //____________________________________________________________ -Double_t AliGenMUONlib::PtCharm( Double_t *px, Double_t *) +Double_t AliGenMUONlib::PtCharm( Double_t *px, Double_t *dummy) { - const Double_t pt0 = 4.08; - const Double_t xn = 9.40; +// Charm pT + const Double_t kpt0 = 4.08; + const Double_t kxn = 9.40; Double_t x=*px; // - Double_t pass1 = 1.+(x/pt0)*(x/pt0); - return x/TMath::Power(pass1,xn); + Double_t pass1 = 1.+(x/kpt0)*(x/kpt0); + return x/TMath::Power(pass1,kxn); } // y-distribution -Double_t AliGenMUONlib::YCharm( Double_t *px, Double_t *) +Double_t AliGenMUONlib::YCharm( Double_t *px, Double_t *dummy) { - Double_t *dummy; - return YJpsi(px,dummy); +// Charm y + Double_t *dum=0; + return YJpsi(px,dum); } Int_t AliGenMUONlib::IpCharm() { - AliMC* pMC = AliMC::GetMC(); +// Charm composition Float_t random[2]; Int_t ip; // 411,421,431,4122 - pMC->Rndm(random,2); + gMC->Rndm(random,2); if (random[0] < 0.5) { ip=411; } else if (random[0] < 0.75) { @@ -262,28 +298,30 @@ Int_t AliGenMUONlib::IpCharm() // // pt-distribution //____________________________________________________________ -Double_t AliGenMUONlib::PtBeauty( Double_t *px, Double_t *) +Double_t AliGenMUONlib::PtBeauty( Double_t *px, Double_t *dummy) { - const Double_t pt0 = 4.; - const Double_t xn = 3.6; +// Beauty pT + const Double_t kpt0 = 4.; + const Double_t kxn = 3.6; Double_t x=*px; // - Double_t pass1 = 1.+(x/pt0)*(x/pt0); - return x/TMath::Power(pass1,xn); + Double_t pass1 = 1.+(x/kpt0)*(x/kpt0); + return x/TMath::Power(pass1,kxn); } // y-distribution -Double_t AliGenMUONlib::YBeauty( Double_t *px, Double_t *) +Double_t AliGenMUONlib::YBeauty( Double_t *px, Double_t *dummy) { - Double_t *dummy; - return YJpsi(px,dummy); +// Beauty y + Double_t *dum=0; + return YJpsi(px,dum); } Int_t AliGenMUONlib::IpBeauty() { - AliMC* pMC = AliMC::GetMC(); +// Beauty Composition Float_t random[2]; Int_t ip; - pMC->Rndm(random,2); + gMC->Rndm(random,2); if (random[0] < 0.5) { ip=511; } else if (random[0] < 0.75) { @@ -301,6 +339,7 @@ Int_t AliGenMUONlib::IpBeauty() typedef Double_t (*GenFunc) (Double_t*, Double_t*); GenFunc AliGenMUONlib::GetPt(Param_t param) { +// Return pointer to pT parameterisation GenFunc func; switch (param) { @@ -325,12 +364,16 @@ GenFunc AliGenMUONlib::GetPt(Param_t param) case kaon_p: func=PtKaon; break; + default: + func=0; + printf(" unknown parametrisation\n"); } return func; } GenFunc AliGenMUONlib::GetY(Param_t param) { +// Return pointer to y- parameterisation GenFunc func; switch (param) { @@ -355,12 +398,16 @@ GenFunc AliGenMUONlib::GetY(Param_t param) case kaon_p: func=YKaon; break; + default: + func=0; + printf(" unknown parametrisation\n"); } return func; } typedef Int_t (*GenFuncIp) (); GenFuncIp AliGenMUONlib::GetIp(Param_t param) { +// Return pointer to particle type parameterisation GenFuncIp func; switch (param) { @@ -385,6 +432,9 @@ GenFuncIp AliGenMUONlib::GetIp(Param_t param) case kaon_p: func=IpKaon; break; + default: + func=0; + printf(" unknown parametrisation\n"); } return func; }