21 : hydro_source_abs_err(1
e-10), drop_stat(-11), miss_stat(-13),
28 std::array<Jetscape::real, 4> &jmu)
const {
29 jmu = {0.0, 0.0, 0.0, 0.0};
32 const auto x_drop = drop_i.get_xmu();
33 double ds2 = tau * tau + x_drop[0] * x_drop[0] -
34 2.0 * tau * x_drop[0] * cosh(eta - x_drop[3]) -
35 (x - x_drop[1]) * (x - x_drop[1]) -
36 (y - x_drop[2]) * (y - x_drop[2]);
38 if (tau >= x_drop[0] && ds2 >= 0.0) {
39 std::array<Jetscape::real, 4> jmu_i = {0.0, 0.0, 0.0, 0.0};
41 for (
int i = 0;
i < 4;
i++)
51 const std::vector<Parton> &pIn, std::vector<Parton> &pOut) {
53 for (
const auto &iparton : pIn) {
54 auto temp = iparton.p_in();
55 if (iparton.pstat() == -1) {
64 for (
const auto &iparton : pOut) {
65 auto temp = iparton.p_in();
66 if (iparton.pstat() == -1) {
71 x_final = iparton.x_in();
80 JSWARN <<
"A vertex does not conserve energy momentum!";
81 JSWARN <<
"E = " << p_missing.
t() <<
" GeV, px = " << p_missing.
x()
82 <<
" GeV, py = " << p_missing.
y() <<
" GeV, pz = " << p_missing.
z()
85 pOut.push_back(parton_miss);
92 auto e_threshold = 2.0;
94 for (
auto &iparton : pOut) {
99 if (iparton.isPhoton(iparton.pid()))
103 if (std::abs(iparton.pid()) == 4 || std::abs(iparton.pid()) == 5)
106 if (iparton.pstat() == -1) {
114 auto tLoc = iparton.x_in().t();
115 auto xLoc = iparton.x_in().x();
116 auto yLoc = iparton.x_in().y();
117 auto zLoc = iparton.x_in().z();
118 std::unique_ptr<FluidCellInfo> check_fluid_info_ptr;
120 auto vxLoc = check_fluid_info_ptr->vx;
121 auto vyLoc = check_fluid_info_ptr->vy;
122 auto vzLoc = check_fluid_info_ptr->vz;
123 auto beta2 = vxLoc * vxLoc + vyLoc * vyLoc + vzLoc * vzLoc;
124 auto gamma = 1.0 / sqrt(1.0 - beta2);
125 auto E_boosted = gamma * (iparton.e() - iparton.p(1) * vxLoc -
126 iparton.p(2) * vyLoc - iparton.p(3) * vzLoc);
127 if (e_threshold > 0.) {
130 if (E_boosted < e_threshold) {
137 auto tempLoc = check_fluid_info_ptr->temperature;
138 if (E_boosted < std::abs(e_threshold) * tempLoc) {
147 std::vector<Parton> &pOut) {
148 if (pOut.size() == 0) {
162 const auto weight_init = 1.0;
163 for (
const auto &iparton : pIn) {
164 auto temp = iparton.p_in();
166 x_init = iparton.x_in();
169 auto weight_final = 0.0;
170 for (
const auto &iparton : pOut) {
177 auto temp = iparton.p_in();
179 x_final = iparton.x_in();
187 auto droplet_t = ((x_final.
t() * weight_final + x_init.
t() * weight_init) /
188 (weight_final + weight_init));
189 auto droplet_x = ((x_final.
x() * weight_final + x_init.
x() * weight_init) /
190 (weight_final + weight_init));
191 auto droplet_y = ((x_final.
y() * weight_final + x_init.
y() * weight_init) /
192 (weight_final + weight_init));
193 auto droplet_z = ((x_final.
z() * weight_final + x_init.
z() * weight_init) /
194 (weight_final + weight_init));
196 auto droplet_tau = sqrt(droplet_t * droplet_t - droplet_z * droplet_z);
198 (0.5 * log((droplet_t + droplet_z) / (droplet_t - droplet_z)));
199 auto droplet_E = p_init.
t() - p_final.
t();
200 auto droplet_px = p_init.
x() - p_final.
x();
201 auto droplet_py = p_init.
y() - p_final.
y();
202 auto droplet_pz = p_init.
z() - p_final.
z();
204 std::array<Jetscape::real, 4> droplet_xmu = {
206 static_cast<Jetscape::real>(droplet_x),
208 static_cast<Jetscape::real>(droplet_eta)};
209 std::array<Jetscape::real, 4> droplet_pmu = {
211 static_cast<Jetscape::real>(droplet_px),
213 static_cast<Jetscape::real>(droplet_pz)};
214 Droplet drop_i(droplet_xmu, droplet_pmu);
224 total_E += drop_i.get_pmu()[0];