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