1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 // Library class for particle pt and y distributions used for
18 // LambdaC simulations.
19 // To be used with AliGenParam.
21 // Author: Annalisa Mastroserio <Annalisa.Mastroserio@cern.ch>
29 #include "AliGenLcLib.h"
35 //---------------------------------------------
37 //---------------------------------------------
38 Int_t AliGenLcLib::IpLcPlus(TRandom *)
44 Int_t AliGenLcLib::IpLcMinus(TRandom *)
50 Double_t AliGenLcLib::PtLcFlat( const Double_t *, const Double_t *)
52 // FLAT pt-distribution
56 Double_t AliGenLcLib::PtLcExp( const Double_t *x, const Double_t *)
58 // EXP pt-distribution
59 return x[0]*TMath::Exp(-x[0]/0.17);
62 Double_t AliGenLcLib::YLcFlat(const Double_t */*x*/,const Double_t *)
64 //LambdaC y-distribution
70 typedef Double_t (*GenFunc) (const Double_t*, const Double_t*);
71 typedef Int_t (*GenFuncIp) (TRandom *);
73 GenFunc AliGenLcLib::GetPt(Int_t iPID, const char * sForm) const
75 // Return pointer to Pt parameterisation
76 printf("PID: %i, form: %s \n",iPID,sForm);
83 if (type=="FLAT") {func=PtLcFlat; break;}
84 else if(type=="EXP") {func=PtLcExp; break;}
86 AliFatal(Form("Unknown Pt distribution form: %s",sForm)); func=0;
90 if (type=="FLAT") {func=PtLcFlat; break;}
91 else if(type=="EXP") {func=PtLcExp; break;}
93 AliFatal(Form("Unknown Pt distribution form: %s",sForm)); func=0;
96 default : AliFatal(Form("Unknown particle type: %i",iPID)); func=0;
102 GenFunc AliGenLcLib::GetY(Int_t iPID, const char *sForm) const
104 AliDebug(1,Form("PID: %i, form: %s",iPID,sForm));
108 case kLcPlus: func=YLcFlat; break;
109 case kLcMinus: func=YLcFlat; break;
111 default : AliFatal(Form("Unknown particle type: %i",iPID)); func=0; break;
117 GenFuncIp AliGenLcLib::GetIp(Int_t iPID, const char *sForm) const
119 // Return pointer to particle type parameterisation
120 AliDebug(1,Form("PID: %i, form: %s",iPID,sForm)); //////////
124 case kLcPlus: return IpLcPlus;
125 case kLcMinus: return IpLcMinus;
127 default : AliFatal(Form("Unknown particle type: %i",iPID)); return 0;