Skip to content

Commit 2b44ba5

Browse files
authored
Refactor LambdaSpinPolarization processing logic
1 parent 9840db8 commit 2b44ba5

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

PWGCF/TwoParticleCorrelations/Tasks/lambdaSpinPolarization.cxx

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,16 +1634,33 @@ struct LambdaSpinPolarization {
16341634
float dphi = RecoDecay::constrainAngle(p1.phi() - p2.phi(), -PI);
16351635
float dR = std::sqrt(drap * drap + dphi * dphi);
16361636

1637-
// Get Lambda-Proton four-momentum
16381637
std::array<float, 4> l1 = {p1.px(), p1.py(), p1.pz(), MassLambda0};
16391638
std::array<float, 4> l2 = {p2.px(), p2.py(), p2.pz(), MassLambda0};
1639+
1640+
std::array<float, 4> llpair = {
1641+
l1[0] + l2[0],
1642+
l1[1] + l2[1],
1643+
l1[2] + l2[2],
1644+
l1[3] + l2[3]};
1645+
16401646
std::array<float, 4> pr1 = {p1.prPx(), p1.prPy(), p1.prPz(), MassProton};
16411647
std::array<float, 4> pr2 = {p2.prPx(), p2.prPy(), p2.prPz(), MassProton};
1642-
std::array<float, 3> v1, v2;
1643-
getBoostVector(l1, v1, cInvBoostFlag);
1644-
getBoostVector(l2, v2, cInvBoostFlag);
1645-
boost(pr1, v1);
1646-
boost(pr2, v2);
1648+
1649+
std::array<float, 3> vPair;
1650+
getBoostVector(llpair, vPair, cInvBoostFlag);
1651+
1652+
boost(l1, vPair);
1653+
boost(l2, vPair);
1654+
1655+
boost(pr1, vPair);
1656+
boost(pr2, vPair);
1657+
1658+
std::array<float, 3> v1_pair, v2_pair;
1659+
getBoostVector(l1, v1_pair, cInvBoostFlag);
1660+
getBoostVector(l2, v2_pair, cInvBoostFlag);
1661+
1662+
boost(pr1, v1_pair);
1663+
boost(pr2, v2_pair);
16471664

16481665
std::array<float, 3> pr1tv = {pr1[0], pr1[1], pr1[2]};
16491666
std::array<float, 3> pr2tv = {pr2[0], pr2[1], pr2[2]};
@@ -1676,7 +1693,7 @@ struct LambdaSpinPolarization {
16761693
continue;
16771694
}
16781695

1679-
// Kinematic matching with named constants
1696+
// Kinematic matching
16801697
float deltaPt = std::abs(trk_1.pt() - trk_2.pt());
16811698
float deltaPhi = std::abs(RecoDecay::constrainAngle(trk_1.phi() - trk_2.phi(), -PI));
16821699
float deltaRap = std::abs(trk_1.rap() - trk_2.rap());
@@ -1718,7 +1735,7 @@ struct LambdaSpinPolarization {
17181735
analyzePairs<kAntiLambdaAntiLambda, true>(antiLambdaTracks, antiLambdaTracks);
17191736
}
17201737

1721-
PROCESS_SWITCH(LambdaSpinPolarization, processDataReco, "Process for Data and MCReco", false);
1738+
PROCESS_SWITCH(LambdaSpinPolarization, processDataReco, "Process for Data and MCReco", true);
17221739

17231740
struct GetMultiplicity {
17241741
float operator()(auto const& col) const
@@ -1766,7 +1783,7 @@ struct LambdaSpinPolarization {
17661783
}
17671784
}
17681785

1769-
PROCESS_SWITCH(LambdaSpinPolarization, processDataRecoMixed, "Process for Data and MCReco for Mixed events", true);
1786+
PROCESS_SWITCH(LambdaSpinPolarization, processDataRecoMixed, "Process for Data and MCReco for Mixed events", false);
17701787

17711788
void processDataRecoMixEvent(LambdaCollisions::iterator const& collision, LambdaTracks const& tracks)
17721789
{

0 commit comments

Comments
 (0)