]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVGEN/AliGeVSimParticle.cxx
Moving the functions used to initialize TF1 and TF2 to the pivate part of the class
[u/mrichter/AliRoot.git] / EVGEN / AliGeVSimParticle.cxx
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 //////////////////////////////////////////////////////////////////////////////
19 //
20 // AliGeVSimParticle is a helper class for GeVSim (AliGenGeVSim) event generator.
21 // An object of this class represents one particle type and contain 
22 // information about particle type thermal parameters.
23 //
24 //////////////////////////////////////////////////////////////////////////////
25 //
26 // For examples, parameters and testing macros refer to:
27 // http:/home.cern.ch/radomski
28 // 
29 // for more detailed description refer to ALICE NOTE
30 // "GeVSim Monte-Carlo Event Generator"
31 // S.Radosmki, P. Foka.
32 //  
33 // Author:
34 // Sylwester Radomski,
35 // GSI, March 2002
36 //  
37 // S.Radomski@gsi.de
38 //
39 ////////////////////////////////////////////////////////////////////////////////
40 //
41 // Updated and revised: September 2002, S. Radomski, GSI
42 //
43 ////////////////////////////////////////////////////////////////////////////////
44
45
46 #include "TMath.h"
47 #include "AliGeVSimParticle.h"
48
49 ClassImp(AliGeVSimParticle)
50
51 ////////////////////////////////////////////////////////////////////////////////////////////////////
52
53 AliGeVSimParticle::AliGeVSimParticle(Int_t pdg, Int_t model, Float_t multiplicity,
54                                      Float_t T, Float_t dY, Float_t exp) {
55   //
56   //  pdg          - Particle type code in PDG standard (see: http://pdg.lbl.gov)
57   //  model        - momentum distribution model (1 - 7)
58   //  multiplicity - multiplicity of particle type
59   //  T            - Inverse slope parameter ("temperature")
60   //  dY           - Raridity Width (only for model 1)
61   //  exp          - expansion velocity (only for model 4) 
62   
63   fPDG = pdg;
64   fT = T;
65   fSigmaY = dY;
66   fExpansion = exp;
67
68   fN = multiplicity;
69   fMultTotal = kTRUE;
70   fIsSetMult = kFALSE;
71
72   SetModel(model);
73
74   fV1[0] = fV1[1] = fV1[2] = fV1[3] = 0.;
75   fV2[0] = fV2[1] = fV2[2] = 0.;
76
77   fIsEllipticSimple = fIsDirectedSimple = kTRUE;
78   fIsEllipticOld = kFALSE;
79 }
80
81 ////////////////////////////////////////////////////////////////////////////////////////////////////
82
83 AliGeVSimParticle::AliGeVSimParticle(Int_t pdg, Int_t model, Float_t multiplicity) {
84   //
85   // pdg - Particle type code in PDG standard (see: http://pdg.lbl.gov)
86   //  
87   // Note that multiplicity can be interpreted by GeVSim 
88   // either as Total multiplicity in the acceptance or dN/dY
89   // 
90  
91   fPDG = pdg;
92   fN = multiplicity; 
93   fMultTotal = kTRUE;
94   fIsSetMult = kFALSE;
95   
96   SetModel(model);
97
98   fT = 0.;
99   fSigmaY = 0.;
100   fExpansion = 0.;
101   
102   fV1[0] = fV1[1] = fV1[2] = fV1[3] = 0.;
103   fV2[0] = fV2[1] = fV2[2] = 0.; 
104
105   fIsEllipticSimple = fIsDirectedSimple = kTRUE;
106   fIsEllipticOld = kFALSE;
107 }
108
109 ////////////////////////////////////////////////////////////////////////////////////////////////////
110
111 void  AliGeVSimParticle::SetModel(Int_t model) {
112   //
113   // Set Model (1-7) 
114   // For details about standard and custom models refer to ALICE NOTE
115   //
116
117   if (model < 1 || model > 7) 
118     Error("SetModel","Model Id ( %d ) out of range [1..7]", model);
119
120   fModel = model;
121 }
122
123 ////////////////////////////////////////////////////////////////////////////////////////////////////
124
125 void  AliGeVSimParticle::SetMultiplicity(Float_t mult) {
126   //
127   // Set multiplicity. The value is interpreted either as a total multiplciity
128   // in the acceptance or as a multiplicity density - dN/dY at midrapidity
129   //  
130
131   fN = mult;
132 }
133
134 ////////////////////////////////////////////////////////////////////////////////////////////////////
135
136 void AliGeVSimParticle::SetMultTotal(Bool_t isTotal) {
137   //
138   // Switch between total multiplicity (kTRUE) and 
139   // multiplciity density (kFALSE)
140   //
141   // If this method is used its overrides mode in AliGenGeVSim 
142   //
143   
144   fMultTotal = isTotal;
145   fIsSetMult = kTRUE;
146 }
147
148 ////////////////////////////////////////////////////////////////////////////////////////////////////
149  
150 void AliGeVSimParticle::SetDirectedSimple(Float_t v1) {
151   //
152   // Set directed flow coefficient to a value independent
153   // of transverse momentum and rapidity
154   //
155
156   fV1[0] = v1;
157   fIsDirectedSimple = kTRUE;
158 }
159
160 ////////////////////////////////////////////////////////////////////////////////////////////////////
161
162 void AliGeVSimParticle::SetEllipticSimple(Float_t v2) {
163   //
164   // Set elliptic flow coefficient to a value independent
165   // of transverse momentum and rapidity
166   //
167
168   fV2[0] = v2;
169   fIsEllipticSimple = kTRUE;
170 }
171
172 ////////////////////////////////////////////////////////////////////////////////////////////////////
173
174 Bool_t AliGeVSimParticle::IsFlowSimple() const
175 {
176   //
177   // Function used by AliGenGeVSim 
178   //
179   // Returns true if both Elliptic and Directed flow has a simple model.
180   // If at least one is parametrised returns false. 
181   // 
182
183   return (fIsDirectedSimple && fIsEllipticSimple);
184 }
185
186 ////////////////////////////////////////////////////////////////////////////////////////////////////
187
188 void AliGeVSimParticle::SetDirectedParam(Float_t v11, Float_t v12, Float_t v13, Float_t v14) {
189   //
190   // Set parameters for Directed Flow 
191   // Actual flow coefficient is calculated as follows
192   //
193   // V1(Pt,Y) = (V11 + V12*Pt) * sign(Y) * (V13 + V14 * Y^3)
194   //
195   // where sign = 1 for Y > 0 and -1 for Y < 0
196   // 
197   // Defaults values
198   // v12 = v14 = 0
199   // v13 = 1
200   // 
201
202   fV1[0] = v11;
203   fV1[1] = v12;
204   fV1[2] = v13;
205   fV1[3] = v14;
206   
207   fIsDirectedSimple = kFALSE;
208 }
209
210 ////////////////////////////////////////////////////////////////////////////////////////////////////
211
212 void AliGeVSimParticle::SetEllipticParam(Float_t v21, Float_t pTmax, Float_t v22) {
213   //
214   // Set parameters for Elliptic Flow
215   // Actual flow coefficient is calculated as follows
216   //
217   // pTmax is in GeV 
218   // v21 - flow value at saturation
219   //
220   //
221   // V2 = v21 * (pT/pTMax ) * exp (-v22 * y^2)    where pT <= pTmax  
222   //      v21 * exp (-v22 * y^2)                   where pT > pTmax  
223   //
224   // Default values:
225   // v22 = 0
226   //
227   // The parametrisation is suitable for relativistic particles
228   // eg. Pions (at RHIC energies)
229   //
230
231
232   fV2[0] = v21;
233   fV2[1] = pTmax;
234   fV2[2] = v22;
235
236   fIsEllipticSimple = kFALSE;
237   fIsEllipticOld = kFALSE;
238 }
239
240 ////////////////////////////////////////////////////////////////////////////////////////////////////
241
242 void AliGeVSimParticle::SetEllipticOld(Float_t v21, Float_t v22, Float_t v23) {
243   //
244   // Set parameters for Elliptic Flow
245   // Actual flow coefficient is calculated as follows
246   //
247   // V2 = (V21 + V22 pT^2) * exp (-v22 * y^2)
248   //
249   // The parameterisation is suitable for heavy particles: proton, kaon
250   //
251
252   fV2[0] = v21;
253   fV2[1] = v22;
254   fV2[2] = v23;
255
256   fIsEllipticSimple = kFALSE;
257   fIsEllipticOld = kTRUE;
258 }
259
260 ////////////////////////////////////////////////////////////////////////////////////////////////////
261
262 Float_t AliGeVSimParticle::GetDirectedFlow(Float_t pt, Float_t y) {
263   //
264   // Return coefficient of a directed flow for a given pt and y.
265   // For coefficient calculation method refer to SetDirectedParam()
266   // 
267   
268   if (fIsDirectedSimple) return fV1[0];
269
270   Float_t v;
271   
272   v = (fV1[0] + fV1[1]* pt) * TMath::Sign((Float_t)1.,y) *
273     (fV1[2] + fV1[3] * TMath::Abs(y*y*y) );
274
275   return v;
276 }
277
278 ////////////////////////////////////////////////////////////////////////////////////////////////////
279
280 Float_t AliGeVSimParticle::GetEllipticFlow(Float_t pt, Float_t y) {
281   //
282   // Return coefficient of a elliptic flow for a given pt and y.
283   // For coefficient calculation method refer to SetEllipticParam()
284   // 
285
286   if (fIsEllipticSimple) return fV2[0];
287
288   if (fIsEllipticOld) {
289     
290     // old parametrisation
291     return (fV2[0]+fV2[1]*pt*pt) * TMath::Exp(-fV2[2]*y*y);
292
293   } else {
294
295     // new "pionic" parameterisation
296     if (pt < fV2[1]) return ( (pt / fV2[1]) * fV2[0] * TMath::Exp(-fV2[2]*y*y) ); 
297     else  return ( fV2[0] * TMath::Exp(-fV2[2]*y*y) );
298   }
299 }
300
301 ////////////////////////////////////////////////////////////////////////////////////////////////////
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316