28 #define MAGENTA "\033[35m"
42 auto adscft_mutex = make_shared<AdSCFTMutex>();
49 JSINFO <<
"Initialize AdSCFT ...";
52 JSDEBUG << s <<
" to be initialized ...";
76 f->WriteComment(
"ElossModule Parton List: " +
GetId());
77 f->WriteComment(
"Energy loss to be implemented accordingly ...");
81 vector<Parton> &pIn, vector<Parton> &pOut) {
84 <<
" " << Q2 <<
" " << &pIn;
86 for (
int i = 0;
i < pIn.size();
i++) {
89 pOut.push_back(pIn[
i]);
94 JSDEBUG <<
" Parton Q2= " << pIn[
i].t();
95 JSDEBUG <<
" Parton Id= " << pIn[
i].pid()
96 <<
" and mass= " << pIn[
i].restmass();
104 double pmod = std::sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]);
108 for (
unsigned int j = 0;
j < 4;
j++)
109 w.push_back(p[
j] / p[3]);
110 double w2 = std::pow(w[0], 2.) + std::pow(w[1], 2.) + std::pow(w[2], 2.);
111 for (
unsigned int j = 0;
j < 3;
j++)
112 w[
j] /= std::sqrt(w2);
115 double initR0 = pIn[
i].x_in().t();
120 x[0] = pIn[
i].x_in().x() + (time - initR0) * w[0];
121 x[1] = pIn[
i].x_in().y() + (time - initR0) * w[1];
122 x[2] = pIn[
i].x_in().z() + (time - initR0) * w[2];
123 x[3] = pIn[
i].x_in().t() + (time - initR0) * w[3];
126 std::unique_ptr<FluidCellInfo> check_fluid_info_ptr;
127 double tau = std::sqrt(x[3] * x[3] - x[2] * x[2]);
136 JSWARN <<
"Couldn't find a hydro module attached!";
137 throw std::runtime_error(
138 "Please attach a hydro module or set in_vac to 1 in the XML file");
145 vx = check_fluid_info_ptr->
vx;
146 vy = check_fluid_info_ptr->
vy;
147 vz = check_fluid_info_ptr->
vz;
149 temp = 0., vx = 0., vy = 0., vz = 0.;
150 JSDEBUG <<
" system time= " << time <<
" parton time= " << x[3]
151 <<
" tau= " << tau <<
" temp= " << temp <<
" vz= " << w[2];
152 JSDEBUG <<
" energy= " << pIn[
i].e();
160 pIn[
i].pstat() >= 0) {
166 VERBOSE(8) <<
" ************ \n \n";
167 VERBOSE(8) <<
" DOING ADSCFT \n \n";
168 VERBOSE(8) <<
" ************ \n \n";
172 v.push_back(vx), v.push_back(vy), v.push_back(vz), v.push_back(1.);
173 double v2 = std::pow(v[0], 2.) + std::pow(v[1], 2.) + std::pow(v[2], 2.);
174 double lore = 1. / sqrt(1. - v2);
178 if (pIn[i].
pid() == 21)
179 CF = std::pow(9. / 4., 1. / 3.);
185 double l_dist = 0., f_dist = 0.;
186 if (pIn[i].has_user_info<AdSCFTUserInfo>()) {
198 double restmass = pIn[
i].restmass();
199 if (abs(pIn[i].
pid()) <= 3)
201 double virttwo = p[3] * p[3] - p[0] * p[0] - p[1] * p[1] - p[2] * p[2] -
203 double virt = std::sqrt(virttwo);
207 double vscalw = v[0] * w[0] + v[1] * w[1] + v[2] * w[2];
213 double insqrt = w2 + lore * lore * (v2 - 2. * vscalw + vscalw * vscalw);
216 f_dist += deltaT * std::sqrt(insqrt);
220 double Efs = ei * lore * (1. - vscalw);
224 newEn = pmod -
AdSCFT::Drag(f_dist, deltaT, Efs, temp, CF);
226 newEn = pmod / 10000000.;
227 double lambda = newEn / pmod;
232 for (
unsigned a = 0;
a < 3;
a++)
235 p[3] = std::sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2] + virt * virt +
236 restmass * restmass);
237 virttwo = p[3] * p[3] - p[0] * p[0] - p[1] * p[1] - p[2] * p[2] -
239 virt = std::sqrt(virttwo);
245 fx[0] = x[3], fx[1] = x[0], fx[2] = x[1], fx[3] = x[2];
247 int pLabel = pIn[
i].plabel();
248 int Id = pIn[
i].pid();
249 int pStat = pIn[
i].pstat();
253 pOut.push_back(
Parton(pLabel, Id, pStat, pVec, xVec));
254 pOut[pOut.size() - 1].set_x(fx);
255 pOut.back().set_user_info(
new AdSCFTUserInfo(ei, f_dist, l_dist));
258 double velocity_jet[4];
259 velocity_jet[0] = 1.0;
260 velocity_jet[1] = pIn[
i].jet_v().x();
261 velocity_jet[2] = pIn[
i].jet_v().y();
262 velocity_jet[3] = pIn[
i].jet_v().z();
263 pOut[pOut.size() - 1].set_jet_v(velocity_jet);
264 pOut[pOut.size() - 1].set_mean_form_time();
265 double ft = pOut[pOut.size() - 1].mean_form_time();
266 pOut[pOut.size() - 1].set_form_time(ft);
269 FourVector pVecM(pIn[i].px() - p[0], pIn[i].py() - p[1],
270 pIn[i].pz() - p[2], pIn[i].
e() - p[3]);
271 pOut.push_back(
Parton(0, 21, -13, pVecM, xVec));
272 pOut[pOut.size() - 1].set_x(fx);
279 double AdSCFT::Drag(
double f_dist,
double deltaT,
double Efs,
double temp,
282 double tstop = 0.2 * std::pow(Efs, 1. / 3.) /
283 (2. * std::pow(temp, 4. / 3.) *
kappa) /
289 double intpiece = Efs * deltaT * 4. / (3.141592) *
290 (1. / (beta * tstop * std::sqrt(beta * beta - 1.)));