CbmRoot
BlastWaveLongitudinal.cxx
Go to the documentation of this file.
2 #include <iostream>
3 
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 T)
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  , fT(T)
30  , fY2Min()
31  , fY2Max()
32  , fEtaMin()
33  , fEtaMax()
34  , fAcceptance()
35  , fReconstructionEfficiency()
36  , fetaay2()
37  , fNormeta()
38  , fNormeta4pi()
39 // fNorm(1.), fY2Min(), fY2Max(), fEtaMin(), fEtaMax(), fAcceptance(), fReconstructionEfficiency(), fetaay2(), fNormeta(), fNormeta4pi()
40 {
42  0., 3., xlag32, wlag32);
45  {
46  TString work = getenv("VMCWORKDIR");
47  TString dir = work + "/KF/KFModelParameters/common/";
48  char spdg[300];
49  sprintf(spdg, "%d", fPDGID);
51  dir + "pty_acc_" + spdg + ".txt")) {
52  fUseAcceptance = false;
53  return;
54  }
57  std::vector<double> etavec(0), y2acc(0), norm(0), norm4pi(0);
58  double deta = 0.01;
59  double etamax = ycm;
60  for (int i = 0;; ++i) {
61  double tmpeta = 1.e-5 + deta * (i);
62  if (i == 0) {
63  fY2Min = y2Av(tmpeta);
64  fEtaMin = tmpeta;
65  }
66  if (tmpeta > etamax) {
67  fY2Max = y2Av(tmpeta - deta);
68  fEtaMax = tmpeta - deta;
69  break;
70  }
71  etavec.push_back(tmpeta);
72  y2acc.push_back(y2Av(tmpeta));
73  norm.push_back(Normalization(tmpeta));
74  norm4pi.push_back(Normalization4pi(tmpeta));
75  // std::cout << "Calc: " << etavec[i] << " " << y2acc[i] << " " << norm[i] << "\n";
76  }
77  fetaay2 = TSpline3("fetaay2acc", &y2acc[0], &etavec[0], etavec.size());
78  fNormeta = TSpline3("fNormacc", &etavec[0], &norm[0], etavec.size());
79  fNormeta4pi = TSpline3("fNorm4pi", &etavec[0], &norm4pi[0], etavec.size());
80  for (unsigned int i = 0; i < etavec.size(); ++i) {
81  // std::cout << "ACalc: " << fetaay2.Eval(y2acc[i]) << " " << y2acc[i] << " " << fNormeta.Eval(etavec[i]) << "\n";
82  // std::cout << "Avs: " << mtAv(Tvec[i]) << " " << mtAv2(Tvec[i]) << "\n";
83  }
84  }
85 }
86 
87 double BlastWaveLongitudinal::y2Av(double eta) {
89  -eta, eta, xlegeta, wlegeta);
90  double ret1 = 0., ret2 = 0.;
91  for (Int_t ie = 0; ie < 32; ie++) {
92  for (Int_t i = 0; i < 32; i++) {
93  for (Int_t j = 0; j < 32; j++) {
94  double tmpf = 0.;
95  double ty = xleg32[j] - xlegeta[ie];
96  double tp = sqrt(xlag32[i] * xlag32[i] + fMass * fMass)
97  * TMath::CosH(xleg32[j] + fYcm);
98  tp = sqrt(tp * tp - fMass * fMass);
99  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
100  tmpf = wlegeta[ie] * wlag32[i] * wleg32[j] * xlag32[i] * tmt
101  * TMath::CosH(ty) * TMath::Exp(-tmt * TMath::CosH(ty) / fT);
102  if (fUseAcceptance)
103  tmpf *= fAcceptance.getAcceptance(xleg32[j] + fYcm, xlag32[i])
105  ret1 += tmpf;
106  ret2 += tmpf * xleg32[j] * xleg32[j];
107  }
108  }
109  }
110  return ret2 / ret1;
111 }
112 
113 double BlastWaveLongitudinal::y2Av2(double eta) {
114  double ret1 = 0., ret2 = 0.;
115  for (Int_t j = 0; j < 32; j++) {
116  ret1 += wleg32[j] * xleg32[j] * xleg32[j] * fy(xleg32[j], eta);
117  ret2 += wleg32[j] * fy(xleg32[j], eta);
118  }
119  return ret1 / ret2;
120 }
121 
122 double BlastWaveLongitudinal::fy(double y, double eta) {
123  double ret = 0.;
125  -eta, eta, xlegeta, wlegeta);
126  for (Int_t ie = 0; ie < 32; ie++) {
127  for (Int_t i = 0; i < 32; i++) {
128  double tmpf = 0.;
129  double ty = y - xlegeta[ie];
130  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
131  double tp = tmt * TMath::CosH(y + fYcm);
132  tp = sqrt(tp * tp - fMass * fMass);
133  tmpf = wlegeta[ie] * wlag32[i] * xlag32[i] * tmt * TMath::CosH(ty)
134  * TMath::Exp(-tmt * TMath::CosH(ty) / fT);
135  if (fUseAcceptance)
136  tmpf *= fAcceptance.getAcceptance(y + fYcm, xlag32[i])
138  ret += tmpf;
139  }
140  }
141  return ret / fNormeta.Eval(eta);
142 }
143 
145  double ret = 0.;
146  //if (fUseAcceptance)
147  {
149  -eta, eta, xlegeta, wlegeta);
150  for (Int_t ie = 0; ie < 32; ie++) {
151  for (Int_t i = 0; i < 32; i++) {
152  for (Int_t j = 0; j < 32; j++) {
153  double tmpf = 0.;
154  double ty = xleg32[j] - xlegeta[ie];
155  double tp = sqrt(xlag32[i] * xlag32[i] + fMass * fMass)
156  * TMath::CosH(xleg32[j] + fYcm);
157  tp = sqrt(tp * tp - fMass * fMass);
158  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
159  tmpf = wlegeta[ie] * wlag32[i] * wleg32[j] * xlag32[i] * tmt
160  * TMath::CosH(ty) * TMath::Exp(-tmt * TMath::CosH(ty) / fT);
161  if (fUseAcceptance)
162  tmpf *= fAcceptance.getAcceptance(xleg32[j] + fYcm, xlag32[i])
164  ret += tmpf;
165  }
166  }
167  }
168  }
169  return ret;
170 }
171 
173  double ret = 0.;
174  //if (fUseAcceptance)
175  {
177  -eta, eta, xlegeta, wlegeta);
178  for (Int_t ie = 0; ie < 32; ie++) {
179  for (Int_t i = 0; i < 32; i++) {
180  for (Int_t j = 0; j < 32; j++) {
181  double tmpf = 0.;
182  double ty = xleg32[j] - xlegeta[ie];
183  double tp = sqrt(xlag32[i] * xlag32[i] + fMass * fMass)
184  * TMath::CosH(xleg32[j] + fYcm);
185  tp = sqrt(tp * tp - fMass * fMass);
186  double tmt = sqrt(xlag32[i] * xlag32[i] + fMass * fMass);
187  tmpf = wlegeta[ie] * wlag32[i] * wleg32[j] * xlag32[i] * tmt
188  * TMath::CosH(ty) * TMath::Exp(-tmt * TMath::CosH(ty) / fT);
189  ret += tmpf;
190  }
191  }
192  }
193  }
194  return ret;
195 }
BlastWaveLongitudinal::wlegeta
std::vector< double > wlegeta
Definition: BlastWaveLongitudinal.h:15
BlastWaveLongitudinal::wleg32
std::vector< double > wleg32
Definition: BlastWaveLongitudinal.h:14
BlastWaveLongitudinal::wlag32
std::vector< double > wlag32
Definition: BlastWaveLongitudinal.h:13
Acceptance::AcceptanceFunction::getAcceptance
Double_t getAcceptance(const Double_t &y, const Double_t &pt) const
Definition: Acceptance.cxx:33
BlastWaveLongitudinal::fReconstructionEfficiency
Acceptance::ReconstructionEfficiencyFunction fReconstructionEfficiency
Definition: BlastWaveLongitudinal.h:25
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
BlastWaveLongitudinal::Normalization
double Normalization(double eta)
Definition: BlastWaveLongitudinal.cxx:144
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
Acceptance::ReconstructionEfficiencyFunction::f
Double_t f(double p)
Definition: Acceptance.h:25
BlastWaveLongitudinal::fNormeta4pi
TSpline3 fNormeta4pi
Definition: BlastWaveLongitudinal.h:27
GetCoefsIntegrateLegendre32
void GetCoefsIntegrateLegendre32(double a, double b, std::vector< double > &x, std::vector< double > &w)
Definition: HRGModel/NumericalIntegration.h:477
BlastWaveLongitudinal::fetaay2
TSpline3 fetaay2
Definition: BlastWaveLongitudinal.h:26
BlastWaveLongitudinal::y2Av2
double y2Av2(double eta)
Definition: BlastWaveLongitudinal.cxx:113
BlastWaveLongitudinal::BlastWaveLongitudinal
BlastWaveLongitudinal(double mass=0.938, int PDGID=2212, bool fUseAcc=false, double ymin=-3., double ymax=3., double ycm=2., double T=0.140)
Definition: BlastWaveLongitudinal.cxx:10
Acceptance::ReconstructionEfficiencyFunction
Definition: Acceptance.h:19
BlastWaveLongitudinal::xlegeta
std::vector< double > xlegeta
Definition: BlastWaveLongitudinal.h:15
BlastWaveLongitudinal::fNormeta
TSpline3 fNormeta
Definition: BlastWaveLongitudinal.h:27
BlastWaveLongitudinal::fUseAcceptance
bool fUseAcceptance
Definition: BlastWaveLongitudinal.h:18
BlastWaveLongitudinal::fMass
double fMass
Definition: BlastWaveLongitudinal.h:16
BlastWaveLongitudinal::fY2Max
double fY2Max
Definition: BlastWaveLongitudinal.h:21
BlastWaveLongitudinal::fYmax
double fYmax
Definition: BlastWaveLongitudinal.h:19
BlastWaveLongitudinal::fEtaMax
double fEtaMax
Definition: BlastWaveLongitudinal.h:22
BlastWaveLongitudinal::fAcceptance
Acceptance::AcceptanceFunction fAcceptance
Definition: BlastWaveLongitudinal.h:24
BlastWaveLongitudinalNamespace
Definition: BlastWaveLongitudinal.cxx:4
BlastWaveLongitudinal::Normalization4pi
double Normalization4pi(double eta)
Definition: BlastWaveLongitudinal.cxx:172
BlastWaveLongitudinal::fEtaMin
double fEtaMin
Definition: BlastWaveLongitudinal.h:22
BlastWaveLongitudinal::fPDGID
int fPDGID
Definition: BlastWaveLongitudinal.h:17
BlastWaveLongitudinal::xlag32
std::vector< double > xlag32
Definition: BlastWaveLongitudinal.h:13
BlastWaveLongitudinal::fYmin
double fYmin
Definition: BlastWaveLongitudinal.h:19
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
BlastWaveLongitudinal::xleg32
std::vector< double > xleg32
Definition: BlastWaveLongitudinal.h:14
Acceptance::ReadAcceptanceFunction
int ReadAcceptanceFunction(AcceptanceFunction &func, TString filename)
Definition: Acceptance.cxx:7
BlastWaveLongitudinal.h
BlastWaveLongitudinal::fT
double fT
Definition: BlastWaveLongitudinal.h:19
BlastWaveLongitudinal::y2Av
double y2Av(double eta)
Definition: BlastWaveLongitudinal.cxx:87
BlastWaveLongitudinal::fYcm
double fYcm
Definition: BlastWaveLongitudinal.h:19
BlastWaveLongitudinal::fY2Min
double fY2Min
Definition: BlastWaveLongitudinal.h:21
BlastWaveLongitudinal::fy
double fy(double y, double eta)
Definition: BlastWaveLongitudinal.cxx:122