CbmRoot
BlastWave.cxx
Go to the documentation of this file.
1 #include "BlastWave.h"
2 #include <iostream>
3 
4 namespace BlastWaveNamespace {
5 
6 #include "../NumericalIntegration.h"
7 
8 }
9 
11  int PDGID,
12  bool UseAcc,
13  double ymin,
14  double ymax,
15  double ycm,
16  double etam)
17  : xlag32()
18  , wlag32()
19  , xleg32()
20  , wleg32()
21  , xlegeta()
22  , wlegeta()
23  , fMass(mass)
24  , fPDGID(PDGID)
25  , fUseAcceptance(UseAcc)
26  , fYmin(ymin)
27  , fYmax(ymax)
28  , fYcm(ycm)
29  , fEtaMax(etam)
30  , fAcceptance()
31  , fReconstructionEfficiency()
32  , fTamt()
33  , fNormT()
34  , fNormT4pi()
35 // fNorm(1.), fAcceptance(), fReconstructionEfficiency(), fTamt(), fNormT(), fNormT4pi()
36 {
37  if (fabs(fEtaMax) < 1e-5) fEtaMax = 1.e-5;
42  //if (fUseAcceptance)
43  {
44  TString work = getenv("VMCWORKDIR");
45  TString dir =
46  work + "/KF/KFModelParameters/common/"; //ThermalModel.mT-t.sts_v13.txt";
47  char spdg[300];
48  sprintf(spdg, "%d", fPDGID);
50  dir + "pty_acc_" + spdg + ".txt")) {
51  fUseAcceptance = false;
52  return;
53  }
56  std::vector<double> Tvec(0), mtacc(0), norm(0), norm4pi(0);
57  double dT = 0.002;
58  double Tmax = 0.5;
59  for (int i = 0;; ++i) {
60  double tmpT = 0.01 + dT * (0.5 + i);
61  if (tmpT > Tmax) break;
62  Tvec.push_back(tmpT);
63  mtacc.push_back(mtAv(tmpT));
64  norm.push_back(Normalization(tmpT));
65  norm4pi.push_back(Normalization4pi(tmpT));
66  }
67  fTamt = TSpline3("fTamtacc", &mtacc[0], &Tvec[0], Tvec.size());
68  fNormT = TSpline3("fNormacc", &Tvec[0], &norm[0], Tvec.size());
69  fNormT4pi = TSpline3("fNorm4pi", &Tvec[0], &norm4pi[0], Tvec.size());
70  }
71 }
72 
73 double BlastWave::mtAv(double T) {
74  double ret1 = 0., ret2 = 0.;
75  for (Int_t ie = 0; ie < 32; ie++) {
76  for (Int_t i = 0; i < 32; i++) {
77  for (Int_t j = 0; j < 32; j++) {
78  double tmpf = 0.;
79  double ty = xleg32[j] - xlegeta[ie];
80  double tp = sqrt(xlag32[i] * xlag32[i] + fMass * fMass)
81  * TMath::CosH(xleg32[j] + fYcm);
82  tp = sqrt(tp * tp - fMass * fMass);
83  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
84  tmpf = wlegeta[ie] * wlag32[i] * wleg32[j] * xlag32[i] * tmt
85  * TMath::CosH(ty) * TMath::Exp(-tmt * TMath::CosH(ty) / T);
86  if (fUseAcceptance)
89  ret1 += tmpf;
90  ret2 += tmpf * tmt;
91  }
92  }
93  }
94  return ret2 / ret1;
95 }
96 
97 double BlastWave::mtAv2(double T) {
98  double ret = 0.;
99  for (Int_t i = 0; i < 32; i++) {
100  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
101  ret += wlag32[i] * xlag32[i] * fmt(tmt, T);
102  }
103  return ret;
104 }
105 
106 double BlastWave::fmt(double mt, double T) {
107  double ret = 0.;
108  double tpt = sqrt(mt * mt - fMass * fMass);
109  for (Int_t ie = 0; ie < 32; ie++) {
110  for (Int_t j = 0; j < 32; j++) {
111  double tmpf = 0.;
112  double tp = mt * TMath::CosH(xleg32[j] + fYcm);
113  double ty = xleg32[j] - xlegeta[ie];
114  tp = sqrt(tp * tp - fMass * fMass);
115  tmpf = wlegeta[ie] * wleg32[j] * tpt * mt * TMath::CosH(ty)
116  * TMath::Exp(-mt * TMath::CosH(ty) / T);
117  if (fUseAcceptance)
118  tmpf *= fAcceptance.getAcceptance(xleg32[j] + fYcm, tpt)
120  ret += tmpf;
121  }
122  }
123  return ret * mt / tpt / fNormT.Eval(T);
124 }
125 
126 double BlastWave::Normalization(double T) {
127  double ret = 0.;
128  {
129  for (Int_t ie = 0; ie < 32; ie++) {
130  for (Int_t i = 0; i < 32; i++) {
131  for (Int_t j = 0; j < 32; j++) {
132  double tmpf = 0.;
133  double ty = xleg32[j] - xlegeta[ie];
134  double tp = sqrt(xlag32[i] * xlag32[i] + fMass * fMass)
135  * TMath::CosH(xleg32[j] + fYcm);
136  tp = sqrt(tp * tp - fMass * fMass);
137  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
138  tmpf = wlegeta[ie] * wlag32[i] * wleg32[j] * xlag32[i] * tmt
139  * TMath::CosH(ty) * TMath::Exp(-tmt * TMath::CosH(ty) / T);
140  if (fUseAcceptance)
141  tmpf *= fAcceptance.getAcceptance(xleg32[j] + fYcm, xlag32[i])
143  ret += tmpf;
144  }
145  }
146  }
147  }
148  return ret;
149 }
150 
151 double BlastWave::Normalization4pi(double T) {
152  double ret = 0.;
153  {
154  for (Int_t ie = 0; ie < 32; ie++) {
155  for (Int_t i = 0; i < 32; i++) {
156  for (Int_t j = 0; j < 32; j++) {
157  double tmpf = 0.;
158  double ty = xleg32[j] - xlegeta[ie];
159  double tp = sqrt(xlag32[i] * xlag32[i] + fMass * fMass)
160  * TMath::CosH(xleg32[j] + fYcm);
161  tp = sqrt(tp * tp - fMass * fMass);
162  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
163  tmpf = wlegeta[ie] * wlag32[i] * wleg32[j] * xlag32[i] * tmt
164  * TMath::CosH(ty) * TMath::Exp(-tmt * TMath::CosH(ty) / T);
165  ret += tmpf;
166  }
167  }
168  }
169  }
170  return ret;
171 }
BlastWave::fYmax
double fYmax
Definition: BlastWave.h:19
BlastWave::fYcm
double fYcm
Definition: BlastWave.h:19
Acceptance::AcceptanceFunction::getAcceptance
Double_t getAcceptance(const Double_t &y, const Double_t &pt) const
Definition: Acceptance.cxx:33
BlastWave::fPDGID
int fPDGID
Definition: BlastWave.h:17
BlastWave::fYmin
double fYmin
Definition: BlastWave.h:19
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
BlastWave.h
BlastWave::wleg32
std::vector< double > wleg32
Definition: BlastWave.h:14
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
BlastWave::fmt
double fmt(double amt, double T)
Definition: BlastWave.cxx:106
BlastWave::xlag32
std::vector< double > xlag32
Definition: BlastWave.h:13
BlastWave::mtAv
double mtAv(double T)
Definition: BlastWave.cxx:73
BlastWave::fReconstructionEfficiency
Acceptance::ReconstructionEfficiencyFunction fReconstructionEfficiency
Definition: BlastWave.h:23
BlastWave::fEtaMax
double fEtaMax
Definition: BlastWave.h:19
BlastWave::fNormT4pi
TSpline3 fNormT4pi
Definition: BlastWave.h:25
Acceptance::ReconstructionEfficiencyFunction::f
Double_t f(double p)
Definition: Acceptance.h:25
GetCoefsIntegrateLegendre32
void GetCoefsIntegrateLegendre32(double a, double b, std::vector< double > &x, std::vector< double > &w)
Definition: HRGModel/NumericalIntegration.h:477
BlastWave::xlegeta
std::vector< double > xlegeta
Definition: BlastWave.h:15
Acceptance::ReconstructionEfficiencyFunction
Definition: Acceptance.h:19
BlastWave::Normalization4pi
double Normalization4pi(double T)
Definition: BlastWave.cxx:151
BlastWave::fTamt
TSpline3 fTamt
Definition: BlastWave.h:24
BlastWave::xleg32
std::vector< double > xleg32
Definition: BlastWave.h:14
BlastWave::fUseAcceptance
bool fUseAcceptance
Definition: BlastWave.h:18
BlastWave::fNormT
TSpline3 fNormT
Definition: BlastWave.h:25
BlastWave::wlegeta
std::vector< double > wlegeta
Definition: BlastWave.h:15
BlastWave::mtAv2
double mtAv2(double T)
Definition: BlastWave.cxx:97
BlastWaveNamespace
Definition: BlastWave.cxx:4
BlastWave::wlag32
std::vector< double > wlag32
Definition: BlastWave.h:13
fabs
friend F32vec4 fabs(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:60
Acceptance::ReadAcceptanceFunction
int ReadAcceptanceFunction(AcceptanceFunction &func, TString filename)
Definition: Acceptance.cxx:7
BlastWave::fMass
double fMass
Definition: BlastWave.h:16
BlastWave::Normalization
double Normalization(double T)
Definition: BlastWave.cxx:126
BlastWave::BlastWave
BlastWave(double mass=0.938, int PDGID=2212, bool fUseAcc=false, double ymin=-3., double ymax=3., double ycm=2., double etam=0.8)
Definition: BlastWave.cxx:10
BlastWave::fAcceptance
Acceptance::AcceptanceFunction fAcceptance
Definition: BlastWave.h:22