Skip to content

Commit d109ef6

Browse files
prchakraalibuild
andauthored
[PWGCF] FemtoUniverse: Add quantum weight in MC Truth same-event pairs, fix bug (#14347)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent e09d587 commit d109ef6

File tree

2 files changed

+94
-54
lines changed

2 files changed

+94
-54
lines changed

PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class FemtoUniverseMath
177177
/// \param mass2 Mass of particle 2
178178
/// \param isiden Identical or non-identical particle pair
179179
template <typename T>
180-
static std::vector<double> newpairfunc(const T& part1, const float mass1, const T& part2, const float mass2, bool isiden)
180+
static std::vector<double> newpairfunc(const T& part1, const float mass1, const T& part2, const float mass2, bool isiden, bool isWeight = 0)
181181
{
182182
const double e1 = std::sqrt(std::pow(part1.px(), 2) + std::pow(part1.py(), 2) + std::pow(part1.pz(), 2) + std::pow(mass1, 2));
183183
const double e2 = std::sqrt(std::pow(part2.px(), 2) + std::pow(part2.py(), 2) + std::pow(part2.pz(), 2) + std::pow(mass2, 2));
@@ -186,6 +186,9 @@ class FemtoUniverseMath
186186
const ROOT::Math::PxPyPzEVector vecpart2(part2.px(), part2.py(), part2.pz(), e2);
187187
const ROOT::Math::PxPyPzEVector trackSum = vecpart1 + vecpart2;
188188

189+
const ROOT::Math::PtEtaPhiMVector vecspace_part1(part1.pt(), part1.eta(), part1.phi(), mass1);
190+
const ROOT::Math::PtEtaPhiMVector vecspace_part2(part2.pt(), part2.eta(), part2.phi(), mass2);
191+
189192
std::vector<double> vect;
190193

191194
const double tPx = trackSum.px();
@@ -222,6 +225,7 @@ class FemtoUniverseMath
222225
const double fDKOutLCMS = px1LCMS - px2LCMS;
223226
const double fDKSideLCMS = py1LCMS - py2LCMS;
224227
const double fDKLongLCMS = pz1LCMS - pz2LCMS;
228+
const double mDE = pE1LCMS - pE2LCMS;
225229

226230
// Boost to PRF
227231

@@ -249,6 +253,27 @@ class FemtoUniverseMath
249253
vect.push_back(fDKSide);
250254
vect.push_back(fDKLong);
251255
}
256+
257+
if (isiden && isWeight) {
258+
259+
const double x1_lcms = (vecspace_part1.x() * tPx + vecspace_part1.y() * tPy) / tPt;
260+
const double y1_lcms = (-vecspace_part1.x() * tPy + vecspace_part1.y() * tPx) / tPt;
261+
const double x2_lcms = (vecspace_part2.x() * tPx + vecspace_part2.y() * tPy) / tPt;
262+
const double y2_lcms = (-vecspace_part2.x() * tPy + vecspace_part2.y() * tPx) / tPt;
263+
264+
const double z1_lcms = gamma * (vecspace_part1.z() - beta * vecspace_part1.t());
265+
const double t1_lcms = gamma * (vecspace_part1.t() - beta * vecspace_part1.z());
266+
const double z2_lcms = gamma * (vecspace_part2.z() - beta * vecspace_part2.t());
267+
const double t2_lcms = gamma * (vecspace_part2.t() - beta * vecspace_part2.z());
268+
269+
const double mRO = (x1_lcms - x2_lcms) / 0.197327;
270+
const double mRS = (y1_lcms - y2_lcms) / 0.197327;
271+
const double mRL = (z1_lcms - z2_lcms) / 0.197327;
272+
const double mDT = (t1_lcms - t2_lcms) / 0.197327;
273+
274+
const double quantumweight = 1.0 + TMath::Cos(-fDKOutLCMS * mRO - fDKSideLCMS * mRS - fDKLongLCMS * mRL + mDE * mDT);
275+
vect.push_back(quantumweight);
276+
}
252277
return vect;
253278
}
254279
};

0 commit comments

Comments
 (0)