]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenGSIlib.cxx
coverity 17740 fixed
[u/mrichter/AliRoot.git] / EVGEN / AliGenGSIlib.cxx
index 54a374fa42d8d98ea6ae50441b13ebb0e7c4dd35..8b9af912c77b0a7d7f0a36ccf758e60c4a3ee3d0 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
   
-/*
-$Log$
-Revision 1.4  2001/03/09 13:01:41  morsch
-- enum constants for paramterisation type (particle family) moved to AliGen*lib.h
-- use AliGenGSIlib::kUpsilon, AliGenPHOSlib::kEtaPrime to access the constants
-
-Revision 1.3  2000/12/21 16:24:06  morsch
-Coding convention clean-up
-
-Revision 1.2  2000/11/30 07:12:50  alibrary
-Introducing new Rndm and QA classes
-
-Revision 1.1  2000/06/15 08:48:43  morsch
-AliGenGSIlib with parametersations for GSI physics simulation added (YF, MI)
-
-Revision 1.7  2000/05/02 08:12:13  morsch
-Coding rule violations corrected.
-
-Revision 1.6  1999/09/29 09:24:14  fca
-Introduction of the Copyright and cvs Log
-
-*/
+/* $Id$ */
 
 /////////////////////////////////////////////////////////////////////////////
 //                                                                         //
@@ -51,7 +30,6 @@ Introduction of the Copyright and cvs Log
 #include "TRandom.h"
 #include "TString.h"
 #include "AliGenGSIlib.h"
-#include "iostream.h"
 
 
 ClassImp(AliGenGSIlib)
@@ -71,35 +49,36 @@ ClassImp(AliGenGSIlib)
 //--------------------------------------------------------------------------
 Int_t AliGenGSIlib::IpUpsilon(TRandom *)
 {
+// Return upsilon pdg code
 
   return 553;     
 
 }
+Double_t AliGenGSIlib::PtUpsilonFlat( const Double_t *px, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                   upsilon pt-distribution FLAT
 //
 //____________________________________________________________--------------
-Double_t AliGenGSIlib::PtUpsilonFlat( Double_t *px, Double_t *dummy )
-{
-
+    
   const Double_t kptmin = 0.0;
   const Double_t kptmax  = 15.0;
   Double_t x=*px;
   Double_t weight = 0.;
 
-  if (kptmin < x < kptmax) weight = 1.;
+  if ((x > kptmin) &&  (x < kptmax)) weight = 1.;
 
   return weight;
    
 }
+Double_t AliGenGSIlib::YUpsilonFlat(const Double_t *py, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                    upsilon y-distribution FLAT
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YUpsilonFlat(Double_t *py, Double_t *dummy)
-{
 
   const Double_t ky0 = 1.5;
   const Double_t kb=1.;
@@ -114,13 +93,13 @@ Double_t AliGenGSIlib::YUpsilonFlat(Double_t *py, Double_t *dummy)
   return yu;
 
 }
+Double_t AliGenGSIlib::PtUpsilonRitman( const Double_t *px, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                 upsilon pt-distribution RITMAN
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::PtUpsilonRitman( Double_t *px, Double_t *dummy )
-{
 
   const Double_t kpt0 = 4.7;
   const Double_t kxn  = 3.5;
@@ -131,13 +110,13 @@ Double_t AliGenGSIlib::PtUpsilonRitman( Double_t *px, Double_t *dummy )
   return x/TMath::Power(pass1,kxn);
    
 }
+Double_t AliGenGSIlib::YUpsilonRitman(const Double_t *py, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                  upsilon y-distribution RITMAN
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YUpsilonRitman(Double_t *py, Double_t *dummy)
-{
 
   const Double_t ky0 = 3.;
   const Double_t kb=1.;
@@ -152,39 +131,38 @@ Double_t AliGenGSIlib::YUpsilonRitman(Double_t *py, Double_t *dummy)
   return yu;
    
 }
+Double_t AliGenGSIlib::PtUpsilonKarel( const Double_t */*px*/, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                 upsilon pt-distribution kAREL
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::PtUpsilonKarel( Double_t *px, Double_t *dummy )
-{
-
-  //to implement
+// to implement
 
   return 0.1;   
 
 }
+Double_t AliGenGSIlib::YUpsilonKarel(const Double_t */*py*/, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                  upsilon y-distribution KAREL
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YUpsilonKarel(Double_t *py, Double_t *dummy)
-{
   
   //to implement
 
   return 0.2;  
 
 }
+Double_t AliGenGSIlib::PtUpsilonMUON( const Double_t *px, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                 upsilon pt-distribution MUONlib
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::PtUpsilonMUON( Double_t *px, Double_t *dummy )
-{
 
   const Double_t kpt0 = 5.3;
   const Double_t kxn  = 2.5;
@@ -195,13 +173,13 @@ Double_t AliGenGSIlib::PtUpsilonMUON( Double_t *px, Double_t *dummy )
   return x/TMath::Power(pass1,kxn);
 
 }
+Double_t AliGenGSIlib::YUpsilonMUON(const Double_t *py, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                   upsilon y-distribution MUONlib
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YUpsilonMUON(Double_t *py, Double_t *dummy)
-{
 
   const Double_t ky0 = 3.;
   const Double_t kb=1.;
@@ -220,42 +198,42 @@ Double_t AliGenGSIlib::YUpsilonMUON(Double_t *py, Double_t *dummy)
 //
 //                             J/Psi
 //
+Int_t AliGenGSIlib::IpJpsi(TRandom *)
+{
 //--------------------------------------------------------------------------
 //
 //                    J/Psi particle composition
 //
 //--------------------------------------------------------------------------
-Int_t AliGenGSIlib::IpJpsi(TRandom *)
-{
 
   return 443;     
 
 }
+Double_t AliGenGSIlib::PtJpsiFlat( const Double_t *px, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                   J/Psi pt-distribution FLAT
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::PtJpsiFlat( Double_t *px, Double_t *dummy )
-{
 
   const Double_t kptmin = 0.0;
   const Double_t kptmax  = 15.0;
   Double_t x=*px;
   Double_t weight = 0.;
 
-  if (kptmin < x < kptmax) weight = 1.;
+  if ((x > kptmin) && (x < kptmax)) weight = 1.;
 
   return weight;
    
 }
+Double_t AliGenGSIlib::YJpsiFlat(const Double_t *py, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                    J/Psi y-distribution FLAT
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YJpsiFlat(Double_t *py, Double_t *dummy)
-{
 
   const Double_t ky0 = 1.5;
   const Double_t kb=1.;
@@ -270,13 +248,13 @@ Double_t AliGenGSIlib::YJpsiFlat(Double_t *py, Double_t *dummy)
   return yu;
 
 }
+Double_t AliGenGSIlib::PtJpsiMUON( const Double_t *px, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                   J/Psi pt-distribution MUONlib
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::PtJpsiMUON( Double_t *px, Double_t *dummy )
-{
 
   const Double_t kpt0 = 4.;
   const Double_t kxn  = 3.6;
@@ -286,13 +264,13 @@ Double_t AliGenGSIlib::PtJpsiMUON( Double_t *px, Double_t *dummy )
   return x/TMath::Power(pass1,kxn);
    
 }
+Double_t AliGenGSIlib::PtJpsiRitman( const Double_t *px, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                   J/Psi pt-distribution Ritman
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::PtJpsiRitman( Double_t *px, Double_t *dummy )
-{
 
   const Double_t kpt0 = 2.3;
   const Double_t kxn  = 3.5;
@@ -303,13 +281,13 @@ Double_t AliGenGSIlib::PtJpsiRitman( Double_t *px, Double_t *dummy )
   return x/TMath::Power(pass1,kxn);
    
 }
+Double_t AliGenGSIlib::YJpsiMUON(const Double_t *py, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                    J/Psi y-distribution MUONlib
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YJpsiMUON(Double_t *py, Double_t *dummy)
-{
 
   const Double_t ky0 = 4.;
   const Double_t kb=1.;
@@ -328,7 +306,7 @@ Double_t AliGenGSIlib::YJpsiMUON(Double_t *py, Double_t *dummy)
 //                  J/Psi pt-distribution by Sergei
 //
 //--------------------------------------------------------------------------
-//Double_t AliGenGSIlib::PtJpsi( Double_t *px, Double_t *dummy )
+//Double_t AliGenGSIlib::PtJpsi( Double_t *px, Double_t */*dummy*/ )
 //{
 
 //  return x = gRandom->Rndm()*10.;
@@ -360,12 +338,12 @@ Double_t AliGenGSIlib::YJpsiMUON(Double_t *py, Double_t *dummy)
 //                        Charm
 //
 //--------------------------------------------------------------------------
+Int_t AliGenGSIlib::IpCharm(TRandom *ran)
+{
 //
 //                    charm particle composition
 //
 //--------------------------------------------------------------------------
-Int_t AliGenGSIlib::IpCharm(TRandom *ran)
-{
   
     Float_t random;
     Int_t ip;
@@ -385,13 +363,13 @@ Int_t AliGenGSIlib::IpCharm(TRandom *ran)
     return ip;
 
 }
+Double_t AliGenGSIlib::PtCharmFlat( const Double_t *px, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                    charm pt-distribution, FLAT
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::PtCharmFlat( Double_t *px, Double_t *dummy)
-{
 
   Double_t x=*px;
 
@@ -400,13 +378,14 @@ Double_t AliGenGSIlib::PtCharmFlat( Double_t *px, Double_t *dummy)
   return x ;
 
 }
+Double_t AliGenGSIlib::PtCharmGSI( const Double_t *px, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                    charm pt-distribution, from Dariuzs Miskowiec
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::PtCharmGSI( Double_t *px, Double_t *dummy)
-{
+
   //Taken from PYTHIA with MRS D-' (3031 from PDFLIB), K=3.0
   const Double_t kp1 = 1.3;
   const Double_t kp2  = 0.39;
@@ -419,13 +398,13 @@ Double_t AliGenGSIlib::PtCharmGSI( Double_t *px, Double_t *dummy)
   return TMath::Power(x,kp1) * (pass1 + kp3 * pass2);
 
 }
+Double_t AliGenGSIlib::PtCharmMUON( const Double_t *px, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                    charm pt-distribution, from MUONlib
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::PtCharmMUON( Double_t *px, Double_t *dummy)
-{
 
   const Double_t kpt0 = 4.08;
   const Double_t kxn  = 9.40;
@@ -436,13 +415,13 @@ Double_t AliGenGSIlib::PtCharmMUON( Double_t *px, Double_t *dummy)
   return x/TMath::Power(pass1,kxn);
 
 }
+Double_t AliGenGSIlib::YCharm( const Double_t *px, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                    charm y-distribution
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YCharm( Double_t *px, Double_t *dummy)
-{
 
     Double_t *dum=0;
 
@@ -454,12 +433,12 @@ Double_t AliGenGSIlib::YCharm( Double_t *px, Double_t *dummy)
 //                        Beauty
 //
 //--------------------------------------------------------------------------
+Int_t AliGenGSIlib::IpBeauty(TRandom *ran)
+{  
 //
 //                    beauty particle composition
 //
 //--------------------------------------------------------------------------
-Int_t AliGenGSIlib::IpBeauty(TRandom *ran)
-{  
 
     Float_t random;
     Int_t ip;
@@ -477,13 +456,13 @@ Int_t AliGenGSIlib::IpBeauty(TRandom *ran)
     
     return ip;
 }
+Double_t AliGenGSIlib::PtBeautyFlat( const Double_t *px, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                    beauty pt-distribution, FLAT
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::PtBeautyFlat( Double_t *px, Double_t *dummy)
-{
 
   Double_t x=*px;
 
@@ -492,14 +471,15 @@ Double_t AliGenGSIlib::PtBeautyFlat( Double_t *px, Double_t *dummy)
   return x ;
 
 }
+Double_t AliGenGSIlib::PtBeautyGSI( const Double_t *px, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //
 //                    beauty pt-distribution, from D. Miskowiec
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::PtBeautyGSI( Double_t *px, Double_t *dummy)
-{
+
   //Taken from PYTHIA with MRS D-' (3031 from PDFLIB), K=3.0
   const Double_t kp1 = 1.3;
   const Double_t kp2  = 1.78;
@@ -513,13 +493,13 @@ Double_t AliGenGSIlib::PtBeautyGSI( Double_t *px, Double_t *dummy)
   return TMath::Power(x,kp1) * (pass1 + kp3 * pass2);
 
 }
+Double_t AliGenGSIlib::PtBeautyMUON( const Double_t *px, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                    beauty pt-distribution, from MUONlib
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::PtBeautyMUON( Double_t *px, Double_t *dummy)
-{
 
   const Double_t kpt0 = 4.;
   const Double_t kxn  = 3.6;
@@ -530,13 +510,13 @@ Double_t AliGenGSIlib::PtBeautyMUON( Double_t *px, Double_t *dummy)
   return x/TMath::Power(pass1,kxn);
 
 }
+Double_t AliGenGSIlib::YBeauty( const Double_t *px, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                    beauty y-distribution
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YBeauty( Double_t *px, Double_t *dummy)
-{
 
     Double_t *dum=0;
 
@@ -548,34 +528,34 @@ Double_t AliGenGSIlib::YBeauty( Double_t *px, Double_t *dummy)
 //                          Eta
 //
 //--------------------------------------------------------------------------
+Int_t AliGenGSIlib::IpEta(TRandom *)
+{
 //
 //                 eta particle composition 
 //
 //--------------------------------------------------------------------------
-Int_t AliGenGSIlib::IpEta(TRandom *)
-{
 
   return 221;     
 
 }
+Double_t AliGenGSIlib::PtEtaPHOS( const Double_t *px, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                  eta pt-distribution
 //
 //____________________________________________________________--------------
-Double_t AliGenGSIlib::PtEtaPHOS( Double_t *px, Double_t *dummy )
-{
 
-  return PtScal(*px,3);  //  3==> Eta in the PtScal function
+  return PtScal(*px,2);  //  2==> Eta in the PtScal function
    
 }
+Double_t AliGenGSIlib::YEtaPHOS(const Double_t *py, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                   eta y-distribution 
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YEtaPHOS(Double_t *py, Double_t *dummy)
-{
 
   const Double_t ka    = 1000.;
   const Double_t kdy   = 4.;
@@ -592,34 +572,34 @@ Double_t AliGenGSIlib::YEtaPHOS(Double_t *py, Double_t *dummy)
 //                       Etaprime
 //
 //--------------------------------------------------------------------------
+Int_t AliGenGSIlib::IpEtaprime(TRandom *)
+{
 //
 //                 etaprime particle composition 
 //
 //--------------------------------------------------------------------------
-Int_t AliGenGSIlib::IpEtaprime(TRandom *)
-{
 
   return 331;     
 
 }
+Double_t AliGenGSIlib::PtEtaprimePHOS( const Double_t *px, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                 etaprime pt-distribution
 //
 //____________________________________________________________--------------
-Double_t AliGenGSIlib::PtEtaprimePHOS( Double_t *px, Double_t *dummy )
-{
 
-  return PtScal(*px,5);  //  5==> Etaprime in the PtScal function
+  return PtScal(*px,4);  //  4==> Etaprime in the PtScal function
    
 }
+Double_t AliGenGSIlib::YEtaprimePHOS(const Double_t *py, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                  etaprime y-distribution 
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YEtaprimePHOS(Double_t *py, Double_t *dummy)
-{
 
   const Double_t ka    = 1000.;
   const Double_t kdy   = 4.;
@@ -636,34 +616,34 @@ Double_t AliGenGSIlib::YEtaprimePHOS(Double_t *py, Double_t *dummy)
 //                       omega 
 //
 //--------------------------------------------------------------------------
+Int_t AliGenGSIlib::IpOmega(TRandom *)
+{
 //
 //                 omega particle composition 
 //
 //--------------------------------------------------------------------------
-Int_t AliGenGSIlib::IpOmega(TRandom *)
-{
 
   return 223;     
 
 }
+Double_t AliGenGSIlib::PtOmega( const Double_t *px, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                  omega pt-distribution
 //
 //____________________________________________________________--------------
-Double_t AliGenGSIlib::PtOmega( Double_t *px, Double_t *dummy )
-{
 
-  return PtScal(*px,4);  //  4==> Omega in the PtScal function
+  return PtScal(*px,3);  //  3==> Omega in the PtScal function
    
 }
+Double_t AliGenGSIlib::YOmega(const Double_t *py, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                   omega y-distribution 
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YOmega(Double_t *py, Double_t *dummy)
-{
 
   const Double_t ka    = 1000.;
   const Double_t kdy   = 4.;
@@ -681,34 +661,36 @@ Double_t AliGenGSIlib::YOmega(Double_t *py, Double_t *dummy)
 //                       Rho 
 //
 //--------------------------------------------------------------------------
+
+Int_t AliGenGSIlib::IpRho(TRandom *)
+{
 //
 //                 rho particle composition 
 //
 //--------------------------------------------------------------------------
-Int_t AliGenGSIlib::IpRho(TRandom *)
-{
 
   return 113;     
 
 }
+Double_t AliGenGSIlib::PtRho( const Double_t *px, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                  rho pt-distribution
 //
 //____________________________________________________________--------------
-Double_t AliGenGSIlib::PtRho( Double_t *px, Double_t *dummy )
-{
 
-  return PtScal(*px,11);  //  11==> Rho in the PtScal function
+  return PtScal(*px,10);  //  10==> Rho in the PtScal function
    
 }
+Double_t AliGenGSIlib::YRho(const Double_t *py, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                   rho y-distribution 
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YRho(Double_t *py, Double_t *dummy)
-{
+
   const Double_t ka    = 1000.;
   const Double_t kdy   = 4.;
 
@@ -725,12 +707,12 @@ Double_t AliGenGSIlib::YRho(Double_t *py, Double_t *dummy)
 //                              Pion
 //
 //--------------------------------------------------------------------------
+Int_t AliGenGSIlib::IpPionPHOS(TRandom *ran)
+{
 //
 //                 particle composition  pi+, pi0, pi-
 //
 //--------------------------------------------------------------------------
-Int_t AliGenGSIlib::IpPionPHOS(TRandom *ran)
-{
 
     Float_t random = ran->Rndm();
 
@@ -750,6 +732,8 @@ Int_t AliGenGSIlib::IpPionPHOS(TRandom *ran)
       }
     }
 }
+Double_t AliGenGSIlib::PtPion( const Double_t *px, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                  pion pt-distribution
@@ -761,8 +745,6 @@ Int_t AliGenGSIlib::IpPionPHOS(TRandom *ran)
 //       MT SCALING BELOW (T=160 MEV)
 //
 //____________________________________________________________--------------
-Double_t AliGenGSIlib::PtPion( Double_t *px, Double_t *dummy )
-{
 
   const Double_t kp0 = 1.3;
   const Double_t kxn = 8.28;
@@ -784,13 +766,13 @@ Double_t AliGenGSIlib::PtPion( Double_t *px, Double_t *dummy )
   return y*x;
    
 }
+Double_t AliGenGSIlib::YPion(const Double_t *py, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                    pion y-distribution 
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YPion(Double_t *py, Double_t *dummy)
-{
 
   const Double_t ka    = 7000.;   
   const Double_t kdy   = 4.;
@@ -802,6 +784,8 @@ Double_t AliGenGSIlib::YPion(Double_t *py, Double_t *dummy)
   return ka*TMath::Exp(-ex);
 
 }
+Int_t AliGenGSIlib::IpKaonPHOS(TRandom *ran)
+{
 //--------------------------------------------------------------------------
 //
 //
@@ -811,8 +795,6 @@ Double_t AliGenGSIlib::YPion(Double_t *py, Double_t *dummy)
 //                kaon particle composition K+, K-, Ko_short, Ko_long
 //
 //--------------------------------------------------------------------------
-Int_t AliGenGSIlib::IpKaonPHOS(TRandom *ran)
-{
 
     Float_t random = ran->Rndm();
     Float_t random2 = ran->Rndm();
@@ -833,24 +815,24 @@ Int_t AliGenGSIlib::IpKaonPHOS(TRandom *ran)
       }
     }
 }
+Double_t AliGenGSIlib::PtKaonPHOS( const Double_t *px, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                   kaon pt-distribution
 //
 //____________________________________________________________--------------
-Double_t AliGenGSIlib::PtKaonPHOS( Double_t *px, Double_t *dummy )
-{
 
-  return PtScal(*px,2);  //  2==> Kaon in the PtScal function
+  return PtScal(*px,1);  //  1==> Kaon in the PtScal function
    
 }
+Double_t AliGenGSIlib::YKaonPHOS(const Double_t *py, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                    kaon y-distribution 
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YKaonPHOS(Double_t *py, Double_t *dummy)
-{
 
   const Double_t ka    = 1000.;
   const Double_t kdy   = 4.;
@@ -866,35 +848,35 @@ Double_t AliGenGSIlib::YKaonPHOS(Double_t *py, Double_t *dummy)
 //
 //                        Phi  
 //
+Int_t AliGenGSIlib::IpPhi(TRandom *)
+{
 //--------------------------------------------------------------------------
 //
 //                 particle composition 
 //
 //--------------------------------------------------------------------------
-Int_t AliGenGSIlib::IpPhi(TRandom *)
-{
 
   return 333;     
 
 }
+Double_t AliGenGSIlib::PtPhiPHOS( const Double_t *px, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                   phi pt-distribution
 //
 //____________________________________________________________--------------
-Double_t AliGenGSIlib::PtPhiPHOS( Double_t *px, Double_t *dummy )
-{
 
-  return PtScal(*px,6);  //  6==> Phi in the PtScal function
+  return PtScal(*px,5);  //  5==> Phi in the PtScal function
    
 }
+Double_t AliGenGSIlib::YPhiPHOS(const Double_t *py, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                    phi y-distribution 
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YPhiPHOS(Double_t *py, Double_t *dummy)
-{
 
   const Double_t ka    = 1000.;
   const Double_t kdy   = 4.;
@@ -907,6 +889,8 @@ Double_t AliGenGSIlib::YPhiPHOS(Double_t *py, Double_t *dummy)
   return ka*TMath::Exp(-ex);
 
 }
+Int_t AliGenGSIlib::IpBaryons(TRandom *ran)
+{
 //--------------------------------------------------------------------------
 //
 //                          Baryons
@@ -916,8 +900,6 @@ Double_t AliGenGSIlib::YPhiPHOS(Double_t *py, Double_t *dummy)
 //                 baryons particle composition p, pbar, n, nbar
 //
 //--------------------------------------------------------------------------
-Int_t AliGenGSIlib::IpBaryons(TRandom *ran)
-{
 
     Float_t random = ran->Rndm();
     Float_t random2 = ran->Rndm();
@@ -938,24 +920,24 @@ Int_t AliGenGSIlib::IpBaryons(TRandom *ran)
       }
     }
 }
+Double_t AliGenGSIlib::PtBaryons( const Double_t *px, const Double_t */*dummy*/ )
+{
 //--------------------------------------------------------------------------
 //
 //                  baryons pt-distribution
 //
 //____________________________________________________________--------------
-Double_t AliGenGSIlib::PtBaryons( Double_t *px, Double_t *dummy )
-{
 
-  return PtScal(*px,7);  //  7==> Baryon in the PtScal function
+  return PtScal(*px,6);  //  6==> Baryon in the PtScal function
    
 }
+Double_t AliGenGSIlib::YBaryons(const Double_t *py, const Double_t */*dummy*/)
+{
 //--------------------------------------------------------------------------
 //
 //                   baryons y-distribution 
 //
 //--------------------------------------------------------------------------
-Double_t AliGenGSIlib::YBaryons(Double_t *py, Double_t *dummy)
-{
 
   const Double_t ka    = 1000.;
   const Double_t kdy   = 4.;
@@ -987,8 +969,8 @@ Double_t AliGenGSIlib::YBaryons(Double_t *py, Double_t *dummy)
 
 // The present adds the Rhos
 
-// MASS   1=>PI, 2=>K, 3=>ETA, 4=>OMEGA, 5=>ETA', 6=>PHI 
-//        7=>BARYON-BARYONBAR, 11==>RHO
+// MASS   0=>PI, 1=>K, 2=>ETA, 3=>OMEGA, 4=>ETA', 5=>PHI 
+//        6=>BARYON-BARYONBAR, 10==>RHO
 
   const Double_t khm[11] = {0.1396, 0.494,  0.547,    0.782,   0.957,   1.02, 
                                          0.938, 0. , 0., 0., 0.769};
@@ -997,7 +979,6 @@ Double_t AliGenGSIlib::YBaryons(Double_t *py, Double_t *dummy)
 
   const Double_t kfmax[11]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
 
-  np--;
   Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
   Double_t kfmax2=f5/kfmax[np];
   // PIONS
@@ -1013,11 +994,11 @@ Double_t AliGenGSIlib::YBaryons(Double_t *py, Double_t *dummy)
 //    
 //==========================================================================
 
-typedef Double_t (*GenFunc) (Double_t*,  Double_t*);
+typedef Double_t (*GenFunc) (const Double_t*,  const Double_t*);
 
 typedef Int_t (*GenFuncIp) (TRandom *);
 
-GenFunc AliGenGSIlib::GetPt(Int_t param, const char * tname)
+GenFunc AliGenGSIlib::GetPt(Int_t param, const char * tname) const
 {
 // Return pointer to pT parameterisation
    GenFunc func=0;
@@ -1027,123 +1008,123 @@ GenFunc AliGenGSIlib::GetPt(Int_t param, const char * tname)
     {
     case kUpsilon:
       if (sname=="FLAT"){
-       func= PtUpsilonFlat;
-       break;
+        func= PtUpsilonFlat;
+        break;
       }
       if (sname=="MUON"){
-       func= PtUpsilonMUON;
-       break;
+        func= PtUpsilonMUON;
+        break;
       }
       if (sname=="RITMAN"){
-       func=PtUpsilonRitman;
-       break;
+        func=PtUpsilonRitman;
+        break;
       }
       if (sname=="KAREL"){
-       func=PtUpsilonKarel;
-       break;
+        func=PtUpsilonKarel;
+        break;
       }
+      func=0;
+      printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
       break;
-       func=0;
-        printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
 
     case kJPsi:
       if (sname=="FLAT"){
-       func= PtJpsiFlat;
-       break;
+        func= PtJpsiFlat;
+        break;
       }
       if (sname=="MUON"){
-       func= PtJpsiMUON;
-       break;
+        func= PtJpsiMUON;
+        break;
       }
       //      if (sname=="SERGEI"){
       //       func= PtJpsi;
       //       break;
       //     }
+      func=0;
+      printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
       break;
-        func=0;
-        printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
 
     case kCharm: 
       if (sname=="FLAT"){
-       func= PtCharmFlat;
-       break;
+        func= PtCharmFlat;
+        break;
       }
 
       if (sname=="MUON"){
-       func= PtCharmMUON;
-       break;
+        func= PtCharmMUON;
+        break;
       }
 
       if (sname=="GSI"){
-       func= PtCharmGSI;
-       break;
+        func= PtCharmGSI;
+        break;
       }
+      func=0;
+      printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
       break;
-       func=0;
-        printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
 
     case kBeauty: 
       if (sname=="FLAT"){
-       func= PtBeautyFlat;
-       break;
+        func= PtBeautyFlat;
+        break;
       }
       if (sname=="MUON"){
-       func= PtBeautyMUON;
-       break;
+        func= PtBeautyMUON;
+        break;
       }
       if (sname=="GSI"){
-       func= PtBeautyGSI;
-       break;
+        func= PtBeautyGSI;
+        break;
       }
+      func=0;
+      printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
       break;
-       func=0;
-        printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
 
 
     case kEta:
-         func=PtEtaPHOS;
-         break;
+      func=PtEtaPHOS;
+      break;
 
     case kEtaprime:
-         func=PtEtaprimePHOS;
-         break;
+      func=PtEtaprimePHOS;
+      break;
 
     case kOmega:
-         func=PtOmega;
-         break;
+      func=PtOmega;
+      break;
 
     case kRho:
-        func=PtRho;
-        break;
+      func=PtRho;
+      break;
 
     case kKaon:
-         func=PtKaonPHOS;
-         break;
+      func=PtKaonPHOS;
+      break;
 
     case kPion:
-         func=PtPion;
-         break;
+      func=PtPion;
+      break;
 
     case kPhi:
-         func=PtPhiPHOS;
-         break;
+      func=PtPhiPHOS;
+      break;
 
         //    case kLambda:
         //         func=PtLambda;
         //         break;
 
     case kBaryons:
-         func=PtBaryons;
-         break;
+      func=PtBaryons;
+      break;
 
     default:
-        func=0;
-        printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
+      func=0;
+      printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
     }
-    return func;
+   return func;
 }
 
-GenFunc AliGenGSIlib::GetY(Int_t param, const char * tname)
+GenFunc AliGenGSIlib::GetY(Int_t param, const char * tname) const
 {
 // Return pointer to y- parameterisation
    GenFunc func=0;
@@ -1241,7 +1222,7 @@ GenFunc AliGenGSIlib::GetY(Int_t param, const char * tname)
     return func;
 }
 
-GenFuncIp AliGenGSIlib::GetIp(Int_t param, const char * tname)
+GenFuncIp AliGenGSIlib::GetIp(Int_t param, const char * tname) const
 {
 // Return pointer to particle type parameterisation
    GenFuncIp func=0;