Skip to content

Commit 3dcf52a

Browse files
committed
refactor: computeBertschPrattLCMS returns tuple, takes pair as args
1 parent 0d484a1 commit 3dcf52a

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

PWGCF/Femto/Core/pairHistManager.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <map>
4040
#include <string>
4141
#include <string_view>
42+
#include <tuple>
4243
#include <unordered_set>
4344
#include <vector>
4445

@@ -507,7 +508,7 @@ class PairHistManager
507508
mKstar = getKstar(mParticle1, mParticle2);
508509

509510
if (mPlotBertschPratt) {
510-
computeBertschPrattLCMS();
511+
std::tie(mQout, mQside, mQlong) = computeBertschPrattLCMS(mParticle1, mParticle2);
511512
}
512513

513514
if (mPlotDeltaEtaDeltaPhi) {
@@ -954,7 +955,7 @@ class PairHistManager
954955
return static_cast<float>(0.5 * std::sqrt(std::max(0.0, kallen) / s));
955956
}
956957

957-
void computeBertschPrattLCMS()
958+
std::tuple<float, float, float> computeBertschPrattLCMS(ROOT::Math::PtEtaPhiMVector const& part1, ROOT::Math::PtEtaPhiMVector const& part2)
958959
{
959960
const ROOT::Math::PxPyPzEVector p1(mParticle1);
960961
const ROOT::Math::PxPyPzEVector p2(mParticle2);
@@ -970,8 +971,7 @@ class PairHistManager
970971

971972
static constexpr double kMinTransverseMomentum = 1e-9;
972973
if (tPt < kMinTransverseMomentum || tMt < kMinTransverseMomentum) {
973-
mQout = mQside = mQlong = 0.f;
974-
return;
974+
return {0.0, 0.0, 0.0};
975975
}
976976

977977
const double betaL = tPz / tE;
@@ -985,9 +985,11 @@ class PairHistManager
985985
const double kside2 = (p2.Py() * tPx - p2.Px() * tPy) / tPt;
986986
const double klong2 = gammaL * (p2.Pz() - betaL * p2.E());
987987

988-
mQout = static_cast<float>(kout1 - kout2);
989-
mQside = static_cast<float>(kside1 - kside2);
990-
mQlong = static_cast<float>(klong1 - klong2);
988+
float qOut = static_cast<float>(kout1 - kout2);
989+
float qSide = static_cast<float>(kside1 - kside2);
990+
float qLong = static_cast<float>(klong1 - klong2);
991+
992+
return {qOut, qSide, qLong};
991993
}
992994

993995
o2::framework::HistogramRegistry* mHistogramRegistry = nullptr;

0 commit comments

Comments
 (0)