StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TGeVSimParticle.cxx
1 //
3 // TGeVSimParticle is a helper class for GeVSim event generator
4 //
5 // One object of this class keep information about one particle type.
6 // Those include PDG code, momentum distribution model, and its parameter
7 // as well as Directed and Elliptic flow parameters.
8 //
9 // For documentation about GeVSim event generator and implemented
10 // momentum distributions models refer to TGeVSim
11 //
12 // Sylwester Radomski, e-mail: S.Radomski@gsi.de
13 // GSI, Dec 13, 2002
14 //
16 
17 
18 #include "TMath.h"
19 #include "TGeVSimParticle.h"
20 
21 #include "TDatabasePDG.h"
22 #include "TParticlePDG.h"
23 
24 ClassImp(TGeVSimParticle);
25 
27 
28 TGeVSimParticle::TGeVSimParticle(Int_t pdg, TGeVSim::Model_t model, Float_t multiplicity,
29  Float_t T, Float_t dY, Float_t param2) {
30  //
31  // Standard constructor
32  //
33  // pdg - Particle type code in PDG standard (see: http://pdg.lbl.gov)
34  // model - momentum distribution model of type TGeVSim::Model_t
35  // multiplicity - multiplicity of particle type
36  // T - Inverse slope parameter ("temperature")
37  // dY - Raridity Width (only for models: kBoltzman and kLevy)
38  // param2 - Additional parameter
39  //
40  // Multiplicity is interpreded either as a total multiplicity or as
41  // a multiplicity density dN/dy. Interpretation is determined either on
42  // the event level in TGeVSim class or on the particle type level
43  // in this class be SetMultTotal() method. If this method is used it overrides
44  // interpretation from TGeVSim.
45  //
46  // param2 is interpreted according to selected model.
47  // If model = TGeVSim::kLevy then it is sigmaTemp
48  // If model = TGeVSIm::kExpension then it is expansion velocity
49  //
50 
51  const char *where = "TGeVSimParticle";
52  const char *msg[] = {
53  "Param2 can be used only with model kLevy and kExpansion",
54  "Param2 not set for kLevy assuming sigTemp = 0.1",
55  "Param2 not set for kExpansion assuming expVel = 0.5 c"
56  };
57 
58  SetModel(model);
59 
60  fPDG = pdg;
61  fT = T;
62  fSigmaY = dY;
63 
64  if (model != TGeVSim::kLevy && model != TGeVSim::kExpansion && (param2 > 0))
65  Warning(where,msg[0]);
66 
67  if (model == TGeVSim::kLevy) {
68  if (param2 > 0.5 || param2 == 0.) {
69  Warning(where, msg[1]);
70  param2 = 10;
71  }
72  SetSigmaTemp(param2);
73  }
74 
75  if (model == TGeVSim::kExpansion) {
76  if (param2 < 0.001) {
77  Warning(where, msg[2]);
78  param2 = 0.5;
79  }
80  SetExpansionVelocity(param2);
81  }
82 
83  fN = multiplicity;
84  fMultTotal = kTRUE;
85  fIsSetMult = kFALSE;
86 
87  fV1[0] = fV1[1] = fV1[2] = fV1[3] = 0.;
88  fV2[0] = fV2[1] = fV2[2] = 0.;
89 
90  fIsEllipticSimple = fIsDirectedSimple = kTRUE;
91  fIsEllipticOld = kFALSE;
92 }
93 
95 
96 TGeVSimParticle::TGeVSimParticle(Int_t pdg, TGeVSim::Model_t model, Float_t multiplicity) {
97  //
98  // pdg - Particle type code in PDG standard (see: http://pdg.lbl.gov)
99  //
100  // Note that multiplicity can be interpreted by GeVSim
101  // either as Total multiplicity in the acceptance or dN/dY
102  //
103 
104  fPDG = pdg;
105  fN = multiplicity;
106  fMultTotal = kTRUE;
107  fIsSetMult = kFALSE;
108 
109  SetModel(model);
110 
111  fT = 0.;
112  fSigmaY = 0.;
113  fParam2 = 0.;
114 
115  fV1[0] = fV1[1] = fV1[2] = fV1[3] = 0.;
116  fV2[0] = fV2[1] = fV2[2] = 0.;
117 
118  fIsEllipticSimple = fIsDirectedSimple = kTRUE;
119  fIsEllipticOld = kFALSE;
120 }
121 
123 
124 void TGeVSimParticle::SetModel(TGeVSim::Model_t model) {
125  //
126  // Set Model from enueration type TGeVSim::Model_t
127  // For details about standard and custom models refer to
128  // TGeVSim class and ALICE NOTE
129  //
130 
131  //if ((model < 1 || model > kExpansion) || (model > 5 && model < 10))
132  // Error("SetModel","Model Id ( %d ) out of range [1..5] or [10..12]", model);
133 
134  fModel = model;
135 }
136 
138 
139 void TGeVSimParticle::SetExpansionVelocity(Float_t vel)
140 {
141  //
142  // Expansion velocity for model kExpansion in speed of light units
143  //
144  // If model for the particle type is not kExpansion or
145  // vel is not between 0 and 1 Error message is issued.
146  //
147 
148  const char *where = "SetExpansionVelocity";
149  const char *msg[] = {
150  "Expansion Velocity can be set only for model 'kExpansion'",
151  "Expansion Velocity = %f out of range (0-1)"
152  };
153 
154  if (fModel != TGeVSim::kExpansion) Error(where, msg[0]);
155  if (vel <= 0 || vel >= 1) Error(where, msg[1], vel);
156 
157  fParam2 = vel;
158 }
159 
161 
162 void TGeVSimParticle::SetSigmaTemp(Float_t sigT)
163 {
164  //
165  // Set SigmaTemp for the Levy distribution
166  //
167  // sigT have to ba a positive numeber lesser than 1
168  // when sigT -> 0 Levy distribution -> Boltzman
169  //
170  // It is not recomendet to use sigmaTemp greatet than 0.2
171  // comparision with HIJING suggest using sigmaTemp ~ 0.1
172  //
173 
174  const char *where = "SetSigmaTemp";
175  const char *msg[] = {
176  "SigmaTemp can be set only for model 'kLevy'",
177  "SigmaTemp = %f have to be positive",
178  "SigmaTemp = %f have to be lesser than 1"
179  };
180 
181  if (fModel != TGeVSim::kLevy) Warning(where, msg[0]);
182  if (sigT <= 0) Error(where, msg[1], sigT);
183  if (sigT >= 1) Error(where, msg[2], sigT);
184 
185  fParam2 = sigT;
186 }
187 
189 
190 Float_t TGeVSimParticle::GetExpansionVelocity() const
191 {
192  //
193  // Returns expansion velocity
194  // is selected model is not kExpansion Warning is issued
195 
196  if (fModel != TGeVSim::kExpansion)
197  Warning("GetExpansionVelocity", "Model is not kExpansion");
198 
199  return fParam2;
200 }
201 
202 
204 
205 Float_t TGeVSimParticle::GetSigmaTemp() const
206 {
207  //
208  // Returns SigmaTemp.
209  // Is selected model is not kLevy Warning is issued
210  //
211 
212  if (fModel != TGeVSim::kLevy)
213  Warning("GetSigmaTemp", "Model is not kLevy");
214 
215  return fParam2;
216 }
217 
219 
220 void TGeVSimParticle::SetMultiplicity(Float_t mult) {
221  //
222  // Set multiplicity. The value is interpreted either as a total multiplciity
223  // in the acceptance or as a multiplicity density - dN/dY at midrapidity
224  //
225 
226  const char *fName = "SetMultiplicity";
227  if (mult < 0) Error(fName, "Multiplicity has to be positive");
228  if (mult > 50000) Warning(fName, "Multiplicity greater than 50 000");
229 
230  fN = mult;
231 }
232 
234 
235 void TGeVSimParticle::SetMultTotal(Bool_t isTotal) {
236  //
237  // Switch between total multiplicity (kTRUE) and
238  // multiplciity density (kFALSE)
239  //
240  // If this method is used its overrides mode in TGenGeVSim
241  //
242 
243  fMultTotal = isTotal;
244  fIsSetMult = kTRUE;
245 }
246 
248 
249 void TGeVSimParticle::SetDirectedSimple(Float_t v1) {
250  //
251  // Set directed flow coefficient to a value independent
252  // of transverse momentum and rapidity
253  //
254 
255  fV1[0] = v1;
256  fIsDirectedSimple = kTRUE;
257 }
258 
260 
261 void TGeVSimParticle::SetEllipticSimple(Float_t v2) {
262  //
263  // Set elliptic flow coefficient to a value independent
264  // of transverse momentum and rapidity
265  //
266 
267  fV2[0] = v2;
268  fIsEllipticSimple = kTRUE;
269 }
270 
272 
273 Bool_t TGeVSimParticle::IsFlowSimple() {
274  //
275  // Function used by TGenGeVSim
276  //
277  // Returns true if both Elliptic and Directed flow has a simple model.
278  // If at least one is parametrised returns false.
279  //
280 
281  return (fIsDirectedSimple && fIsEllipticSimple);
282 }
283 
285 
286 void TGeVSimParticle::SetDirectedParam(Float_t v11, Float_t v12, Float_t v13, Float_t v14) {
287  //
288  // Set parameters for Directed Flow
289  // Actual flow coefficient is calculated as follows
290  //
291  // V1(Pt,Y) = (V11 + V12*Pt) * sign(Y) * (V13 + V14 * Y^3)
292  //
293  // where sign = 1 for Y > 0 and -1 for Y < 0
294  //
295  // Default values
296  // v11 = v12 = v13 = v14 = 0
297  //
298 
299  fV1[0] = v11;
300  fV1[1] = v12;
301  fV1[2] = v13;
302  fV1[3] = v14;
303 
304  fIsDirectedSimple = kFALSE;
305 }
306 
308 
309 void TGeVSimParticle::SetEllipticParam1(Float_t v21, Float_t pTmax, Float_t v22) {
310  //
311  // Set parameters for Elliptic Flow
312  // Actual flow coefficient is calculated as follows
313  //
314  // pTmax is in GeV
315  // v21 - flow value at saturation
316  //
317  //
318  // V2 = v21 * (pT/pTMax ) * exp (-v22 * y^2) where pT <= pTmax
319  // v21 * exp (-v22 * y^2) where pT > pTmax
320  //
321  // Default values:
322  // v21 = pTMax = v23 = 0
323  //
324  // The parametrisation is suitable for relativistic particles
325  // eg. Pions (at RHIC energies)
326  //
327 
328 
329  fV2[0] = v21;
330  fV2[1] = pTmax;
331  fV2[2] = v22;
332 
333  fIsEllipticSimple = kFALSE;
334  fIsEllipticOld = kFALSE;
335 }
336 
338 
339 void TGeVSimParticle::SetEllipticParam2(Float_t v21, Float_t v22, Float_t v23) {
340  //
341  // Set parameters for Elliptic Flow
342  // Actual flow coefficient is calculated as follows
343  //
344  // V2 = (V21 + V22 pT^2) * exp (-V23 * y^2)
345  //
346  // The parameterisation is suitable for heavy particles: proton, kaon
347  //
348  // Default values
349  // v21 = v22 = v23 = 0
350 
351  fV2[0] = v21;
352  fV2[1] = v22;
353  fV2[2] = v23;
354 
355  fIsEllipticSimple = kFALSE;
356  fIsEllipticOld = kTRUE;
357 }
358 
360 
361 Float_t TGeVSimParticle::GetDirectedFlow(Float_t pt, Float_t y) {
362  //
363  // Return coefficient of a directed flow for a given pt and y.
364  // For coefficient calculation method refer to SetDirectedParam()
365  //
366 
367  if (fIsDirectedSimple) return fV1[0];
368 
369  Float_t v;
370 
371  v = (fV1[0] + fV1[1]* pt) * TMath::Sign((Float_t)1.,y) *
372  (fV1[2] + fV1[3] * TMath::Abs(y*y*y) );
373 
374  return v;
375 }
376 
378 
379 Float_t TGeVSimParticle::GetEllipticFlow(Float_t pt, Float_t y) {
380  //
381  // Return coefficient of a elliptic flow for a given pt and y.
382  // For coefficient calculation method refer to SetEllipticParam()
383  //
384 
385  if (fIsEllipticSimple) return fV2[0];
386 
387  if (fIsEllipticOld) {
388 
389  // old parametrisation
390  return (fV2[0]+fV2[1]*pt*pt) * TMath::Exp(-fV2[2]*y*y);
391 
392  } else {
393 
394  // new "pionic" parameterisation
395  if (pt < fV2[1]) return ( (pt / fV2[1]) * fV2[0] * TMath::Exp(-fV2[2]*y*y) );
396  else return ( fV2[0] * TMath::Exp(-fV2[2]*y*y) );
397  }
398 }
399 
401 
402 void TGeVSimParticle::Print(Option_t* option) const
403 {
404  //
405  // Print informations about the particle type
406  //
407 
408  const char *dummy = "unknown type";
409  const char *models[15] = {
410  "","Boltzman ", "Levy ", "Pratt ", "Bertsch ", "Expansion ",
411  "", "", "", "",
412  "1D Formulas", "2D Formula", "1D Histograms", "2D Histogram", "Function"
413  };
414 
415  const char *name;
416  const TParticlePDG *ap = TDatabasePDG::Instance()->GetParticle(fPDG);
417  if (ap) name = ap->GetName();
418  else name = (char*)dummy;
419 
420  printf("** %s\tModel: %s Mult = %4d, T = %.3f GeV\n", name, models[fModel], (Int_t)fN, fT);
421 }
422 
Definition: FJcore.h:367