New class AliGenRICHlib added. (Annalisa Mastroserio <Annalisa.Mastroserio@ba.infn...
[u/mrichter/AliRoot.git] / EVGEN / AliGenRICHlib.cxx
CommitLineData
d1590034 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// Library class for particle pt and y distributions used for
17// HMPID simulations.
18// To be used with AliGenParam.
19// The following particle typed can be simulated:
20// phi, lambda, k
21//
22// Author: Annalisa Mastroserio <Annalisa.Mastroserio@ba.infn.it>
23//
24//
25
26#include <TRandom.h>
27#include <TString.h>
28#include <AliLog.h>
29#include "AliGenRICHlib.h"
30
31ClassImp(AliGenRICHlib)
32
33Int_t AliGenRICHlib::IpPhi(TRandom *)
34{
35//PDG code
36 return 333;
37}
38
39Double_t AliGenRICHlib::PtPhiFlat( Double_t *, Double_t *)
40{
41// Phi FLAT pt-distribution
42 return 1;
43}
44
45Double_t AliGenRICHlib::PtPhiExp( Double_t *x, Double_t *)
46{
47//phi EXP pt-distribution
48 return x[0]*TMath::Exp(-x[0]/0.17);
49}
50
51Double_t AliGenRICHlib::YPhiFlat(Double_t *,Double_t *)
52{
53//phi y-distribution
54 return 1;
55}
56
57//-------------------------------------------------------
58// LAMBDAS
59//-------------------------------------------------------
60
61Int_t AliGenRICHlib::IpLambda(TRandom *)
62{
63//PDG code
64 return 3122;
65}
66
67Double_t AliGenRICHlib::PtLambdaFlat( Double_t *, Double_t *)
68{
69// Lambda FLAT pt-distribution
70
71 return 1;
72}
73
74Double_t AliGenRICHlib::PtLambdaExp( Double_t *x, Double_t *)
75{
76//Lambda EXP pt-distribution
77 return x[0]*TMath::Exp(-x[0]/0.17);
78}
79
80Double_t AliGenRICHlib::YLambdaFlat(Double_t *,Double_t *)
81{
82 //Lambda y-distribution
83 return 1;
84}
85
86
87Int_t AliGenRICHlib::IpLambdaBar(TRandom *)
88{
89//PDG code
90 return -3122;
91}
92
93Double_t AliGenRICHlib::PtLambdaBarFlat( Double_t *, Double_t *)
94{
95// LambdaBar FLAT pt-distribution
96
97 return 1;
98}
99
100Double_t AliGenRICHlib::PtLambdaBarExp( Double_t *x, Double_t *)
101{
102//LambdaBar EXP pt-distribution
103 return x[0]*TMath::Exp(-x[0]/0.17);
104}
105
106Double_t AliGenRICHlib::YLambdaBarFlat(Double_t *,Double_t *)
107{
108 //LambdaBar y-distribution
109 return 1;
110}
111
112
113
114//---------------------------------------------------------
115// K0 short
116//--------------------------------------------------------
117
118Int_t AliGenRICHlib::IpK0s(TRandom *)
119{
120//PDG code
121 return 310;
122}
123
124Double_t AliGenRICHlib::PtK0sFlat( Double_t *, Double_t *)
125{
126// K0s FLAT pt-distribution
127 return 1;
128}
129
130Double_t AliGenRICHlib::PtK0sExp( Double_t *x, Double_t *)
131{
132// K0s EXP pt-distribution
133 return x[0]*TMath::Exp(-x[0]/0.17);
134}
135
136Double_t AliGenRICHlib::YK0sFlat(Double_t *,Double_t *)
137{
138// K0s y-distribution
139 return 1;
140}
141
142
143
144
145typedef Double_t (*GenFunc) (Double_t*, Double_t*);
146typedef Int_t (*GenFuncIp) (TRandom *);
147
148GenFunc AliGenRICHlib::GetPt(Int_t iPID, const char * sForm) const
149{
150// Return pointer to Pt parameterisation
151 AliDebug(1,Form("PID: %i, form: %s",iPID,sForm));
152 TString type(sForm);
153
154 switch(iPID) {
155 case kPhi:
156 if (type=="FLAT") return PtPhiFlat;
157 else if(type=="EXP") return PtPhiExp;
158 else {
159 AliFatal(Form("Unknown Pt distribution form: %s",sForm)); return 0;
160 }
161
162 case kLambda0:
163 if (type=="FLAT") return PtLambdaFlat;
164 else if(type=="EXP") return PtLambdaExp;
165 else {
166 AliFatal(Form("Unknown Pt distribution form: %s",sForm)); return 0;
167 }
168
169 case kLambda0Bar:
170 if (type=="FLAT") return PtLambdaBarFlat;
171 else if(type=="EXP") return PtLambdaBarExp;
172 else {
173 AliFatal(Form("Unknown Pt distribution form: %s",sForm)); return 0;
174 }
175
176
177 case kK0Short:
178 if (type=="FLAT") return PtK0sFlat;
179 else if(type=="EXP") return PtK0sExp;
180 else {
181 AliFatal(Form("Unknown Pt distribution form: %s",sForm)); return 0;
182 }
183
184 default : AliFatal(Form("Unknown particle type: %i",iPID)); return 0;
185 }//switch
186}
187
188GenFunc AliGenRICHlib::GetY(Int_t iPID, const char *sForm) const
189{
190 AliDebug(1,Form("PID: %i, form: %s",iPID,sForm));
191
192 switch (iPID) {
193 case kPhi: return YPhiFlat;
194 case kLambda0: return YLambdaFlat;
195 case kLambda0Bar: return YLambdaBarFlat;
196 case kK0Short: return YK0sFlat;
197
198 default : AliFatal(Form("Unknown particle type: %i",iPID)); return 0;
199
200 }//switch
201}
202
203GenFuncIp AliGenRICHlib::GetIp(Int_t iPID, const char *sForm) const
204{
205// Return pointer to particle type parameterisation
206 AliDebug(1,Form("PID: %i, form: %s",iPID,sForm)); //////////
207 switch (iPID){
208 case kPhi: return IpPhi;
209 case kLambda0: return IpLambda;
210 case kLambda0Bar: return IpLambdaBar;
211 case kK0Short: return IpK0s;
212
213 default : AliFatal(Form("Unknown particle type: %i",iPID)) return 0;
214 }
215}
216