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