Skip to content

Commit fe4c212

Browse files
authored
[PWGCF] : Update lambdaR2Correlation.cxx (#13834)
1 parent a1d59a8 commit fe4c212

File tree

1 file changed

+33
-44
lines changed

1 file changed

+33
-44
lines changed

PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx

Lines changed: 33 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,11 +1489,11 @@ struct LambdaSpinCorrelation {
14891489
Configurable<int> cNPtBins{"cNPtBins", 30, "N pT Bins"};
14901490
Configurable<float> cMinPt{"cMinPt", 0.5, "pT Min"};
14911491
Configurable<float> cMaxPt{"cMaxPt", 3.5, "pT Max"};
1492-
Configurable<int> cNRapBins{"cNRapBins", 20, "N Rapidity Bins"};
1492+
Configurable<int> cNRapBins{"cNRapBins", 10, "N Rapidity Bins"};
14931493
Configurable<float> cMinRap{"cMinRap", -0.5, "Minimum Rapidity"};
14941494
Configurable<float> cMaxRap{"cMaxRap", 0.5, "Maximum Rapidity"};
14951495
Configurable<int> cNPhiBins{"cNPhiBins", 36, "N Phi Bins"};
1496-
Configurable<bool> cAnaPairs{"cAnaPairs", false, "Analyze Pairs Flag"};
1496+
Configurable<int> cNBinsCosTS{"cNBinsCosTS", 10, "N CosTS Bins"};
14971497
Configurable<bool> cInvBoostFlag{"cInvBoostFlag", true, "Inverse Boost Flag"};
14981498

14991499
// Centrality Axis
@@ -1517,25 +1517,27 @@ struct LambdaSpinCorrelation {
15171517
const AxisSpec axisEta(cNRapBins, cMinRap, cMaxRap, "#eta");
15181518
const AxisSpec axisRap(cNRapBins, cMinRap, cMaxRap, "y");
15191519
const AxisSpec axisPhi(cNPhiBins, 0., TwoPI, "#varphi (rad)");
1520+
const AxisSpec axisDRap(2 * cNRapBins, cMinRap - cMaxRap, cMaxRap - cMinRap, "#Deltay");
15201521
const AxisSpec axisDPhi(cNPhiBins, -PI, PI, "#Delta#varphi");
1522+
const AxisSpec axisCosTS(cNBinsCosTS, -1, 1, "cos(#theta*)");
1523+
const AxisSpec axisDR(10, 0, 2, "#DeltaR");
15211524

15221525
// Single and Two Particle Densities
15231526
// 1D Histograms
1524-
histos.add("Reco/h2f_n2_mass_LaPLaM", "m_{inv}^{#Lambda} vs m_{inv}^{#bar{#Lambda}}", kTH2F, {axisMass, axisMass});
1525-
histos.add("Reco/h2f_n2_mass_LaPLaP", "m_{inv}^{#Lambda} vs m_{inv}^{#Lambda}", kTH2F, {axisMass, axisMass});
1526-
histos.add("Reco/h2f_n2_mass_LaMLaM", "m_{inv}^{#bar{#Lambda}} vs m_{inv}^{#bar{#Lambda}}", kTH2F, {axisMass, axisMass});
1527-
1528-
// rho1 for C2
1529-
histos.add("RecoCorr/h2f_n1_phi_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPhi});
1530-
histos.add("RecoCorr/h2f_n1_phi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPhi});
1527+
histos.add("Reco/h2f_n2_mass_LaPLaM", "m_{inv}^{#Lambda} vs m_{inv}^{#bar{#Lambda}}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt});
1528+
histos.add("Reco/h2f_n2_mass_LaPLaP", "m_{inv}^{#Lambda} vs m_{inv}^{#Lambda}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt});
1529+
histos.add("Reco/h2f_n2_mass_LaMLaM", "m_{inv}^{#bar{#Lambda}} vs m_{inv}^{#bar{#Lambda}}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt});
15311530

15321531
// rho2 for C2
1533-
histos.add("RecoCorr/h2f_n2_dphi_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH2F, {axisCent, axisDPhi});
1534-
histos.add("RecoCorr/h2f_n2_dphi_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTH2F, {axisCent, axisDPhi});
1535-
histos.add("RecoCorr/h2f_n2_dphi_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH2F, {axisCent, axisDPhi});
1536-
histos.add("RecoCorr/h2f_n2_phiphi_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH3F, {axisCent, axisPhi, axisPhi});
1537-
histos.add("RecoCorr/h2f_n2_phiphi_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTH3F, {axisCent, axisPhi, axisPhi});
1538-
histos.add("RecoCorr/h2f_n2_phiphi_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH3F, {axisCent, axisPhi, axisPhi});
1532+
histos.add("RecoCorr/h2f_n2_dlta_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDR});
1533+
histos.add("RecoCorr/h2f_n2_dlta_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDR});
1534+
histos.add("RecoCorr/h2f_n2_dlta_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS});
1535+
histos.add("RecoCorr/h2f_n2_cphi_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS});
1536+
histos.add("RecoCorr/h2f_n2_cphi_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS});
1537+
histos.add("RecoCorr/h2f_n2_cphi_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS});
1538+
histos.add("RecoCorr/h2f_n2_dphi_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi});
1539+
histos.add("RecoCorr/h2f_n2_dphi_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi});
1540+
histos.add("RecoCorr/h2f_n2_dphi_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi});
15391541
}
15401542

15411543
void getBoostVector(std::array<float, 4> const& p, std::array<float, 3>& v, bool inverseBoostFlag = true)
@@ -1569,7 +1571,9 @@ struct LambdaSpinCorrelation {
15691571
static constexpr std::string_view SubDirHist[] = {"LaPLaM", "LaPLaP", "LaMLaM"};
15701572

15711573
// Fill lambda pair mass
1572-
histos.fill(HIST("Reco/h2f_n2_mass_") + HIST(SubDirHist[part_pair]), p1.mass(), p2.mass());
1574+
histos.fill(HIST("Reco/h2f_n2_mass_") + HIST(SubDirHist[part_pair]), p1.mass(), p2.mass(), p1.pt(), p2.pt());
1575+
float drap = p1.rap() - p2.rap();
1576+
float dphi = RecoDecay::constrainAngle(p1.phi() - p2.phi(), -PI);
15731577

15741578
// Get Lambda-Proton four-momentum
15751579
std::array<float, 4> l1 = {p1.px(), p1.py(), p1.pz(), MassLambda0};
@@ -1582,26 +1586,17 @@ struct LambdaSpinCorrelation {
15821586
boost(pr1, v1);
15831587
boost(pr2, v2);
15841588

1585-
// Fill pair density
1586-
histos.fill(HIST("RecoCorr/h2f_n2_phiphi_") + HIST(SubDirHist[part_pair]), cent, RecoDecay::constrainAngle(RecoDecay::phi(pr1)), RecoDecay::phi(pr2));
1587-
histos.fill(HIST("RecoCorr/h2f_n2_dphi_") + HIST(SubDirHist[part_pair]), cent, RecoDecay::constrainAngle(RecoDecay::phi(pr1) - RecoDecay::phi(pr2), -PI));
1588-
}
1589+
std::array<float, 3> pr1tv = {pr1[0], pr1[1], pr1[2]};
1590+
std::array<float, 3> pr2tv = {pr2[0], pr2[1], pr2[2]};
1591+
float cphi = RecoDecay::dotProd(pr1tv, pr2tv) / (RecoDecay::sqrtSumOfSquares(pr1tv[0], pr1tv[1], pr1tv[2]) * RecoDecay::sqrtSumOfSquares(pr2tv[0], pr2tv[1], pr2tv[2]));
1592+
float prdphi = RecoDecay::constrainAngle(RecoDecay::phi(pr1) - RecoDecay::phi(pr2), -PI);
1593+
float prdrap = RecoDecay::eta(pr1tv) - RecoDecay::eta(pr2tv);
1594+
float dr = std::sqrt(prdrap * prdrap + prdphi * prdphi);
15891595

1590-
template <ParticleType part, typename T>
1591-
void analyzeSingles(T const& tracks)
1592-
{
1593-
static constexpr std::string_view SubDirHist[] = {"LaP", "LaM"};
1594-
for (auto const& track : tracks) {
1595-
// Get four-momentum of lambda
1596-
std::array<float, 4> l = {MassLambda0, track.px(), track.py(), track.pz()};
1597-
std::array<float, 4> p = {MassProton, track.prPx(), track.prPy(), track.prPz()};
1598-
std::array<float, 3> v;
1599-
getBoostVector(l, v, cInvBoostFlag);
1600-
boost(p, v);
1601-
1602-
// Fill single histograms
1603-
histos.fill(HIST("RecoCorr/h2f_n1_phi_") + HIST(SubDirHist[part]), cent, RecoDecay::constrainAngle(RecoDecay::phi(p)));
1604-
}
1596+
// Fill pair density
1597+
histos.fill(HIST("RecoCorr/h2f_n2_dphi_") + HIST(SubDirHist[part_pair]), cent, drap, dphi, RecoDecay::constrainAngle(RecoDecay::phi(pr1) - RecoDecay::phi(pr2), -PI));
1598+
histos.fill(HIST("RecoCorr/h2f_n2_cphi_") + HIST(SubDirHist[part_pair]), cent, drap, dphi, cphi);
1599+
histos.fill(HIST("RecoCorr/h2f_n2_dlta_") + HIST(SubDirHist[part_pair]), cent, drap, dphi, dr);
16051600
}
16061601

16071602
template <ParticlePairType partpair, bool samelambda, typename T>
@@ -1637,15 +1632,9 @@ struct LambdaSpinCorrelation {
16371632

16381633
auto lambdaTracks = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache);
16391634
auto antiLambdaTracks = partAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache);
1640-
1641-
analyzeSingles<kLambda>(lambdaTracks);
1642-
analyzeSingles<kAntiLambda>(antiLambdaTracks);
1643-
1644-
if (cAnaPairs) {
1645-
analyzePairs<kLambdaAntiLambda, false>(lambdaTracks, antiLambdaTracks);
1646-
analyzePairs<kLambdaLambda, true>(lambdaTracks, lambdaTracks);
1647-
analyzePairs<kAntiLambdaAntiLambda, true>(antiLambdaTracks, antiLambdaTracks);
1648-
}
1635+
analyzePairs<kLambdaAntiLambda, false>(lambdaTracks, antiLambdaTracks);
1636+
analyzePairs<kLambdaLambda, true>(lambdaTracks, lambdaTracks);
1637+
analyzePairs<kAntiLambdaAntiLambda, true>(antiLambdaTracks, antiLambdaTracks);
16491638
}
16501639

16511640
PROCESS_SWITCH(LambdaSpinCorrelation, processDataReco, "Process for Data and MCReco", false);

0 commit comments

Comments
 (0)