Pluto v6.3.0
Loading...
Searching...
No Matches
PFireball.h
Go to the documentation of this file.
1// Author: Romain Holzmann
2// Written: 28.04.00
3// Revised: 14.08.00 MK
4// Revised: 05.09.05 RH
5// Revised: 28.03.06 RH
6// Revised: 02.02.07 RH
7// Revised: 21.02.07 RH
8// PFireball Class Header
9
10#ifndef _PFireball_H_
11#define _PFireball_H_
12
13#include "PF2.h"
14#include "TH2F.h"
15#include "PParticle.h"
16#include "PChannel.h"
17#include "PChannelModel.h"
18#include "PFunction.h"
19#include "PAdaptiveMeshN.h"
20
21class PFireball: public PParticle {
22
23 protected:
24
25 int prodId; // product id
26 float T1; // temperature of component 1 (in GeV)
27 float T2; // temperature of component 2 (in GeV)
28 float frac; // fraction of component 1 (0 < frac < 1)
29 float blast; // radial blast velocity (0 < blast < 1)
30 float power1; // power of p**n term in p**n exp(-E/T) sampling at 0 deg
31 float power2; // power of p**n term at 90 deg
32 float A2; // polar anisotropy (dN/dOmega = 1 + A2*cost**2 + A4*cost**4)
33 float A4; //
34 float v1; // directed flow parameter at mid-rapidity
35 float v2; // elliptic flow (squeeze out) at mid-rapidity
36 float Ap; // projectile mass
37 float At; // target mass
38 float prob; // particle production probability per participant nucleon
39 float bmin; // min impact parameter
40 float bmax; // max impact parameter
41 float meanN; // mean multiplicity
42 int nProd; // number of product particles
43 bool flag;
44 float mt_fac;
45 double sig;
47
48 int spect;
49 // if set to 2 projectile-like spectator
50
52 TF1 *fE_1d;
54 TF1 *fE1_1d;
56 TF1 *fE2_1d;
58 TF1 *fA;
59 TF1 *fMt;
60 TH2F *fHisto;
62 Int_t npx, npy;
63
66
70
74
75 Float_t y0; // mid-rapidity of source
76
77 public:
78 PFireball(const char *particle, float AGeV, float t1, float t2=0.0, float f=1.0,
79 float b=0.0, float a2=0.0, float a4=0.0, float w1=0.0, float w2=0.0, int sp=0);
80
81 void setTemperature(float t1, float t2, float f, int id=0) {
82 T1 = t1;
83 T2 = t2;
84 frac = f;
86 if (mt_fac > 0.)
87 mt_fac = mtIntegral(makeStaticData()->GetParticleMass(prodId),T1);
88 }
89
90 //Rapidity sampling:
91 void setSigma(double s) {
92 SetSigma(s);
93 }
94 void SetSigma(double s) {
95 sig = s;
96 }
99 };
100
101 void setBlast(float b, int id=0) {
102 blast = b;
103 updateFunctions(id);
104 }
105 void setAnisotropy(float a2, float a4, int id=0) {
106 A2 = a2;
107 A4 = a4;
108 updateFunctions(id);
109 }
110 void setFlow(float a, float b) {
111 v1 = a;
112 v2 = b;
113 }
114
115 Double_t AvApart(Double_t ap, Double_t at, Double_t bn, Double_t bx);
116 Double_t AvApart(Double_t ap, Double_t at) {
117 return (ap*pow(at,0.667) + at*pow(ap,0.667))
118 /pow((pow(ap,0.333)+pow(at,0.333)),2); // average Apart
119 }
120 void setRandomB(float ap, float at, float p=0., float bn=0., float bx=20.) {
121 Ap = ap;
122 At = at;
123 prob = p;
124 flag = 1;
125 bmin = bn;
126 bmax = bx;
127 if (prob <= 0.)
128 prob = meanN/AvApart(Ap, At);
130 if (bmax > 1.14*(pow((double)Ap,(double)0.333) + pow((double)At,(double)0.333))+2.)
131 bmax = 1.14*(pow((double)Ap,(double)0.333) + pow((double)At,(double)0.333)+2.);
132 if (bmin > bmax) {
133 float temp = bmin;
134 bmin = bmax;
135 bmax = temp;
136 }
137 }
138 void setMeanN(float mN) {
139 if (mN >= 0.) meanN = mN;
140 }
141 void setSpectator(int sp){
142 spect=sp;
143 }
144
145 bool IsRandomB() {return flag;}
146 bool IsRandomN() {return meanN>0. ? 1 : 0;}
147
148 int getParticleId() {return prodId;}
149 float getT1() {return T1;}
150 float getT2() {return T1;}
151 float getFrac() {return frac;}
152 float getBlast() {return blast;}
153 float getA2() {return A2;}
154 float getA4() {return A4;}
155 float getV1() {return v1;}
156 float getV2() {return v2;}
157 int getSpectator() {return spect;}
158 PF2 *getFuncE() {return fE;}
159 PF2 *getFuncE1() {return fE1;}
160 PF2 *getFuncE2() {return fE2;}
161 PF2 *getFuncE3() {return fE3;}
162 TF1 *getFuncA() {return fA;}
163 TF1 *getFuncMt() {return fMt;}
164 void setHisto(TH2F *pH) {
165 fHisto = pH;
166 A2 = A4 = 0.;
167 }
168 TH2F *getHisto() {return fHisto;}
169
170 void SetNpx(Int_t my_npx);
171 void SetNpy(Int_t my_npy);
172 void SetEpsilon(Double_t e);
173
175 sample_option = 1;
177 }
178 void UseMesh(void) {
179 mesh_option = 1;
180 }
181
182
183 void sampleECM(Double_t &E, Double_t &M, int didx);
184
185 void sampleECM1(Double_t &E, Double_t &M, int didx) {
186 if (fE1) {
187 if (didx != didx_old) {
188 didx_old = didx; //prevent random initialization each time
189 if (didx < 0)
190 fE1->SetParameter(5, -1.1);
191 else
192 fE1->SetParameter(5, (double) didx);
193 }
194 fE1->GetRandom2(E, M);
195 } else if (fE1_1d) {
196 E = fE1_1d->GetRandom();
197 } else {
198 Error("sampleECM1", "fE1 not found");
199 }
200 }
201
202 void sampleECM2(Double_t &E, Double_t &M, int didx) {
203 if (fE2) {
204 if (didx != didx_old) {
205 didx_old = didx; //prevent random initialization each time
206 if (didx<0)
207 fE2->SetParameter(5, -1.1);
208 else
209 fE2->SetParameter(5, (double) didx);
210 }
211 fE2->GetRandom2(E, M);
212 } else if (fE2_1d) {
213 E = fE2_1d->GetRandom();
214 } else {
215 Error("sampleECM2", "fE2 not found");
216 }
217 }
218
219 void sampleECM3(Double_t &E, Double_t &Theta) {
220 fE3->GetRandom2(E, Theta);
221 }
222
223 double sampleThetaCM() {return fA->GetRandom();}
224 double sampleMt() {return fMt->GetRandom();}
225 void samplePartCM(double &px, double &py, double &pz, double &E, int didx);
226 float sampleB() const ;
228 int sampleNProd(float b);
229 int getLastNProd() {return nProd;}
230 int IsFireball() {return 1;}
231
232 PChannel *makeChannel(Int_t nMax, Float_t nAverage=0.);
233
234 void setTrueThermal(Bool_t flag=kTRUE) {
236 }
238 mt_fac = mtIntegral(makeStaticData()->GetParticleMass(prodId),T1);
239 }
240 float mtScale(double m) {
241 return mt_fac>0. ? mtIntegral(m,T1)/mt_fac : 1.;
242 }
243 virtual void Print(const Option_t *delme="") const;
244 void printAverages() const ;
245 virtual ~PFireball() {
246 delete fE;
247 delete fE_1d;
248 delete fE1;
249 delete fE1_1d;
250 delete fE2;
251 delete fE2_1d;
252 delete fA;
253 delete fMt;
254 }
255 float mtIntegral(double mass, float temperature);
256
257 void SetW(double w=1.) {
258 if (*(makeStaticData()->GetBatchValue("_system_weight_version"))) {
259 Info("SetW", "Use old weighting method (pure chain based)");
260 }
261 *(makeStaticData()->GetBatchValue("_system_weight_version")) = 0.;
263 };
264
265 protected:
266 void updateFunctions(int id = 0);
267 void setToMidrapidity(float AGeV);
268 float Npar(float ap, float at, float b);
269 float NparSmeared(float ap, float at, float b) const ;
270
271 ClassDef(PFireball, 1) // Pluto Fireball Class
272
273};
274#endif // _PFireball_H_
275
276
PStaticData * makeStaticData()
double pz
TFile * f
Definition analyze_g12C.C:8
double px
double py
Definition PF2.h:12
void setSigma(double s)
Definition PFireball.h:91
virtual void Print(const Option_t *delme="") const
void SetW(double w=1.)
Definition PFireball.h:257
float sampleB() const
TF1 * fMt
polar angle sampling function
Definition PFireball.h:59
void SetSigma(double s)
Definition PFireball.h:94
TF1 * rapidity_function
sigma of gaussian dNdy distribution
Definition PFireball.h:46
float getA4()
Definition PFireball.h:154
void sampleECM1(Double_t &E, Double_t &M, int didx)
Definition PFireball.h:185
float NparSmeared(float ap, float at, float b) const
bool quasistable
array of particle pointers
Definition PFireball.h:65
bool trueThermal
dN2/dEdTheta sampling histogram
Definition PFireball.h:61
float bmax
Definition PFireball.h:40
float mt_fac
if set, sample impact parameter first, then Poisson Npart
Definition PFireball.h:44
Double_t AvApart(Double_t ap, Double_t at)
Definition PFireball.h:116
PF2 * getFuncE1()
Definition PFireball.h:159
int sampleNProd()
PFireball(const char *particle, float AGeV, float t1, float t2=0.0, float f=1.0, float b=0.0, float a2=0.0, float a4=0.0, float w1=0.0, float w2=0.0, int sp=0)
void setHisto(TH2F *pH)
Definition PFireball.h:164
TF1 * getFuncMt()
Definition PFireball.h:163
void sampleECM(Double_t &E, Double_t &M, int didx)
float meanN
Definition PFireball.h:41
int getLastNProd()
Definition PFireball.h:229
void setSpectator(int sp)
Definition PFireball.h:141
double sampleMt()
Definition PFireball.h:224
PParticle ** part
Granularity for all 2-dim histograms.
Definition PFireball.h:64
PFunction * pfE
option to use the adaptive mesh
Definition PFireball.h:72
float At
Definition PFireball.h:37
PChannelModel * model
long-lived or stable particle flag
Definition PFireball.h:67
float T2
Definition PFireball.h:27
Double_t AvApart(Double_t ap, Double_t at, Double_t bn, Double_t bx)
void setTemperature(float t1, float t2, float f, int id=0)
Definition PFireball.h:81
void RotateSamplingPlane(void)
Definition PFireball.h:174
float Npar(float ap, float at, float b)
double sig
mt scaling of mass distribution
Definition PFireball.h:45
PF2 * fE1
Definition PFireball.h:53
void SetRapidityDistribution(TF1 *f)
Definition PFireball.h:97
float A4
Definition PFireball.h:33
float power1
Definition PFireball.h:30
void SetNpy(Int_t my_npy)
PChannel * makeChannel(Int_t nMax, Float_t nAverage=0.)
void setFlow(float a, float b)
Definition PFireball.h:110
void printAverages() const
void updateFunctions(int id=0)
void setRandomB(float ap, float at, float p=0., float bn=0., float bx=20.)
Definition PFireball.h:120
void SetEpsilon(Double_t e)
int didx_old
Primary model for emitted particle prodId.
Definition PFireball.h:68
bool IsRandomN()
Definition PFireball.h:146
void setAnisotropy(float a2, float a4, int id=0)
Definition PFireball.h:105
float Ap
Definition PFireball.h:36
TF1 * fE2_1d
energy sampling function with E*p**3 x BW(M)
Definition PFireball.h:56
PAdaptiveMeshN * afE
Envelope for thermal channel model E.
Definition PFireball.h:73
void setBlast(float b, int id=0)
Definition PFireball.h:101
float getT2()
Definition PFireball.h:150
void sampleECM2(Double_t &E, Double_t &M, int didx)
Definition PFireball.h:202
float power2
Definition PFireball.h:31
TF1 * getFuncA()
Definition PFireball.h:162
int spect
Function of dNdy distribution.
Definition PFireball.h:48
void SetNpx(Int_t my_npx)
TF1 * fA
energy sampling function with p**n x W(Theta)
Definition PFireball.h:58
float blast
Definition PFireball.h:29
int mesh_option
option for a rotation in the E-M-plane
Definition PFireball.h:71
void sampleECM3(Double_t &E, Double_t &Theta)
Definition PFireball.h:219
PF2 * getFuncE()
Definition PFireball.h:158
float getA2()
Definition PFireball.h:153
void setMtScaling()
Definition PFireball.h:237
Int_t npy
Definition PFireball.h:62
PF2 * getFuncE3()
Definition PFireball.h:161
float getT1()
Definition PFireball.h:149
bool flag
Definition PFireball.h:43
float mtScale(double m)
Definition PFireball.h:240
float v2
Definition PFireball.h:35
Int_t npx
thermal sampling flag
Definition PFireball.h:62
int nProd
Definition PFireball.h:42
PF2 * fE3
Definition PFireball.h:57
Float_t y0
Mesh for thermal channel model E.
Definition PFireball.h:75
void setMeanN(float mN)
Definition PFireball.h:138
virtual ~PFireball()
Definition PFireball.h:245
void setTrueThermal(Bool_t flag=kTRUE)
Definition PFireball.h:234
int prodId
Definition PFireball.h:25
float bmin
Definition PFireball.h:39
TH2F * getHisto()
Definition PFireball.h:168
int sample_option
cache for didx
Definition PFireball.h:69
float frac
Definition PFireball.h:28
double sampleThetaCM()
Definition PFireball.h:223
float getBlast()
Definition PFireball.h:152
int sampleNProd(float b)
void setToMidrapidity(float AGeV)
void samplePartCM(double &px, double &py, double &pz, double &E, int didx)
float prob
Definition PFireball.h:38
PF2 * getFuncE2()
Definition PFireball.h:160
float T1
Definition PFireball.h:26
TF1 * fE_1d
energy sampling function (true Boltzmann) x BW(M)
Definition PFireball.h:52
TF1 * fE1_1d
energy sampling function with E*sqrt(p) x BW(M)
Definition PFireball.h:54
float getFrac()
Definition PFireball.h:151
bool IsRandomB()
Definition PFireball.h:145
void UseMesh(void)
Definition PFireball.h:178
int IsFireball()
Definition PFireball.h:230
float getV2()
Definition PFireball.h:156
PF2 * fE
if set to 0 participant, if set to 1 target-like spectator,
Definition PFireball.h:51
int getSpectator()
Definition PFireball.h:157
float mtIntegral(double mass, float temperature)
PF2 * fE2
Definition PFireball.h:55
float v1
Definition PFireball.h:34
TH2F * fHisto
mt sampling function
Definition PFireball.h:60
float getV1()
Definition PFireball.h:155
int getParticleId()
Definition PFireball.h:148
float A2
Definition PFireball.h:32
PParticle(Int_t id=0, Double_t T=0., Double_t w=1.)
void SetW(Double_t w=1.)
Definition PParticle.h:93
Double_t * GetBatchValue(const char *name, Int_t make_val=1)
PParticle * p
Definition dp_mult.C:24
PParticle * s
Definition dp_mult.C:25
Double_t mass
PParticle * w