LCOV - code coverage report
Current view: top level - EVGEN - AliGenMUONlib.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 1306 0.1 %
Date: 2016-06-14 17:26:59 Functions: 1 346 0.3 %

          Line data    Source code
       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             : // muon spectrometer simulations.
      20             : // To be used with AliGenParam.
      21             : // The following particle typed can be simulated:
      22             : // pi, K, phi, omega, eta, J/Psi, Upsilon, charm and beauty mesons. 
      23             : //
      24             : // andreas.morsch@cern.ch
      25             : //
      26             : 
      27             : #include "TMath.h"
      28             : #include "TRandom.h"
      29             : #include "TDatabasePDG.h"
      30             : 
      31             : #include "AliGenMUONlib.h"
      32             : 
      33           6 : ClassImp(AliGenMUONlib)
      34             : //
      35             : //  Pions
      36             : Double_t AliGenMUONlib::PtPion(const Double_t *px, const Double_t* /*dummy*/)
      37             : {
      38             : //
      39             : //     PT-PARAMETERIZATION CDF, PRL 61(88) 1819
      40             : //     POWER LAW FOR PT > 500 MEV
      41             : //     MT SCALING BELOW (T=160 MEV)
      42             : //
      43             :   const Double_t kp0 = 1.3;
      44             :   const Double_t kxn = 8.28;
      45             :   const Double_t kxlim=0.5;
      46             :   const Double_t kt=0.160;
      47             :   const Double_t kxmpi=0.139;
      48             :   const Double_t kb=1.;
      49             :   Double_t y, y1, xmpi2, ynorm, a;
      50           0 :   Double_t x=*px;
      51             :   //
      52           0 :   y1=TMath::Power(kp0/(kp0+kxlim),kxn);
      53             :   xmpi2=kxmpi*kxmpi;
      54           0 :   ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+xmpi2)/kt));
      55           0 :   a=ynorm/y1;
      56           0 :   if (x > kxlim)
      57           0 :     y=a*TMath::Power(kp0/(kp0+x),kxn);
      58             :   else
      59           0 :     y=kb*TMath::Exp(-sqrt(x*x+xmpi2)/kt);
      60           0 :   return y*x;
      61             : }
      62             : //
      63             : // y-distribution
      64             : //
      65             : Double_t AliGenMUONlib::YPion( const Double_t *py, const Double_t */*dummy*/)
      66             : {
      67             : // Pion y
      68           0 :   Double_t y=TMath::Abs(*py);
      69             : /*
      70             :   const Double_t ka    = 7000.;
      71             :   const Double_t kdy   = 4.;
      72             :   Double_t ex = y*y/(2*kdy*kdy);
      73             :   return ka*TMath::Exp(-ex);
      74             : */
      75           0 :   return 1.16526e+04+y*-3.79886e+03+y*y*4.31130e+02;
      76             :   
      77             : }
      78             : //                 particle composition
      79             : //
      80             : Int_t AliGenMUONlib::IpPion(TRandom *ran)
      81             : {
      82             : // Pion composition 
      83           0 :     if (ran->Rndm() < 0.5) {
      84           0 :         return  211;
      85             :     } else {
      86           0 :         return -211;
      87             :     }
      88           0 : }
      89             : 
      90             : //____________________________________________________________
      91             : //
      92             : // Mt-scaling
      93             : 
      94             : Double_t AliGenMUONlib::PtScal(Double_t pt, Int_t np)
      95             : {
      96             :   //    SCALING EN MASSE PAR RAPPORT A PTPI
      97             :   //    MASS PI,K,ETA,RHO,OMEGA,ETA',PHI
      98             :   const Double_t khm[10] = {.13957,.493,.5488,.769,.7826,.958,1.02,0,0,0};
      99             :   //     VALUE MESON/PI AT 5 GEV
     100             :   const Double_t kfmax[10]={1.,0.3,0.55,1.0,1.0,1.0,1.0,0,0,0};
     101           0 :   np--;
     102           0 :   Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
     103           0 :   Double_t fmax2=f5/kfmax[np];
     104             :   // PIONS
     105           0 :   Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
     106           0 :   Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
     107           0 :                                  (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ fmax2;
     108           0 :   return fmtscal*ptpion;
     109             : }
     110             : //
     111             : // kaon
     112             : //
     113             : //                pt-distribution
     114             : //____________________________________________________________
     115             : Double_t AliGenMUONlib::PtKaon( const Double_t *px, const Double_t */*dummy*/)
     116             : {
     117             : // Kaon pT
     118           0 :   return PtScal(*px,2);
     119             : }
     120             : 
     121             : // y-distribution
     122             : //____________________________________________________________
     123             : Double_t AliGenMUONlib::YKaon( const Double_t *py, const Double_t */*dummy*/)
     124             : {
     125             : // Kaon y
     126           0 :   Double_t y=TMath::Abs(*py);
     127             : /*
     128             :   const Double_t ka    = 1000.;
     129             :   const Double_t kdy   = 4.;
     130             :   //
     131             :   Double_t ex = y*y/(2*kdy*kdy);
     132             :   return ka*TMath::Exp(-ex);
     133             : */
     134             : 
     135           0 :   return 1.16526e+04+y*-3.79886e+03+y*y*4.31130e+02;
     136             : }
     137             : 
     138             : //                 particle composition
     139             : //
     140             : Int_t AliGenMUONlib::IpKaon(TRandom *ran)
     141             : {
     142             : // Kaon composition
     143           0 :     if (ran->Rndm() < 0.5) {
     144           0 :         return  321;
     145             :     } else {
     146           0 :         return -321;
     147             :     }
     148           0 : }
     149             : 
     150             : //                    J/Psi 
     151             : //
     152             : //
     153             : //                pt-distribution
     154             : //____________________________________________________________
     155             : Double_t AliGenMUONlib::PtJpsiPPdummy(Double_t x, Double_t energy)
     156             : {
     157             : // J/Psi pT
     158             : // pp
     159             : // from the fit of RHIC, CDF & LHC data, see arXiv:1103.2394
     160             : //
     161           0 :   const Double_t kpt0 = 1.04*TMath::Power(energy,0.101);
     162             :   const Double_t kxn  = 3.9;
     163             :   //
     164           0 :   Double_t pass1 = 1.+0.363*(x/kpt0)*(x/kpt0);
     165           0 :   return x/TMath::Power(pass1,kxn);
     166             : }
     167             : 
     168             : Double_t AliGenMUONlib::PtJpsiPP7000(const Double_t *px, const Double_t */*dummy*/)
     169             : {
     170             : // J/Psi pT
     171             : // pp 7 TeV
     172             : //
     173           0 :   return PtJpsiPPdummy(*px,7000);
     174             : }
     175             : 
     176             : Double_t AliGenMUONlib::PtJpsiPP8000(const Double_t *px, const Double_t */*dummy*/)
     177             : {
     178             : // J/Psi pT
     179             : // pp 7 TeV
     180             : //
     181           0 :   return PtJpsiPPdummy(*px,8000);
     182             : }
     183             : 
     184             : Double_t AliGenMUONlib::PtJpsiPP2760(const Double_t *px, const Double_t */*dummy*/)
     185             : {
     186             : // J/Psi pT
     187             : // pp 2.76 TeV
     188             : //
     189           0 :   return PtJpsiPPdummy(*px,2760);
     190             : }
     191             : 
     192             : Double_t AliGenMUONlib::PtJpsiPP4400(const Double_t *px, const Double_t */*dummy*/)
     193             : {
     194             : // J/Psi pT
     195             : // pp 4.4 TeV
     196             : //
     197           0 :   return PtJpsiPPdummy(*px,4400);
     198             : }
     199             : 
     200             : Double_t AliGenMUONlib::PtJpsiPP5030(const Double_t *px, const Double_t */*dummy*/)
     201             : {
     202             : // J/Psi pT
     203             : // pp 5.03 TeV
     204             : //
     205           0 :   return PtJpsiPPdummy(*px,5030);
     206             : }
     207             : 
     208             : Double_t AliGenMUONlib::PtJpsiPP8800(const Double_t *px, const Double_t */*dummy*/)
     209             : {
     210             : // J/Psi pT
     211             : // pp 8.8 TeV
     212             : //
     213           0 :   return PtJpsiPPdummy(*px,8800);
     214             : }
     215             : 
     216             : Double_t AliGenMUONlib::PtJpsiPbPb2760ShFdummy(Double_t x, Int_t n)
     217             : {
     218             : // J/Psi shadowing factor vs pT for PbPb min. bias and 11 centr. bins (in 2.5<y<4)
     219             : //
     220             : // PbPb 2.76 TeV, for EKS98, minimum bias shadowing factor = 0.66 in 4pi
     221             : // S.Grigoryan, details presented at the PWG3-Muon meeting (05.10.2011)
     222             : // https://indico.cern.ch/conferenceDisplay.py?confId=157367
     223             : //
     224             :   const Double_t f1[12] = {1, 1.128, 1.097, 1.037, 0.937, 0.821, 0.693, 0.558,
     225             :                            0.428, 0.317, 0.231, 0.156};
     226             :   const Double_t f2[12] = {1, 1.313, 1.202, 1.039, 0.814, 0.593, 0.391, 0.224,
     227             :                            0.106, 0.041, 0.013, 0.002};
     228             :   const Double_t c1[7] = {1.6077e+00, 7.6300e-02,-7.1880e-03, 3.4067e-04,
     229             :                           -9.2776e-06,1.5138e-07, 1.4652e-09}; 
     230             :   const Double_t c2[7] = {6.2047e-01, 5.7653e-02,-4.1414e-03, 1.0301e-04, 
     231             :                           9.6205e-07,-7.4098e-08, 5.0946e-09}; 
     232             :   Double_t y1, y2;
     233             :   Int_t j;
     234             :   y1 = c1[j = 6]; y2 = c2[6];
     235           0 :   while (j > 0) {y1 = y1 * x + c1[--j]; y2 = y2 * x + c2[j];}
     236             :   
     237           0 :   y1 /= 1.+c1[6]*TMath::Power(x,6);
     238           0 :   y2 /= 1.+c2[6]*TMath::Power(x,6);
     239             :   //  
     240           0 :   y1 = 1 + (y1-2)*f1[n] + (y2+1-y1)*f2[n];
     241           0 :   if(y1<0) y1=0;
     242           0 :   return y1;
     243             : }
     244             : 
     245             : Double_t AliGenMUONlib::PtJpsiPbPb2760(const Double_t *px, const Double_t *dummy)
     246             : {
     247             : // J/Psi pT
     248             : // PbPb 2.76 TeV, minimum bias 0-100 %
     249             : //
     250           0 :   return PtJpsiPbPb2760ShFdummy(*px, 0) * PtJpsiPP2760(px, dummy);
     251             : }
     252             : 
     253             : Double_t AliGenMUONlib::PtJpsiPbPb2760c1(const Double_t *px, const Double_t *dummy)
     254             : {
     255             : // J/Psi pT
     256             : // PbPb 2.76 TeV, 1st centrality bin 0-5 %
     257             : //
     258           0 :   return PtJpsiPbPb2760ShFdummy(*px, 1) * PtJpsiPP2760(px, dummy);
     259             : }
     260             : 
     261             : Double_t AliGenMUONlib::PtJpsiPbPb2760c2(const Double_t *px, const Double_t *dummy)
     262             : {
     263             : // J/Psi pT
     264             : // PbPb 2.76 TeV, 2nd centrality bin 5-10 %
     265             : //
     266           0 :   return PtJpsiPbPb2760ShFdummy(*px, 2) * PtJpsiPP2760(px, dummy);
     267             : }
     268             : 
     269             : Double_t AliGenMUONlib::PtJpsiPbPb2760c3(const Double_t *px, const Double_t *dummy)
     270             : {
     271             : // J/Psi pT
     272             : // PbPb 2.76 TeV, 3rd centrality bin 10-20 %
     273             : //
     274           0 :   return PtJpsiPbPb2760ShFdummy(*px, 3) * PtJpsiPP2760(px, dummy);
     275             : }
     276             : 
     277             : Double_t AliGenMUONlib::PtJpsiPbPb2760c4(const Double_t *px, const Double_t *dummy)
     278             : {
     279             : // J/Psi pT
     280             : // PbPb 2.76 TeV, 4th centrality bin 20-30 %
     281             : //
     282           0 :   return PtJpsiPbPb2760ShFdummy(*px, 4) * PtJpsiPP2760(px, dummy);
     283             : }
     284             : 
     285             : Double_t AliGenMUONlib::PtJpsiPbPb2760c5(const Double_t *px, const Double_t *dummy)
     286             : {
     287             : // J/Psi pT
     288             : // PbPb 2.76 TeV, 5th centrality bin 30-40 %
     289             : //
     290           0 :   return PtJpsiPbPb2760ShFdummy(*px, 5) * PtJpsiPP2760(px, dummy);
     291             : }
     292             : 
     293             : Double_t AliGenMUONlib::PtJpsiPbPb2760c6(const Double_t *px, const Double_t *dummy)
     294             : {
     295             : // J/Psi pT
     296             : // PbPb 2.76 TeV, 6th centrality bin 40-50 %
     297             : //
     298           0 :   return PtJpsiPbPb2760ShFdummy(*px, 6) * PtJpsiPP2760(px, dummy);
     299             : }
     300             : 
     301             : Double_t AliGenMUONlib::PtJpsiPbPb2760c7(const Double_t *px, const Double_t *dummy)
     302             : {
     303             : // J/Psi pT
     304             : // PbPb 2.76 TeV, 7th centrality bin 50-60 %
     305             : //
     306           0 :   return PtJpsiPbPb2760ShFdummy(*px, 7) * PtJpsiPP2760(px, dummy);
     307             : }
     308             : 
     309             : Double_t AliGenMUONlib::PtJpsiPbPb2760c8(const Double_t *px, const Double_t *dummy)
     310             : {
     311             : // J/Psi pT
     312             : // PbPb 2.76 TeV, 8th centrality bin 60-70 %
     313             : //
     314           0 :   return PtJpsiPbPb2760ShFdummy(*px, 8) * PtJpsiPP2760(px, dummy);
     315             : }
     316             : 
     317             : Double_t AliGenMUONlib::PtJpsiPbPb2760c9(const Double_t *px, const Double_t *dummy)
     318             : {
     319             : // J/Psi pT
     320             : // PbPb 2.76 TeV, 9th centrality bin 70-80 %
     321             : //
     322           0 :   return PtJpsiPbPb2760ShFdummy(*px, 9) * PtJpsiPP2760(px, dummy);
     323             : }
     324             : 
     325             : Double_t AliGenMUONlib::PtJpsiPbPb2760c10(const Double_t *px, const Double_t *dummy)
     326             : {
     327             : // J/Psi pT
     328             : // PbPb 2.76 TeV, 10th centrality bin 80-90 %
     329             : //
     330           0 :   return PtJpsiPbPb2760ShFdummy(*px, 10) * PtJpsiPP2760(px, dummy);
     331             : }
     332             : 
     333             : Double_t AliGenMUONlib::PtJpsiPbPb2760c11(const Double_t *px, const Double_t *dummy)
     334             : {
     335             : // J/Psi pT
     336             : // PbPb 2.76 TeV, 11th centrality bin 90-100 %
     337             : //
     338           0 :   return PtJpsiPbPb2760ShFdummy(*px, 11) * PtJpsiPP2760(px, dummy);
     339             : }
     340             : 
     341             : Double_t AliGenMUONlib::PtJpsiPPb5030ShFdummy(Double_t x, Int_t n)
     342             : {
     343             : // J/Psi shadowing factor vs pT for pPb min. bias and 4 centr. bins (in 2.5<y<4)
     344             : //
     345             : // pPb 5.03 TeV, for EPS09-LO, minimum bias shadowing factor = 0.81 in 4pi
     346             : //
     347             :   const Double_t f[5] = {1, 1.33, 1.05, 0.67, 0.23};
     348             :   const Double_t c[7] = {6.675e-01, 1.808e-02, 2.721e-03,-7.793e-04, 7.504e-05,-3.884e-06, 5.759e-07}; 
     349             :   Double_t y;
     350             :   Int_t j;
     351             :   y = c[j = 6];
     352           0 :   while (j > 0) y  = y * x + c[--j];
     353           0 :   y /= 1 + c[6]*TMath::Power(x,6);
     354             :   //  
     355           0 :   return 1 + (y-1)*f[n];
     356             : }
     357             : 
     358             : Double_t AliGenMUONlib::PtJpsiPPb5030(const Double_t *px, const Double_t *dummy)
     359             : {
     360             : // J/Psi pT
     361             : // pPb 5.03 TeV, minimum bias 0-100 %
     362             : //
     363           0 :   return PtJpsiPPb5030ShFdummy(*px, 0) * PtJpsiPP5030(px, dummy);
     364             : }
     365             : 
     366             : Double_t AliGenMUONlib::PtJpsiPPb5030c1(const Double_t *px, const Double_t *dummy)
     367             : {
     368             : // J/Psi pT
     369             : // pPb 5.03 TeV, 1st centrality bin 0-20 %
     370             : //
     371           0 :   return PtJpsiPPb5030ShFdummy(*px, 1) * PtJpsiPP5030(px, dummy);
     372             : }
     373             : 
     374             : Double_t AliGenMUONlib::PtJpsiPPb5030c2(const Double_t *px, const Double_t *dummy)
     375             : {
     376             : // J/Psi pT
     377             : // pPb 5.03 TeV, 2nd centrality bin 20-40 %
     378             : //
     379           0 :   return PtJpsiPPb5030ShFdummy(*px, 2) * PtJpsiPP5030(px, dummy);
     380             : }
     381             : 
     382             : Double_t AliGenMUONlib::PtJpsiPPb5030c3(const Double_t *px, const Double_t *dummy)
     383             : {
     384             : // J/Psi pT
     385             : // pPb 5.03 TeV, 3rd centrality bin 40-60 %
     386             : //
     387           0 :   return PtJpsiPPb5030ShFdummy(*px, 3) * PtJpsiPP5030(px, dummy);
     388             : }
     389             : 
     390             : Double_t AliGenMUONlib::PtJpsiPPb5030c4(const Double_t *px, const Double_t *dummy)
     391             : {
     392             : // J/Psi pT
     393             : // pPb 5.03 TeV, 4th centrality bin 60-100 %
     394             : //
     395           0 :   return PtJpsiPPb5030ShFdummy(*px, 4) * PtJpsiPP5030(px, dummy);
     396             : }
     397             : 
     398             : Double_t AliGenMUONlib::PtJpsiPbP5030ShFdummy(Double_t x, Int_t n)
     399             : {
     400             : // J/Psi shadowing factor vs pT for Pbp min. bias and 4 centr. bins (in 2.5<y<4)
     401             : //
     402             : // Pbp 5.03 TeV, for EPS09-LO, minimum bias shadowing factor = 0.81 in 4pi
     403             : //
     404             :   const Double_t f[5] = {1, 1.33, 1.05, 0.67, 0.23};
     405             :   const Double_t c[7] = {8.966e-01, 3.498e-02, 6.637e-03,-1.765e-03, 1.240e-04,-2.086e-06, 4.062e-07};
     406             :   Double_t y;
     407             :   Int_t j;
     408             :   y = c[j = 6];
     409           0 :   while (j > 0) y  = y * x + c[--j];
     410           0 :   y /= 1 + c[6]*TMath::Power(x,6);
     411             :   //  
     412           0 :   return 1 + (y-1)*f[n];
     413             : }
     414             : 
     415             : Double_t AliGenMUONlib::PtJpsiPbP5030(const Double_t *px, const Double_t *dummy)
     416             : {
     417             : // J/Psi pT
     418             : // Pbp 5.03 TeV, minimum bias 0-100 %
     419             : //
     420           0 :   return PtJpsiPbP5030ShFdummy(*px, 0) * PtJpsiPP5030(px, dummy);
     421             : }
     422             : 
     423             : Double_t AliGenMUONlib::PtJpsiPbP5030c1(const Double_t *px, const Double_t *dummy)
     424             : {
     425             : // J/Psi pT
     426             : // Pbp 5.03 TeV, 1st centrality bin 0-20 %
     427             : //
     428           0 :   return PtJpsiPbP5030ShFdummy(*px, 1) * PtJpsiPP5030(px, dummy);
     429             : }
     430             : 
     431             : Double_t AliGenMUONlib::PtJpsiPbP5030c2(const Double_t *px, const Double_t *dummy)
     432             : {
     433             : // J/Psi pT
     434             : // Pbp 5.03 TeV, 2nd centrality bin 20-40 %
     435             : //
     436           0 :   return PtJpsiPbP5030ShFdummy(*px, 2) * PtJpsiPP5030(px, dummy);
     437             : }
     438             : 
     439             : Double_t AliGenMUONlib::PtJpsiPbP5030c3(const Double_t *px, const Double_t *dummy)
     440             : {
     441             : // J/Psi pT
     442             : // Pbp 5.03 TeV, 3rd centrality bin 40-60 %
     443             : //
     444           0 :   return PtJpsiPbP5030ShFdummy(*px, 3) * PtJpsiPP5030(px, dummy);
     445             : }
     446             : 
     447             : Double_t AliGenMUONlib::PtJpsiPbP5030c4(const Double_t *px, const Double_t *dummy)
     448             : {
     449             : // J/Psi pT
     450             : // Pbp 5.03 TeV, 4th centrality bin 60-100 %
     451             : //
     452           0 :   return PtJpsiPbP5030ShFdummy(*px, 4) * PtJpsiPP5030(px, dummy);
     453             : }
     454             : 
     455             : Double_t AliGenMUONlib::PtJpsiPPb8800ShFdummy(Double_t x, Int_t n)
     456             : {
     457             : // J/Psi shadowing factor vs pT for pPb min. bias and 4 centr. bins (in 2.5<y<4)
     458             : //
     459             : // pPb 8.8 TeV, for EKS98, minimum bias shadowing factor = 0.78 in 4pi
     460             : //
     461             :   const Double_t f[5] = {1, 1.33, 1.05, 0.67, 0.23};
     462             :   const Double_t c[7] = {6.4922e-01, 6.4857e-03, 4.7268e-03,-9.5075e-04, 
     463             :                          8.4075e-05,-4.2006e-06, 4.9970e-07};
     464             :   Double_t y;
     465             :   Int_t j;
     466             :   y = c[j = 6];
     467           0 :   while (j > 0) y  = y * x + c[--j];
     468           0 :   y /= 1 + c[6]*TMath::Power(x,6);
     469             :   //  
     470           0 :   return 1 + (y-1)*f[n];
     471             : }
     472             : 
     473             : Double_t AliGenMUONlib::PtJpsiPPb8800(const Double_t *px, const Double_t *dummy)
     474             : {
     475             : // J/Psi pT
     476             : // pPb 8.8 TeV, minimum bias 0-100 %
     477             : //
     478           0 :   return PtJpsiPPb8800ShFdummy(*px, 0) * PtJpsiPP8800(px, dummy);
     479             : }
     480             : 
     481             : Double_t AliGenMUONlib::PtJpsiPPb8800c1(const Double_t *px, const Double_t *dummy)
     482             : {
     483             : // J/Psi pT
     484             : // pPb 8.8 TeV, 1st centrality bin 0-20 %
     485             : //
     486           0 :   return PtJpsiPPb8800ShFdummy(*px, 1) * PtJpsiPP8800(px, dummy);
     487             : }
     488             : 
     489             : Double_t AliGenMUONlib::PtJpsiPPb8800c2(const Double_t *px, const Double_t *dummy)
     490             : {
     491             : // J/Psi pT
     492             : // pPb 8.8 TeV, 2nd centrality bin 20-40 %
     493             : //
     494           0 :   return PtJpsiPPb8800ShFdummy(*px, 2) * PtJpsiPP8800(px, dummy);
     495             : }
     496             : 
     497             : Double_t AliGenMUONlib::PtJpsiPPb8800c3(const Double_t *px, const Double_t *dummy)
     498             : {
     499             : // J/Psi pT
     500             : // pPb 8.8 TeV, 3rd centrality bin 40-60 %
     501             : //
     502           0 :   return PtJpsiPPb8800ShFdummy(*px, 3) * PtJpsiPP8800(px, dummy);
     503             : }
     504             : 
     505             : Double_t AliGenMUONlib::PtJpsiPPb8800c4(const Double_t *px, const Double_t *dummy)
     506             : {
     507             : // J/Psi pT
     508             : // pPb 8.8 TeV, 4th centrality bin 60-100 %
     509             : //
     510           0 :   return PtJpsiPPb8800ShFdummy(*px, 4) * PtJpsiPP8800(px, dummy);
     511             : }
     512             : 
     513             : Double_t AliGenMUONlib::PtJpsiPbP8800ShFdummy(Double_t x, Int_t n)
     514             : {
     515             : // J/Psi shadowing factor vs pT for Pbp min. bias and 4 centr. bins (in 2.5<y<4)
     516             : //
     517             : // Pbp 8.8 TeV, for EKS98, minimum bias shadowing factor = 0.78 in 4pi
     518             : //
     519             :   const Double_t f[5] = {1, 1.33, 1.05, 0.67, 0.23};
     520             :   const Double_t c[7] = {8.7562e-01, 2.1944e-02, 7.8509e-03,-1.3979e-03, 
     521             :                          3.8513e-05, 4.2008e-06, 1.7088e-06};
     522             :   Double_t y;
     523             :   Int_t j;
     524             :   y = c[j = 6];
     525           0 :   while (j > 0) y  = y * x + c[--j];
     526           0 :   y /= 1 + c[6]*TMath::Power(x,6);
     527             :   //  
     528           0 :   return 1 + (y-1)*f[n];
     529             : }
     530             : 
     531             : Double_t AliGenMUONlib::PtJpsiPbP8800(const Double_t *px, const Double_t *dummy)
     532             : {
     533             : // J/Psi pT
     534             : // Pbp 8.8 TeV, minimum bias 0-100 %
     535             : //
     536           0 :   return PtJpsiPbP8800ShFdummy(*px, 0) * PtJpsiPP8800(px, dummy);
     537             : }
     538             : 
     539             : Double_t AliGenMUONlib::PtJpsiPbP8800c1(const Double_t *px, const Double_t *dummy)
     540             : {
     541             : // J/Psi pT
     542             : // Pbp 8.8 TeV, 1st centrality bin 0-20 %
     543             : //
     544           0 :   return PtJpsiPbP8800ShFdummy(*px, 1) * PtJpsiPP8800(px, dummy);
     545             : }
     546             : 
     547             : Double_t AliGenMUONlib::PtJpsiPbP8800c2(const Double_t *px, const Double_t *dummy)
     548             : {
     549             : // J/Psi pT
     550             : // Pbp 8.8 TeV, 2nd centrality bin 20-40 %
     551             : //
     552           0 :   return PtJpsiPbP8800ShFdummy(*px, 2) * PtJpsiPP8800(px, dummy);
     553             : }
     554             : 
     555             : Double_t AliGenMUONlib::PtJpsiPbP8800c3(const Double_t *px, const Double_t *dummy)
     556             : {
     557             : // J/Psi pT
     558             : // Pbp 8.8 TeV, 3rd centrality bin 40-60 %
     559             : //
     560           0 :   return PtJpsiPbP8800ShFdummy(*px, 3) * PtJpsiPP8800(px, dummy);
     561             : }
     562             : 
     563             : Double_t AliGenMUONlib::PtJpsiPbP8800c4(const Double_t *px, const Double_t *dummy)
     564             : {
     565             : // J/Psi pT
     566             : // Pbp 8.8 TeV, 4th centrality bin 60-100 %
     567             : //
     568           0 :   return PtJpsiPbP8800ShFdummy(*px, 4) * PtJpsiPP8800(px, dummy);
     569             : }
     570             : 
     571             : Double_t AliGenMUONlib::PtJpsi( const Double_t *px, const Double_t */*dummy*/)
     572             : {
     573             : // J/Psi pT
     574             :   const Double_t kpt0 = 4.;
     575             :   const Double_t kxn  = 3.6;
     576           0 :   Double_t x=*px;
     577             :   //
     578           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
     579           0 :   return x/TMath::Power(pass1,kxn);
     580             : }
     581             : 
     582             : Double_t AliGenMUONlib::PtJpsiCDFscaled( const Double_t *px, const Double_t */*dummy*/)
     583             : {
     584             : // J/Psi pT
     585             : //
     586             : // PbPb 5.5 TeV
     587             : // scaled from CDF data at 2 TeV
     588             : // see S.Grigoryan, PWG3 Meeting, 27th Oct 2008
     589             : 
     590             :   const Double_t kpt0 = 5.100;
     591             :   const Double_t kxn  = 4.102;
     592           0 :   Double_t x=*px;
     593             :   //
     594           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
     595           0 :   return x/TMath::Power(pass1,kxn);
     596             : }
     597             : 
     598             : Double_t AliGenMUONlib::PtJpsiCDFscaledPP( const Double_t *px, const Double_t */*dummy*/)
     599             : {
     600             : // J/Psi pT
     601             : //
     602             : // pp 14 TeV
     603             : // scaled from CDF data at 2 TeV
     604             : 
     605             :   const Double_t kpt0 = 5.630;
     606             :   const Double_t kxn  = 4.071;
     607           0 :   Double_t x=*px;
     608             :   //
     609           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
     610           0 :   return x/TMath::Power(pass1,kxn);
     611             : }
     612             : 
     613             : Double_t AliGenMUONlib::PtJpsiCDFscaledPP10( const Double_t *px, const Double_t */*dummy*/)
     614             : {
     615             : // J/Psi pT
     616             : //
     617             : // pp 10 TeV
     618             : // scaled from CDF data at 2 TeV
     619             : 
     620             :   const Double_t kpt0 = 5.334;
     621             :   const Double_t kxn  = 4.071;
     622           0 :   Double_t x=*px;
     623             :   //
     624           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
     625           0 :   return x/TMath::Power(pass1,kxn);
     626             : }
     627             : 
     628             : Double_t AliGenMUONlib::PtJpsiCDFscaledPP9( const Double_t *px, const Double_t */*dummy*/)
     629             : {
     630             : // J/Psi pT
     631             : //
     632             : // pp 8.8 TeV
     633             : // scaled from CDF data at 2 TeV
     634             : //
     635             :   const Double_t kpt0 = 5.245;
     636             :   const Double_t kxn  = 4.071;
     637           0 :   Double_t x=*px;
     638             :   //
     639           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
     640           0 :   return x/TMath::Power(pass1,kxn);
     641             : }
     642             : 
     643             : Double_t AliGenMUONlib::PtJpsiCDFscaledPP7( const Double_t *px, const Double_t */*dummy*/)
     644             : {
     645             : // J/Psi pT
     646             : //
     647             : // pp 7 TeV
     648             : // scaled from CDF data at 2 TeV
     649             : 
     650             :   const Double_t kpt0 = 5.072;
     651             :   const Double_t kxn  = 4.071;
     652           0 :   Double_t x=*px;
     653             :   //
     654           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
     655           0 :   return x/TMath::Power(pass1,kxn);
     656             : }
     657             : 
     658             : Double_t AliGenMUONlib::PtJpsiCDFscaledPP4( const Double_t *px, const Double_t */*dummy*/)
     659             : {
     660             : // J/Psi pT
     661             : //
     662             : // pp 3.94 TeV
     663             : // scaled from CDF data at 2 TeV
     664             : //
     665             :   const Double_t kpt0 = 4.647;
     666             :   const Double_t kxn  = 4.071;
     667           0 :   Double_t x=*px;
     668             :   //
     669           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
     670           0 :   return x/TMath::Power(pass1,kxn);
     671             : }
     672             : 
     673             : Double_t AliGenMUONlib::PtJpsiCDFscaledPP3( const Double_t *px, const Double_t */*dummy*/)
     674             : {
     675             : // J/Psi pT
     676             : //
     677             : // pp 2.76 TeV
     678             : // scaled from CDF data at 1.9 TeV
     679             : //
     680             :   const Double_t kpt0 = 4.435;
     681             :   const Double_t kxn  = 4.071;
     682           0 :   Double_t x=*px;
     683             :   //
     684           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
     685           0 :   return x/TMath::Power(pass1,kxn);
     686             : }
     687             : 
     688             : Double_t AliGenMUONlib::PtJpsiCDFscaledPP2( const Double_t *px, const Double_t */*dummy*/)
     689             : {
     690             : // J/Psi pT
     691             : //
     692             : // pp 1.96 TeV
     693             : // fit of the CDF data at 1.96 TeV
     694             : //
     695             :   const Double_t kpt0 = 4.233;
     696             :   const Double_t kxn  = 4.071;
     697           0 :   Double_t x=*px;
     698             :   //
     699           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
     700           0 :   return x/TMath::Power(pass1,kxn);
     701             : }
     702             : 
     703             : Double_t AliGenMUONlib::PtJpsiCDFscaledPPb9( const Double_t *px, const Double_t *dummy)
     704             : {
     705             : // J/Psi pT
     706             : //
     707             : // pPb 8.8 TeV, for EKS98 with minimum bias shadowing factor 0.79
     708             : //
     709           0 :   Double_t c[5] = {6.42774e-01, 1.86168e-02, -6.77296e-04, 8.93512e-06, 1.31586e-07};
     710           0 :   Double_t x=*px;
     711             :   Double_t y;
     712             :   Int_t j;
     713           0 :   y = c[j = 4];
     714           0 :   while (j > 0) y  = y * x + c[--j];
     715             :   //  
     716           0 :   Double_t d = 1.+c[4]*TMath::Power(x,4);
     717           0 :   return y/d * AliGenMUONlib::PtJpsiCDFscaledPP9(px,dummy);
     718           0 : }
     719             : 
     720             : Double_t AliGenMUONlib::PtJpsiCDFscaledPbP9( const Double_t *px, const Double_t *dummy)
     721             : {
     722             : // J/Psi pT
     723             : //
     724             : // Pbp 8.8 TeV, for EKS98 with minimum bias shadowing factor 0.79
     725             : //
     726           0 :   Double_t c[5] = {8.58557e-01, 5.39791e-02, -4.75180e-03, 2.49463e-04, 5.52396e-05};
     727           0 :   Double_t x=*px;
     728             :   Double_t y;
     729             :   Int_t j;
     730           0 :   y = c[j = 4];
     731           0 :   while (j > 0) y  = y * x + c[--j];
     732             :   //  
     733           0 :   Double_t d = 1.+c[4]*TMath::Power(x,4);
     734           0 :   return y/d * AliGenMUONlib::PtJpsiCDFscaledPP9(px,dummy);
     735           0 : }
     736             : 
     737             : Double_t AliGenMUONlib::PtJpsiCDFscaledPbPb4( const Double_t *px, const Double_t *dummy)
     738             : {
     739             : // J/Psi pT
     740             : //
     741             : // PbPb 3.94 TeV, for EKS98 with minimum bias shadowing factor 0.66
     742             : //
     743           0 :   Double_t c[5] = {6.01022e-01, 4.70988e-02, -2.27917e-03, 3.09885e-05, 1.31955e-06};
     744           0 :   Double_t x=*px;
     745             :   Double_t y;
     746             :   Int_t j;
     747           0 :   y = c[j = 4];
     748           0 :   while (j > 0) y  = y * x + c[--j];
     749             :   //  
     750           0 :   Double_t d = 1.+c[4]*TMath::Power(x,4);
     751           0 :   return y/d * AliGenMUONlib::PtJpsiCDFscaledPP4(px,dummy);
     752           0 : }
     753             : 
     754             : Double_t AliGenMUONlib::PtJpsiFlat( const Double_t */*px*/, const Double_t */*dummy*/ )
     755             : {
     756           0 :   return 1.;
     757             : }
     758             : 
     759             : Double_t AliGenMUONlib::PtJpsiPbPb( const Double_t *px, const Double_t */*dummy*/)
     760             : {
     761             : // J/Psi pT spectrum
     762             : //
     763             : // R. Vogt 2002
     764             : // PbPb 5.5 TeV
     765             : // MRST HO
     766             : // mc = 1.4 GeV, pt-kick 1 GeV
     767             : //
     768           0 :     Float_t x = px[0];
     769           0 :     Float_t c[8] = {
     770             :         -2.13098e+00, 9.46552e+00, -5.06799e+00, 1.27260e+00, 
     771             :         -1.83806e-01, 1.55853e-02, -7.23241e-04, 1.42105e-05
     772             :     };
     773             :     
     774             :     Double_t y;
     775           0 :     if (x < 10.) {
     776             :         Int_t j;
     777           0 :         y = c[j = 7];
     778           0 :         while (j > 0) y  = y * x +c[--j];
     779           0 :         y = x * TMath::Exp(y);
     780           0 :     } else {
     781             :         y = 0.;
     782             :     }
     783           0 :     return y;
     784           0 : }
     785             : 
     786             : Double_t AliGenMUONlib::PtJpsiBPbPb( const Double_t *px, const Double_t */*dummy*/)
     787             : {
     788             : // J/Psi pT spectrum
     789             : // B -> J/Psi X
     790             :     Double_t x0 =   4.0384;
     791             :     Double_t  n =   3.0288;
     792             :     
     793           0 :     Double_t x = px[0];
     794           0 :     Double_t y = x / TMath::Power((1. + (x/x0)*(x/x0)), n);
     795             :     
     796           0 :     return y;
     797             : }
     798             : 
     799             : 
     800             : Double_t AliGenMUONlib::PtJpsiPP( const Double_t *px, const Double_t */*dummy*/)
     801             : {
     802             : // J/Psi pT spectrum
     803             : //
     804             : // R. Vogt 2002
     805             : // pp 14 TeV
     806             : // MRST HO
     807             : // mc = 1.4 GeV, pt-kick 1 GeV
     808             : //
     809           0 :     Float_t x = px[0];
     810           0 :     Float_t c[4] = {8.47471e+00, -1.93567e+00, 1.50271e-01, -5.51212e-03};
     811             :  
     812             :     Double_t y;
     813           0 :     if (x < 10.) {
     814             :         Int_t j;
     815           0 :         y = c[j = 3];
     816           0 :         while (j > 0) y  = y * x +c[--j];
     817           0 :         y = x * TMath::Exp(y);
     818           0 :     } else {
     819             :         y = 0.;
     820             :     }
     821           0 :     return y;
     822           0 : }
     823             : 
     824             : //
     825             : //               y-distribution
     826             : //____________________________________________________________
     827             : Double_t AliGenMUONlib::YJpsiPPdummy(Double_t x, Double_t energy)
     828             : {
     829             : // J/Psi y
     830             : // pp
     831             : // from the fit of RHIC + LHC data, see arXiv:1103.2394
     832             : //
     833           0 :     x = x/TMath::Log(energy/3.097);
     834           0 :     x = x*x;
     835           0 :     Double_t y = TMath::Exp(-x/0.4/0.4/2);
     836           0 :     if(x > 1) y=0;
     837           0 :     return y;
     838             : }
     839             : 
     840             : Double_t AliGenMUONlib::YJpsiPPpoly(Double_t x, Double_t energy)
     841             : {
     842             : // J/Psi y
     843             : // pp
     844             : // from the fit of RHIC + LHC data, see arXiv:1103.2394
     845             : //
     846           0 :     x = x/TMath::Log(energy/3.097);
     847           0 :     x = x*x;
     848           0 :     Double_t y = 1 - 6.9*x*x;
     849           0 :     if(y < 0) y=0;
     850           0 :     return y;
     851             : }
     852             : 
     853             : Double_t AliGenMUONlib::YJpsiPP7000(const Double_t *px, const Double_t */*dummy*/)
     854             : {
     855             : // J/Psi y
     856             : // pp 7 TeV
     857             : //
     858           0 :   return YJpsiPPdummy(*px, 7000);
     859             : }
     860             : 
     861             : Double_t AliGenMUONlib::YJpsiPP8000(const Double_t *px, const Double_t */*dummy*/)
     862             : {
     863             : // J/Psi y
     864             : // pp 7 TeV
     865             : //
     866           0 :   return YJpsiPPdummy(*px, 8000);
     867             : }
     868             : 
     869             : Double_t AliGenMUONlib::YJpsiPP2760(const Double_t *px, const Double_t */*dummy*/)
     870             : {
     871             : // J/Psi y
     872             : // pp 2.76 TeV
     873             : //
     874           0 :   return YJpsiPPdummy(*px, 2760);
     875             : }
     876             : 
     877             : Double_t AliGenMUONlib::YJpsiPP4400(const Double_t *px, const Double_t */*dummy*/)
     878             : {
     879             : // J/Psi y
     880             : // pp 4.4 TeV
     881             : //
     882           0 :   return YJpsiPPdummy(*px, 4400);
     883             : }
     884             : 
     885             : Double_t AliGenMUONlib::YJpsiPP5030(const Double_t *px, const Double_t */*dummy*/)
     886             : {
     887             : // J/Psi y
     888             : // pp 5.03 TeV
     889             : //
     890           0 :   return YJpsiPPdummy(*px, 5030);
     891             : }
     892             : 
     893             : Double_t AliGenMUONlib::YJpsiPP8800(const Double_t *px, const Double_t */*dummy*/)
     894             : {
     895             : // J/Psi y
     896             : // pp 8.8 TeV
     897             : //
     898           0 :   return YJpsiPPdummy(*px, 8800);
     899             : }
     900             : 
     901             : Double_t AliGenMUONlib::YJpsiPPpoly7000(const Double_t *px, const Double_t */*dummy*/)
     902             : {
     903             : // J/Psi y
     904             : // pp 7 TeV
     905             : //
     906           0 :   return YJpsiPPpoly(*px, 7000);
     907             : }
     908             : 
     909             : Double_t AliGenMUONlib::YJpsiPPpoly2760(const Double_t *px, const Double_t */*dummy*/)
     910             : {
     911             : // J/Psi y
     912             : // pp 2.76 TeV
     913             : //
     914           0 :   return YJpsiPPpoly(*px, 2760);
     915             : }
     916             : 
     917             : Double_t AliGenMUONlib::YJpsiPbPb2760ShFdummy(Double_t x, Int_t n)
     918             : {
     919             : // J/Psi shadowing factor vs y for PbPb min. bias and 11 centr. bins
     920             : //
     921             : // PbPb 2.76 TeV, for EKS98, minimum bias shadowing factor = 0.66 in 4pi
     922             : //
     923             :   const Double_t f1[12] = {1, 1.128, 1.097, 1.037, 0.937, 0.821, 0.693, 0.558,
     924             :                            0.428, 0.317, 0.231, 0.156};
     925             :   const Double_t f2[12] = {1, 1.313, 1.202, 1.039, 0.814, 0.593, 0.391, 0.224,
     926             :                            0.106, 0.041, 0.013, 0.002};
     927             :   const Double_t c1[5] = {1.5591e+00, 7.5827e-03, 2.0676e-03,-1.1717e-04, 1.5237e-06}; 
     928             :   const Double_t c2[5] = {6.0861e-01, 4.8854e-03, 1.3685e-03,-7.9182e-05, 1.0475e-06}; 
     929             : 
     930           0 :   x = x*x;
     931             :   Double_t y1, y2;
     932             :   Int_t j;
     933             :   y1 = c1[j = 4]; y2 = c2[4];
     934           0 :   while (j > 0) {y1 = y1 * x + c1[--j]; y2 = y2 * x + c2[j];}
     935             :   
     936           0 :   y1 = 1 + (y1-2)*f1[n] + (y2+1-y1)*f2[n];
     937           0 :   if(y1<0) y1=0;
     938           0 :   return y1;
     939             : }
     940             : 
     941             : Double_t AliGenMUONlib::YJpsiPbPb2760(const Double_t *px, const Double_t *dummy)
     942             : {
     943             : // J/Psi y
     944             : // PbPb 2.76 TeV, minimum bias 0-100 %
     945             : //
     946           0 :   return YJpsiPbPb2760ShFdummy(*px, 0) * YJpsiPP2760(px, dummy);
     947             : }
     948             : 
     949             : Double_t AliGenMUONlib::YJpsiPbPb2760c1(const Double_t *px, const Double_t *dummy)
     950             : {
     951             : // J/Psi y
     952             : // PbPb 2.76 TeV, 1st centrality bin 0-5 %
     953             : //
     954           0 :   return YJpsiPbPb2760ShFdummy(*px, 1) * YJpsiPP2760(px, dummy);
     955             : }
     956             : 
     957             : Double_t AliGenMUONlib::YJpsiPbPb2760c2(const Double_t *px, const Double_t *dummy)
     958             : {
     959             : // J/Psi y
     960             : // PbPb 2.76 TeV, 2nd centrality bin 5-10 %
     961             : //
     962           0 :   return YJpsiPbPb2760ShFdummy(*px, 2) * YJpsiPP2760(px, dummy);
     963             : }
     964             : 
     965             : Double_t AliGenMUONlib::YJpsiPbPb2760c3(const Double_t *px, const Double_t *dummy)
     966             : {
     967             : // J/Psi y
     968             : // PbPb 2.76 TeV, 3rd centrality bin 10-20 %
     969             : //
     970           0 :   return YJpsiPbPb2760ShFdummy(*px, 3) * YJpsiPP2760(px, dummy);
     971             : }
     972             : 
     973             : Double_t AliGenMUONlib::YJpsiPbPb2760c4(const Double_t *px, const Double_t *dummy)
     974             : {
     975             : // J/Psi y
     976             : // PbPb 2.76 TeV, 4th centrality bin 20-30 %
     977             : //
     978           0 :   return YJpsiPbPb2760ShFdummy(*px, 4) * YJpsiPP2760(px, dummy);
     979             : }
     980             : 
     981             : Double_t AliGenMUONlib::YJpsiPbPb2760c5(const Double_t *px, const Double_t *dummy)
     982             : {
     983             : // J/Psi y
     984             : // PbPb 2.76 TeV, 5th centrality bin 30-40 %
     985             : //
     986           0 :   return YJpsiPbPb2760ShFdummy(*px, 5) * YJpsiPP2760(px, dummy);
     987             : }
     988             : 
     989             : Double_t AliGenMUONlib::YJpsiPbPb2760c6(const Double_t *px, const Double_t *dummy)
     990             : {
     991             : // J/Psi y
     992             : // PbPb 2.76 TeV, 6th centrality bin 40-50 %
     993             : //
     994           0 :   return YJpsiPbPb2760ShFdummy(*px, 6) * YJpsiPP2760(px, dummy);
     995             : }
     996             : 
     997             : Double_t AliGenMUONlib::YJpsiPbPb2760c7(const Double_t *px, const Double_t *dummy)
     998             : {
     999             : // J/Psi y
    1000             : // PbPb 2.76 TeV, 7th centrality bin 50-60 %
    1001             : //
    1002           0 :   return YJpsiPbPb2760ShFdummy(*px, 7) * YJpsiPP2760(px, dummy);
    1003             : }
    1004             : 
    1005             : Double_t AliGenMUONlib::YJpsiPbPb2760c8(const Double_t *px, const Double_t *dummy)
    1006             : {
    1007             : // J/Psi y
    1008             : // PbPb 2.76 TeV, 8th centrality bin 60-70 %
    1009             : //
    1010           0 :   return YJpsiPbPb2760ShFdummy(*px, 8) * YJpsiPP2760(px, dummy);
    1011             : }
    1012             : 
    1013             : Double_t AliGenMUONlib::YJpsiPbPb2760c9(const Double_t *px, const Double_t *dummy)
    1014             : {
    1015             : // J/Psi y
    1016             : // PbPb 2.76 TeV, 9th centrality bin 70-80 %
    1017             : //
    1018           0 :   return YJpsiPbPb2760ShFdummy(*px, 9) * YJpsiPP2760(px, dummy);
    1019             : }
    1020             : 
    1021             : Double_t AliGenMUONlib::YJpsiPbPb2760c10(const Double_t *px, const Double_t *dummy)
    1022             : {
    1023             : // J/Psi y
    1024             : // PbPb 2.76 TeV, 10th centrality bin 80-90 %
    1025             : //
    1026           0 :   return YJpsiPbPb2760ShFdummy(*px, 10) * YJpsiPP2760(px, dummy);
    1027             : }
    1028             : 
    1029             : Double_t AliGenMUONlib::YJpsiPbPb2760c11(const Double_t *px, const Double_t *dummy)
    1030             : {
    1031             : // J/Psi y
    1032             : // PbPb 2.76 TeV, 11th centrality bin 90-100 %
    1033             : //
    1034           0 :   return YJpsiPbPb2760ShFdummy(*px, 11) * YJpsiPP2760(px, dummy);
    1035             : }
    1036             : 
    1037             : Double_t AliGenMUONlib::YJpsiPP5030dummy(Double_t px)
    1038             : {
    1039           0 :   return AliGenMUONlib::YJpsiPP5030(&px, (Double_t*) 0);
    1040             : }
    1041             : 
    1042             : Double_t AliGenMUONlib::YJpsiPPb5030ShFdummy(Double_t x, Int_t n)
    1043             : {
    1044             : // J/Psi shadowing factor vs y for pPb min. bias and 4 centr. bins
    1045             : //
    1046             : // pPb 5.03 TeV, for EPS09-LO, minimum bias shadowing factor = 0.81 in 4pi
    1047             : //
    1048             :   const Double_t f[5] = {1, 1.33, 1.05, 0.67, 0.23};
    1049             :   const Double_t c[7] = {7.641e-01, 1.611e-02, 4.109e-03, 2.818e-03, 3.359e-04,-6.376e-05,-9.717e-06};
    1050             :   Double_t y;
    1051             :   Int_t j;
    1052             :   y = c[j = 6];
    1053           0 :   while (j > 0) y = y * x + c[--j];
    1054           0 :   if(y<0) y=0;
    1055             :   //
    1056           0 :   return 1 +(y-1)*f[n];
    1057             : }
    1058             : 
    1059             : Double_t AliGenMUONlib::YJpsiPPb5030(const Double_t *px, const Double_t */*dummy*/)
    1060             : {
    1061             : // J/Psi y
    1062             : // pPb 5.03 TeV, minimum bias 0-100 %
    1063             : //
    1064           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    1065           0 :   return YJpsiPPb5030ShFdummy(x, 0) * YJpsiPP5030dummy(x);
    1066             : }
    1067             : 
    1068             : Double_t AliGenMUONlib::YJpsiPPb5030c1(const Double_t *px, const Double_t */*dummy*/)
    1069             : {
    1070             : // J/Psi y
    1071             : // pPb 5.03 TeV, 1st centrality bin 0-20 %
    1072             : //
    1073           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    1074           0 :   return YJpsiPPb5030ShFdummy(x, 1) * YJpsiPP5030dummy(x);
    1075             : }
    1076             : 
    1077             : Double_t AliGenMUONlib::YJpsiPPb5030c2(const Double_t *px, const Double_t */*dummy*/)
    1078             : {
    1079             : // J/Psi y
    1080             : // pPb 5.03 TeV, 2nd centrality bin 20-40 %
    1081             : //
    1082           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    1083           0 :   return YJpsiPPb5030ShFdummy(x, 2) * YJpsiPP5030dummy(x);
    1084             : }
    1085             : 
    1086             : Double_t AliGenMUONlib::YJpsiPPb5030c3(const Double_t *px, const Double_t */*dummy*/)
    1087             : {
    1088             : // J/Psi y
    1089             : // pPb 5.03 TeV, 3rd centrality bin 40-60 %
    1090             : //
    1091           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    1092           0 :   return YJpsiPPb5030ShFdummy(x, 3) * YJpsiPP5030dummy(x);
    1093             : }
    1094             : 
    1095             : Double_t AliGenMUONlib::YJpsiPPb5030c4(const Double_t *px, const Double_t */*dummy*/)
    1096             : {
    1097             : // J/Psi y
    1098             : // pPb 5.03 TeV, 4th centrality bin 60-100 %
    1099             : //
    1100           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    1101           0 :   return YJpsiPPb5030ShFdummy(x, 4) * YJpsiPP5030dummy(x);
    1102             : }
    1103             : 
    1104             : Double_t AliGenMUONlib::YJpsiPbP5030(const Double_t *px, const Double_t */*dummy*/)
    1105             : {
    1106             : // J/Psi y
    1107             : // Pbp 5.03 TeV, minimum bias 0-100 %
    1108             : //
    1109           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    1110           0 :   return YJpsiPPb5030ShFdummy(x, 0) * YJpsiPP5030dummy(x);
    1111             : }
    1112             : 
    1113             : Double_t AliGenMUONlib::YJpsiPbP5030c1(const Double_t *px, const Double_t */*dummy*/)
    1114             : {
    1115             : // J/Psi y
    1116             : // Pbp 5.03 TeV, 1st centrality bin 0-20 %
    1117             : //
    1118           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    1119           0 :   return YJpsiPPb5030ShFdummy(x, 1) * YJpsiPP5030dummy(x);
    1120             : }
    1121             : 
    1122             : Double_t AliGenMUONlib::YJpsiPbP5030c2(const Double_t *px, const Double_t */*dummy*/)
    1123             : {
    1124             : // J/Psi y
    1125             : // Pbp 5.03 TeV, 2nd centrality bin 20-40 %
    1126             : //
    1127           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    1128           0 :   return YJpsiPPb5030ShFdummy(x, 2) * YJpsiPP5030dummy(x);
    1129             : }
    1130             : 
    1131             : Double_t AliGenMUONlib::YJpsiPbP5030c3(const Double_t *px, const Double_t */*dummy*/)
    1132             : {
    1133             : // J/Psi y
    1134             : // Pbp 5.03 TeV, 3rd centrality bin 40-60 %
    1135             : //
    1136           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    1137           0 :   return YJpsiPPb5030ShFdummy(x, 3) * YJpsiPP5030dummy(x);
    1138             : }
    1139             : 
    1140             : Double_t AliGenMUONlib::YJpsiPbP5030c4(const Double_t *px, const Double_t */*dummy*/)
    1141             : {
    1142             : // J/Psi y
    1143             : // Pbp 5.03 TeV, 4th centrality bin 60-100 %
    1144             : //
    1145           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    1146           0 :   return YJpsiPPb5030ShFdummy(x, 4) * YJpsiPP5030dummy(x);
    1147             : }
    1148             : 
    1149             : Double_t AliGenMUONlib::YJpsiPP8800dummy(Double_t px)
    1150             : {
    1151           0 :     return AliGenMUONlib::YJpsiPP8800(&px, (Double_t*) 0);
    1152             : }
    1153             : 
    1154             : Double_t AliGenMUONlib::YJpsiPPb8800ShFdummy(Double_t x, Int_t n)
    1155             : {
    1156             : // J/Psi shadowing factor vs y for pPb min. bias and 4 centr. bins
    1157             : //
    1158             : // pPb 8.8 TeV, for EKS98, minimum bias shadowing factor = 0.78 in 4pi
    1159             : //
    1160             :     const Double_t f[5] = {1, 1.33, 1.05, 0.67, 0.23};
    1161             :     const Double_t c[7] = {7.4372e-01, 2.3299e-02, 2.8678e-03, 1.9595e-03, 
    1162             :                            3.2849e-04,-4.0547e-05,-7.9732e-06}; 
    1163             :     Double_t y;
    1164             :     Int_t j;
    1165             :     y = c[j = 6];
    1166           0 :     while (j > 0) y = y * x + c[--j];
    1167           0 :     if(y<0) y=0;
    1168             :     //
    1169           0 :     return 1 +(y-1)*f[n];
    1170             : }
    1171             : 
    1172             : Double_t AliGenMUONlib::YJpsiPPb8800(const Double_t *px, const Double_t */*dummy*/)
    1173             : {
    1174             : // J/Psi y
    1175             : // pPb 8.8 TeV, minimum bias 0-100 %
    1176             : //
    1177           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    1178           0 :   return YJpsiPPb8800ShFdummy(x, 0) * YJpsiPP8800dummy(x);
    1179             : }
    1180             : 
    1181             : Double_t AliGenMUONlib::YJpsiPPb8800c1(const Double_t *px, const Double_t */*dummy*/)
    1182             : {
    1183             : // J/Psi y
    1184             : // pPb 8.8 TeV, 1st centrality bin 0-20 %
    1185             : //
    1186           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    1187           0 :   return YJpsiPPb8800ShFdummy(x, 1) * YJpsiPP8800dummy(x);
    1188             : }
    1189             : 
    1190             : Double_t AliGenMUONlib::YJpsiPPb8800c2(const Double_t *px, const Double_t */*dummy*/)
    1191             : {
    1192             : // J/Psi y
    1193             : // pPb 8.8 TeV, 2nd centrality bin 20-40 %
    1194             : //
    1195           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    1196           0 :   return YJpsiPPb8800ShFdummy(x, 2) * YJpsiPP8800dummy(x);
    1197             : }
    1198             : 
    1199             : Double_t AliGenMUONlib::YJpsiPPb8800c3(const Double_t *px, const Double_t */*dummy*/)
    1200             : {
    1201             : // J/Psi y
    1202             : // pPb 8.8 TeV, 3rd centrality bin 40-60 %
    1203             : //
    1204           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    1205           0 :   return YJpsiPPb8800ShFdummy(x, 3) * YJpsiPP8800dummy(x);
    1206             : }
    1207             : 
    1208             : Double_t AliGenMUONlib::YJpsiPPb8800c4(const Double_t *px, const Double_t */*dummy*/)
    1209             : {
    1210             : // J/Psi y
    1211             : // pPb 8.8 TeV, 4th centrality bin 60-100 %
    1212             : //
    1213           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    1214           0 :   return YJpsiPPb8800ShFdummy(x, 4) * YJpsiPP8800dummy(x);
    1215             : }
    1216             : 
    1217             : Double_t AliGenMUONlib::YJpsiPbP8800(const Double_t *px, const Double_t */*dummy*/)
    1218             : {
    1219             : // J/Psi y
    1220             : // Pbp 8.8 TeV, minimum bias 0-100 %
    1221             : //
    1222           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    1223           0 :   return YJpsiPPb8800ShFdummy(x, 0) * YJpsiPP8800dummy(x);
    1224             : }
    1225             : 
    1226             : Double_t AliGenMUONlib::YJpsiPbP8800c1(const Double_t *px, const Double_t */*dummy*/)
    1227             : {
    1228             : // J/Psi y
    1229             : // Pbp 8.8 TeV, 1st centrality bin 0-20 %
    1230             : //
    1231           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    1232           0 :   return YJpsiPPb8800ShFdummy(x, 1) * YJpsiPP8800dummy(x);
    1233             : }
    1234             : 
    1235             : Double_t AliGenMUONlib::YJpsiPbP8800c2(const Double_t *px, const Double_t */*dummy*/)
    1236             : {
    1237             : // J/Psi y
    1238             : // Pbp 8.8 TeV, 2nd centrality bin 20-40 %
    1239             : //
    1240           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    1241           0 :   return YJpsiPPb8800ShFdummy(x, 2) * YJpsiPP8800dummy(x);
    1242             : }
    1243             : 
    1244             : Double_t AliGenMUONlib::YJpsiPbP8800c3(const Double_t *px, const Double_t */*dummy*/)
    1245             : {
    1246             : // J/Psi y
    1247             : // Pbp 8.8 TeV, 3rd centrality bin 40-60 %
    1248             : //
    1249           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    1250           0 :   return YJpsiPPb8800ShFdummy(x, 3) * YJpsiPP8800dummy(x);
    1251             : }
    1252             : 
    1253             : Double_t AliGenMUONlib::YJpsiPbP8800c4(const Double_t *px, const Double_t */*dummy*/)
    1254             : {
    1255             : // J/Psi y
    1256             : // Pbp 8.8 TeV, 4th centrality bin 60-100 %
    1257             : //
    1258           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    1259           0 :   return YJpsiPPb8800ShFdummy(x, 4) * YJpsiPP8800dummy(x);
    1260             : }
    1261             : 
    1262             : Double_t AliGenMUONlib::YJpsi(const Double_t *py, const Double_t */*dummy*/)
    1263             : {
    1264             : // J/psi y
    1265             :   const Double_t ky0 = 4.;
    1266             :   const Double_t kb=1.;
    1267             :   Double_t yj;
    1268           0 :   Double_t y=TMath::Abs(*py);
    1269             :   //
    1270           0 :   if (y < ky0)
    1271           0 :     yj=kb;
    1272             :   else
    1273           0 :     yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
    1274           0 :   return yj;
    1275             : }
    1276             : 
    1277             : Double_t AliGenMUONlib::YJpsiFlat( const Double_t */*py*/, const Double_t */*dummy*/ )
    1278             : {
    1279           0 :   return 1.;
    1280             : }
    1281             : 
    1282             : 
    1283             : Double_t AliGenMUONlib::YJpsiPbPb( const Double_t *px, const Double_t */*dummy*/)
    1284             : {
    1285             : 
    1286             : //
    1287             : // J/Psi y
    1288             : //
    1289             : //
    1290             : // R. Vogt 2002
    1291             : // PbPb 5.5 TeV
    1292             : // MRST HO
    1293             : // mc = 1.4 GeV, pt-kick 1 GeV
    1294             : //
    1295           0 :     Double_t c[5] = {-6.03425e+02, 4.98257e+02, -1.38794e+02, 1.62209e+01, -6.85955e-01};
    1296           0 :     Double_t x = TMath::Abs(px[0]);
    1297             :     Double_t y;
    1298             :     
    1299           0 :     if (x < 4.) {
    1300             :         y = 31.754;
    1301           0 :     } else if (x < 6) {
    1302             :         Int_t j;
    1303           0 :         y = c[j = 4];
    1304           0 :         while (j > 0) y  = y * x + c[--j];
    1305           0 :     } else {
    1306             :         y =0.;
    1307             :     }
    1308             :     
    1309           0 :     return y;
    1310           0 : }
    1311             : 
    1312             : Double_t AliGenMUONlib::YJpsiCDFscaled( const Double_t *px, const Double_t* dummy)
    1313             : {
    1314             :     // J/Psi y 
    1315           0 :     return AliGenMUONlib::YJpsiPbPb(px, dummy);
    1316             : }
    1317             : 
    1318             : Double_t AliGenMUONlib::YJpsiCDFscaledPP( const Double_t *px, const Double_t* dummy)
    1319             : {
    1320             :     // J/Psi y 
    1321           0 :     return AliGenMUONlib::YJpsiPP(px, dummy);
    1322             : }
    1323             : 
    1324             : Double_t AliGenMUONlib::YJpsiCDFscaledPP10( const Double_t *px, const Double_t */*dummy*/)
    1325             : {
    1326             : // J/Psi y
    1327             : //
    1328             : // pp 10 TeV
    1329             : // scaled from YJpsiPP(14 TeV) using 10 TeV / 14 TeV ratio of y-spectra in LO pQCD. 
    1330             : // see S.Grigoryan, PWG3 Meeting, 27th Oct 2008
    1331             : //
    1332             : 
    1333           0 :     Double_t c[5] = {2.46681e+01, 8.91486e+01, -3.21227e+01, 3.63075e+00, -1.32047e-01};
    1334             : 
    1335           0 :     Double_t x = TMath::Abs(px[0]);
    1336             :     Double_t y;
    1337             : 
    1338           0 :     if (x < 3.2) {
    1339           0 :         y = 98.523 - 1.3664 * x * x;
    1340           0 :     } else if (x < 7.5) {
    1341             :         Int_t j;
    1342           0 :         y = c[j = 4];
    1343           0 :         while (j > 0) y  = y * x + c[--j];
    1344           0 :     } else {
    1345             :         y =0.;
    1346             :     }
    1347             : 
    1348           0 :     if(y<0) y=0;
    1349             : 
    1350           0 :     return y;
    1351           0 : }
    1352             : 
    1353             : Double_t AliGenMUONlib::YJpsiCDFscaledPP9( const Double_t *px, const Double_t */*dummy*/)
    1354             : {
    1355             : // J/Psi y
    1356             : //
    1357             : // pp 8.8 TeV
    1358             : // rescaling of YJpsiPP(14 TeV) using 8.8 TeV / 14 TeV ratio of y-spectra in LO QCD 
    1359             : //
    1360           0 :     Double_t c[5] = {3.33882e+02, -1.30980e+02, 2.59082e+01, -3.08935e+00, 1.56375e-01};
    1361           0 :     Double_t x = TMath::Abs(px[0]);
    1362             :     Double_t y;
    1363             : 
    1364           0 :     if (x < 3.7) {
    1365           0 :         y = 99.236 - 1.5498 * x * x;
    1366           0 :     } else if (x < 7.4) {
    1367             :         Int_t j;
    1368           0 :         y = c[j = 4];
    1369           0 :         while (j > 0) y  = y * x + c[--j];
    1370           0 :     } else {
    1371             :         y =0.;
    1372             :     }
    1373             : 
    1374           0 :     if(y<0) y=0;
    1375             : 
    1376           0 :     return y;
    1377           0 : }
    1378             : 
    1379             : Double_t AliGenMUONlib::YJpsiCDFscaledPP9dummy(Double_t px)
    1380             : {
    1381           0 :     return AliGenMUONlib::YJpsiCDFscaledPP9(&px, (Double_t*) 0);
    1382             : }
    1383             : 
    1384             : Double_t AliGenMUONlib::YJpsiCDFscaledPP7( const Double_t *px, const Double_t */*dummy*/)
    1385             : {
    1386             : // J/Psi y
    1387             : //
    1388             : // pp 7 TeV
    1389             : // scaled from YJpsiPP(14 TeV) using 7 TeV / 14 TeV ratio of y-spectra in LO pQCD. 
    1390             : //
    1391             : 
    1392           0 :     Double_t c[5] = {6.71181e+02, -3.69240e+02, 8.89644e+01, -1.04937e+01, 4.80959e-01};
    1393             : 
    1394           0 :     Double_t x = TMath::Abs(px[0]);
    1395             :     Double_t y;
    1396             : 
    1397           0 :     if (x < 4.0) {
    1398           0 :         y = 100.78 - 1.8353 * x * x;
    1399           0 :     } else if (x < 7.3) {
    1400             :         Int_t j;
    1401           0 :         y = c[j = 4];
    1402           0 :         while (j > 0) y  = y * x + c[--j];
    1403           0 :     } else {
    1404             :         y =0.;
    1405             :     }
    1406             : 
    1407           0 :     if(y<0) y=0;
    1408             : 
    1409           0 :     return y;
    1410           0 : }
    1411             : 
    1412             : Double_t AliGenMUONlib::YJpsiCDFscaledPP4( const Double_t *px, const Double_t */*dummy*/)
    1413             : {
    1414             : // J/Psi y
    1415             : //
    1416             : // pp 3.94 TeV
    1417             : // rescaling of YJpsiPP(14 TeV) using 3.94 TeV / 14 TeV ratio of y-spectra in LO QCD 
    1418             : //
    1419           0 :     Double_t c[5] = {4.00785e+02, -1.41159e+01, -3.28599e+01, 5.53048e+00, -2.45151e-01};
    1420           0 :     Double_t x = TMath::Abs(px[0]);
    1421             :     Double_t y;
    1422             : 
    1423           0 :     if (x < 5.5) {
    1424           0 :         y = 107.389 - 2.7454 * x * x;
    1425           0 :     } else if (x < 7.0) {
    1426             :         Int_t j;
    1427           0 :         y = c[j = 4];
    1428           0 :         while (j > 0) y  = y * x + c[--j];
    1429           0 :     } else {
    1430             :         y =0.;
    1431             :     }
    1432             : 
    1433           0 :     if(y<0) y=0;
    1434             : 
    1435           0 :     return y;
    1436           0 : }
    1437             : 
    1438             : Double_t AliGenMUONlib::YJpsiCDFscaledPP3( const Double_t *px, const Double_t *dummy)
    1439             : {
    1440             : // J/Psi y 
    1441           0 :     return AliGenMUONlib::YJpsiPP2760(px, dummy);
    1442             : }
    1443             : 
    1444             : Double_t AliGenMUONlib::YJpsiCDFscaledPP2( const Double_t *px, const Double_t */*dummy*/)
    1445             : {
    1446             : // J/Psi y
    1447             : // pp 1.96 TeV
    1448             : //
    1449           0 :   return YJpsiPPdummy(*px, 1960);
    1450             : }
    1451             : 
    1452             : Double_t AliGenMUONlib::YJpsiPP( const Double_t *px, const Double_t */*dummy*/)
    1453             : {
    1454             : 
    1455             : //
    1456             : // J/Psi y
    1457             : //
    1458             : //
    1459             : // R. Vogt 2002
    1460             : // pp 14  TeV
    1461             : // MRST HO
    1462             : // mc = 1.4 GeV, pt-kick 1 GeV
    1463             : //
    1464             : 
    1465           0 :     Double_t c[5] = {1.38532e+00, 1.00596e+02, -3.46378e+01, 3.94172e+00, -1.48319e-01};
    1466           0 :     Double_t x = TMath::Abs(px[0]);
    1467             :     Double_t y;
    1468             :     
    1469           0 :     if (x < 2.5) {
    1470           0 :         y = 96.455 - 0.8483 * x * x;
    1471           0 :     } else if (x < 7.9) {
    1472             :         Int_t j;
    1473           0 :         y = c[j = 4];
    1474           0 :         while (j > 0) y  = y * x + c[--j];
    1475           0 :     } else {
    1476             :         y =0.;
    1477             :     }
    1478             :     
    1479           0 :     return y;
    1480           0 : }
    1481             : 
    1482             : Double_t AliGenMUONlib::YJpsiCDFscaledPPb9( const Double_t *px, const Double_t */*dummy*/)
    1483             : {
    1484             : // J/Psi y
    1485             : //
    1486             : // pPb 8.8 TeV, for EKS98 with minimum bias shadowing factor 0.79
    1487             : //
    1488           0 :     Double_t c[7] = {7.52296e-01, 2.49917e-02, 3.36500e-03, 1.91187e-03, 2.92154e-04,
    1489             :                      -4.16509e-05,-7.62709e-06}; 
    1490             :     Double_t y;
    1491           0 :     Double_t x = px[0] + 0.47;              // rapidity shift
    1492             :     Int_t j;
    1493           0 :     y = c[j = 6];
    1494           0 :     while (j > 0) y = y * x + c[--j];
    1495           0 :     if(y<0) y=0;
    1496             : 
    1497           0 :     return y * AliGenMUONlib::YJpsiCDFscaledPP9dummy(x);
    1498           0 : }
    1499             : 
    1500             : Double_t AliGenMUONlib::YJpsiCDFscaledPbP9( const Double_t *px, const Double_t */*dummy*/)
    1501             : {
    1502             : // J/Psi y
    1503             : //
    1504             : // Pbp 8.8 TeV, for EKS98 with minimum bias shadowing factor 0.79
    1505             : //
    1506           0 :     Double_t c[7] = {7.52296e-01, 2.49917e-02, 3.36500e-03, 1.91187e-03, 2.92154e-04,
    1507             :                      -4.16509e-05,-7.62709e-06}; 
    1508             :     Double_t y;
    1509           0 :     Double_t x = -px[0] + 0.47;              // rapidity shift
    1510             :     Int_t j;
    1511           0 :     y = c[j = 6];
    1512           0 :     while (j > 0) y = y * x + c[--j];
    1513           0 :     if(y<0) y=0;
    1514             : 
    1515           0 :     return y * AliGenMUONlib::YJpsiCDFscaledPP9dummy(x);
    1516           0 : }
    1517             : 
    1518             : Double_t AliGenMUONlib::YJpsiCDFscaledPbPb4( const Double_t *px, const Double_t *dummy)
    1519             : {
    1520             : // J/Psi y
    1521             : //
    1522             : // PbPb 3.94 TeV, for EKS98 with minimum bias shadowing factor 0.66
    1523             : //
    1524           0 :     Double_t c[4] = {5.95228e-01, 9.45069e-03, 2.44710e-04, -1.32894e-05}; 
    1525           0 :     Double_t x = px[0]*px[0];
    1526             :     Double_t y;
    1527             :     Int_t j;
    1528           0 :     y = c[j = 3];
    1529           0 :     while (j > 0) y  = y * x + c[--j];
    1530           0 :     if(y<0) y=0;
    1531             : 
    1532           0 :     return y * AliGenMUONlib::YJpsiCDFscaledPP4(px,dummy);
    1533           0 : }
    1534             : 
    1535             : Double_t AliGenMUONlib::YJpsiBPbPb( const Double_t *px, const Double_t */*dummy*/)
    1536             : {
    1537             : 
    1538             : //
    1539             : // J/Psi from B->J/Psi X
    1540             : //
    1541             : //
    1542             :     
    1543             : 
    1544           0 :     Double_t c[7] = {7.37025e-02, 0., -2.94487e-03, 0., 6.07953e-06, 0., 5.39219e-07};
    1545             :     
    1546           0 :     Double_t x = TMath::Abs(px[0]);
    1547             :     Double_t y;
    1548             :     
    1549           0 :     if (x > 6.) {
    1550             :         y = 0.;
    1551           0 :     } else {
    1552             :         Int_t j;
    1553           0 :         y = c[j = 6];
    1554           0 :         while (j > 0) y  = y * x + c[--j];
    1555             :     } 
    1556             :     
    1557           0 :     return y;
    1558           0 : }
    1559             : 
    1560             : 
    1561             : 
    1562             : //                 particle composition
    1563             : //
    1564             : Int_t AliGenMUONlib::IpJpsi(TRandom *)
    1565             : {
    1566             : // J/Psi composition
    1567           0 :     return 443;
    1568             : }
    1569             : Int_t AliGenMUONlib::IpPsiP(TRandom *)
    1570             : {
    1571             : // Psi prime composition
    1572           0 :     return 100443;
    1573             : }
    1574             : Int_t AliGenMUONlib::IpJpsiFamily(TRandom *)
    1575             : {
    1576             : // J/Psi composition
    1577             :   Int_t ip;
    1578           0 :   Float_t r = gRandom->Rndm();
    1579           0 :   if (r < 0.98) {
    1580             :     ip = 443;
    1581           0 :   } else {
    1582             :     ip = 100443;
    1583             :   }
    1584           0 :   return ip;
    1585             : }
    1586             : 
    1587             : 
    1588             : 
    1589             : //                      Upsilon
    1590             : //
    1591             : //
    1592             : //                  pt-distribution
    1593             : //____________________________________________________________
    1594             : Double_t AliGenMUONlib::PtUpsilonPPdummy(Double_t x, Double_t energy)
    1595             : {
    1596             : // Upsilon pT
    1597             : // pp
    1598             : // from the fit of CDF & LHC data, like for J/Psi in arXiv:1103.2394
    1599             : //
    1600           0 :   const Double_t kpt0 = 1.96*TMath::Power(energy,0.095);
    1601             :   const Double_t kxn  = 3.4;
    1602             :   //
    1603           0 :   Double_t pass1 = 1.+0.471*(x/kpt0)*(x/kpt0);
    1604           0 :   return x/TMath::Power(pass1,kxn);
    1605             : }
    1606             : 
    1607             : Double_t AliGenMUONlib::PtUpsilonPP7000(const Double_t *px, const Double_t */*dummy*/)
    1608             : {
    1609             : // Upsilon pT
    1610             : // pp 7 TeV
    1611             : //
    1612           0 :   return PtUpsilonPPdummy(*px,7000);
    1613             : }
    1614             : 
    1615             : Double_t AliGenMUONlib::PtUpsilonPP8000(const Double_t *px, const Double_t */*dummy*/)
    1616             : {
    1617             : // Upsilon pT
    1618             : // pp 8 TeV
    1619             : //
    1620           0 :   return PtUpsilonPPdummy(*px,8000);
    1621             : }
    1622             : 
    1623             : Double_t AliGenMUONlib::PtUpsilonPP2760(const Double_t *px, const Double_t */*dummy*/)
    1624             : {
    1625             : // Upsilon pT
    1626             : // pp 2.76 TeV
    1627             : //
    1628           0 :   return PtUpsilonPPdummy(*px,2760);
    1629             : }
    1630             : 
    1631             : Double_t AliGenMUONlib::PtUpsilonPP4400(const Double_t *px, const Double_t */*dummy*/)
    1632             : {
    1633             : // Upsilon pT
    1634             : // pp 4.4 TeV
    1635             : //
    1636           0 :   return PtUpsilonPPdummy(*px,4400);
    1637             : }
    1638             : 
    1639             : Double_t AliGenMUONlib::PtUpsilonPP5030(const Double_t *px, const Double_t */*dummy*/)
    1640             : {
    1641             : // Upsilon pT
    1642             : // pp 5.03 TeV
    1643             : //
    1644           0 :   return PtUpsilonPPdummy(*px,5030);
    1645             : }
    1646             : 
    1647             : Double_t AliGenMUONlib::PtUpsilonPP8800(const Double_t *px, const Double_t */*dummy*/)
    1648             : {
    1649             : // Upsilon pT
    1650             : // pp 8.8 TeV
    1651             : //
    1652           0 :   return PtUpsilonPPdummy(*px,8800);
    1653             : }
    1654             : 
    1655             : Double_t AliGenMUONlib::PtUpsilonPbPb2760ShFdummy(Double_t x, Int_t n)
    1656             : {
    1657             : // Usilon shadowing factor vs pT for PbPb min. bias and 11 centr. bins (in 2.5<y<4)
    1658             : //
    1659             : // PbPb 2.76 TeV, for EKS98, minimum bias shadowing factor = 0.87 in 4pi
    1660             : //
    1661             :   const Double_t f1[12] = {1, 1.128, 1.097, 1.037, 0.937, 0.821, 0.693, 0.558,
    1662             :                            0.428, 0.317, 0.231, 0.156};
    1663             :   const Double_t f2[12] = {1, 1.313, 1.202, 1.039, 0.814, 0.593, 0.391, 0.224,
    1664             :                            0.106, 0.041, 0.013, 0.002};
    1665             :   const Double_t c1[7] = {1.9089e+00, 1.2969e-03, 8.9786e-05,-5.3062e-06,
    1666             :                           -1.0046e-06,6.1446e-08, 1.0885e-09};
    1667             :   const Double_t c2[7] = {8.8423e-01,-8.7488e-05, 5.9857e-04,-5.7959e-05, 
    1668             :                           2.0059e-06,-2.7343e-08, 6.6053e-10};
    1669             :   Double_t y1, y2;
    1670             :   Int_t j;
    1671             :   y1 = c1[j = 6]; y2 = c2[6];
    1672           0 :   while (j > 0) {y1 = y1 * x + c1[--j]; y2 = y2 * x + c2[j];}
    1673             :   
    1674           0 :   y1 /= 1.+c1[6]*TMath::Power(x,6);
    1675           0 :   y2 /= 1.+c2[6]*TMath::Power(x,6);
    1676             :   //  
    1677           0 :   y1 = 1 + (y1-2)*f1[n] + (y2+1-y1)*f2[n];
    1678           0 :   if(y1<0) y1=0;
    1679           0 :   return y1;
    1680             : }
    1681             : 
    1682             : Double_t AliGenMUONlib::PtUpsilonPbPb2760(const Double_t *px, const Double_t *dummy)
    1683             : {
    1684             : // Upsilon pT
    1685             : // PbPb 2.76 TeV, minimum bias 0-100 %
    1686             : //
    1687           0 :   return PtUpsilonPbPb2760ShFdummy(*px, 0) * PtUpsilonPP2760(px, dummy);
    1688             : }
    1689             : 
    1690             : Double_t AliGenMUONlib::PtUpsilonPbPb2760c1(const Double_t *px, const Double_t *dummy)
    1691             : {
    1692             : // Upsilon pT
    1693             : // PbPb 2.76 TeV, 1st centrality bin 0-5 %
    1694             : //
    1695           0 :   return PtUpsilonPbPb2760ShFdummy(*px, 1) * PtUpsilonPP2760(px, dummy);
    1696             : }
    1697             : 
    1698             : Double_t AliGenMUONlib::PtUpsilonPbPb2760c2(const Double_t *px, const Double_t *dummy)
    1699             : {
    1700             : // Upsilon pT
    1701             : // PbPb 2.76 TeV, 2nd centrality bin 5-10 %
    1702             : //
    1703           0 :   return PtUpsilonPbPb2760ShFdummy(*px, 2) * PtUpsilonPP2760(px, dummy);
    1704             : }
    1705             : 
    1706             : Double_t AliGenMUONlib::PtUpsilonPbPb2760c3(const Double_t *px, const Double_t *dummy)
    1707             : {
    1708             : // Upsilon pT
    1709             : // PbPb 2.76 TeV, 3rd centrality bin 10-20 %
    1710             : //
    1711           0 :   return PtUpsilonPbPb2760ShFdummy(*px, 3) * PtUpsilonPP2760(px, dummy);
    1712             : }
    1713             : 
    1714             : Double_t AliGenMUONlib::PtUpsilonPbPb2760c4(const Double_t *px, const Double_t *dummy)
    1715             : {
    1716             : // Upsilon pT
    1717             : // PbPb 2.76 TeV, 4th centrality bin 20-30 %
    1718             : //
    1719           0 :   return PtUpsilonPbPb2760ShFdummy(*px, 4) * PtUpsilonPP2760(px, dummy);
    1720             : }
    1721             : 
    1722             : Double_t AliGenMUONlib::PtUpsilonPbPb2760c5(const Double_t *px, const Double_t *dummy)
    1723             : {
    1724             : // Upsilon pT
    1725             : // PbPb 2.76 TeV, 5th centrality bin 30-40 %
    1726             : //
    1727           0 :   return PtUpsilonPbPb2760ShFdummy(*px, 5) * PtUpsilonPP2760(px, dummy);
    1728             : }
    1729             : 
    1730             : Double_t AliGenMUONlib::PtUpsilonPbPb2760c6(const Double_t *px, const Double_t *dummy)
    1731             : {
    1732             : // Upsilon pT
    1733             : // PbPb 2.76 TeV, 6th centrality bin 40-50 %
    1734             : //
    1735           0 :   return PtUpsilonPbPb2760ShFdummy(*px, 6) * PtUpsilonPP2760(px, dummy);
    1736             : }
    1737             : 
    1738             : Double_t AliGenMUONlib::PtUpsilonPbPb2760c7(const Double_t *px, const Double_t *dummy)
    1739             : {
    1740             : // Upsilon pT
    1741             : // PbPb 2.76 TeV, 7th centrality bin 50-60 %
    1742             : //
    1743           0 :   return PtUpsilonPbPb2760ShFdummy(*px, 7) * PtUpsilonPP2760(px, dummy);
    1744             : }
    1745             : 
    1746             : Double_t AliGenMUONlib::PtUpsilonPbPb2760c8(const Double_t *px, const Double_t *dummy)
    1747             : {
    1748             : // Upsilon pT
    1749             : // PbPb 2.76 TeV, 8th centrality bin 60-70 %
    1750             : //
    1751           0 :   return PtUpsilonPbPb2760ShFdummy(*px, 8) * PtUpsilonPP2760(px, dummy);
    1752             : }
    1753             : 
    1754             : Double_t AliGenMUONlib::PtUpsilonPbPb2760c9(const Double_t *px, const Double_t *dummy)
    1755             : {
    1756             : // Upsilon pT
    1757             : // PbPb 2.76 TeV, 9th centrality bin 70-80 %
    1758             : //
    1759           0 :   return PtUpsilonPbPb2760ShFdummy(*px, 9) * PtUpsilonPP2760(px, dummy);
    1760             : }
    1761             : 
    1762             : Double_t AliGenMUONlib::PtUpsilonPbPb2760c10(const Double_t *px, const Double_t *dummy)
    1763             : {
    1764             : // Upsilon pT
    1765             : // PbPb 2.76 TeV, 10th centrality bin 80-90 %
    1766             : //
    1767           0 :   return PtUpsilonPbPb2760ShFdummy(*px, 10) * PtUpsilonPP2760(px, dummy);
    1768             : }
    1769             : 
    1770             : Double_t AliGenMUONlib::PtUpsilonPbPb2760c11(const Double_t *px, const Double_t *dummy)
    1771             : {
    1772             : // Upsilon pT
    1773             : // PbPb 2.76 TeV, 11th centrality bin 90-100 %
    1774             : //
    1775           0 :   return PtUpsilonPbPb2760ShFdummy(*px, 11) * PtUpsilonPP2760(px, dummy);
    1776             : }
    1777             : 
    1778             : Double_t AliGenMUONlib::PtUpsilonPPb5030ShFdummy(Double_t x, Int_t n)
    1779             : {
    1780             : // Upsilon shadowing factor vs pT for pPb min. bias and 4 centr. bins (in 2.5<y<4)
    1781             : //
    1782             : // pPb 5.03 TeV, for EPS09-LO, minimum bias shadowing factor = 0.92 in 4pi
    1783             : //
    1784             :   const Double_t f[5] = {1, 1.33, 1.05, 0.67, 0.23};
    1785             :   const Double_t c[5] = {8.069e-01, 1.407e-04, 4.372e-04,-2.797e-05, 4.405e-06};
    1786             :   Double_t y;
    1787             :   Int_t j;
    1788             :   y = c[j = 4];
    1789           0 :   while (j > 0) y  = y * x + c[--j];
    1790           0 :   y /= 1 + c[4]*TMath::Power(x,4);
    1791             :   //  
    1792           0 :   return 1 + (y-1)*f[n];
    1793             : }
    1794             : 
    1795             : Double_t AliGenMUONlib::PtUpsilonPPb5030(const Double_t *px, const Double_t *dummy)
    1796             : {
    1797             : // Upsilon pT
    1798             : // pPb 5.03 TeV, minimum bias 0-100 %
    1799             : //
    1800           0 :   return PtUpsilonPPb5030ShFdummy(*px, 0) * PtUpsilonPP5030(px, dummy);
    1801             : }
    1802             : 
    1803             : Double_t AliGenMUONlib::PtUpsilonPPb5030c1(const Double_t *px, const Double_t *dummy)
    1804             : {
    1805             : // Upsilon pT
    1806             : // pPb 5.03 TeV, 1st centrality bin 0-20 %
    1807             : //
    1808           0 :   return PtUpsilonPPb5030ShFdummy(*px, 1) * PtUpsilonPP5030(px, dummy);
    1809             : }
    1810             : 
    1811             : Double_t AliGenMUONlib::PtUpsilonPPb5030c2(const Double_t *px, const Double_t *dummy)
    1812             : {
    1813             : // Upsilon pT
    1814             : // pPb 5.03 TeV, 2nd centrality bin 20-40 %
    1815             : //
    1816           0 :   return PtUpsilonPPb5030ShFdummy(*px, 2) * PtUpsilonPP5030(px, dummy);
    1817             : }
    1818             : 
    1819             : Double_t AliGenMUONlib::PtUpsilonPPb5030c3(const Double_t *px, const Double_t *dummy)
    1820             : {
    1821             : // Upsilon pT
    1822             : // pPb 5.03 TeV, 3rd centrality bin 40-60 %
    1823             : //
    1824           0 :   return PtUpsilonPPb5030ShFdummy(*px, 3) * PtUpsilonPP5030(px, dummy);
    1825             : }
    1826             : 
    1827             : Double_t AliGenMUONlib::PtUpsilonPPb5030c4(const Double_t *px, const Double_t *dummy)
    1828             : {
    1829             : // Upsilon pT
    1830             : // pPb 5.03 TeV, 4th centrality bin 60-100 %
    1831             : //
    1832           0 :   return PtUpsilonPPb5030ShFdummy(*px, 4) * PtUpsilonPP5030(px, dummy);
    1833             : }
    1834             : 
    1835             : Double_t AliGenMUONlib::PtUpsilonPbP5030ShFdummy(Double_t x, Int_t n)
    1836             : {
    1837             : // Upsilon shadowing factor vs pT for Pbp min. bias and 4 centr. bins (in 2.5<y<4)
    1838             : //
    1839             : // Pbp 5.03 TeV, for EPS09-LO, minimum bias shadowing factor = 0.92 in 4pi
    1840             : //
    1841             :   const Double_t f[5] = {1, 1.33, 1.05, 0.67, 0.23};
    1842             :   const Double_t c[5] = {1.122, 2.565e-03,-3.025e-04, 4.113e-06, 6.140e-07};
    1843             :   Double_t y;
    1844             :   Int_t j;
    1845             :   y = c[j = 4];
    1846           0 :   while (j > 0) y  = y * x + c[--j];
    1847           0 :   y /= 1 + c[4]*TMath::Power(x,4);
    1848             :   //  
    1849           0 :   return 1 + (y-1)*f[n];
    1850             : }
    1851             : 
    1852             : Double_t AliGenMUONlib::PtUpsilonPbP5030(const Double_t *px, const Double_t *dummy)
    1853             : {
    1854             : // Upsilon pT
    1855             : // Pbp 5.03 TeV, minimum bias 0-100 %
    1856             : //
    1857           0 :   return PtUpsilonPbP5030ShFdummy(*px, 0) * PtUpsilonPP5030(px, dummy);
    1858             : }
    1859             : 
    1860             : Double_t AliGenMUONlib::PtUpsilonPbP5030c1(const Double_t *px, const Double_t *dummy)
    1861             : {
    1862             : // Upsilon pT
    1863             : // Pbp 5.03 TeV, 1st centrality bin 0-20 %
    1864             : //
    1865           0 :   return PtUpsilonPbP5030ShFdummy(*px, 1) * PtUpsilonPP5030(px, dummy);
    1866             : }
    1867             : 
    1868             : Double_t AliGenMUONlib::PtUpsilonPbP5030c2(const Double_t *px, const Double_t *dummy)
    1869             : {
    1870             : // Upsilon pT
    1871             : // Pbp 5.03 TeV, 2nd centrality bin 20-40 %
    1872             : //
    1873           0 :   return PtUpsilonPbP5030ShFdummy(*px, 2) * PtUpsilonPP5030(px, dummy);
    1874             : }
    1875             : 
    1876             : Double_t AliGenMUONlib::PtUpsilonPbP5030c3(const Double_t *px, const Double_t *dummy)
    1877             : {
    1878             : // Upsilon pT
    1879             : // Pbp 5.03 TeV, 3rd centrality bin 40-60 %
    1880             : //
    1881           0 :   return PtUpsilonPbP5030ShFdummy(*px, 3) * PtUpsilonPP5030(px, dummy);
    1882             : }
    1883             : 
    1884             : Double_t AliGenMUONlib::PtUpsilonPbP5030c4(const Double_t *px, const Double_t *dummy)
    1885             : {
    1886             : // Upsilon pT
    1887             : // Pbp 5.03 TeV, 4th centrality bin 60-100 %
    1888             : //
    1889           0 :   return PtUpsilonPbP5030ShFdummy(*px, 4) * PtUpsilonPP5030(px, dummy);
    1890             : }
    1891             : 
    1892             : Double_t AliGenMUONlib::PtUpsilonPPb8800ShFdummy(Double_t x, Int_t n)
    1893             : {
    1894             : // Upsilon shadowing factor vs pT for pPb min. bias and 4 centr. bins (in 2.5<y<4)
    1895             : //
    1896             : // pPb 8.8 TeV, for EKS98, minimum bias shadowing factor = 0.89 in 4pi
    1897             : //
    1898             :   const Double_t f[5] = {1, 1.33, 1.05, 0.67, 0.23};
    1899             :   const Double_t c[5] = {7.6561e-01, 1.1360e-04, 4.9596e-04,-3.0287e-05, 3.7555e-06};
    1900             :   Double_t y;
    1901             :   Int_t j;
    1902             :   y = c[j = 4];
    1903           0 :   while (j > 0) y  = y * x + c[--j];
    1904           0 :   y /= 1 + c[4]*TMath::Power(x,4);
    1905             :   //  
    1906           0 :   return 1 + (y-1)*f[n];
    1907             : }
    1908             : 
    1909             : Double_t AliGenMUONlib::PtUpsilonPPb8800(const Double_t *px, const Double_t *dummy)
    1910             : {
    1911             : // Upsilon pT
    1912             : // pPb 8.8 TeV, minimum bias 0-100 %
    1913             : //
    1914           0 :   return PtUpsilonPPb8800ShFdummy(*px, 0) * PtUpsilonPP8800(px, dummy);
    1915             : }
    1916             : 
    1917             : Double_t AliGenMUONlib::PtUpsilonPPb8800c1(const Double_t *px, const Double_t *dummy)
    1918             : {
    1919             : // Upsilon pT
    1920             : // pPb 8.8 TeV, 1st centrality bin 0-20 %
    1921             : //
    1922           0 :   return PtUpsilonPPb8800ShFdummy(*px, 1) * PtUpsilonPP8800(px, dummy);
    1923             : }
    1924             : 
    1925             : Double_t AliGenMUONlib::PtUpsilonPPb8800c2(const Double_t *px, const Double_t *dummy)
    1926             : {
    1927             : // Upsilon pT
    1928             : // pPb 8.8 TeV, 2nd centrality bin 20-40 %
    1929             : //
    1930           0 :   return PtUpsilonPPb8800ShFdummy(*px, 2) * PtUpsilonPP8800(px, dummy);
    1931             : }
    1932             : 
    1933             : Double_t AliGenMUONlib::PtUpsilonPPb8800c3(const Double_t *px, const Double_t *dummy)
    1934             : {
    1935             : // Upsilon pT
    1936             : // pPb 8.8 TeV, 3rd centrality bin 40-60 %
    1937             : //
    1938           0 :   return PtUpsilonPPb8800ShFdummy(*px, 3) * PtUpsilonPP8800(px, dummy);
    1939             : }
    1940             : 
    1941             : Double_t AliGenMUONlib::PtUpsilonPPb8800c4(const Double_t *px, const Double_t *dummy)
    1942             : {
    1943             : // Upsilon pT
    1944             : // pPb 8.8 TeV, 4th centrality bin 60-100 %
    1945             : //
    1946           0 :   return PtUpsilonPPb8800ShFdummy(*px, 4) * PtUpsilonPP8800(px, dummy);
    1947             : }
    1948             : 
    1949             : Double_t AliGenMUONlib::PtUpsilonPbP8800ShFdummy(Double_t x, Int_t n)
    1950             : {
    1951             : // Upsilon shadowing factor vs pT for Pbp min. bias and 4 centr. bins (in 2.5<y<4)
    1952             : //
    1953             : // Pbp 8.8 TeV, for EKS98, minimum bias shadowing factor = 0.89 in 4pi
    1954             : //
    1955             :   const Double_t f[5] = {1, 1.33, 1.05, 0.67, 0.23};
    1956             :   const Double_t c[5] = {1.0975, 3.1905e-03,-2.0477e-04, 8.5270e-06, 2.5343e-06};
    1957             :   Double_t y;
    1958             :   Int_t j;
    1959             :   y = c[j = 4];
    1960           0 :   while (j > 0) y  = y * x + c[--j];
    1961           0 :   y /= 1 + c[4]*TMath::Power(x,4);
    1962             :   //  
    1963           0 :   return 1 + (y-1)*f[n];
    1964             : }
    1965             : 
    1966             : Double_t AliGenMUONlib::PtUpsilonPbP8800(const Double_t *px, const Double_t *dummy)
    1967             : {
    1968             : // Upsilon pT
    1969             : // Pbp 8.8 TeV, minimum bias 0-100 %
    1970             : //
    1971           0 :   return PtUpsilonPbP8800ShFdummy(*px, 0) * PtUpsilonPP8800(px, dummy);
    1972             : }
    1973             : 
    1974             : Double_t AliGenMUONlib::PtUpsilonPbP8800c1(const Double_t *px, const Double_t *dummy)
    1975             : {
    1976             : // Upsilon pT
    1977             : // Pbp 8.8 TeV, 1st centrality bin 0-20 %
    1978             : //
    1979           0 :   return PtUpsilonPbP8800ShFdummy(*px, 1) * PtUpsilonPP8800(px, dummy);
    1980             : }
    1981             : 
    1982             : Double_t AliGenMUONlib::PtUpsilonPbP8800c2(const Double_t *px, const Double_t *dummy)
    1983             : {
    1984             : // Upsilon pT
    1985             : // Pbp 8.8 TeV, 2nd centrality bin 20-40 %
    1986             : //
    1987           0 :   return PtUpsilonPbP8800ShFdummy(*px, 2) * PtUpsilonPP8800(px, dummy);
    1988             : }
    1989             : 
    1990             : Double_t AliGenMUONlib::PtUpsilonPbP8800c3(const Double_t *px, const Double_t *dummy)
    1991             : {
    1992             : // Upsilon pT
    1993             : // Pbp 8.8 TeV, 3rd centrality bin 40-60 %
    1994             : //
    1995           0 :   return PtUpsilonPbP8800ShFdummy(*px, 3) * PtUpsilonPP8800(px, dummy);
    1996             : }
    1997             : 
    1998             : Double_t AliGenMUONlib::PtUpsilonPbP8800c4(const Double_t *px, const Double_t *dummy)
    1999             : {
    2000             : // Upsilon pT
    2001             : // Pbp 8.8 TeV, 4th centrality bin 60-100 %
    2002             : //
    2003           0 :   return PtUpsilonPbP8800ShFdummy(*px, 4) * PtUpsilonPP8800(px, dummy);
    2004             : }
    2005             : 
    2006             : Double_t AliGenMUONlib::PtUpsilon( const Double_t *px, const Double_t */*dummy*/ )
    2007             : {
    2008             : // Upsilon pT
    2009             :   const Double_t kpt0 = 5.3;
    2010             :   const Double_t kxn  = 2.5;
    2011           0 :   Double_t x=*px;
    2012             :   //
    2013           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    2014           0 :   return x/TMath::Power(pass1,kxn);
    2015             : }
    2016             : 
    2017             : Double_t AliGenMUONlib::PtUpsilonCDFscaled( const Double_t *px, const Double_t */*dummy*/ )
    2018             : {
    2019             : // Upsilon pT
    2020             :   const Double_t kpt0 = 7.753;
    2021             :   const Double_t kxn  = 3.042;
    2022           0 :   Double_t x=*px;
    2023             :   //
    2024           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    2025           0 :   return x/TMath::Power(pass1,kxn);
    2026             : }
    2027             : 
    2028             : Double_t AliGenMUONlib::PtUpsilonCDFscaledPP( const Double_t *px, const Double_t */*dummy*/ )
    2029             : {
    2030             : // Upsilon pT
    2031             : //
    2032             : // pp 14 TeV
    2033             : //
    2034             : // scaled from CDF data at 2 TeV
    2035             : 
    2036             :   const Double_t kpt0 = 8.610;
    2037             :   const Double_t kxn  = 3.051;
    2038           0 :   Double_t x=*px;
    2039             :   //
    2040           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    2041           0 :   return x/TMath::Power(pass1,kxn);
    2042             : }
    2043             : 
    2044             : Double_t AliGenMUONlib::PtUpsilonCDFscaledPP10( const Double_t *px, const Double_t */*dummy*/)
    2045             : {
    2046             : // Upsilon pT
    2047             : //
    2048             : // pp 10 TeV
    2049             : //
    2050             : // scaled from CDF data at 2 TeV
    2051             : 
    2052             :   const Double_t kpt0 = 8.235;
    2053             :   const Double_t kxn  = 3.051;
    2054           0 :   Double_t x=*px;
    2055             :   //
    2056           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    2057           0 :   return x/TMath::Power(pass1,kxn);
    2058             : }
    2059             : 
    2060             : Double_t AliGenMUONlib::PtUpsilonCDFscaledPP9( const Double_t *px, const Double_t */*dummy*/)
    2061             : {
    2062             : // Upsilon pT
    2063             : //
    2064             : // pp 8.8 TeV
    2065             : // scaled from CDF data at 2 TeV
    2066             : //
    2067             :   const Double_t kpt0 = 8.048;
    2068             :   const Double_t kxn  = 3.051;
    2069           0 :   Double_t x=*px;
    2070             :   //
    2071           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    2072           0 :   return x/TMath::Power(pass1,kxn);
    2073             : }
    2074             : 
    2075             : Double_t AliGenMUONlib::PtUpsilonCDFscaledPP7( const Double_t *px, const Double_t */*dummy*/)
    2076             : {
    2077             : // Upsilon pT
    2078             : //
    2079             : // pp 7 TeV
    2080             : //
    2081             : // scaled from CDF data at 2 TeV
    2082             : 
    2083             :   const Double_t kpt0 = 7.817;
    2084             :   const Double_t kxn  = 3.051;
    2085           0 :   Double_t x=*px;
    2086             :   //
    2087           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    2088           0 :   return x/TMath::Power(pass1,kxn);
    2089             : }
    2090             : 
    2091             : Double_t AliGenMUONlib::PtUpsilonCDFscaledPP4( const Double_t *px, const Double_t */*dummy*/)
    2092             : {
    2093             : // Upsilon pT
    2094             : //
    2095             : // pp 3.94 TeV
    2096             : // scaled from CDF data at 2 TeV
    2097             : //
    2098             :   const Double_t kpt0 = 7.189;
    2099             :   const Double_t kxn  = 3.051;
    2100           0 :   Double_t x=*px;
    2101             :   //
    2102           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    2103           0 :   return x/TMath::Power(pass1,kxn);
    2104             : }
    2105             : 
    2106             : Double_t AliGenMUONlib::PtUpsilonCDFscaledPPb9( const Double_t *px, const Double_t *dummy)
    2107             : {
    2108             : // Upsilon pT
    2109             : //
    2110             : // pPb 8.8 TeV, for EKS98 with minimum bias shadowing factor 0.89
    2111             : //
    2112           0 :   Double_t c[5] = {7.64952e-01, 1.12501e-04, 4.96038e-04, -3.03198e-05, 3.74035e-06};
    2113           0 :   Double_t x=*px;
    2114             :   Double_t y;
    2115             :   Int_t j;
    2116           0 :   y = c[j = 4];
    2117           0 :   while (j > 0) y  = y * x + c[--j];
    2118             :   //  
    2119           0 :   Double_t d = 1.+c[4]*TMath::Power(x,4);
    2120           0 :   return y/d * AliGenMUONlib::PtUpsilonCDFscaledPP9(px,dummy);
    2121           0 : }
    2122             : 
    2123             : Double_t AliGenMUONlib::PtUpsilonCDFscaledPbP9( const Double_t *px, const Double_t *dummy)
    2124             : {
    2125             : // Upsilon pT
    2126             : //
    2127             : // Pbp 8.8 TeV, for EKS98 with minimum bias shadowing factor 0.89
    2128             : //
    2129           0 :   Double_t c[5] = {1.09881e+00, 3.08329e-03, -2.00356e-04, 8.28991e-06, 2.52576e-06};
    2130           0 :   Double_t x=*px;
    2131             :   Double_t y;
    2132             :   Int_t j;
    2133           0 :   y = c[j = 4];
    2134           0 :   while (j > 0) y  = y * x + c[--j];
    2135             :   //  
    2136           0 :   Double_t d = 1.+c[4]*TMath::Power(x,4);
    2137           0 :   return y/d * AliGenMUONlib::PtUpsilonCDFscaledPP9(px,dummy);
    2138           0 : }
    2139             : 
    2140             : Double_t AliGenMUONlib::PtUpsilonCDFscaledPbPb4( const Double_t *px, const Double_t *dummy)
    2141             : {
    2142             : // Upsilon pT
    2143             : //
    2144             : // PbPb 3.94 TeV, for EKS98 with minimum bias shadowing factor 0.85
    2145             : //
    2146           0 :   Double_t c[5] = {8.65872e-01, 2.05465e-03, 2.56063e-04, -1.65598e-05, 2.29209e-06};
    2147           0 :   Double_t x=*px;
    2148             :   Double_t y;
    2149             :   Int_t j;
    2150           0 :   y = c[j = 4];
    2151           0 :   while (j > 0) y  = y * x + c[--j];
    2152             :   //  
    2153           0 :   Double_t d = 1.+c[4]*TMath::Power(x,4);
    2154           0 :   return y/d * AliGenMUONlib::PtUpsilonCDFscaledPP4(px,dummy);
    2155           0 : }
    2156             : 
    2157             : Double_t AliGenMUONlib::PtUpsilonFlat( const Double_t */*px*/, const Double_t */*dummy*/ )
    2158             : {
    2159           0 :   return 1.;
    2160             : }
    2161             : 
    2162             : Double_t AliGenMUONlib::PtUpsilonPbPb( const Double_t *px, const Double_t */*dummy*/)
    2163             : {
    2164             : //
    2165             : // Upsilon pT
    2166             : //
    2167             : //
    2168             : // R. Vogt 2002
    2169             : // PbPb 5.5 TeV
    2170             : // MRST HO
    2171             : // mc = 1.4 GeV, pt-kick 1 GeV
    2172             : //
    2173           0 :     Float_t x = px[0];
    2174           0 :     Double_t c[8] = {
    2175             :         -1.03488e+01, 1.28065e+01, -6.60500e+00, 1.66140e+00,       
    2176             :         -2.34293e-01, 1.86925e-02, -7.80708e-04, 1.30610e-05
    2177             :     };
    2178             :     Double_t y;
    2179           0 :     if (x < 10.) {
    2180             :         Int_t j;
    2181           0 :         y = c[j = 7];
    2182           0 :         while (j > 0) y  = y * x +c[--j];
    2183           0 :         y = x * TMath::Exp(y);
    2184           0 :     } else {
    2185             :         y = 0.;
    2186             :     }
    2187           0 :     return y;
    2188           0 : }
    2189             : 
    2190             : Double_t AliGenMUONlib::PtUpsilonPP( const Double_t *px, const Double_t */*dummy*/)
    2191             : {
    2192             : //
    2193             : // Upsilon pT
    2194             : //
    2195             : //
    2196             : // R. Vogt 2002
    2197             : // pp 14 TeV
    2198             : // MRST HO
    2199             : // mc = 1.4 GeV, pt-kick 1 GeV
    2200             : //
    2201           0 :     Float_t x = px[0];
    2202           0 :     Double_t c[8] = {-7.93955e+00, 1.06306e+01, -5.21392e+00, 1.19703e+00,   
    2203             :                      -1.45718e-01, 8.95151e-03, -2.04806e-04, -1.13053e-06};
    2204             :     
    2205             :     Double_t y;
    2206           0 :     if (x < 10.) {
    2207             :         Int_t j;
    2208           0 :         y = c[j = 7];
    2209           0 :         while (j > 0) y  = y * x +c[--j];
    2210           0 :         y = x * TMath::Exp(y);
    2211           0 :     } else {
    2212             :         y = 0.;
    2213             :     }
    2214           0 :     return y;
    2215           0 : }
    2216             : 
    2217             : //
    2218             : //                    y-distribution
    2219             : //
    2220             : //____________________________________________________________
    2221             : Double_t AliGenMUONlib::YUpsilonPPdummy(Double_t x, Double_t energy)
    2222             : {
    2223             : // Upsilon y
    2224             : // pp
    2225             : // from the fit of CDF & LHC data, like for J/Psi in arXiv:1103.2394
    2226             : //
    2227           0 :     x = x/TMath::Log(energy/9.46);
    2228           0 :     x = x*x;
    2229           0 :     Double_t y = TMath::Exp(-x/0.4/0.4/2);
    2230           0 :     if(x > 1) y=0;
    2231           0 :     return y;
    2232             : }
    2233             : 
    2234             : Double_t AliGenMUONlib::YUpsilonPPpoly(Double_t x, Double_t energy)
    2235             : {
    2236             : // Upsilon y
    2237             : // pp
    2238             : // from the fit of CDF & LHC data, like for J/Psi in arXiv:1103.2394
    2239             : //
    2240           0 :     x = x/TMath::Log(energy/9.46);
    2241           0 :     x = x*x;
    2242           0 :     Double_t y = 1 - 6.9*x*x;
    2243           0 :     if(y < 0) y=0;
    2244           0 :     return y;
    2245             : }
    2246             : 
    2247             : Double_t AliGenMUONlib::YUpsilonPP7000(const Double_t *px, const Double_t */*dummy*/)
    2248             : {
    2249             : // Upsilon y
    2250             : // pp 7 TeV
    2251             : //
    2252           0 :   return YUpsilonPPdummy(*px, 7000);
    2253             : }
    2254             : 
    2255             : Double_t AliGenMUONlib::YUpsilonPP8000(const Double_t *px, const Double_t */*dummy*/)
    2256             : {
    2257             : // Upsilon y
    2258             : // pp 7 TeV
    2259             : //
    2260           0 :   return YUpsilonPPdummy(*px, 8000);
    2261             : }
    2262             : 
    2263             : Double_t AliGenMUONlib::YUpsilonPP2760(const Double_t *px, const Double_t */*dummy*/)
    2264             : {
    2265             : // Upsilon y
    2266             : // pp 2.76 TeV
    2267             : //
    2268           0 :   return YUpsilonPPdummy(*px, 2760);
    2269             : }
    2270             : 
    2271             : Double_t AliGenMUONlib::YUpsilonPP4400(const Double_t *px, const Double_t */*dummy*/)
    2272             : {
    2273             : // Upsilon y
    2274             : // pp 4.4 TeV
    2275             : //
    2276           0 :   return YUpsilonPPdummy(*px, 4400);
    2277             : }
    2278             : 
    2279             : Double_t AliGenMUONlib::YUpsilonPP5030(const Double_t *px, const Double_t */*dummy*/)
    2280             : {
    2281             : // Upsilon y
    2282             : // pp 5.03 TeV
    2283             : //
    2284           0 :   return YUpsilonPPdummy(*px, 5030);
    2285             : }
    2286             : 
    2287             : Double_t AliGenMUONlib::YUpsilonPP8800(const Double_t *px, const Double_t */*dummy*/)
    2288             : {
    2289             : // Upsilon y
    2290             : // pp 8.8 TeV
    2291             : //
    2292           0 :   return YUpsilonPPdummy(*px, 8800);
    2293             : }
    2294             : 
    2295             : Double_t AliGenMUONlib::YUpsilonPPpoly7000(const Double_t *px, const Double_t */*dummy*/)
    2296             : {
    2297             : // Upsilon y
    2298             : // pp 7 TeV
    2299             : //
    2300           0 :   return YUpsilonPPpoly(*px, 7000);
    2301             : }
    2302             : 
    2303             : Double_t AliGenMUONlib::YUpsilonPPpoly2760(const Double_t *px, const Double_t */*dummy*/)
    2304             : {
    2305             : // Upsilon y
    2306             : // pp 2.76 TeV
    2307             : //
    2308           0 :   return YUpsilonPPpoly(*px, 2760);
    2309             : }
    2310             : 
    2311             : Double_t AliGenMUONlib::YUpsilonPbPb2760ShFdummy(Double_t x, Int_t n)
    2312             : {
    2313             : // Upsilon shadowing factor vs y for PbPb min. bias and 11 centr. bins
    2314             : //
    2315             : // PbPb 2.76 TeV, for EKS98, minimum bias shadowing factor = 0.87 in 4pi
    2316             : //
    2317             :   const Double_t f1[12] = {1, 1.128, 1.097, 1.037, 0.937, 0.821, 0.693, 0.558,
    2318             :                            0.428, 0.317, 0.231, 0.156};
    2319             :   const Double_t f2[12] = {1, 1.313, 1.202, 1.039, 0.814, 0.593, 0.391, 0.224,
    2320             :                            0.106, 0.041, 0.013, 0.002};
    2321             :   const Double_t c1[5] = {1.8547e+00, 1.6717e-02,-2.1285e-04,-9.7662e-05, 2.5768e-06};
    2322             :   const Double_t c2[5] = {8.6029e-01, 1.1742e-02,-2.7944e-04,-6.7973e-05, 1.8838e-06}; 
    2323             : 
    2324           0 :   x = x*x;
    2325             :   Double_t y1, y2;
    2326             :   Int_t j;
    2327             :   y1 = c1[j = 4]; y2 = c2[4];
    2328           0 :   while (j > 0) {y1 = y1 * x + c1[--j]; y2 = y2 * x + c2[j];}
    2329             :   
    2330           0 :   y1 = 1 + (y1-2)*f1[n] + (y2+1-y1)*f2[n];
    2331           0 :   if(y1<0) y1=0;
    2332           0 :   return y1;
    2333             : }
    2334             : 
    2335             : Double_t AliGenMUONlib::YUpsilonPbPb2760(const Double_t *px, const Double_t *dummy)
    2336             : {
    2337             : // Upsilon y
    2338             : // PbPb 2.76 TeV, minimum bias 0-100 %
    2339             : //
    2340           0 :   return YUpsilonPbPb2760ShFdummy(*px, 0) * YUpsilonPP2760(px, dummy);
    2341             : }
    2342             : 
    2343             : Double_t AliGenMUONlib::YUpsilonPbPb2760c1(const Double_t *px, const Double_t *dummy)
    2344             : {
    2345             : // Upsilon y
    2346             : // PbPb 2.76 TeV, 1st centrality bin 0-5 %
    2347             : //
    2348           0 :   return YUpsilonPbPb2760ShFdummy(*px, 1) * YUpsilonPP2760(px, dummy);
    2349             : }
    2350             : 
    2351             : Double_t AliGenMUONlib::YUpsilonPbPb2760c2(const Double_t *px, const Double_t *dummy)
    2352             : {
    2353             : // Upsilon y
    2354             : // PbPb 2.76 TeV, 2nd centrality bin 5-10 %
    2355             : //
    2356           0 :   return YUpsilonPbPb2760ShFdummy(*px, 2) * YUpsilonPP2760(px, dummy);
    2357             : }
    2358             : 
    2359             : Double_t AliGenMUONlib::YUpsilonPbPb2760c3(const Double_t *px, const Double_t *dummy)
    2360             : {
    2361             : // Upsilon y
    2362             : // PbPb 2.76 TeV, 3rd centrality bin 10-20 %
    2363             : //
    2364           0 :   return YUpsilonPbPb2760ShFdummy(*px, 3) * YUpsilonPP2760(px, dummy);
    2365             : }
    2366             : 
    2367             : Double_t AliGenMUONlib::YUpsilonPbPb2760c4(const Double_t *px, const Double_t *dummy)
    2368             : {
    2369             : // Upsilon y
    2370             : // PbPb 2.76 TeV, 4th centrality bin 20-30 %
    2371             : //
    2372           0 :   return YUpsilonPbPb2760ShFdummy(*px, 4) * YUpsilonPP2760(px, dummy);
    2373             : }
    2374             : 
    2375             : Double_t AliGenMUONlib::YUpsilonPbPb2760c5(const Double_t *px, const Double_t *dummy)
    2376             : {
    2377             : // Upsilon y
    2378             : // PbPb 2.76 TeV, 5th centrality bin 30-40 %
    2379             : //
    2380           0 :   return YUpsilonPbPb2760ShFdummy(*px, 5) * YUpsilonPP2760(px, dummy);
    2381             : }
    2382             : 
    2383             : Double_t AliGenMUONlib::YUpsilonPbPb2760c6(const Double_t *px, const Double_t *dummy)
    2384             : {
    2385             : // Upsilon y
    2386             : // PbPb 2.76 TeV, 6th centrality bin 40-50 %
    2387             : //
    2388           0 :   return YUpsilonPbPb2760ShFdummy(*px, 6) * YUpsilonPP2760(px, dummy);
    2389             : }
    2390             : 
    2391             : Double_t AliGenMUONlib::YUpsilonPbPb2760c7(const Double_t *px, const Double_t *dummy)
    2392             : {
    2393             : // Upsilon y
    2394             : // PbPb 2.76 TeV, 7th centrality bin 50-60 %
    2395             : //
    2396           0 :   return YUpsilonPbPb2760ShFdummy(*px, 7) * YUpsilonPP2760(px, dummy);
    2397             : }
    2398             : 
    2399             : Double_t AliGenMUONlib::YUpsilonPbPb2760c8(const Double_t *px, const Double_t *dummy)
    2400             : {
    2401             : // Upsilon y
    2402             : // PbPb 2.76 TeV, 8th centrality bin 60-70 %
    2403             : //
    2404           0 :   return YUpsilonPbPb2760ShFdummy(*px, 8) * YUpsilonPP2760(px, dummy);
    2405             : }
    2406             : 
    2407             : Double_t AliGenMUONlib::YUpsilonPbPb2760c9(const Double_t *px, const Double_t *dummy)
    2408             : {
    2409             : // Upsilon y
    2410             : // PbPb 2.76 TeV, 9th centrality bin 70-80 %
    2411             : //
    2412           0 :   return YUpsilonPbPb2760ShFdummy(*px, 9) * YUpsilonPP2760(px, dummy);
    2413             : }
    2414             : 
    2415             : Double_t AliGenMUONlib::YUpsilonPbPb2760c10(const Double_t *px, const Double_t *dummy)
    2416             : {
    2417             : // Upsilon y
    2418             : // PbPb 2.76 TeV, 10th centrality bin 80-90 %
    2419             : //
    2420           0 :   return YUpsilonPbPb2760ShFdummy(*px, 10) * YUpsilonPP2760(px, dummy);
    2421             : }
    2422             : 
    2423             : Double_t AliGenMUONlib::YUpsilonPbPb2760c11(const Double_t *px, const Double_t *dummy)
    2424             : {
    2425             : // Upsilon y
    2426             : // PbPb 2.76 TeV, 11th centrality bin 90-100 %
    2427             : //
    2428           0 :   return YUpsilonPbPb2760ShFdummy(*px, 11) * YUpsilonPP2760(px, dummy);
    2429             : }
    2430             : 
    2431             : Double_t AliGenMUONlib::YUpsilonPP5030dummy(Double_t px)
    2432             : {
    2433           0 :     return AliGenMUONlib::YUpsilonPP5030(&px, (Double_t*) 0);
    2434             : }
    2435             : 
    2436             : Double_t AliGenMUONlib::YUpsilonPPb5030ShFdummy(Double_t x, Int_t n)
    2437             : {
    2438             : // Upsilon shadowing factor vs y for pPb min. bias and 4 centr. bins
    2439             : //
    2440             : // pPb 5.03 TeV, for EPS09-LO, minimum bias shadowing factor = 0.92 in 4pi
    2441             : //
    2442             :     const Double_t f[5] = {1, 1.33, 1.05, 0.67, 0.23};
    2443             :     const Double_t c[7] = {8.885e-01, 4.620e-02, 1.158e-02, 4.959e-04,-4.422e-04,-5.345e-05, 0.};
    2444             :     Double_t y;
    2445             :     Int_t j;
    2446             :     y = c[j = 6];
    2447           0 :     while (j > 0) y = y * x + c[--j];
    2448           0 :     if(y<0) y=0;
    2449             :     //
    2450           0 :     return 1 +(y-1)*f[n];
    2451             : }
    2452             : 
    2453             : Double_t AliGenMUONlib::YUpsilonPPb5030(const Double_t *px, const Double_t */*dummy*/)
    2454             : {
    2455             : // Upsilon y
    2456             : // pPb 5.03 TeV, minimum bias 0-100 %
    2457             : //
    2458           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    2459           0 :   return YUpsilonPPb5030ShFdummy(x, 0) * YUpsilonPP5030dummy(x);
    2460             : }
    2461             : 
    2462             : Double_t AliGenMUONlib::YUpsilonPPb5030c1(const Double_t *px, const Double_t */*dummy*/)
    2463             : {
    2464             : // Upsilon y
    2465             : // pPb 5.03 TeV, 1st centrality bin 0-20 %
    2466             : //
    2467           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    2468           0 :   return YUpsilonPPb5030ShFdummy(x, 1) * YUpsilonPP5030dummy(x);
    2469             : }
    2470             : 
    2471             : Double_t AliGenMUONlib::YUpsilonPPb5030c2(const Double_t *px, const Double_t */*dummy*/)
    2472             : {
    2473             : // Upsilon y
    2474             : // pPb 5.03 TeV, 2nd centrality bin 20-40 %
    2475             : //
    2476           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    2477           0 :   return YUpsilonPPb5030ShFdummy(x, 2) * YUpsilonPP5030dummy(x);
    2478             : }
    2479             : 
    2480             : Double_t AliGenMUONlib::YUpsilonPPb5030c3(const Double_t *px, const Double_t */*dummy*/)
    2481             : {
    2482             : // Upsilon y
    2483             : // pPb 5.03 TeV, 3rd centrality bin 40-60 %
    2484             : //
    2485           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    2486           0 :   return YUpsilonPPb5030ShFdummy(x, 3) * YUpsilonPP5030dummy(x);
    2487             : }
    2488             : 
    2489             : Double_t AliGenMUONlib::YUpsilonPPb5030c4(const Double_t *px, const Double_t */*dummy*/)
    2490             : {
    2491             : // Upsilon y
    2492             : // pPb 5.03 TeV, 4th centrality bin 60-100 %
    2493             : //
    2494           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    2495           0 :   return YUpsilonPPb5030ShFdummy(x, 4) * YUpsilonPP5030dummy(x);
    2496             : }
    2497             : 
    2498             : Double_t AliGenMUONlib::YUpsilonPbP5030(const Double_t *px, const Double_t */*dummy*/)
    2499             : {
    2500             : // Upsilon y
    2501             : // Pbp 5.03 TeV, minimum bias 0-100 %
    2502             : //
    2503           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    2504           0 :   return YUpsilonPPb5030ShFdummy(x, 0) * YUpsilonPP5030dummy(x);
    2505             : }
    2506             : 
    2507             : Double_t AliGenMUONlib::YUpsilonPbP5030c1(const Double_t *px, const Double_t */*dummy*/)
    2508             : {
    2509             : // Upsilon y
    2510             : // Pbp 5.03 TeV, 1st centrality bin 0-20 %
    2511             : //
    2512           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    2513           0 :   return YUpsilonPPb5030ShFdummy(x, 1) * YUpsilonPP5030dummy(x);
    2514             : }
    2515             : 
    2516             : Double_t AliGenMUONlib::YUpsilonPbP5030c2(const Double_t *px, const Double_t */*dummy*/)
    2517             : {
    2518             : // Upsilon y
    2519             : // Pbp 5.03 TeV, 2nd centrality bin 20-40 %
    2520             : //
    2521           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    2522           0 :   return YUpsilonPPb5030ShFdummy(x, 2) * YUpsilonPP5030dummy(x);
    2523             : }
    2524             : 
    2525             : Double_t AliGenMUONlib::YUpsilonPbP5030c3(const Double_t *px, const Double_t */*dummy*/)
    2526             : {
    2527             : // Upsilon y
    2528             : // Pbp 5.03 TeV, 3rd centrality bin 40-60 %
    2529             : //
    2530           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    2531           0 :   return YUpsilonPPb5030ShFdummy(x, 3) * YUpsilonPP5030dummy(x);
    2532             : }
    2533             : 
    2534             : Double_t AliGenMUONlib::YUpsilonPbP5030c4(const Double_t *px, const Double_t */*dummy*/)
    2535             : {
    2536             : // Upsilon y
    2537             : // Pbp 5.03 TeV, 4th centrality bin 60-100 %
    2538             : //
    2539           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    2540           0 :   return YUpsilonPPb5030ShFdummy(x, 4) * YUpsilonPP5030dummy(x);
    2541             : }
    2542             : 
    2543             : Double_t AliGenMUONlib::YUpsilonPP8800dummy(Double_t px)
    2544             : {
    2545           0 :     return AliGenMUONlib::YUpsilonPP8800(&px, (Double_t*) 0);
    2546             : }
    2547             : 
    2548             : Double_t AliGenMUONlib::YUpsilonPPb8800ShFdummy(Double_t x, Int_t n)
    2549             : {
    2550             : // Upsilon shadowing factor vs y for pPb min. bias and 4 centr. bins
    2551             : //
    2552             : // pPb 8.8 TeV, for EKS98, minimum bias shadowing factor = 0.89 in 4pi
    2553             : //
    2554             :     const Double_t f[5] = {1, 1.33, 1.05, 0.67, 0.23};
    2555             :     const Double_t c[7] = {8.6581e-01, 4.6111e-02, 7.6911e-03, 8.7313e-04,
    2556             :                            -1.4700e-04,-5.0975e-05,-3.5718e-06}; 
    2557             :     Double_t y;
    2558             :     Int_t j;
    2559             :     y = c[j = 6];
    2560           0 :     while (j > 0) y = y * x + c[--j];
    2561           0 :     if(y<0) y=0;
    2562             :     //
    2563           0 :     return 1 +(y-1)*f[n];
    2564             : }
    2565             : 
    2566             : Double_t AliGenMUONlib::YUpsilonPPb8800(const Double_t *px, const Double_t */*dummy*/)
    2567             : {
    2568             : // Upsilon y
    2569             : // pPb 8.8 TeV, minimum bias 0-100 %
    2570             : //
    2571           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    2572           0 :   return YUpsilonPPb8800ShFdummy(x, 0) * YUpsilonPP8800dummy(x);
    2573             : }
    2574             : 
    2575             : Double_t AliGenMUONlib::YUpsilonPPb8800c1(const Double_t *px, const Double_t */*dummy*/)
    2576             : {
    2577             : // Upsilon y
    2578             : // pPb 8.8 TeV, 1st centrality bin 0-20 %
    2579             : //
    2580           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    2581           0 :   return YUpsilonPPb8800ShFdummy(x, 1) * YUpsilonPP8800dummy(x);
    2582             : }
    2583             : 
    2584             : Double_t AliGenMUONlib::YUpsilonPPb8800c2(const Double_t *px, const Double_t */*dummy*/)
    2585             : {
    2586             : // Upsilon y
    2587             : // pPb 8.8 TeV, 2nd centrality bin 20-40 %
    2588             : //
    2589           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    2590           0 :   return YUpsilonPPb8800ShFdummy(x, 2) * YUpsilonPP8800dummy(x);
    2591             : }
    2592             : 
    2593             : Double_t AliGenMUONlib::YUpsilonPPb8800c3(const Double_t *px, const Double_t */*dummy*/)
    2594             : {
    2595             : // Upsilon y
    2596             : // pPb 8.8 TeV, 3rd centrality bin 40-60 %
    2597             : //
    2598           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    2599           0 :   return YUpsilonPPb8800ShFdummy(x, 3) * YUpsilonPP8800dummy(x);
    2600             : }
    2601             : 
    2602             : Double_t AliGenMUONlib::YUpsilonPPb8800c4(const Double_t *px, const Double_t */*dummy*/)
    2603             : {
    2604             : // Upsilon y
    2605             : // pPb 8.8 TeV, 4th centrality bin 60-100 %
    2606             : //
    2607           0 :   Double_t x = px[0] + 0.47;              // rapidity shift
    2608           0 :   return YUpsilonPPb8800ShFdummy(x, 4) * YUpsilonPP8800dummy(x);
    2609             : }
    2610             : 
    2611             : Double_t AliGenMUONlib::YUpsilonPbP8800(const Double_t *px, const Double_t */*dummy*/)
    2612             : {
    2613             : // Upsilon y
    2614             : // Pbp 8.8 TeV, minimum bias 0-100 %
    2615             : //
    2616           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    2617           0 :   return YUpsilonPPb8800ShFdummy(x, 0) * YUpsilonPP8800dummy(x);
    2618             : }
    2619             : 
    2620             : Double_t AliGenMUONlib::YUpsilonPbP8800c1(const Double_t *px, const Double_t */*dummy*/)
    2621             : {
    2622             : // Upsilon y
    2623             : // Pbp 8.8 TeV, 1st centrality bin 0-20 %
    2624             : //
    2625           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    2626           0 :   return YUpsilonPPb8800ShFdummy(x, 1) * YUpsilonPP8800dummy(x);
    2627             : }
    2628             : 
    2629             : Double_t AliGenMUONlib::YUpsilonPbP8800c2(const Double_t *px, const Double_t */*dummy*/)
    2630             : {
    2631             : // Upsilon y
    2632             : // Pbp 8.8 TeV, 2nd centrality bin 20-40 %
    2633             : //
    2634           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    2635           0 :   return YUpsilonPPb8800ShFdummy(x, 2) * YUpsilonPP8800dummy(x);
    2636             : }
    2637             : 
    2638             : Double_t AliGenMUONlib::YUpsilonPbP8800c3(const Double_t *px, const Double_t */*dummy*/)
    2639             : {
    2640             : // Upsilon y
    2641             : // Pbp 8.8 TeV, 3rd centrality bin 40-60 %
    2642             : //
    2643           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    2644           0 :   return YUpsilonPPb8800ShFdummy(x, 3) * YUpsilonPP8800dummy(x);
    2645             : }
    2646             : 
    2647             : Double_t AliGenMUONlib::YUpsilonPbP8800c4(const Double_t *px, const Double_t */*dummy*/)
    2648             : {
    2649             : // Upsilon y
    2650             : // Pbp 8.8 TeV, 4th centrality bin 60-100 %
    2651             : //
    2652           0 :   Double_t x = -px[0] + 0.47;              // rapidity shift
    2653           0 :   return YUpsilonPPb8800ShFdummy(x, 4) * YUpsilonPP8800dummy(x);
    2654             : }
    2655             : 
    2656             : Double_t AliGenMUONlib::YUpsilon(const Double_t *py, const Double_t */*dummy*/)
    2657             : {
    2658             : // Upsilon y
    2659             :   const Double_t ky0 = 3.;
    2660             :   const Double_t kb=1.;
    2661             :   Double_t yu;
    2662           0 :   Double_t y=TMath::Abs(*py);
    2663             :   //
    2664           0 :   if (y < ky0)
    2665           0 :     yu=kb;
    2666             :   else
    2667           0 :     yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
    2668           0 :   return yu;
    2669             : }
    2670             : 
    2671             : 
    2672             : Double_t AliGenMUONlib::YUpsilonPbPb( const Double_t *px, const Double_t */*dummy*/)
    2673             : {
    2674             : 
    2675             : //
    2676             : // Upsilon y
    2677             : //
    2678             : //
    2679             : // R. Vogt 2002
    2680             : // PbPb 5.5 TeV
    2681             : // MRST HO
    2682             : // mc = 1.4 GeV, pt-kick 1 GeV
    2683             : //
    2684             : 
    2685           0 :     Double_t c[7] = {3.40036e-01, -3.98882e-07, -4.48398e-03, 8.46411e-08, -6.10854e-04,
    2686             :                      -2.99753e-09, 1.28895e-05};
    2687           0 :     Double_t x = TMath::Abs(px[0]);
    2688           0 :     if (x > 5.55) return 0.;
    2689             :     Int_t j;
    2690           0 :     Double_t y = c[j = 6];
    2691           0 :     while (j > 0) y  = y * x +c[--j];
    2692             :     return y;
    2693           0 : }
    2694             : 
    2695             : Double_t AliGenMUONlib::YUpsilonCDFscaled( const Double_t *px, const Double_t *dummy)
    2696             : {
    2697             :     // Upsilon y
    2698           0 :     return AliGenMUONlib::YUpsilonPbPb(px, dummy);
    2699             :     
    2700             : }
    2701             : 
    2702             : Double_t AliGenMUONlib::YUpsilonCDFscaledPP( const Double_t *px, const Double_t *dummy)
    2703             : {
    2704             :     // Upsilon y
    2705           0 :     return AliGenMUONlib::YUpsilonPP(px, dummy);
    2706             :     
    2707             : }
    2708             : 
    2709             : Double_t AliGenMUONlib::YUpsilonFlat( const Double_t */*px*/, const Double_t */*dummy*/)
    2710             : {
    2711             :     // Upsilon y
    2712           0 :     return 1.;
    2713             :     
    2714             : }
    2715             : 
    2716             : Double_t AliGenMUONlib::YUpsilonCDFscaledPP10( const Double_t *px, const Double_t */*dummy*/)
    2717             : {
    2718             : // Upsilon y
    2719             : //
    2720             : // pp 10 TeV
    2721             : // scaled from YUpsilonPP(14 TeV) using 10 TeV / 14 TeV ratio of y-spectra in LO pQCD. 
    2722             : // see S.Grigoryan, PWG3 Meeting, 27th Oct 2008
    2723             : //
    2724           0 :     Double_t c[4] = {1., -2.17877e-02, -6.52830e-04, 1.40578e-05};
    2725           0 :     Double_t x = TMath::Abs(px[0]);
    2726           0 :     if (x > 6.1) return 0.;
    2727             :     Int_t j;
    2728           0 :     Double_t y = c[j = 3];
    2729           0 :     while (j > 0) y  = y * x*x +c[--j];
    2730             :     return y;
    2731           0 : }
    2732             : 
    2733             : Double_t AliGenMUONlib::YUpsilonCDFscaledPP9( const Double_t *px, const Double_t */*dummy*/)
    2734             : {
    2735             : // Upsilon y
    2736             : //
    2737             : // pp 8.8 TeV
    2738             : // rescaling of YUpsilonPP(14 TeV) using 8.8 TeV / 14 TeV ratio of y-spectra in LO QCD 
    2739             : //
    2740           0 :     Double_t c[4] = {1., -2.37621e-02, -6.29610e-04, 1.47976e-05};
    2741           0 :     Double_t x = TMath::Abs(px[0]);
    2742           0 :     if (x > 6.1) return 0.;
    2743             :     Int_t j;
    2744           0 :     Double_t y = c[j = 3];
    2745           0 :     while (j > 0) y  = y * x*x +c[--j];
    2746             :     return y;
    2747           0 : }
    2748             : 
    2749             : Double_t AliGenMUONlib::YUpsilonCDFscaledPP9dummy(Double_t px)
    2750             : {
    2751           0 :     return AliGenMUONlib::YUpsilonCDFscaledPP9(&px, (Double_t*) 0);
    2752             : }
    2753             : 
    2754             : Double_t AliGenMUONlib::YUpsilonCDFscaledPP7( const Double_t *px, const Double_t */*dummy*/)
    2755             : {
    2756             : // Upsilon y
    2757             : //
    2758             : // pp 7 TeV
    2759             : // scaled from YUpsilonPP(14 TeV) using 7 TeV / 14 TeV ratio of y-spectra in LO pQCD. 
    2760             : //
    2761           0 :     Double_t c[4] = {1., -2.61009e-02, -6.83937e-04, 1.78451e-05};
    2762           0 :     Double_t x = TMath::Abs(px[0]);
    2763           0 :     if (x > 6.0) return 0.;
    2764             :     Int_t j;
    2765           0 :     Double_t y = c[j = 3];
    2766           0 :     while (j > 0) y  = y * x*x +c[--j];
    2767             :     return y;
    2768           0 : }
    2769             : 
    2770             : Double_t AliGenMUONlib::YUpsilonCDFscaledPP4( const Double_t *px, const Double_t */*dummy*/)
    2771             : {
    2772             : // Upsilon y
    2773             : //
    2774             : // pp 3.94 TeV
    2775             : // rescaling of YUpsilonPP(14 TeV) using 3.94 TeV / 14 TeV ratio of y-spectra in LO QCD
    2776             : //
    2777           0 :     Double_t c[4] = {1., -3.91924e-02, -4.26184e-04, 2.10914e-05};
    2778           0 :     Double_t x = TMath::Abs(px[0]);
    2779           0 :     if (x > 5.7) return 0.;
    2780             :     Int_t j;
    2781           0 :     Double_t y = c[j = 3];
    2782           0 :     while (j > 0) y  = y * x*x +c[--j];
    2783             : 
    2784             :     return y;
    2785           0 : }
    2786             : 
    2787             : Double_t AliGenMUONlib::YUpsilonPP( const Double_t *px, const Double_t */*dummy*/)
    2788             : {
    2789             : 
    2790             : //
    2791             : // Upsilon y
    2792             : //
    2793             : //
    2794             : // R. Vogt 2002
    2795             : // p p  14. TeV
    2796             : // MRST HO
    2797             : // mc = 1.4 GeV, pt-kick 1 GeV
    2798             : //
    2799           0 :     Double_t c[7] = {8.91936e-01, -6.46645e-07, -1.52774e-02, 4.28677e-08, -7.01517e-04, 
    2800             :                      -6.20539e-10, 1.29943e-05};
    2801           0 :     Double_t x = TMath::Abs(px[0]);
    2802           0 :     if (x > 6.2) return 0.;
    2803             :     Int_t j;
    2804           0 :     Double_t y = c[j = 6];
    2805           0 :     while (j > 0) y  = y * x +c[--j];
    2806             :     return y;
    2807           0 : }
    2808             : 
    2809             : Double_t AliGenMUONlib::YUpsilonCDFscaledPPb9( const Double_t *px, const Double_t */*dummy*/)
    2810             : {
    2811             : // Upsilon y
    2812             : //
    2813             : // pPb 8.8 TeV, for EKS98 with minimum bias shadowing factor 0.89
    2814             : //
    2815           0 :     Double_t c[7] = {8.71829e-01, 4.77467e-02, 8.09671e-03, 6.45294e-04, -2.15730e-04,
    2816             :                      -4.67538e-05,-2.11683e-06}; 
    2817             :     Double_t y;
    2818           0 :     Double_t x = px[0] + 0.47;              // rapidity shift
    2819             :     Int_t j;
    2820           0 :     y = c[j = 6];
    2821           0 :     while (j > 0) y = y * x + c[--j];
    2822           0 :     if(y<0) y=0;
    2823             : 
    2824           0 :     return y * AliGenMUONlib::YUpsilonCDFscaledPP9dummy(x);
    2825           0 : }
    2826             : 
    2827             : Double_t AliGenMUONlib::YUpsilonCDFscaledPbP9( const Double_t *px, const Double_t */*dummy*/)
    2828             : {
    2829             : // Upsilon y
    2830             : //
    2831             : // Pbp 8.8 TeV, for EKS98 with minimum bias shadowing factor 0.89
    2832             : //
    2833           0 :     Double_t c[7] = {8.71829e-01, 4.77467e-02, 8.09671e-03, 6.45294e-04, -2.15730e-04,
    2834             :                      -4.67538e-05,-2.11683e-06}; 
    2835             :     Double_t y;
    2836           0 :     Double_t x = -px[0] + 0.47;              // rapidity shift
    2837             :     Int_t j;
    2838           0 :     y = c[j = 6];
    2839           0 :     while (j > 0) y = y * x + c[--j];
    2840           0 :     if(y<0) y=0;
    2841             : 
    2842           0 :     return y * AliGenMUONlib::YUpsilonCDFscaledPP9dummy(x);
    2843           0 : }
    2844             : 
    2845             : Double_t AliGenMUONlib::YUpsilonCDFscaledPbPb4( const Double_t *px, const Double_t *dummy)
    2846             : {
    2847             : // Upsilon y
    2848             : //
    2849             : // PbPb 3.94 TeV, for EKS98 with minimum bias shadowing factor 0.85
    2850             : //
    2851           0 :     Double_t c[4] = {8.27837e-01, 1.70115e-02, -1.26046e-03, 1.52091e-05}; 
    2852           0 :     Double_t x = px[0]*px[0];
    2853             :     Double_t y;
    2854             :     Int_t j;
    2855           0 :     y = c[j = 3];
    2856           0 :     while (j > 0) y  = y * x + c[--j];
    2857           0 :     if(y<0) y=0;
    2858             : 
    2859           0 :     return y * AliGenMUONlib::YUpsilonCDFscaledPP4(px,dummy);
    2860           0 : }
    2861             : 
    2862             : 
    2863             : //                 particle composition
    2864             : //
    2865             : Int_t AliGenMUONlib::IpUpsilon(TRandom *)
    2866             : {
    2867             : // y composition
    2868           0 :     return 553;
    2869             : }
    2870             : Int_t AliGenMUONlib::IpUpsilonP(TRandom *)
    2871             : {
    2872             : // y composition
    2873           0 :     return 100553;
    2874             : }
    2875             : Int_t AliGenMUONlib::IpUpsilonPP(TRandom *)
    2876             : {
    2877             : // y composition
    2878           0 :     return 200553;
    2879             : }
    2880             : Int_t AliGenMUONlib::IpUpsilonFamily(TRandom *)
    2881             : {
    2882             : // y composition
    2883             :   // Using the LHCb pp data at 7 TeV: CERN-PH-EP-2012-051
    2884             :   // (L. Manceau, S. Grigoryan)
    2885             :   Int_t ip;
    2886           0 :   Float_t r = gRandom->Rndm();  
    2887           0 :   if (r < 0.687) {
    2888             :     //  if (r < 0.712) {
    2889             :     ip = 553;
    2890           0 :   } else if (r < 0.903) {
    2891             :     //  } else if (r < 0.896) {
    2892             :     ip = 100553;
    2893           0 :   } else {
    2894             :     ip = 200553;
    2895             :   }
    2896           0 :   return ip;
    2897             : }
    2898             : 
    2899             : 
    2900             : //
    2901             : //                        Phi
    2902             : //
    2903             : //
    2904             : //    pt-distribution (by scaling of pion distribution)
    2905             : //____________________________________________________________
    2906             : Double_t AliGenMUONlib::PtPhi( const Double_t *px, const Double_t */*dummy*/)
    2907             : {
    2908             : // Phi pT
    2909           0 :   return PtScal(*px,7);
    2910             : }
    2911             : //    y-distribution
    2912             : Double_t AliGenMUONlib::YPhi( const Double_t *px, const Double_t */*dummy*/)
    2913             : {
    2914             : // Phi y
    2915             :     Double_t *dum=0;
    2916           0 :     return YJpsi(px,dum);
    2917             : }
    2918             : //                 particle composition
    2919             : //
    2920             : Int_t AliGenMUONlib::IpPhi(TRandom *)
    2921             : {
    2922             : // Phi composition
    2923           0 :     return 333;
    2924             : }
    2925             : 
    2926             : //
    2927             : //                        omega
    2928             : //
    2929             : //
    2930             : //    pt-distribution (by scaling of pion distribution)
    2931             : //____________________________________________________________
    2932             : Double_t AliGenMUONlib::PtOmega( const Double_t *px, const Double_t */*dummy*/)
    2933             : {
    2934             : // Omega pT
    2935           0 :   return PtScal(*px,5);
    2936             : }
    2937             : //    y-distribution
    2938             : Double_t AliGenMUONlib::YOmega( const Double_t *px, const Double_t */*dummy*/)
    2939             : {
    2940             : // Omega y
    2941             :     Double_t *dum=0;
    2942           0 :     return YJpsi(px,dum);
    2943             : }
    2944             : //                 particle composition
    2945             : //
    2946             : Int_t AliGenMUONlib::IpOmega(TRandom *)
    2947             : {
    2948             : // Omega composition
    2949           0 :     return 223;
    2950             : }
    2951             : 
    2952             : 
    2953             : //
    2954             : //                        omega
    2955             : //
    2956             : //
    2957             : //    pt-distribution (by scaling of pion distribution)
    2958             : //____________________________________________________________
    2959             : Double_t AliGenMUONlib::PtRho( const Double_t *px, const Double_t */*dummy*/)
    2960             : {
    2961             : // Omega pT
    2962           0 :   return PtScal(*px,5);
    2963             : }
    2964             : //    y-distribution
    2965             : Double_t AliGenMUONlib::YRho( const Double_t *px, const Double_t */*dummy*/)
    2966             : {
    2967             : // Omega y
    2968             :     Double_t *dum=0;
    2969           0 :     return YJpsi(px,dum);
    2970             : }
    2971             : //                 particle composition
    2972             : //
    2973             : Int_t AliGenMUONlib::IpRho(TRandom *)
    2974             : {
    2975             : // Omega composition
    2976           0 :     return 113;
    2977             : }
    2978             : 
    2979             : //
    2980             : //                        Eta
    2981             : //
    2982             : //
    2983             : //    pt-distribution (by scaling of pion distribution)
    2984             : //____________________________________________________________
    2985             : Double_t AliGenMUONlib::PtEta( const Double_t *px, const Double_t */*dummy*/)
    2986             : {
    2987             : // Eta pT
    2988           0 :   return PtScal(*px,3);
    2989             : }
    2990             : //    y-distribution
    2991             : Double_t AliGenMUONlib::YEta( const Double_t *px, const Double_t */*dummy*/)
    2992             : {
    2993             : // Eta y
    2994             :     Double_t *dum=0;
    2995           0 :     return YJpsi(px,dum);
    2996             : }
    2997             : //                 particle composition
    2998             : //
    2999             : Int_t AliGenMUONlib::IpEta(TRandom *)
    3000             : {
    3001             : // Eta composition
    3002           0 :     return 221;
    3003             : }
    3004             : 
    3005             : //
    3006             : //                        Charm
    3007             : //
    3008             : //
    3009             : //                    pt-distribution
    3010             : //____________________________________________________________
    3011             : Double_t AliGenMUONlib::PtCharm( const Double_t *px, const Double_t */*dummy*/)
    3012             : {
    3013             : // Charm pT
    3014             :   const Double_t kpt0 = 2.25;
    3015             :   const Double_t kxn  = 3.17;
    3016           0 :   Double_t x=*px;
    3017             :   //
    3018           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3019           0 :   return x/TMath::Power(pass1,kxn);
    3020             : }
    3021             : 
    3022             : Double_t AliGenMUONlib::PtCharmCentral( const Double_t *px, const Double_t */*dummy*/)
    3023             : {
    3024             : // Charm pT
    3025             :   const Double_t kpt0 = 2.12;
    3026             :   const Double_t kxn  = 2.78;
    3027           0 :   Double_t x=*px;
    3028             :   //
    3029           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3030           0 :   return x/TMath::Power(pass1,kxn);
    3031             : }
    3032             : Double_t AliGenMUONlib::PtCharmF0M0S0PP( const Double_t *px, const Double_t */*dummy*/)
    3033             : {
    3034             : // FiMjSkPP define theoretical uncertainties around F0M0S0PP as follows:
    3035             : // PtCharmFiMjSkPP = PtCharmF0M0S0PP * (dN(i,j,k)/dpt / dN(0,0,0)/dpt)_MNR
    3036             : //       i=0,1,2;  j=0,1,2;  k=0,1,...,6
    3037             : // dN(i,j,k)/dpt - spectra obtained by A.Dainese (hep-ph/0601164, p.88; 
    3038             : // http://www-zeus.desy.de/~corradi/benchmarks) from NLO pQCD (MNR)
    3039             : // calculations for the following inputs: 
    3040             : // Peterson fragmentation function (F) with \epsilon_c = 0.02, 0.002 & 0.11 
    3041             : // for i=0,1 & 2 respectively; quark mass (M) of 1.5, 1.3 & 1.7 GeV 
    3042             : // for j=0,1 & 2 respectively; 
    3043             : // factorisation \mu_F = a*mt and renormalisation \mu_R = b*mt scales (S) 
    3044             : // with a/b = 1/1, 1/0.5, 0.5/1, 0.5/0.5, 1/2, 2/1 & 2/2 
    3045             : // for k = 0, 1, 2, 3, 4, 5 & 6 respectively; CTEQ6.1 PDF set 
    3046             : // (PDF uncertainty not considered since is small, see hep-ph/0601164, p.89).
    3047             : // June 2008, Smbat.Grigoryan@cern.ch
    3048             : 
    3049             : // Charm pT
    3050             : // Pythia6.214 (kCharmppMNRwmi, PDF = CTEQ5L, quark mass = 1.2 GeV, PtHard > 2.76 GeV/c)
    3051             : // for pp collisions at 14 TeV with one c-cbar pair per event.
    3052             : // Corresponding NLO total cross section is 5.68 mb
    3053             : 
    3054             : 
    3055             :   const Double_t kpt0 = 2.2930;
    3056             :   const Double_t kxn  = 3.1196;
    3057             :   Double_t c[3]={-5.2180e-01,1.8753e-01,2.8669e-02};
    3058           0 :   Double_t x=*px;
    3059             :   //
    3060           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3061           0 :   return x/TMath::Power(pass1,kxn)*(1.+c[0]*x+c[1]*x*x)/(1.+c[2]*x*x);
    3062             : }
    3063             : Double_t AliGenMUONlib::PtCharmF1M0S0PP( const Double_t *px, const Double_t */*dummy*/)
    3064             : {
    3065             : // Charm pT
    3066             : // Corresponding NLO total cross section is 6.06 mb
    3067             :   const Double_t kpt0 = 2.8669;
    3068             :   const Double_t kxn  = 3.1044;
    3069             :   Double_t c[3]={-4.6714e-01,1.5005e-01,4.5003e-02};
    3070           0 :   Double_t x=*px;
    3071             :   //
    3072           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3073           0 :   return x/TMath::Power(pass1,kxn)*(1.+c[0]*x+c[1]*x*x)/(1.+c[2]*x*x);
    3074             : }
    3075             : Double_t AliGenMUONlib::PtCharmF2M0S0PP( const Double_t *px, const Double_t */*dummy*/)
    3076             : {
    3077             : // Charm pT
    3078             : // Corresponding NLO total cross section is 6.06 mb
    3079             :   const Double_t kpt0 = 1.8361;
    3080             :   const Double_t kxn  = 3.2966;
    3081             :   Double_t c[3]={-6.1550e-01,2.6498e-01,1.0728e-02};
    3082           0 :   Double_t x=*px;
    3083             :   //
    3084           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3085           0 :   return x/TMath::Power(pass1,kxn)*(1.+c[0]*x+c[1]*x*x)/(1.+c[2]*x*x);
    3086             : }
    3087             : Double_t AliGenMUONlib::PtCharmF0M1S0PP( const Double_t *px, const Double_t */*dummy*/)
    3088             : {
    3089             : // Charm pT
    3090             : // Corresponding NLO total cross section is 7.69 mb
    3091             :   const Double_t kpt0 = 2.1280;
    3092             :   const Double_t kxn  = 3.1397;
    3093             :   Double_t c[3]={-5.4021e-01,2.0944e-01,2.5211e-02};
    3094           0 :   Double_t x=*px;
    3095             :   //
    3096           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3097           0 :   return x/TMath::Power(pass1,kxn)*(1.+c[0]*x+c[1]*x*x)/(1.+c[2]*x*x);
    3098             : }
    3099             : Double_t AliGenMUONlib::PtCharmF0M2S0PP( const Double_t *px, const Double_t */*dummy*/)
    3100             : {
    3101             : // Charm pT
    3102             : // Corresponding NLO total cross section is 4.81 mb
    3103             :   const Double_t kpt0 = 2.4579;
    3104             :   const Double_t kxn  = 3.1095;
    3105             :   Double_t c[3]={-5.1497e-01,1.7532e-01,3.2429e-02};
    3106           0 :   Double_t x=*px;
    3107             :   //
    3108           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3109           0 :   return x/TMath::Power(pass1,kxn)*(1.+c[0]*x+c[1]*x*x)/(1.+c[2]*x*x);
    3110             : }
    3111             : Double_t AliGenMUONlib::PtCharmF0M0S1PP( const Double_t *px, const Double_t */*dummy*/)
    3112             : {
    3113             : // Charm pT
    3114             : // Corresponding NLO total cross section is 14.09 mb
    3115             :   const Double_t kpt0 = 2.1272;
    3116             :   const Double_t kxn  = 3.1904;
    3117             :   Double_t c[3]={-4.6088e-01,2.1918e-01,2.3055e-02};
    3118           0 :   Double_t x=*px;
    3119             :   //
    3120           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3121           0 :   return x/TMath::Power(pass1,kxn)*(1.+c[0]*x+c[1]*x*x)/(1.+c[2]*x*x);
    3122             : }
    3123             : Double_t AliGenMUONlib::PtCharmF0M0S2PP( const Double_t *px, const Double_t */*dummy*/)
    3124             : {
    3125             : // Charm pT
    3126             : // Corresponding NLO total cross section is 1.52 mb
    3127             :   const Double_t kpt0 = 2.8159;
    3128             :   const Double_t kxn  = 3.0857;
    3129             :   Double_t c[3]={-6.4691e-01,2.0289e-01,2.4922e-02};
    3130           0 :   Double_t x=*px;
    3131             :   //
    3132           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3133           0 :   return x/TMath::Power(pass1,kxn)*(1.+c[0]*x+c[1]*x*x)/(1.+c[2]*x*x);
    3134             : }
    3135             : Double_t AliGenMUONlib::PtCharmF0M0S3PP( const Double_t *px, const Double_t */*dummy*/)
    3136             : {
    3137             : // Charm pT
    3138             : // Corresponding NLO total cross section is 3.67 mb
    3139             :   const Double_t kpt0 = 2.7297;
    3140             :   const Double_t kxn  = 3.3019;
    3141             :   Double_t c[3]={-6.2216e-01,1.9031e-01,1.5341e-02};
    3142           0 :   Double_t x=*px;
    3143             :   //
    3144           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3145           0 :   return x/TMath::Power(pass1,kxn)*(1.+c[0]*x+c[1]*x*x)/(1.+c[2]*x*x);
    3146             : }
    3147             : Double_t AliGenMUONlib::PtCharmF0M0S4PP( const Double_t *px, const Double_t */*dummy*/)
    3148             : {
    3149             : // Charm pT
    3150             : // Corresponding NLO total cross section is 3.38 mb
    3151             :   const Double_t kpt0 = 2.3894;
    3152             :   const Double_t kxn  = 3.1075;
    3153             :   Double_t c[3]={-4.9742e-01,1.7032e-01,2.5994e-02};
    3154           0 :   Double_t x=*px;
    3155             :   //
    3156           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3157           0 :   return x/TMath::Power(pass1,kxn)*(1.+c[0]*x+c[1]*x*x)/(1.+c[2]*x*x);
    3158             : }
    3159             : Double_t AliGenMUONlib::PtCharmF0M0S5PP( const Double_t *px, const Double_t */*dummy*/)
    3160             : {
    3161             : // Charm pT
    3162             : // Corresponding NLO total cross section is 10.37 mb
    3163             :   const Double_t kpt0 = 2.0187;
    3164             :   const Double_t kxn  = 3.3011;
    3165             :   Double_t c[3]={-3.9869e-01,2.9248e-01,1.1763e-02};
    3166           0 :   Double_t x=*px;
    3167             :   //
    3168           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3169           0 :   return x/TMath::Power(pass1,kxn)*(1.+c[0]*x+c[1]*x*x)/(1.+c[2]*x*x);
    3170             : }
    3171             : Double_t AliGenMUONlib::PtCharmF0M0S6PP( const Double_t *px, const Double_t */*dummy*/)
    3172             : {
    3173             : // Charm pT
    3174             : // Corresponding NLO total cross section is 7.22 mb
    3175             :   const Double_t kpt0 = 2.1089;
    3176             :   const Double_t kxn  = 3.1848;
    3177             :   Double_t c[3]={-4.6275e-01,1.8114e-01,2.1363e-02};
    3178           0 :   Double_t x=*px;
    3179             :   //
    3180           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3181           0 :   return x/TMath::Power(pass1,kxn)*(1.+c[0]*x+c[1]*x*x)/(1.+c[2]*x*x);
    3182             : }
    3183             : 
    3184             : //                  y-distribution
    3185             : Double_t AliGenMUONlib::YCharm( const Double_t *px, const Double_t */*dummy*/)
    3186             : {
    3187             : // Charm y :: Carrer & Dainese : ALICE-INT-2003-019 v.3 (hep-ph/0311225) 
    3188             : // Pythia tuned to reproduce the distribution given by the HVQMNR program based on NLO calculations (pQCD)
    3189             : // shadowing + kt broadening 
    3190             : 
    3191           0 :     Double_t x=px[0];
    3192             :     Double_t c[2]={-2.42985e-03,-2.31001e-04};
    3193           0 :     Double_t y=1+(c[0]*TMath::Power(x,2))+(c[1]*TMath::Power(x,4));
    3194             :     Double_t ycharm;
    3195             :     
    3196           0 :     if (TMath::Abs(x)>8) {
    3197             :       ycharm=0.;
    3198           0 :     }
    3199             :     else {
    3200           0 :       ycharm=TMath::Power(y,3);
    3201             :     }
    3202             :     
    3203           0 :     return ycharm;
    3204             : }
    3205             : Double_t AliGenMUONlib::YCharmF0M0S0PP( const Double_t *px, const Double_t */*dummy*/)
    3206             : {
    3207             : // FiMjSkPP define theoretical uncertainties around F0M0S0PP as follows:
    3208             : // YCharmFiMjSkPP = YCharmF0M0S0PP * (dN(i,j,k)/dy / dN(0,0,0)/dy)_MNR
    3209             : //       i=0,1,2;  j=0,1,2;  k=0,1,...,6
    3210             : // dN(i,j,k)/dy - spectra obtained by A.Dainese (hep-ph/0601164, p.88; 
    3211             : // http://www-zeus.desy.de/~corradi/benchmarks) from NLO pQCD (MNR) 
    3212             : // calculations for the following inputs: 
    3213             : // Peterson fragmentation function (F) with \epsilon_c = 0.02, 0.002 & 0.11 
    3214             : // for i=0,1 & 2 respectively; quark mass (M) of 1.5, 1.3 & 1.7 GeV 
    3215             : // for j=0,1 & 2 respectively; 
    3216             : // factorisation \mu_F = a*mt and renormalisation \mu_R = b*mt scales (S) 
    3217             : // with a/b = 1/1,1/0.5, 0.5/1, 0.5/0.5, 1/2, 2/1 & 2/2 for 
    3218             : // k = 0, 1, 2, 3, 4, 5 & 6 respectively; CTEQ6.1 PDF set
    3219             : // (PDF uncertainty not considered since is small, see hep-ph/0601164, p.89).
    3220             : // June 2008, Smbat.Grigoryan@cern.ch
    3221             : 
    3222             : // Charm y
    3223             : // Pythia6.214 (kCharmppMNRwmi, PDF = CTEQ5L, quark mass = 1.2 GeV, PtHard > 2.76 GeV/c)
    3224             : // for pp collisions at 14 TeV with one c-cbar pair per event.
    3225             : // Corresponding NLO total cross section is 5.68 mb
    3226             : 
    3227           0 :     Double_t x=px[0];
    3228             :     Double_t c[2]={7.0909e-03,6.1967e-05};
    3229           0 :     Double_t y=1-(c[0]*TMath::Power(x,2))-(c[1]*TMath::Power(x,4));
    3230             :     Double_t ycharm;
    3231             :     
    3232           0 :     if (TMath::Abs(x)>9) {
    3233             :       ycharm=0.;
    3234           0 :     }
    3235             :     else {
    3236           0 :       ycharm=TMath::Power(y,3);
    3237             :     }
    3238             :     
    3239           0 :     return ycharm;
    3240             : }
    3241             : Double_t AliGenMUONlib::YCharmF1M0S0PP( const Double_t *px, const Double_t */*dummy*/)
    3242             : {
    3243             : // Charm y
    3244             : // Corresponding NLO total cross section is 6.06 mb
    3245           0 :     Double_t x=px[0];
    3246             :     Double_t c[2]={6.9707e-03,6.0971e-05};
    3247           0 :     Double_t y=1-(c[0]*TMath::Power(x,2))-(c[1]*TMath::Power(x,4));
    3248             :     Double_t ycharm;
    3249             :     
    3250           0 :     if (TMath::Abs(x)>9) {
    3251             :       ycharm=0.;
    3252           0 :     }
    3253             :     else {
    3254           0 :       ycharm=TMath::Power(y,3);
    3255             :     }
    3256             :     
    3257           0 :     return ycharm;
    3258             : }
    3259             : Double_t AliGenMUONlib::YCharmF2M0S0PP( const Double_t *px, const Double_t */*dummy*/)
    3260             : {
    3261             : // Charm y
    3262             : // Corresponding NLO total cross section is 6.06 mb
    3263           0 :     Double_t x=px[0];
    3264             :     Double_t c[2]={7.1687e-03,6.5303e-05};
    3265           0 :     Double_t y=1-(c[0]*TMath::Power(x,2))-(c[1]*TMath::Power(x,4));
    3266             :     Double_t ycharm;
    3267             :     
    3268           0 :     if (TMath::Abs(x)>9) {
    3269             :       ycharm=0.;
    3270           0 :     }
    3271             :     else {
    3272           0 :       ycharm=TMath::Power(y,3);
    3273             :     }
    3274             :     
    3275           0 :     return ycharm;
    3276             : }
    3277             : Double_t AliGenMUONlib::YCharmF0M1S0PP( const Double_t *px, const Double_t */*dummy*/)
    3278             : {
    3279             : // Charm y
    3280             : // Corresponding NLO total cross section is 7.69 mb
    3281           0 :     Double_t x=px[0];
    3282             :     Double_t c[2]={5.9090e-03,7.1854e-05};
    3283           0 :     Double_t y=1-(c[0]*TMath::Power(x,2))-(c[1]*TMath::Power(x,4));
    3284             :     Double_t ycharm;
    3285             :     
    3286           0 :     if (TMath::Abs(x)>9) {
    3287             :       ycharm=0.;
    3288           0 :     }
    3289             :     else {
    3290           0 :       ycharm=TMath::Power(y,3);
    3291             :     }
    3292             :     
    3293           0 :     return ycharm;
    3294             : }
    3295             : Double_t AliGenMUONlib::YCharmF0M2S0PP( const Double_t *px, const Double_t */*dummy*/)
    3296             : {
    3297             : // Charm y
    3298             : // Corresponding NLO total cross section is 4.81 mb
    3299           0 :     Double_t x=px[0];
    3300             :     Double_t c[2]={8.0882e-03,5.5872e-05};
    3301           0 :     Double_t y=1-(c[0]*TMath::Power(x,2))-(c[1]*TMath::Power(x,4));
    3302             :     Double_t ycharm;
    3303             :     
    3304           0 :     if (TMath::Abs(x)>9) {
    3305             :       ycharm=0.;
    3306           0 :     }
    3307             :     else {
    3308           0 :       ycharm=TMath::Power(y,3);
    3309             :     }
    3310             :     
    3311           0 :     return ycharm;
    3312             : }
    3313             : Double_t AliGenMUONlib::YCharmF0M0S1PP( const Double_t *px, const Double_t */*dummy*/)
    3314             : {
    3315             : // Charm y
    3316             : // Corresponding NLO total cross section is 14.09 mb
    3317           0 :     Double_t x=px[0];
    3318             :     Double_t c[2]={7.2520e-03,6.2691e-05};
    3319           0 :     Double_t y=1-(c[0]*TMath::Power(x,2))-(c[1]*TMath::Power(x,4));
    3320             :     Double_t ycharm;
    3321             :     
    3322           0 :     if (TMath::Abs(x)>9) {
    3323             :       ycharm=0.;
    3324           0 :     }
    3325             :     else {
    3326           0 :       ycharm=TMath::Power(y,3);
    3327             :     }
    3328             :     
    3329           0 :     return ycharm;
    3330             : }
    3331             : Double_t AliGenMUONlib::YCharmF0M0S2PP( const Double_t *px, const Double_t */*dummy*/)
    3332             : {
    3333             : // Charm y
    3334             : // Corresponding NLO total cross section is 1.52 mb
    3335           0 :     Double_t x=px[0];
    3336             :     Double_t c[2]={1.1040e-04,1.4498e-04};
    3337           0 :     Double_t y=1-(c[0]*TMath::Power(x,2))-(c[1]*TMath::Power(x,4));
    3338             :     Double_t ycharm;
    3339             :     
    3340           0 :     if (TMath::Abs(x)>9) {
    3341             :       ycharm=0.;
    3342           0 :     }
    3343             :     else {
    3344           0 :       ycharm=TMath::Power(y,3);
    3345             :     }
    3346             :     
    3347           0 :     return ycharm;
    3348             : }
    3349             : Double_t AliGenMUONlib::YCharmF0M0S3PP( const Double_t *px, const Double_t */*dummy*/)
    3350             : {
    3351             : // Charm y
    3352             : // Corresponding NLO total cross section is 3.67 mb
    3353           0 :     Double_t x=px[0];
    3354             :     Double_t c[2]={-3.1328e-03,1.8270e-04};
    3355           0 :     Double_t y=1-(c[0]*TMath::Power(x,2))-(c[1]*TMath::Power(x,4));
    3356             :     Double_t ycharm;
    3357             :     
    3358           0 :     if (TMath::Abs(x)>9) {
    3359             :       ycharm=0.;
    3360           0 :     }
    3361             :     else {
    3362           0 :       ycharm=TMath::Power(y,3);
    3363             :     }
    3364             :     
    3365           0 :     return ycharm;
    3366             : }
    3367             : Double_t AliGenMUONlib::YCharmF0M0S4PP( const Double_t *px, const Double_t */*dummy*/)
    3368             : {
    3369             : // Charm y
    3370             : // Corresponding NLO total cross section is 3.38 mb
    3371           0 :     Double_t x=px[0];
    3372             :     Double_t c[2]={7.0865e-03,6.2532e-05};
    3373           0 :     Double_t y=1-(c[0]*TMath::Power(x,2))-(c[1]*TMath::Power(x,4));
    3374             :     Double_t ycharm;
    3375             :     
    3376           0 :     if (TMath::Abs(x)>9) {
    3377             :       ycharm=0.;
    3378           0 :     }
    3379             :     else {
    3380           0 :       ycharm=TMath::Power(y,3);
    3381             :     }
    3382             :     
    3383           0 :     return ycharm;
    3384             : }
    3385             : Double_t AliGenMUONlib::YCharmF0M0S5PP( const Double_t *px, const Double_t */*dummy*/)
    3386             : {
    3387             : // Charm y
    3388             : // Corresponding NLO total cross section is 10.37 mb
    3389           0 :     Double_t x=px[0];
    3390             :     Double_t c[2]={7.7070e-03,5.3533e-05};
    3391           0 :     Double_t y=1-(c[0]*TMath::Power(x,2))-(c[1]*TMath::Power(x,4));
    3392             :     Double_t ycharm;
    3393             :     
    3394           0 :     if (TMath::Abs(x)>9) {
    3395             :       ycharm=0.;
    3396           0 :     }
    3397             :     else {
    3398           0 :       ycharm=TMath::Power(y,3);
    3399             :     }
    3400             :     
    3401           0 :     return ycharm;
    3402             : }
    3403             : Double_t AliGenMUONlib::YCharmF0M0S6PP( const Double_t *px, const Double_t */*dummy*/)
    3404             : {
    3405             : // Charm y
    3406             : // Corresponding NLO total cross section is 7.22 mb
    3407           0 :     Double_t x=px[0];
    3408             :     Double_t c[2]={7.9195e-03,5.3823e-05};
    3409           0 :     Double_t y=1-(c[0]*TMath::Power(x,2))-(c[1]*TMath::Power(x,4));
    3410             :     Double_t ycharm;
    3411             :     
    3412           0 :     if (TMath::Abs(x)>9) {
    3413             :       ycharm=0.;
    3414           0 :     }
    3415             :     else {
    3416           0 :       ycharm=TMath::Power(y,3);
    3417             :     }
    3418             :     
    3419           0 :     return ycharm;
    3420             : }
    3421             : 
    3422             : 
    3423             : Int_t AliGenMUONlib::IpCharm(TRandom *ran)
    3424             : {  
    3425             : // Charm composition
    3426             :     Float_t random;
    3427             :     Int_t ip;
    3428             : //    411,421,431,4122
    3429           0 :     random = ran->Rndm();
    3430             : //  Taux de production Carrer & Dainese : ALICE-INT-2003-019 v.3  
    3431             : //  >>>>> cf. tab 4 p 11
    3432             :   
    3433           0 :     if (random < 0.30) {                       
    3434             :         ip=421;
    3435           0 :     } else if (random < 0.60) {
    3436             :         ip=-421;
    3437           0 :     } else if (random < 0.70) {
    3438             :         ip=411;
    3439           0 :     } else if (random < 0.80) {
    3440             :         ip=-411;
    3441           0 :     } else if (random < 0.86) {
    3442             :         ip=431;
    3443           0 :     } else if (random < 0.92) {
    3444             :         ip=-431;        
    3445           0 :     } else if (random < 0.96) {
    3446             :         ip=4122;
    3447           0 :     } else {
    3448             :         ip=-4122;
    3449             :     }
    3450             :     
    3451           0 :     return ip;
    3452             : }
    3453             : 
    3454             : //
    3455             : //                        Beauty
    3456             : //
    3457             : //
    3458             : //                    pt-distribution
    3459             : //____________________________________________________________
    3460             : Double_t AliGenMUONlib::PtBeauty( const Double_t *px, const Double_t */*dummy*/)
    3461             : {
    3462             : // Beauty pT
    3463             :   const Double_t kpt0 = 6.53;
    3464             :   const Double_t kxn  = 3.59;
    3465           0 :   Double_t x=*px;
    3466             :   //
    3467           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3468           0 :   return x/TMath::Power(pass1,kxn);
    3469             : }
    3470             : 
    3471             : Double_t AliGenMUONlib::PtBeautyCentral( const Double_t *px, const Double_t */*dummy*/)
    3472             : {
    3473             : // Beauty pT
    3474             :   const Double_t kpt0 = 6.14;
    3475             :   const Double_t kxn  = 2.93;
    3476           0 :   Double_t x=*px;
    3477             :   //
    3478           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3479           0 :   return x/TMath::Power(pass1,kxn);
    3480             : }
    3481             : Double_t AliGenMUONlib::PtBeautyF0M0S0PP( const Double_t *px, const Double_t */*dummy*/)
    3482             : {
    3483             : // FiMjSkPP define theoretical uncertainties around F0M0S0PP as follows:
    3484             : // PtBeautyFiMjSkPP = PtBeautyF0M0S0PP * (dN(i,j,k)/dpt / dN(0,0,0)/dpt)_MNR
    3485             : //       i=0,1,2;  j=0,1,2;  k=0,1,...,6
    3486             : // dN(i,j,k)/dpt - spectra obtained by A.Dainese (hep-ph/0601164, p.88; 
    3487             : // http://www-zeus.desy.de/~corradi/benchmarks) from NLO pQCD (MNR) 
    3488             : // calculations for the following inputs: 
    3489             : // Peterson fragmentation function (F) with \epsilon_b = 0.001, 0.0002 & 0.004 
    3490             : // for i=0,1 & 2 respectively; quark mass (M) of 4.75, 4.5 & 5.0 GeV 
    3491             : // for j=0,1 & 2 respectively; 
    3492             : // factorisation \mu_F = a*mt and renormalisation \mu_R = b*mt scales (S) 
    3493             : // with a/b = 1/1, 1/0.5, 0.5/1, 0.5/0.5, 1/2, 2/1 & 2/2 for 
    3494             : // k = 0, 1, 2, 3, 4, 5 & 6 respectively; CTEQ6.1 PDF set
    3495             : // (PDF uncertainty not considered since is small, see hep-ph/0601164, p.89).
    3496             : // June 2008, Smbat.Grigoryan@cern.ch
    3497             : 
    3498             : // Beauty pT
    3499             : // Pythia6.214 (kBeautyppMNRwmi, PDF = CTEQ5L, quark mass = 4.75 GeV, PtHard > 2.76 GeV/c)
    3500             : // for pp collisions at 14 TeV with one b-bbar pair per event.
    3501             : // Corresponding NLO total cross section is 0.494 mb
    3502             : 
    3503             :   const Double_t kpt0 = 8.0575;
    3504             :   const Double_t kxn  = 3.1921;
    3505           0 :   Double_t x=*px;
    3506             :   //
    3507           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3508           0 :   return x/TMath::Power(pass1,kxn);
    3509             : }
    3510             : Double_t AliGenMUONlib::PtBeautyF1M0S0PP( const Double_t *px, const Double_t */*dummy*/)
    3511             : {
    3512             : // Beauty pT
    3513             : // Corresponding NLO total cross section is 0.445 mb
    3514             :   const Double_t kpt0 = 8.6239;
    3515             :   const Double_t kxn  = 3.2911;
    3516           0 :   Double_t x=*px;
    3517             :   //
    3518           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3519           0 :   return x/TMath::Power(pass1,kxn);
    3520             : }
    3521             : Double_t AliGenMUONlib::PtBeautyF2M0S0PP( const Double_t *px, const Double_t */*dummy*/)
    3522             : {
    3523             : // Beauty pT
    3524             : // Corresponding NLO total cross section is 0.445 mb
    3525             :   const Double_t kpt0 = 7.3367;
    3526             :   const Double_t kxn  = 3.0692;
    3527           0 :   Double_t x=*px;
    3528             :   //
    3529           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3530           0 :   return x/TMath::Power(pass1,kxn);
    3531             : }
    3532             : Double_t AliGenMUONlib::PtBeautyF0M1S0PP( const Double_t *px, const Double_t */*dummy*/)
    3533             : {
    3534             : // Beauty pT
    3535             : // Corresponding NLO total cross section is 0.518 mb
    3536             :   const Double_t kpt0 = 7.6409;
    3537             :   const Double_t kxn  = 3.1364;
    3538           0 :   Double_t x=*px;
    3539             :   //
    3540           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3541           0 :   return x/TMath::Power(pass1,kxn);
    3542             : }
    3543             : Double_t AliGenMUONlib::PtBeautyF0M2S0PP( const Double_t *px, const Double_t */*dummy*/)
    3544             : {
    3545             : // Beauty pT
    3546             : // Corresponding NLO total cross section is 0.384 mb
    3547             :   const Double_t kpt0 = 8.4948;
    3548             :   const Double_t kxn  = 3.2546;
    3549           0 :   Double_t x=*px;
    3550             :   //
    3551           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3552           0 :   return x/TMath::Power(pass1,kxn);
    3553             : }
    3554             : Double_t AliGenMUONlib::PtBeautyF0M0S1PP( const Double_t *px, const Double_t */*dummy*/)
    3555             : {
    3556             : // Beauty pT
    3557             : // Corresponding NLO total cross section is 0.648 mb
    3558             :   const Double_t kpt0 = 7.6631;
    3559             :   const Double_t kxn  = 3.1621;
    3560           0 :   Double_t x=*px;
    3561             :   //
    3562           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3563           0 :   return x/TMath::Power(pass1,kxn);
    3564             : }
    3565             : Double_t AliGenMUONlib::PtBeautyF0M0S2PP( const Double_t *px, const Double_t */*dummy*/)
    3566             : {
    3567             : // Beauty pT
    3568             : // Corresponding NLO total cross section is 0.294 mb
    3569             :   const Double_t kpt0 = 8.7245;
    3570             :   const Double_t kxn  = 3.2213;
    3571           0 :   Double_t x=*px;
    3572             :   //
    3573           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3574           0 :   return x/TMath::Power(pass1,kxn);
    3575             : }
    3576             : Double_t AliGenMUONlib::PtBeautyF0M0S3PP( const Double_t *px, const Double_t */*dummy*/)
    3577             : {
    3578             : // Beauty pT
    3579             : // Corresponding NLO total cross section is 0.475 mb
    3580             :   const Double_t kpt0 = 8.5296;
    3581             :   const Double_t kxn  = 3.2187;
    3582           0 :   Double_t x=*px;
    3583             :   //
    3584           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3585           0 :   return x/TMath::Power(pass1,kxn);
    3586             : }
    3587             : Double_t AliGenMUONlib::PtBeautyF0M0S4PP( const Double_t *px, const Double_t */*dummy*/)
    3588             : {
    3589             : // Beauty pT
    3590             : // Corresponding NLO total cross section is 0.324 mb
    3591             :   const Double_t kpt0 = 7.9440;
    3592             :   const Double_t kxn  = 3.1614;
    3593           0 :   Double_t x=*px;
    3594             :   //
    3595           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3596           0 :   return x/TMath::Power(pass1,kxn);
    3597             : }
    3598             : Double_t AliGenMUONlib::PtBeautyF0M0S5PP( const Double_t *px, const Double_t */*dummy*/)
    3599             : {
    3600             : // Beauty pT
    3601             : // Corresponding NLO total cross section is 0.536 mb
    3602             :   const Double_t kpt0 = 8.2408;
    3603             :   const Double_t kxn  = 3.3029;
    3604           0 :   Double_t x=*px;
    3605             :   //
    3606           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3607           0 :   return x/TMath::Power(pass1,kxn);
    3608             : }
    3609             : Double_t AliGenMUONlib::PtBeautyF0M0S6PP( const Double_t *px, const Double_t */*dummy*/)
    3610             : {
    3611             : // Beauty pT
    3612             : // Corresponding NLO total cross section is 0.420 mb
    3613             :   const Double_t kpt0 = 7.8041;
    3614             :   const Double_t kxn  = 3.2094;
    3615           0 :   Double_t x=*px;
    3616             :   //
    3617           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    3618           0 :   return x/TMath::Power(pass1,kxn);
    3619             : }
    3620             : 
    3621             : //                     y-distribution
    3622             : Double_t AliGenMUONlib::YBeauty( const Double_t *px, const Double_t */*dummy*/)
    3623             : {
    3624             : // Beauty y :: Carrer & Dainese : ALICE-INT-2003-019 v.3 (hep-ph/0311225) 
    3625             : // Pythia tuned to reproduce the distribution given by the HVQMNR program based on NLO calculations (pQCD)
    3626             : // shadowing + kt broadening 
    3627             : 
    3628           0 :     Double_t x=px[0];
    3629             :     Double_t c[2]={-1.27590e-02,-2.42731e-04};
    3630           0 :     Double_t y=1+c[0]*TMath::Power(x,2)+c[1]*TMath::Power(x,4);
    3631             :     Double_t ybeauty;
    3632             :     
    3633           0 :     if (TMath::Abs(x)>6) {
    3634             :       ybeauty=0.;
    3635           0 :     }
    3636             :     else {
    3637           0 :       ybeauty=TMath::Power(y,3);
    3638             :     }
    3639             :     
    3640           0 :     return ybeauty;
    3641             : }
    3642             : Double_t AliGenMUONlib::YBeautyF0M0S0PP( const Double_t *px, const Double_t */*dummy*/)
    3643             : {
    3644             : // FiMjSkPP define theoretical uncertainties around F0M0S0PP as follows:
    3645             : // YBeautyFiMjSkPP = YBeautyF0M0S0PP * (dN(i,j,k)/dy / dN(0,0,0)/dy)_MNR
    3646             : //       i=0,1,2;  j=0,1,2;  k=0,1,...,6
    3647             : // dN(i,j,k)/dy - spectra obtained by A.Dainese (hep-ph/0601164, p.88; 
    3648             : // http://www-zeus.desy.de/~corradi/benchmarks) from NLO pQCD (MNR) 
    3649             : // calculations for the following inputs: 
    3650             : // Peterson fragmentation function (F) with \epsilon_b = 0.001, 0.0002 & 0.004 
    3651             : // for i=0,1 & 2 respectively; quark mass (M) of 4.75, 4.5 & 5.0 GeV 
    3652             : // for j=0,1 & 2 respectively; 
    3653             : // factorisation \mu_F = a*mt and renormalisation \mu_R = b*mt scales (S) 
    3654             : // with a/b = 1/1, 1/0.5, 0.5/1, 0.5/0.5, 1/2, 2/1 & 2/2 
    3655             : // for k = 0, 1, 2, 3, 4, 5 & 6 respectively; CTEQ6.1 PDF set 
    3656             : // (PDF uncertainty not considered since is small, see hep-ph/0601164, p.89).
    3657             : // June 2008, Smbat.Grigoryan@cern.ch
    3658             : 
    3659             : // Beauty y
    3660             : // Pythia6.214 (kBeautyppMNRwmi, PDF = CTEQ5L, quark mass = 4.75 GeV, PtHard > 2.76 GeV/c)
    3661             : // for pp collisions at 14 TeV with one b-bbar pair per event.
    3662             : // Corresponding NLO total cross section is 0.494 mb
    3663             : 
    3664             : 
    3665           0 :     Double_t x=px[0];
    3666             :     Double_t c[2]={1.2350e-02,9.2667e-05};
    3667           0 :     Double_t y=1-c[0]*TMath::Power(x,2)-c[1]*TMath::Power(x,4);
    3668             :     Double_t ybeauty;
    3669             :     
    3670           0 :     if (TMath::Abs(x)>7.6) {
    3671             :       ybeauty=0.;
    3672           0 :     }
    3673             :     else {
    3674           0 :       ybeauty=TMath::Power(y,3);
    3675             :     }
    3676             :     
    3677           0 :     return ybeauty;
    3678             : }
    3679             : Double_t AliGenMUONlib::YBeautyF1M0S0PP( const Double_t *px, const Double_t */*dummy*/)
    3680             : {
    3681             : // Beauty y
    3682             : // Corresponding NLO total cross section is 0.445 mb
    3683           0 :     Double_t x=px[0];
    3684             :     Double_t c[2]={1.2292e-02,9.1847e-05};
    3685           0 :     Double_t y=1-c[0]*TMath::Power(x,2)-c[1]*TMath::Power(x,4);
    3686             :     Double_t ybeauty;
    3687             :     
    3688           0 :     if (TMath::Abs(x)>7.6) {
    3689             :       ybeauty=0.;
    3690           0 :     }
    3691             :     else {
    3692           0 :       ybeauty=TMath::Power(y,3);
    3693             :     }
    3694             :     
    3695           0 :     return ybeauty;
    3696             : }
    3697             : Double_t AliGenMUONlib::YBeautyF2M0S0PP( const Double_t *px, const Double_t */*dummy*/)
    3698             : {
    3699             : // Beauty y
    3700             : // Corresponding NLO total cross section is 0.445 mb
    3701           0 :     Double_t x=px[0];
    3702             :     Double_t c[2]={1.2436e-02,9.3709e-05};
    3703           0 :     Double_t y=1-c[0]*TMath::Power(x,2)-c[1]*TMath::Power(x,4);
    3704             :     Double_t ybeauty;
    3705             :     
    3706           0 :     if (TMath::Abs(x)>7.6) {
    3707             :       ybeauty=0.;
    3708           0 :     }
    3709             :     else {
    3710           0 :       ybeauty=TMath::Power(y,3);
    3711             :     }
    3712             :     
    3713           0 :     return ybeauty;
    3714             : }
    3715             : Double_t AliGenMUONlib::YBeautyF0M1S0PP( const Double_t *px, const Double_t */*dummy*/)
    3716             : {
    3717             : // Beauty y
    3718             : // Corresponding NLO total cross section is 0.518 mb
    3719           0 :     Double_t x=px[0];
    3720             :     Double_t c[2]={1.1714e-02,1.0068e-04};
    3721           0 :     Double_t y=1-c[0]*TMath::Power(x,2)-c[1]*TMath::Power(x,4);
    3722             :     Double_t ybeauty;
    3723             :     
    3724           0 :     if (TMath::Abs(x)>7.6) {
    3725             :       ybeauty=0.;
    3726           0 :     }
    3727             :     else {
    3728           0 :       ybeauty=TMath::Power(y,3);
    3729             :     }
    3730             :     
    3731           0 :     return ybeauty;
    3732             : }
    3733             : Double_t AliGenMUONlib::YBeautyF0M2S0PP( const Double_t *px, const Double_t */*dummy*/)
    3734             : {
    3735             : // Beauty y
    3736             : // Corresponding NLO total cross section is 0.384 mb
    3737           0 :     Double_t x=px[0];
    3738             :     Double_t c[2]={1.2944e-02,8.5500e-05};
    3739           0 :     Double_t y=1-c[0]*TMath::Power(x,2)-c[1]*TMath::Power(x,4);
    3740             :     Double_t ybeauty;
    3741             :     
    3742           0 :     if (TMath::Abs(x)>7.6) {
    3743             :       ybeauty=0.;
    3744           0 :     }
    3745             :     else {
    3746           0 :       ybeauty=TMath::Power(y,3);
    3747             :     }
    3748             :     
    3749           0 :     return ybeauty;
    3750             : }
    3751             : Double_t AliGenMUONlib::YBeautyF0M0S1PP( const Double_t *px, const Double_t */*dummy*/)
    3752             : {
    3753             : // Beauty y
    3754             : // Corresponding NLO total cross section is 0.648 mb
    3755           0 :     Double_t x=px[0];
    3756             :     Double_t c[2]={1.2455e-02,9.2713e-05};
    3757           0 :     Double_t y=1-c[0]*TMath::Power(x,2)-c[1]*TMath::Power(x,4);
    3758             :     Double_t ybeauty;
    3759             :     
    3760           0 :     if (TMath::Abs(x)>7.6) {
    3761             :       ybeauty=0.;
    3762           0 :     }
    3763             :     else {
    3764           0 :       ybeauty=TMath::Power(y,3);
    3765             :     }
    3766             :     
    3767           0 :     return ybeauty;
    3768             : }
    3769             : Double_t AliGenMUONlib::YBeautyF0M0S2PP( const Double_t *px, const Double_t */*dummy*/)
    3770             : {
    3771             : // Beauty y
    3772             : // Corresponding NLO total cross section is 0.294 mb
    3773           0 :     Double_t x=px[0];
    3774             :     Double_t c[2]={1.0897e-02,1.1878e-04};
    3775           0 :     Double_t y=1-c[0]*TMath::Power(x,2)-c[1]*TMath::Power(x,4);
    3776             :     Double_t ybeauty;
    3777             :     
    3778           0 :     if (TMath::Abs(x)>7.6) {
    3779             :       ybeauty=0.;
    3780           0 :     }
    3781             :     else {
    3782           0 :       ybeauty=TMath::Power(y,3);
    3783             :     }
    3784             :     
    3785           0 :     return ybeauty;
    3786             : }
    3787             : Double_t AliGenMUONlib::YBeautyF0M0S3PP( const Double_t *px, const Double_t */*dummy*/)
    3788             : {
    3789             : // Beauty y
    3790             : // Corresponding NLO total cross section is 0.475 mb
    3791           0 :     Double_t x=px[0];
    3792             :     Double_t c[2]={1.0912e-02,1.1858e-04};
    3793           0 :     Double_t y=1-c[0]*TMath::Power(x,2)-c[1]*TMath::Power(x,4);
    3794             :     Double_t ybeauty;
    3795             :     
    3796           0 :     if (TMath::Abs(x)>7.6) {
    3797             :       ybeauty=0.;
    3798           0 :     }
    3799             :     else {
    3800           0 :       ybeauty=TMath::Power(y,3);
    3801             :     }
    3802             :     
    3803           0 :     return ybeauty;
    3804             : }
    3805             : Double_t AliGenMUONlib::YBeautyF0M0S4PP( const Double_t *px, const Double_t */*dummy*/)
    3806             : {
    3807             : // Beauty y
    3808             : // Corresponding NLO total cross section is 0.324 mb
    3809           0 :     Double_t x=px[0];
    3810             :     Double_t c[2]={1.2378e-02,9.2490e-05};
    3811           0 :     Double_t y=1-c[0]*TMath::Power(x,2)-c[1]*TMath::Power(x,4);
    3812             :     Double_t ybeauty;
    3813             :     
    3814           0 :     if (TMath::Abs(x)>7.6) {
    3815             :       ybeauty=0.;
    3816           0 :     }
    3817             :     else {
    3818           0 :       ybeauty=TMath::Power(y,3);
    3819             :     }
    3820             :     
    3821           0 :     return ybeauty;
    3822             : }
    3823             : Double_t AliGenMUONlib::YBeautyF0M0S5PP( const Double_t *px, const Double_t */*dummy*/)
    3824             : {
    3825             : // Beauty y
    3826             : // Corresponding NLO total cross section is 0.536 mb
    3827           0 :     Double_t x=px[0];
    3828             :     Double_t c[2]={1.2886e-02,8.2912e-05};
    3829           0 :     Double_t y=1-c[0]*TMath::Power(x,2)-c[1]*TMath::Power(x,4);
    3830             :     Double_t ybeauty;
    3831             :     
    3832           0 :     if (TMath::Abs(x)>7.6) {
    3833             :       ybeauty=0.;
    3834           0 :     }
    3835             :     else {
    3836           0 :       ybeauty=TMath::Power(y,3);
    3837             :     }
    3838             :     
    3839           0 :     return ybeauty;
    3840             : }
    3841             : Double_t AliGenMUONlib::YBeautyF0M0S6PP( const Double_t *px, const Double_t */*dummy*/)
    3842             : {
    3843             : // Beauty y
    3844             : // Corresponding NLO total cross section is 0.420 mb
    3845           0 :     Double_t x=px[0];
    3846             :     Double_t c[2]={1.3106e-02,8.0115e-05};
    3847           0 :     Double_t y=1-c[0]*TMath::Power(x,2)-c[1]*TMath::Power(x,4);
    3848             :     Double_t ybeauty;
    3849             :     
    3850           0 :     if (TMath::Abs(x)>7.6) {
    3851             :       ybeauty=0.;
    3852           0 :     }
    3853             :     else {
    3854           0 :       ybeauty=TMath::Power(y,3);
    3855             :     }
    3856             :     
    3857           0 :     return ybeauty;
    3858             : }
    3859             : 
    3860             : Int_t AliGenMUONlib::IpBeauty(TRandom *ran)
    3861             : {  
    3862             : // Beauty Composition
    3863             :     Float_t random;
    3864             :     Int_t ip;
    3865           0 :     random = ran->Rndm(); 
    3866             :     
    3867             : //  Taux de production Carrer & Dainese : ALICE-INT-2003-019 v.3  
    3868             : //  >>>>> cf. tab 4 p 11
    3869             :     
    3870           0 :  if (random < 0.20) {                       
    3871             :         ip=511;
    3872           0 :     } else if (random < 0.40) {
    3873             :         ip=-511;
    3874           0 :     } else if (random < 0.605) {
    3875             :         ip=521;
    3876           0 :     } else if (random < 0.81) {
    3877             :         ip=-521;
    3878           0 :     } else if (random < 0.87) {
    3879             :         ip=531;
    3880           0 :     } else if (random < 0.93) {
    3881             :         ip=-531;        
    3882           0 :     } else if (random < 0.965) {
    3883             :         ip=5122;
    3884           0 :     } else {
    3885             :         ip=-5122;
    3886             :     }
    3887             :     
    3888           0 :  return ip;
    3889             : }
    3890             : 
    3891             : 
    3892             : typedef Double_t (*GenFunc) (const Double_t*,  const Double_t*);
    3893             : GenFunc AliGenMUONlib::GetPt(Int_t param,  const char* tname) const
    3894             : {
    3895             : // Return pointer to pT parameterisation
    3896           0 :     TString sname = TString(tname);
    3897             :     GenFunc func;
    3898           0 :     switch (param) 
    3899             :     {
    3900             :     case kPhi:
    3901             :         func=PtPhi;
    3902           0 :         break;
    3903             :     case kOmega:
    3904             :         func=PtOmega;
    3905           0 :         break;
    3906             :     case kEta:
    3907             :         func=PtEta;
    3908           0 :         break;
    3909             :     case kJpsiFamily:
    3910             :     case kPsiP:
    3911             :     case kChic1:
    3912             :     case kChic2:
    3913             :     case kJpsi:
    3914           0 :         if (sname == "Vogt" || sname == "Vogt PbPb") {
    3915             :             func=PtJpsiPbPb;
    3916           0 :         } else if (sname == "Vogt pp") {
    3917             :             func=PtJpsiPP;
    3918           0 :         } else if (sname == "pp 7") {
    3919             :             func=PtJpsiPP7000;
    3920           0 :         } else if (sname == "pp 8") {
    3921             :             func=PtJpsiPP8000;
    3922           0 :         } else if (sname == "pp 2.76") {
    3923             :             func=PtJpsiPP2760;
    3924           0 :         } else if (sname == "pp 4.4") {
    3925             :             func=PtJpsiPP4400;
    3926           0 :         } else if (sname == "pp 5.03") {
    3927             :             func=PtJpsiPP5030;          
    3928           0 :         } else if (sname == "pp 8.8") {
    3929             :             func=PtJpsiPP8800;
    3930           0 :         } else if (sname == "pp 7 poly") {
    3931             :             func=PtJpsiPP7000;
    3932           0 :         } else if (sname == "pp 2.76 poly") {
    3933             :             func=PtJpsiPP2760;
    3934           0 :         } else if (sname == "PbPb 2.76") {
    3935             :             func=PtJpsiPbPb2760;
    3936           0 :         } else if (sname == "PbPb 2.76c1") {
    3937             :             func=PtJpsiPbPb2760c1;
    3938           0 :         } else if (sname == "PbPb 2.76c2") {
    3939             :             func=PtJpsiPbPb2760c2;
    3940           0 :         } else if (sname == "PbPb 2.76c3") {
    3941             :             func=PtJpsiPbPb2760c3;
    3942           0 :         } else if (sname == "PbPb 2.76c4") {
    3943             :             func=PtJpsiPbPb2760c4;
    3944           0 :         } else if (sname == "PbPb 2.76c5") {
    3945             :             func=PtJpsiPbPb2760c5;
    3946           0 :         } else if (sname == "PbPb 2.76c6") {
    3947             :             func=PtJpsiPbPb2760c6;
    3948           0 :         } else if (sname == "PbPb 2.76c7") {
    3949             :             func=PtJpsiPbPb2760c7;
    3950           0 :         } else if (sname == "PbPb 2.76c8") {
    3951             :             func=PtJpsiPbPb2760c8;
    3952           0 :         } else if (sname == "PbPb 2.76c9") {
    3953             :             func=PtJpsiPbPb2760c9;
    3954           0 :         } else if (sname == "PbPb 2.76c10") {
    3955             :             func=PtJpsiPbPb2760c10;
    3956           0 :         } else if (sname == "PbPb 2.76c11") {
    3957             :             func=PtJpsiPbPb2760c11;
    3958           0 :         } else if (sname == "pPb 5.03") {
    3959             :             func=PtJpsiPPb5030;
    3960           0 :         } else if (sname == "pPb 5.03c1") {
    3961             :             func=PtJpsiPPb5030c1;
    3962           0 :         } else if (sname == "pPb 5.03c2") {
    3963             :             func=PtJpsiPPb5030c2;
    3964           0 :         } else if (sname == "pPb 5.03c3") {
    3965             :             func=PtJpsiPPb5030c3;
    3966           0 :         } else if (sname == "pPb 5.03c4") {
    3967             :             func=PtJpsiPPb5030c4;
    3968           0 :         } else if (sname == "Pbp 5.03") {
    3969             :             func=PtJpsiPbP5030;
    3970           0 :         } else if (sname == "Pbp 5.03c1") {
    3971             :             func=PtJpsiPbP5030c1;
    3972           0 :         } else if (sname == "Pbp 5.03c2") {
    3973             :             func=PtJpsiPbP5030c2;
    3974           0 :         } else if (sname == "Pbp 5.03c3") {
    3975             :             func=PtJpsiPbP5030c3;
    3976           0 :         } else if (sname == "Pbp 5.03c4") {
    3977             :             func=PtJpsiPbP5030c4;
    3978           0 :         } else if (sname == "pPb 8.8") {
    3979             :             func=PtJpsiPPb8800;
    3980           0 :         } else if (sname == "pPb 8.8c1") {
    3981             :             func=PtJpsiPPb8800c1;
    3982           0 :         } else if (sname == "pPb 8.8c2") {
    3983             :             func=PtJpsiPPb8800c2;
    3984           0 :         } else if (sname == "pPb 8.8c3") {
    3985             :             func=PtJpsiPPb8800c3;
    3986           0 :         } else if (sname == "pPb 8.8c4") {
    3987             :             func=PtJpsiPPb8800c4;
    3988           0 :         } else if (sname == "Pbp 8.8") {
    3989             :             func=PtJpsiPbP8800;
    3990           0 :         } else if (sname == "Pbp 8.8c1") {
    3991             :             func=PtJpsiPbP8800c1;
    3992           0 :         } else if (sname == "Pbp 8.8c2") {
    3993             :             func=PtJpsiPbP8800c2;
    3994           0 :         } else if (sname == "Pbp 8.8c3") {
    3995             :             func=PtJpsiPbP8800c3;
    3996           0 :         } else if (sname == "Pbp 8.8c4") {
    3997             :             func=PtJpsiPbP8800c4;
    3998           0 :         } else if (sname == "CDF scaled") {
    3999             :             func=PtJpsiCDFscaled;
    4000           0 :         } else if (sname == "CDF pp") {
    4001             :             func=PtJpsiCDFscaledPP;
    4002           0 :         } else if (sname == "CDF pp 10") {
    4003             :             func=PtJpsiCDFscaledPP10;
    4004           0 :         } else if (sname == "CDF pp 8.8") {
    4005             :             func=PtJpsiCDFscaledPP9;
    4006           0 :         } else if (sname == "CDF pp 7" || sname == "CDF pp 7 flat y") {
    4007             :             func=PtJpsiCDFscaledPP7;
    4008           0 :         } else if (sname == "CDF pp 3.94") {
    4009             :             func=PtJpsiCDFscaledPP4;
    4010           0 :         } else if (sname == "CDF pp 2.76") {
    4011             :             func=PtJpsiCDFscaledPP3;
    4012           0 :         } else if (sname == "CDF pp 1.9") {
    4013             :             func=PtJpsiCDFscaledPP2;
    4014           0 :         } else if (sname == "CDF pPb 8.8") {
    4015             :             func=PtJpsiCDFscaledPPb9;
    4016           0 :         } else if (sname == "CDF Pbp 8.8") {
    4017             :             func=PtJpsiCDFscaledPbP9;
    4018           0 :         } else if (sname == "CDF PbPb 3.94") {
    4019             :             func=PtJpsiCDFscaledPbPb4;
    4020           0 :         } else if (sname == "Flat" || sname == "CDF pp 7 flat pt") {
    4021             :             func=PtJpsiFlat;
    4022           0 :         } else {
    4023             :             func=PtJpsi;
    4024             :         }
    4025             :         break;
    4026             :     case kJpsiFromB:
    4027             :         func = PtJpsiBPbPb;
    4028           0 :         break;
    4029             :     case kUpsilonFamily:
    4030             :     case kUpsilonP:
    4031             :     case kUpsilonPP:
    4032             :     case kUpsilon:
    4033           0 :         if (sname == "Vogt" || sname == "Vogt PbPb") {
    4034             :             func=PtUpsilonPbPb;
    4035           0 :         } else if (sname == "Vogt pp") {
    4036             :             func=PtUpsilonPP;
    4037           0 :         } else if (sname == "pp 7") {
    4038             :             func=PtUpsilonPP7000;
    4039           0 :        } else if (sname == "pp 8") {
    4040             :            func=PtUpsilonPP8000;
    4041           0 :         } else if (sname == "pp 2.76") {
    4042             :             func=PtUpsilonPP2760;
    4043           0 :         } else if (sname == "pp 4.4") {
    4044             :             func=PtUpsilonPP4400;
    4045           0 :         } else if (sname == "pp 5.03") {
    4046             :             func=PtUpsilonPP5030;
    4047           0 :         } else if (sname == "pp 8.8") {
    4048             :             func=PtUpsilonPP8800;
    4049           0 :         } else if (sname == "pp 7 poly") {
    4050             :             func=PtUpsilonPP7000;
    4051           0 :         } else if (sname == "pp 2.76 poly") {
    4052             :             func=PtUpsilonPP2760;
    4053           0 :         } else if (sname == "PbPb 2.76") {
    4054             :             func=PtUpsilonPbPb2760;
    4055           0 :         } else if (sname == "PbPb 2.76c1") {
    4056             :             func=PtUpsilonPbPb2760c1;
    4057           0 :         } else if (sname == "PbPb 2.76c2") {
    4058             :             func=PtUpsilonPbPb2760c2;
    4059           0 :         } else if (sname == "PbPb 2.76c3") {
    4060             :             func=PtUpsilonPbPb2760c3;
    4061           0 :         } else if (sname == "PbPb 2.76c4") {
    4062             :             func=PtUpsilonPbPb2760c4;
    4063           0 :         } else if (sname == "PbPb 2.76c5") {
    4064             :             func=PtUpsilonPbPb2760c5;
    4065           0 :         } else if (sname == "PbPb 2.76c6") {
    4066             :             func=PtUpsilonPbPb2760c6;
    4067           0 :         } else if (sname == "PbPb 2.76c7") {
    4068             :             func=PtUpsilonPbPb2760c7;
    4069           0 :         } else if (sname == "PbPb 2.76c8") {
    4070             :             func=PtUpsilonPbPb2760c8;
    4071           0 :         } else if (sname == "PbPb 2.76c9") {
    4072             :             func=PtUpsilonPbPb2760c9;
    4073           0 :         } else if (sname == "PbPb 2.76c10") {
    4074             :             func=PtUpsilonPbPb2760c10;
    4075           0 :         } else if (sname == "PbPb 2.76c11") {
    4076             :             func=PtUpsilonPbPb2760c11;
    4077           0 :         } else if (sname == "pPb 5.03") {
    4078             :             func=PtUpsilonPPb5030;
    4079           0 :         } else if (sname == "pPb 5.03c1") {
    4080             :             func=PtUpsilonPPb5030c1;
    4081           0 :         } else if (sname == "pPb 5.03c2") {
    4082             :             func=PtUpsilonPPb5030c2;
    4083           0 :         } else if (sname == "pPb 5.03c3") {
    4084             :             func=PtUpsilonPPb5030c3;
    4085           0 :         } else if (sname == "pPb 5.03c4") {
    4086             :             func=PtUpsilonPPb5030c4;
    4087           0 :         } else if (sname == "Pbp 5.03") {
    4088             :             func=PtUpsilonPbP5030;
    4089           0 :         } else if (sname == "Pbp 5.03c1") {
    4090             :             func=PtUpsilonPbP5030c1;
    4091           0 :         } else if (sname == "Pbp 5.03c2") {
    4092             :             func=PtUpsilonPbP5030c2;
    4093           0 :         } else if (sname == "Pbp 5.03c3") {
    4094             :             func=PtUpsilonPbP5030c3;
    4095           0 :         } else if (sname == "Pbp 5.03c4") {
    4096             :             func=PtUpsilonPbP5030c4;
    4097           0 :         } else if (sname == "pPb 8.8") {
    4098             :             func=PtUpsilonPPb8800;
    4099           0 :         } else if (sname == "pPb 8.8c1") {
    4100             :             func=PtUpsilonPPb8800c1;
    4101           0 :         } else if (sname == "pPb 8.8c2") {
    4102             :             func=PtUpsilonPPb8800c2;
    4103           0 :         } else if (sname == "pPb 8.8c3") {
    4104             :             func=PtUpsilonPPb8800c3;
    4105           0 :         } else if (sname == "pPb 8.8c4") {
    4106             :             func=PtUpsilonPPb8800c4;
    4107           0 :         } else if (sname == "Pbp 8.8") {
    4108             :             func=PtUpsilonPbP8800;
    4109           0 :         } else if (sname == "Pbp 8.8c1") {
    4110             :             func=PtUpsilonPbP8800c1;
    4111           0 :         } else if (sname == "Pbp 8.8c2") {
    4112             :             func=PtUpsilonPbP8800c2;
    4113           0 :         } else if (sname == "Pbp 8.8c3") {
    4114             :             func=PtUpsilonPbP8800c3;
    4115           0 :         } else if (sname == "Pbp 8.8c4") {
    4116             :             func=PtUpsilonPbP8800c4;
    4117           0 :         } else if (sname == "CDF scaled") {
    4118             :             func=PtUpsilonCDFscaled;
    4119           0 :         } else if (sname == "CDF pp") {
    4120             :             func=PtUpsilonCDFscaledPP;
    4121           0 :         } else if (sname == "CDF pp 10") {
    4122             :             func=PtUpsilonCDFscaledPP10;
    4123           0 :         } else if (sname == "CDF pp 8.8") {
    4124             :             func=PtUpsilonCDFscaledPP9;
    4125           0 :         } else if (sname == "CDF pp 7") {
    4126             :             func=PtUpsilonCDFscaledPP7;
    4127           0 :         } else if (sname == "CDF pp 3.94") {
    4128             :             func=PtUpsilonCDFscaledPP4;
    4129           0 :         } else if (sname == "CDF pPb 8.8") {
    4130             :             func=PtUpsilonCDFscaledPPb9;
    4131           0 :         } else if (sname == "CDF Pbp 8.8") {
    4132             :             func=PtUpsilonCDFscaledPbP9;
    4133           0 :         } else if (sname == "CDF PbPb 3.94") {
    4134             :             func=PtUpsilonCDFscaledPbPb4;
    4135           0 :         } else if (sname == "Flat") {
    4136             :             func=PtUpsilonFlat;
    4137           0 :         } else {
    4138             :             func=PtUpsilon;
    4139             :         }
    4140             :         break;  
    4141             :     case kCharm:
    4142           0 :         if (sname == "F0M0S0 pp") {
    4143             :             func=PtCharmF0M0S0PP;
    4144           0 :         } else if (sname == "F1M0S0 pp") {
    4145             :             func=PtCharmF1M0S0PP;
    4146           0 :         } else if (sname == "F2M0S0 pp") {
    4147             :             func=PtCharmF2M0S0PP;
    4148           0 :         } else if (sname == "F0M1S0 pp") {
    4149             :             func=PtCharmF0M1S0PP;
    4150           0 :         } else if (sname == "F0M2S0 pp") {
    4151             :             func=PtCharmF0M2S0PP;
    4152           0 :         } else if (sname == "F0M0S1 pp") {
    4153             :             func=PtCharmF0M0S1PP;
    4154           0 :         } else if (sname == "F0M0S2 pp") {
    4155             :             func=PtCharmF0M0S2PP;
    4156           0 :         } else if (sname == "F0M0S3 pp") {
    4157             :             func=PtCharmF0M0S3PP;
    4158           0 :         } else if (sname == "F0M0S4 pp") {
    4159             :             func=PtCharmF0M0S4PP;
    4160           0 :         } else if (sname == "F0M0S5 pp") {
    4161             :             func=PtCharmF0M0S5PP;
    4162           0 :         } else if (sname == "F0M0S6 pp") {
    4163             :             func=PtCharmF0M0S6PP;
    4164           0 :         } else if (sname == "central") {
    4165             :             func=PtCharmCentral;
    4166           0 :         } else {
    4167             :             func=PtCharm;
    4168             :         }
    4169             :         break;
    4170             :     case kBeauty:
    4171           0 :         if (sname == "F0M0S0 pp") {
    4172             :             func=PtBeautyF0M0S0PP;
    4173           0 :         } else if (sname == "F1M0S0 pp") {
    4174             :             func=PtBeautyF1M0S0PP;
    4175           0 :         } else if (sname == "F2M0S0 pp") {
    4176             :             func=PtBeautyF2M0S0PP;
    4177           0 :         } else if (sname == "F0M1S0 pp") {
    4178             :             func=PtBeautyF0M1S0PP;
    4179           0 :         } else if (sname == "F0M2S0 pp") {
    4180             :             func=PtBeautyF0M2S0PP;
    4181           0 :         } else if (sname == "F0M0S1 pp") {
    4182             :             func=PtBeautyF0M0S1PP;
    4183           0 :         } else if (sname == "F0M0S2 pp") {
    4184             :             func=PtBeautyF0M0S2PP;
    4185           0 :         } else if (sname == "F0M0S3 pp") {
    4186             :             func=PtBeautyF0M0S3PP;
    4187           0 :         } else if (sname == "F0M0S4 pp") {
    4188             :             func=PtBeautyF0M0S4PP;
    4189           0 :         } else if (sname == "F0M0S5 pp") {
    4190             :             func=PtBeautyF0M0S5PP;
    4191           0 :         } else if (sname == "F0M0S6 pp") {
    4192             :             func=PtBeautyF0M0S6PP;
    4193           0 :         } else if (sname == "central") {
    4194             :             func=PtBeautyCentral;
    4195           0 :         } else {
    4196             :             func=PtBeauty;
    4197             :         }
    4198             :         break;
    4199             :     case kPion:
    4200           0 :         if (sname == "2010 Pos PP") {
    4201             :             func=PtPionPos2010PP;
    4202           0 :         } else if (sname == "2010 Neg PP") {
    4203             :             func=PtPionNeg2010PP;
    4204           0 :         } else {
    4205             :             func=PtPion;
    4206             :         }
    4207             :         break;
    4208             :     case kKaon:
    4209           0 :         if (sname == "2010 Pos PP") {
    4210             :             func=PtKaonPos2010PP;
    4211           0 :         } else if (sname == "2010 Neg PP") {
    4212             :             func=PtKaonNeg2010PP;
    4213           0 :         } else {
    4214             :             func=PtKaon;
    4215             :         }
    4216             :         break;
    4217             :     case kChic0:
    4218             :         func=PtChic0;
    4219           0 :         break;
    4220             :     case kChic:
    4221             :         func=PtChic;
    4222           0 :         break;
    4223             :     default:
    4224             :         func=0;
    4225           0 :         printf("<AliGenMUONlib::GetPt> unknown parametrisation\n");
    4226             :     }
    4227             :     return func;
    4228           0 : }
    4229             : 
    4230             : GenFunc AliGenMUONlib::GetY(Int_t param, const char* tname) const
    4231             : {
    4232             :   //    
    4233             :   // Return pointer to y- parameterisation
    4234             :   //
    4235           0 :     TString sname = TString(tname);
    4236             :     GenFunc func;
    4237           0 :     switch (param) 
    4238             :     {
    4239             :     case kPhi:
    4240             :         func=YPhi;
    4241           0 :         break;
    4242             :     case kEta:
    4243             :         func=YEta;
    4244           0 :         break;
    4245             :     case kOmega:
    4246             :         func=YOmega;
    4247           0 :         break;
    4248             :     case kJpsiFamily:
    4249             :     case kPsiP:
    4250             :     case kChic1:
    4251             :     case kChic2:
    4252             :     case kJpsi:
    4253           0 :         if (sname == "Vogt" || sname == "Vogt PbPb") {
    4254             :             func=YJpsiPbPb;
    4255           0 :         } else if (sname == "Vogt pp"){
    4256             :             func=YJpsiPP;
    4257           0 :         } else if (sname == "pp 7") {
    4258             :             func=YJpsiPP7000;
    4259           0 :         } else if (sname == "pp 8") {
    4260             :             func=YJpsiPP8000;
    4261           0 :         } else if (sname == "pp 2.76") {
    4262             :             func=YJpsiPP2760;
    4263           0 :         } else if (sname == "pp 4.4") {
    4264             :             func=YJpsiPP4400;
    4265           0 :         } else if (sname == "pp 5.03") {
    4266             :             func=YJpsiPP5030;           
    4267           0 :         } else if (sname == "pp 8.8") {
    4268             :             func=YJpsiPP8800;
    4269           0 :         } else if (sname == "pp 7 poly") {
    4270             :             func=YJpsiPPpoly7000;
    4271           0 :         } else if (sname == "pp 2.76 poly") {
    4272             :             func=YJpsiPPpoly2760;
    4273           0 :         } else if (sname == "PbPb 2.76") {
    4274             :             func=YJpsiPbPb2760;
    4275           0 :         } else if (sname == "PbPb 2.76c1") {
    4276             :             func=YJpsiPbPb2760c1;
    4277           0 :         } else if (sname == "PbPb 2.76c2") {
    4278             :             func=YJpsiPbPb2760c2;
    4279           0 :         } else if (sname == "PbPb 2.76c3") {
    4280             :             func=YJpsiPbPb2760c3;
    4281           0 :         } else if (sname == "PbPb 2.76c4") {
    4282             :             func=YJpsiPbPb2760c4;
    4283           0 :         } else if (sname == "PbPb 2.76c5") {
    4284             :             func=YJpsiPbPb2760c5;
    4285           0 :         } else if (sname == "PbPb 2.76c6") {
    4286             :             func=YJpsiPbPb2760c6;
    4287           0 :         } else if (sname == "PbPb 2.76c7") {
    4288             :             func=YJpsiPbPb2760c7;
    4289           0 :         } else if (sname == "PbPb 2.76c8") {
    4290             :             func=YJpsiPbPb2760c8;
    4291           0 :         } else if (sname == "PbPb 2.76c9") {
    4292             :             func=YJpsiPbPb2760c9;
    4293           0 :         } else if (sname == "PbPb 2.76c10") {
    4294             :             func=YJpsiPbPb2760c10;
    4295           0 :         } else if (sname == "PbPb 2.76c11") {
    4296             :             func=YJpsiPbPb2760c11;
    4297           0 :         } else if (sname == "pPb 5.03") {
    4298             :             func=YJpsiPPb5030;
    4299           0 :         } else if (sname == "pPb 5.03c1") {
    4300             :             func=YJpsiPPb5030c1;
    4301           0 :         } else if (sname == "pPb 5.03c2") {
    4302             :             func=YJpsiPPb5030c2;
    4303           0 :         } else if (sname == "pPb 5.03c3") {
    4304             :             func=YJpsiPPb5030c3;
    4305           0 :         } else if (sname == "pPb 5.03c4") {
    4306             :             func=YJpsiPPb5030c4;
    4307           0 :         } else if (sname == "Pbp 5.03") {
    4308             :             func=YJpsiPbP5030;
    4309           0 :         } else if (sname == "Pbp 5.03c1") {
    4310             :             func=YJpsiPbP5030c1;
    4311           0 :         } else if (sname == "Pbp 5.03c2") {
    4312             :             func=YJpsiPbP5030c2;
    4313           0 :         } else if (sname == "Pbp 5.03c3") {
    4314             :             func=YJpsiPbP5030c3;
    4315           0 :         } else if (sname == "Pbp 5.03c4") {
    4316             :             func=YJpsiPbP5030c4;
    4317           0 :         } else if (sname == "pPb 8.8") {
    4318             :             func=YJpsiPPb8800;
    4319           0 :         } else if (sname == "pPb 8.8c1") {
    4320             :             func=YJpsiPPb8800c1;
    4321           0 :         } else if (sname == "pPb 8.8c2") {
    4322             :             func=YJpsiPPb8800c2;
    4323           0 :         } else if (sname == "pPb 8.8c3") {
    4324             :             func=YJpsiPPb8800c3;
    4325           0 :         } else if (sname == "pPb 8.8c4") {
    4326             :             func=YJpsiPPb8800c4;
    4327           0 :         } else if (sname == "Pbp 8.8") {
    4328             :             func=YJpsiPbP8800;
    4329           0 :         } else if (sname == "Pbp 8.8c1") {
    4330             :             func=YJpsiPbP8800c1;
    4331           0 :         } else if (sname == "Pbp 8.8c2") {
    4332             :             func=YJpsiPbP8800c2;
    4333           0 :         } else if (sname == "Pbp 8.8c3") {
    4334             :             func=YJpsiPbP8800c3;
    4335           0 :         } else if (sname == "Pbp 8.8c4") {
    4336             :             func=YJpsiPbP8800c4;
    4337           0 :         } else if (sname == "CDF scaled") {
    4338             :             func=YJpsiCDFscaled;
    4339           0 :         } else if (sname == "CDF pp") {
    4340             :             func=YJpsiCDFscaledPP;
    4341           0 :         } else if (sname == "CDF pp 10") {
    4342             :             func=YJpsiCDFscaledPP10;
    4343           0 :         } else if (sname == "CDF pp 8.8") {
    4344             :             func=YJpsiCDFscaledPP9;
    4345           0 :         } else if (sname == "CDF pp 7" || sname == "CDF pp 7 flat pt") {
    4346             :             func=YJpsiCDFscaledPP7;
    4347           0 :         } else if (sname == "CDF pp 3.94") {
    4348             :             func=YJpsiCDFscaledPP4;
    4349           0 :         } else if (sname == "CDF pp 2.76") {
    4350             :             func=YJpsiCDFscaledPP3;
    4351           0 :         } else if (sname == "CDF pp 1.9") {
    4352             :             func=YJpsiCDFscaledPP2;
    4353           0 :         } else if (sname == "CDF pPb 8.8") {
    4354             :             func=YJpsiCDFscaledPPb9;
    4355           0 :         } else if (sname == "CDF Pbp 8.8") {
    4356             :             func=YJpsiCDFscaledPbP9;
    4357           0 :         } else if (sname == "CDF PbPb 3.94") {
    4358             :             func=YJpsiCDFscaledPbPb4;
    4359           0 :         } else if (sname == "Flat" || sname == "CDF pp 7 flat y") {
    4360             :             func=YJpsiFlat;
    4361           0 :         } else {
    4362             :             func=YJpsi;
    4363             :         }
    4364             :         break;
    4365             :     case kJpsiFromB:
    4366             :         func = YJpsiBPbPb;
    4367           0 :         break;
    4368             :     case kUpsilonFamily:
    4369             :     case kUpsilonP:
    4370             :     case kUpsilonPP:
    4371             :     case kUpsilon:
    4372           0 :         if (sname == "Vogt" || sname == "Vogt PbPb") {
    4373             :             func=YUpsilonPbPb;
    4374           0 :         } else if (sname == "Vogt pp") {
    4375             :             func = YUpsilonPP;
    4376           0 :         } else if (sname == "pp 7") {
    4377             :             func=YUpsilonPP7000;
    4378           0 :         } else if (sname == "pp 8") {
    4379             :             func=YUpsilonPP8000;
    4380           0 :         } else if (sname == "pp 2.76") {
    4381             :             func=YUpsilonPP2760;
    4382           0 :         } else if (sname == "pp 4.4") {
    4383             :             func=YUpsilonPP4400;
    4384           0 :         } else if (sname == "pp 5.03") {
    4385             :             func=YUpsilonPP5030;
    4386           0 :         } else if (sname == "pp 8.8") {
    4387             :             func=YUpsilonPP8800;
    4388           0 :         } else if (sname == "pp 7 poly") {
    4389             :             func=YUpsilonPPpoly7000;
    4390           0 :         } else if (sname == "pp 2.76 poly") {
    4391             :             func=YUpsilonPPpoly2760;
    4392           0 :         } else if (sname == "PbPb 2.76") {
    4393             :             func=YUpsilonPbPb2760;
    4394           0 :         } else if (sname == "PbPb 2.76c1") {
    4395             :             func=YUpsilonPbPb2760c1;
    4396           0 :         } else if (sname == "PbPb 2.76c2") {
    4397             :             func=YUpsilonPbPb2760c2;
    4398           0 :         } else if (sname == "PbPb 2.76c3") {
    4399             :             func=YUpsilonPbPb2760c3;
    4400           0 :         } else if (sname == "PbPb 2.76c4") {
    4401             :             func=YUpsilonPbPb2760c4;
    4402           0 :         } else if (sname == "PbPb 2.76c5") {
    4403             :             func=YUpsilonPbPb2760c5;
    4404           0 :         } else if (sname == "PbPb 2.76c6") {
    4405             :             func=YUpsilonPbPb2760c6;
    4406           0 :         } else if (sname == "PbPb 2.76c7") {
    4407             :             func=YUpsilonPbPb2760c7;
    4408           0 :         } else if (sname == "PbPb 2.76c8") {
    4409             :             func=YUpsilonPbPb2760c8;
    4410           0 :         } else if (sname == "PbPb 2.76c9") {
    4411             :             func=YUpsilonPbPb2760c9;
    4412           0 :         } else if (sname == "PbPb 2.76c10") {
    4413             :             func=YUpsilonPbPb2760c10;
    4414           0 :         } else if (sname == "PbPb 2.76c11") {
    4415             :             func=YUpsilonPbPb2760c11;
    4416           0 :         } else if (sname == "pPb 5.03") {
    4417             :             func=YUpsilonPPb5030;
    4418           0 :         } else if (sname == "pPb 5.03c1") {
    4419             :             func=YUpsilonPPb5030c1;
    4420           0 :         } else if (sname == "pPb 5.03c2") {
    4421             :             func=YUpsilonPPb5030c2;
    4422           0 :         } else if (sname == "pPb 5.03c3") {
    4423             :             func=YUpsilonPPb5030c3;
    4424           0 :         } else if (sname == "pPb 5.03c4") {
    4425             :             func=YUpsilonPPb5030c4;
    4426           0 :         } else if (sname == "Pbp 5.03") {
    4427             :             func=YUpsilonPbP5030;
    4428           0 :         } else if (sname == "Pbp 5.03c1") {
    4429             :             func=YUpsilonPbP5030c1;
    4430           0 :         } else if (sname == "Pbp 5.03c2") {
    4431             :             func=YUpsilonPbP5030c2;
    4432           0 :         } else if (sname == "Pbp 5.03c3") {
    4433             :             func=YUpsilonPbP5030c3;
    4434           0 :         } else if (sname == "Pbp 5.03c4") {
    4435             :             func=YUpsilonPbP5030c4;
    4436           0 :         } else if (sname == "pPb 8.8") {
    4437             :             func=YUpsilonPPb8800;
    4438           0 :         } else if (sname == "pPb 8.8c1") {
    4439             :             func=YUpsilonPPb8800c1;
    4440           0 :         } else if (sname == "pPb 8.8c2") {
    4441             :             func=YUpsilonPPb8800c2;
    4442           0 :         } else if (sname == "pPb 8.8c3") {
    4443             :             func=YUpsilonPPb8800c3;
    4444           0 :         } else if (sname == "pPb 8.8c4") {
    4445             :             func=YUpsilonPPb8800c4;
    4446           0 :         } else if (sname == "Pbp 8.8") {
    4447             :             func=YUpsilonPbP8800;
    4448           0 :         } else if (sname == "Pbp 8.8c1") {
    4449             :             func=YUpsilonPbP8800c1;
    4450           0 :         } else if (sname == "Pbp 8.8c2") {
    4451             :             func=YUpsilonPbP8800c2;
    4452           0 :         } else if (sname == "Pbp 8.8c3") {
    4453             :             func=YUpsilonPbP8800c3;
    4454           0 :         } else if (sname == "Pbp 8.8c4") {
    4455             :             func=YUpsilonPbP8800c4;
    4456           0 :         } else if (sname == "CDF scaled") {
    4457             :             func=YUpsilonCDFscaled;
    4458           0 :         } else if (sname == "CDF pp") {
    4459             :             func=YUpsilonCDFscaledPP;
    4460           0 :         } else if (sname == "CDF pp 10") {
    4461             :             func=YUpsilonCDFscaledPP10;
    4462           0 :         } else if (sname == "CDF pp 8.8") {
    4463             :             func=YUpsilonCDFscaledPP9;
    4464           0 :         } else if (sname == "CDF pp 7") {
    4465             :             func=YUpsilonCDFscaledPP7;
    4466           0 :         } else if (sname == "CDF pp 3.94") {
    4467             :             func=YUpsilonCDFscaledPP4;
    4468           0 :         } else if (sname == "CDF pPb 8.8") {
    4469             :             func=YUpsilonCDFscaledPPb9;
    4470           0 :         } else if (sname == "CDF Pbp 8.8") {
    4471             :             func=YUpsilonCDFscaledPbP9;
    4472           0 :         } else if (sname == "CDF PbPb 3.94") {
    4473             :             func=YUpsilonCDFscaledPbPb4;
    4474           0 :         } else if (sname == "Flat") {
    4475             :             func=YUpsilonFlat;
    4476           0 :         } else {
    4477             :             func=YUpsilon;
    4478             :         }
    4479             :         break;
    4480             :     case kCharm:
    4481           0 :         if (sname == "F0M0S0 pp") {
    4482             :             func=YCharmF0M0S0PP;
    4483           0 :         } else if (sname == "F1M0S0 pp") {
    4484             :             func=YCharmF1M0S0PP;
    4485           0 :         } else if (sname == "F2M0S0 pp") {
    4486             :             func=YCharmF2M0S0PP;
    4487           0 :         } else if (sname == "F0M1S0 pp") {
    4488             :             func=YCharmF0M1S0PP;
    4489           0 :         } else if (sname == "F0M2S0 pp") {
    4490             :             func=YCharmF0M2S0PP;
    4491           0 :         } else if (sname == "F0M0S1 pp") {
    4492             :             func=YCharmF0M0S1PP;
    4493           0 :         } else if (sname == "F0M0S2 pp") {
    4494             :             func=YCharmF0M0S2PP;
    4495           0 :         } else if (sname == "F0M0S3 pp") {
    4496             :             func=YCharmF0M0S3PP;
    4497           0 :         } else if (sname == "F0M0S4 pp") {
    4498             :             func=YCharmF0M0S4PP;
    4499           0 :         } else if (sname == "F0M0S5 pp") {
    4500             :             func=YCharmF0M0S5PP;
    4501           0 :         } else if (sname == "F0M0S6 pp") {
    4502             :             func=YCharmF0M0S6PP;
    4503           0 :         } else {
    4504             :             func=YCharm;
    4505             :         }
    4506             :         break;
    4507             :     case kBeauty:
    4508           0 :         if (sname == "F0M0S0 pp") {
    4509             :             func=YBeautyF0M0S0PP;
    4510           0 :         } else if (sname == "F1M0S0 pp") {
    4511             :             func=YBeautyF1M0S0PP;
    4512           0 :         } else if (sname == "F2M0S0 pp") {
    4513             :             func=YBeautyF2M0S0PP;
    4514           0 :         } else if (sname == "F0M1S0 pp") {
    4515             :             func=YBeautyF0M1S0PP;
    4516           0 :         } else if (sname == "F0M2S0 pp") {
    4517             :             func=YBeautyF0M2S0PP;
    4518           0 :         } else if (sname == "F0M0S1 pp") {
    4519             :             func=YBeautyF0M0S1PP;
    4520           0 :         } else if (sname == "F0M0S2 pp") {
    4521             :             func=YBeautyF0M0S2PP;
    4522           0 :         } else if (sname == "F0M0S3 pp") {
    4523             :             func=YBeautyF0M0S3PP;
    4524           0 :         } else if (sname == "F0M0S4 pp") {
    4525             :             func=YBeautyF0M0S4PP;
    4526           0 :         } else if (sname == "F0M0S5 pp") {
    4527             :             func=YBeautyF0M0S5PP;
    4528           0 :         } else if (sname == "F0M0S6 pp") {
    4529             :             func=YBeautyF0M0S6PP;
    4530           0 :         } else {
    4531             :             func=YBeauty;
    4532             :         }
    4533             :         break;
    4534             :     case kPion:
    4535           0 :         if (sname == "2010 Pos PP") {
    4536             :             func=YKaonPion2010PP;
    4537           0 :         } else if (sname == "2010 Neg PP") {
    4538             :             func=YKaonPion2010PP;
    4539           0 :         } else {
    4540             :             func=YPion;
    4541             :         }
    4542             :         break;
    4543             :     case kKaon:
    4544           0 :         if (sname == "2010 Pos PP") {
    4545             :             func=YKaonPion2010PP;
    4546           0 :         } else if (sname == "2010 Neg PP") {
    4547             :             func=YKaonPion2010PP;
    4548           0 :         } else {
    4549             :             func=YKaon;
    4550             :         }
    4551             :         break;
    4552             :     case kChic0:
    4553             :         func=YChic0;
    4554           0 :         break;
    4555             :     case kChic:
    4556             :         func=YChic;
    4557           0 :         break;
    4558             :     default:
    4559             :         func=0;
    4560           0 :         printf("<AliGenMUONlib::GetY> unknown parametrisation\n");
    4561             :     }
    4562             :     return func;
    4563           0 : }
    4564             : 
    4565             : //
    4566             : //                    Chi
    4567             : //
    4568             : //
    4569             : //                pt-distribution
    4570             : //____________________________________________________________
    4571             : Double_t AliGenMUONlib::PtChic0( const Double_t *px, const Double_t */*dummy*/)
    4572             : {
    4573             : // Chi_c1 pT
    4574             :   const Double_t kpt0 = 4.;
    4575             :   const Double_t kxn  = 3.6;
    4576           0 :   Double_t x=*px;
    4577             :   //
    4578           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    4579           0 :   return x/TMath::Power(pass1,kxn);
    4580             : }
    4581             : Double_t AliGenMUONlib::PtChic1( const Double_t *px, const Double_t */*dummy*/)
    4582             : {
    4583             : // Chi_c1 pT
    4584             :   const Double_t kpt0 = 4.;
    4585             :   const Double_t kxn  = 3.6;
    4586           0 :   Double_t x=*px;
    4587             :   //
    4588           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    4589           0 :   return x/TMath::Power(pass1,kxn);
    4590             : }
    4591             : Double_t AliGenMUONlib::PtChic2( const Double_t *px, const Double_t */*dummy*/)
    4592             : {
    4593             : // Chi_c2 pT
    4594             :   const Double_t kpt0 = 4.;
    4595             :   const Double_t kxn  = 3.6;
    4596           0 :   Double_t x=*px;
    4597             :   //
    4598           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    4599           0 :   return x/TMath::Power(pass1,kxn);
    4600             : }
    4601             : Double_t AliGenMUONlib::PtChic( const Double_t *px, const Double_t */*dummy*/)
    4602             : {
    4603             : // Chi_c family pT
    4604             :   const Double_t kpt0 = 4.;
    4605             :   const Double_t kxn  = 3.6;
    4606           0 :   Double_t x=*px;
    4607             :   //
    4608           0 :   Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
    4609           0 :   return x/TMath::Power(pass1,kxn);
    4610             : }
    4611             : 
    4612             : //
    4613             : //               y-distribution
    4614             : //____________________________________________________________
    4615             : Double_t AliGenMUONlib::YChic0(const Double_t *py, const Double_t */*dummy*/)
    4616             : {
    4617             : // Chi-1c y
    4618             :   const Double_t ky0 = 4.;
    4619             :  const Double_t kb=1.;
    4620             :   Double_t yj;
    4621           0 :   Double_t y=TMath::Abs(*py);
    4622             :   //
    4623           0 :   if (y < ky0)
    4624           0 :     yj=kb;
    4625             :   else
    4626           0 :     yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
    4627           0 :   return yj;
    4628             : }
    4629             : 
    4630             : Double_t AliGenMUONlib::YChic1(const Double_t *py, const Double_t */*dummy*/)
    4631             : {
    4632             : // Chi-1c y
    4633             :   const Double_t ky0 = 4.;
    4634             :   const Double_t kb=1.;
    4635             :   Double_t yj;
    4636           0 :   Double_t y=TMath::Abs(*py);
    4637             :   //
    4638           0 :   if (y < ky0)
    4639           0 :     yj=kb;
    4640             :   else
    4641           0 :     yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
    4642           0 :   return yj;
    4643             : }
    4644             : 
    4645             : Double_t AliGenMUONlib::YChic2(const Double_t *py, const Double_t */*dummy*/)
    4646             : {
    4647             : // Chi-2c y
    4648             :   const Double_t ky0 = 4.;
    4649             :   const Double_t kb=1.;
    4650             :   Double_t yj;
    4651           0 :   Double_t y=TMath::Abs(*py);
    4652             :   //
    4653           0 :   if (y < ky0)
    4654           0 :     yj=kb;
    4655             :   else
    4656           0 :     yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
    4657           0 :   return yj;
    4658             : }
    4659             : 
    4660             : Double_t AliGenMUONlib::YChic(const Double_t *py, const Double_t */*dummy*/)
    4661             : {
    4662             : // Chi_c family y
    4663             :   const Double_t ky0 = 4.;
    4664             :   const Double_t kb=1.;
    4665             :   Double_t yj;
    4666           0 :   Double_t y=TMath::Abs(*py);
    4667             :   //
    4668           0 :   if (y < ky0)
    4669           0 :     yj=kb;
    4670             :   else
    4671           0 :     yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
    4672           0 :   return yj;
    4673             : }
    4674             : 
    4675             : //                 particle composition
    4676             : //
    4677             : Int_t AliGenMUONlib::IpChic0(TRandom *)
    4678             : {
    4679             : // Chi composition
    4680           0 :     return 10441;
    4681             : }
    4682             : //
    4683             : Int_t AliGenMUONlib::IpChic1(TRandom *)
    4684             : {
    4685             : // Chi composition
    4686           0 :     return 20443;
    4687             : }
    4688             : Int_t AliGenMUONlib::IpChic2(TRandom *)
    4689             : {
    4690             : // Chi_c2 prime composition
    4691           0 :     return 445;
    4692             : }
    4693             : Int_t AliGenMUONlib::IpChic(TRandom *)
    4694             : {
    4695             : // Chi composition
    4696             :   Int_t ip;
    4697           0 :   Float_t r = gRandom->Rndm();
    4698           0 :   if (r < 0.001) {
    4699             :     ip = 10441;
    4700           0 :   } else if( r < 0.377 ) {
    4701             :     ip = 20443;
    4702           0 :   } else {
    4703             :     ip = 445;
    4704             :   }
    4705           0 :   return ip;
    4706             : }
    4707             : 
    4708             : 
    4709             : //_____________________________________________________________
    4710             : 
    4711             : typedef Int_t (*GenFuncIp) (TRandom *);
    4712             : GenFuncIp AliGenMUONlib::GetIp(Int_t param,  const char* tname) const
    4713             : {
    4714             : // Return pointer to particle type parameterisation
    4715           0 :     TString sname = TString(tname);
    4716             :     GenFuncIp func;
    4717           0 :     switch (param) 
    4718             :     {
    4719             :     case kPhi:
    4720             :         func=IpPhi;
    4721           0 :         break;
    4722             :     case kEta:
    4723             :         func=IpEta;
    4724           0 :         break;
    4725             :     case kOmega:
    4726             :         func=IpOmega;
    4727           0 :         break;
    4728             :     case kJpsiFamily:
    4729             :         func=IpJpsiFamily;
    4730           0 :         break;
    4731             :     case kPsiP:
    4732             :         func=IpPsiP;
    4733           0 :         break;
    4734             :     case kJpsi:
    4735             :     case kJpsiFromB:
    4736             :         func=IpJpsi;
    4737           0 :         break;
    4738             :     case kUpsilon:
    4739             :         func=IpUpsilon;
    4740           0 :         break;
    4741             :     case kUpsilonFamily:
    4742             :       func=IpUpsilonFamily;
    4743           0 :       break;
    4744             :     case kUpsilonP:
    4745             :         func=IpUpsilonP;
    4746           0 :         break;
    4747             :     case kUpsilonPP:
    4748             :         func=IpUpsilonPP;
    4749           0 :         break;
    4750             :     case kCharm:
    4751             :         func=IpCharm;
    4752           0 :         break;
    4753             :     case kBeauty:
    4754             :         func=IpBeauty;
    4755           0 :         break;
    4756             :     case kPion:
    4757           0 :         if (sname == "2010 Pos PP") {
    4758             :             func=IpPionPos;
    4759           0 :         } else if (sname == "2010 Neg PP") {
    4760             :             func=IpPionNeg;
    4761           0 :         } else {
    4762             :             func=IpPion;
    4763             :         }
    4764             :         break;
    4765             :     case kKaon:
    4766           0 :         if (sname == "2010 Pos PP") {
    4767             :             func=IpKaonPos;
    4768           0 :         } else if (sname == "2010 Neg PP") {
    4769             :             func=IpKaonNeg;
    4770           0 :         } else {
    4771             :             func=IpKaon;
    4772             :         }
    4773             :         break;
    4774             :     case kChic0:
    4775             :         func=IpChic0;
    4776           0 :         break;
    4777             :     case kChic1:
    4778             :         func=IpChic1;
    4779           0 :         break;
    4780             :     case kChic2:
    4781             :         func=IpChic2;
    4782           0 :         break;
    4783             :     case kChic:
    4784             :         func=IpChic;
    4785           0 :         break;
    4786             :     default:
    4787             :         func=0;
    4788           0 :         printf("<AliGenMUONlib::GetIp> unknown parametrisation\n");
    4789             :     }
    4790             :     return func;
    4791           0 : }
    4792             : 
    4793             : 
    4794             : 
    4795             : Float_t AliGenMUONlib::Interpolate(Float_t x, Float_t* y, Float_t x0, 
    4796             :                                    Float_t dx,
    4797             :                                    Int_t n, Int_t no)
    4798             : {
    4799             : //
    4800             : // Neville's alorithm for interpolation
    4801             : //
    4802             : // x:  x-value
    4803             : // y:  Input array
    4804             : // x0: minimum x 
    4805             : // dx: step size
    4806             : //  n: number of data points
    4807             : // no: order of polynom 
    4808             : //
    4809           0 :     Float_t*  c = new Float_t[n];
    4810           0 :     Float_t*  d = new Float_t[n];
    4811             :     Int_t m, i;
    4812           0 :     for (i = 0; i < n; i++) {
    4813           0 :         c[i] = y[i];
    4814           0 :         d[i] = y[i];
    4815             :     }
    4816             :     
    4817           0 :     Int_t   ns  = int((x - x0)/dx);
    4818             :     
    4819           0 :     Float_t y1  = y[ns];
    4820           0 :     ns--;    
    4821           0 :     for (m = 0; m < no; m++) {
    4822           0 :         for (i = 0; i < n-m; i++) {  
    4823           0 :             Float_t ho = x0 + Float_t(i) * dx - x;
    4824           0 :             Float_t hp = x0 + Float_t(i+m+1) * dx - x;
    4825           0 :             Float_t w  = c[i+1] - d[i];
    4826           0 :             Float_t den = ho-hp;
    4827           0 :             den = w/den;
    4828           0 :             d[i] = hp * den;
    4829           0 :             c[i] = ho * den;
    4830             :         }
    4831             :         Float_t dy;
    4832             :         
    4833           0 :         if (2*ns < (n-m-1)) {
    4834           0 :             dy  = c[ns+1];
    4835           0 :         } else {
    4836           0 :             dy  = d[ns--];
    4837             :         }
    4838           0 :         y1 += dy;}
    4839           0 :     delete[] c;
    4840           0 :     delete[] d;
    4841             : 
    4842           0 :     return y1;
    4843             : }
    4844             : 
    4845             : //=============================================================================
    4846             : Double_t AliGenMUONlib::PtPionPos2010PP(const Double_t *px, const Double_t* /*dummy*/)
    4847             : {
    4848             : // Pos pion
    4849             :   const Double_t par[3] = {2.27501, 0.116141, 5.59591};
    4850           0 :   Double_t pt = px[0];
    4851           0 :   Double_t m0 = TDatabasePDG::Instance()->GetParticle(211)->Mass();
    4852           0 :   Double_t mt = TMath::Sqrt(m0*m0 + pt*pt);
    4853             :   Double_t nc = par[1]*par[2];
    4854           0 :   Double_t t1 = (par[2]-1.)/nc/(nc/(par[2]-2.)+m0);
    4855           0 :   Double_t t2 = TMath::Power(1.+(mt-m0)/nc, -1.*par[2]);
    4856           0 :   Double_t fn = par[0] * pt * t1 * t2;
    4857           0 :   return fn;
    4858             : }
    4859             : 
    4860             : //=============================================================================
    4861             : Double_t AliGenMUONlib::PtPionNeg2010PP(const Double_t *px, const Double_t* /*dummy*/)
    4862             : {
    4863             : // Neg pion
    4864             :   const Double_t par[3] = {2.25188, 0.12176, 5.91166};
    4865           0 :   Double_t pt = px[0];
    4866           0 :   Double_t m0 = TDatabasePDG::Instance()->GetParticle(211)->Mass();
    4867           0 :   Double_t mt = TMath::Sqrt(m0*m0 + pt*pt);
    4868             :   Double_t nc = par[1]*par[2];
    4869           0 :   Double_t t1 = (par[2]-1.)/nc/(nc/(par[2]-2.)+m0);
    4870           0 :   Double_t t2 = TMath::Power(1.+(mt-m0)/nc, -1.*par[2]);
    4871           0 :   Double_t fn = par[0] * pt * t1 * t2;
    4872           0 :   return fn;
    4873             : }
    4874             : 
    4875             : //=============================================================================
    4876             : Double_t AliGenMUONlib::PtKaonPos2010PP(const Double_t *px, const Double_t* /*dummy*/)
    4877             : {
    4878             : // Pos kaons
    4879             :   const Double_t par[3] = {0.279386, 0.195466, 6.59587};
    4880           0 :   Double_t pt = px[0];
    4881           0 :   Double_t m0 = TDatabasePDG::Instance()->GetParticle(321)->Mass();
    4882           0 :   Double_t mt = TMath::Sqrt(m0*m0 + pt*pt);
    4883             :   Double_t nc = par[1]*par[2];
    4884           0 :   Double_t t1 = (par[2]-1.)/nc/(nc/(par[2]-2.)+m0);
    4885           0 :   Double_t t2 = TMath::Power(1.+(mt-m0)/nc, -1.*par[2]);
    4886           0 :   Double_t fn = par[0] * pt * t1 * t2;
    4887           0 :   return fn;
    4888             : }
    4889             : 
    4890             : //=============================================================================
    4891             : Double_t AliGenMUONlib::PtKaonNeg2010PP(const Double_t *px, const Double_t* /*dummy*/)
    4892             : {
    4893             : // Neg kaons
    4894             :   const Double_t par[3] = {0.278927, 0.189049, 6.43006};
    4895           0 :   Double_t pt = px[0];
    4896           0 :   Double_t m0 = TDatabasePDG::Instance()->GetParticle(321)->Mass();
    4897           0 :   Double_t mt = TMath::Sqrt(m0*m0 + pt*pt);
    4898             :   Double_t nc = par[1]*par[2];
    4899           0 :   Double_t t1 = (par[2]-1.)/nc/(nc/(par[2]-2.)+m0);
    4900           0 :   Double_t t2 = TMath::Power(1.+(mt-m0)/nc, -1.*par[2]);
    4901           0 :   Double_t fn = par[0] * pt * t1 * t2;
    4902           0 :   return fn;
    4903             : }
    4904             : 
    4905             : //=============================================================================
    4906             : Double_t AliGenMUONlib::YKaonPion2010PP(const Double_t *px, const Double_t* /*dummy*/)
    4907             : {
    4908             : // pions and kaons
    4909           0 :   Double_t y = px[0];
    4910             :   Double_t sigma = 2.35;
    4911           0 :   Double_t kernal = y/2./sigma;
    4912           0 :   Double_t fxn = TMath::Exp(-1.*kernal*kernal);
    4913           0 :   return fxn;
    4914             : }
    4915             : 
    4916             : //=============================================================================
    4917             : Int_t AliGenMUONlib::IpPionPos(TRandom *)
    4918             : {
    4919             : // Pos pions
    4920           0 :     return 211;
    4921             : }
    4922             : 
    4923             : //=============================================================================
    4924             : Int_t AliGenMUONlib::IpPionNeg(TRandom *)
    4925             : {
    4926             : // Neg pions
    4927           0 :     return -211;
    4928             : }
    4929             : 
    4930             : //=============================================================================
    4931             : Int_t AliGenMUONlib::IpKaonPos(TRandom *)
    4932             : {
    4933             : // pos Kaons
    4934           0 :     return 321;
    4935             : }
    4936             : 
    4937             : //=============================================================================
    4938             : Int_t AliGenMUONlib::IpKaonNeg(TRandom *)
    4939             : {
    4940             : // neg Kaons 
    4941           0 :     return -321;
    4942             : }

Generated by: LCOV version 1.11