19 #include "TGeVSimParticle.h"
21 #include "TDatabasePDG.h"
22 #include "TParticlePDG.h"
28 TGeVSimParticle::TGeVSimParticle(Int_t pdg, TGeVSim::Model_t model, Float_t multiplicity,
29 Float_t T, Float_t dY, Float_t param2) {
51 const char *where =
"TGeVSimParticle";
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"
64 if (model != TGeVSim::kLevy && model != TGeVSim::kExpansion && (param2 > 0))
65 Warning(where,msg[0]);
67 if (model == TGeVSim::kLevy) {
68 if (param2 > 0.5 || param2 == 0.) {
69 Warning(where, msg[1]);
75 if (model == TGeVSim::kExpansion) {
77 Warning(where, msg[2]);
80 SetExpansionVelocity(param2);
87 fV1[0] = fV1[1] = fV1[2] = fV1[3] = 0.;
88 fV2[0] = fV2[1] = fV2[2] = 0.;
90 fIsEllipticSimple = fIsDirectedSimple = kTRUE;
91 fIsEllipticOld = kFALSE;
96 TGeVSimParticle::TGeVSimParticle(Int_t pdg, TGeVSim::Model_t model, Float_t multiplicity) {
115 fV1[0] = fV1[1] = fV1[2] = fV1[3] = 0.;
116 fV2[0] = fV2[1] = fV2[2] = 0.;
118 fIsEllipticSimple = fIsDirectedSimple = kTRUE;
119 fIsEllipticOld = kFALSE;
124 void TGeVSimParticle::SetModel(TGeVSim::Model_t model) {
139 void TGeVSimParticle::SetExpansionVelocity(Float_t vel)
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)"
154 if (fModel != TGeVSim::kExpansion)
Error(where, msg[0]);
155 if (vel <= 0 || vel >= 1)
Error(where, msg[1], vel);
162 void TGeVSimParticle::SetSigmaTemp(Float_t sigT)
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"
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);
190 Float_t TGeVSimParticle::GetExpansionVelocity()
const
196 if (fModel != TGeVSim::kExpansion)
197 Warning(
"GetExpansionVelocity",
"Model is not kExpansion");
205 Float_t TGeVSimParticle::GetSigmaTemp()
const
212 if (fModel != TGeVSim::kLevy)
213 Warning(
"GetSigmaTemp",
"Model is not kLevy");
220 void TGeVSimParticle::SetMultiplicity(Float_t mult) {
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");
235 void TGeVSimParticle::SetMultTotal(Bool_t isTotal) {
243 fMultTotal = isTotal;
249 void TGeVSimParticle::SetDirectedSimple(Float_t v1) {
256 fIsDirectedSimple = kTRUE;
261 void TGeVSimParticle::SetEllipticSimple(Float_t v2) {
268 fIsEllipticSimple = kTRUE;
273 Bool_t TGeVSimParticle::IsFlowSimple() {
281 return (fIsDirectedSimple && fIsEllipticSimple);
286 void TGeVSimParticle::SetDirectedParam(Float_t v11, Float_t v12, Float_t v13, Float_t v14) {
304 fIsDirectedSimple = kFALSE;
309 void TGeVSimParticle::SetEllipticParam1(Float_t v21, Float_t pTmax, Float_t v22) {
333 fIsEllipticSimple = kFALSE;
334 fIsEllipticOld = kFALSE;
339 void TGeVSimParticle::SetEllipticParam2(Float_t v21, Float_t v22, Float_t v23) {
355 fIsEllipticSimple = kFALSE;
356 fIsEllipticOld = kTRUE;
361 Float_t TGeVSimParticle::GetDirectedFlow(Float_t pt, Float_t y) {
367 if (fIsDirectedSimple)
return fV1[0];
371 v = (fV1[0] + fV1[1]* pt) * TMath::Sign((Float_t)1.,y) *
372 (fV1[2] + fV1[3] * TMath::Abs(y*y*y) );
379 Float_t TGeVSimParticle::GetEllipticFlow(Float_t pt, Float_t y) {
385 if (fIsEllipticSimple)
return fV2[0];
387 if (fIsEllipticOld) {
390 return (fV2[0]+fV2[1]*pt*pt) * TMath::Exp(-fV2[2]*y*y);
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) );
402 void TGeVSimParticle::Print(Option_t* option)
const
408 const char *dummy =
"unknown type";
409 const char *models[15] = {
410 "",
"Boltzman ",
"Levy ",
"Pratt ",
"Bertsch ",
"Expansion ",
412 "1D Formulas",
"2D Formula",
"1D Histograms",
"2D Histogram",
"Function"
416 const TParticlePDG *ap = TDatabasePDG::Instance()->GetParticle(fPDG);
417 if (ap) name = ap->GetName();
418 else name = (
char*)dummy;
420 printf(
"** %s\tModel: %s Mult = %4d, T = %.3f GeV\n", name, models[fModel], (Int_t)fN, fT);