Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions PWGLF/TableProducer/Strangeness/lambdaspincorrelation.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGLF/TableProducer/Strangeness/lambdaspincorrelation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -74,7 +74,7 @@
ConfigurableAxis axisMultiplicityClass{"axisMultiplicityClass", {8, 0, 80}, "multiplicity percentile for bin"};

// events
Configurable<float> cfgEventTypepp{"cfgEventTypepp", true, "Type of collisions"};
Configurable<bool> cfgEventTypepp{"cfgEventTypepp", false, "Type of collisions"};
Configurable<float> cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"};
Configurable<float> cfgCutCentralityMax{"cfgCutCentralityMax", 80.0f, "Accepted maximum Centrality"};
Configurable<float> cfgCutCentralityMin{"cfgCutCentralityMin", 0.0f, "Accepted minimum Centrality"};
Expand Down Expand Up @@ -151,9 +151,9 @@
if (std::abs(ctauLambda) > cMaxV0LifeTime) {
return false;
}
if (std::abs(candidate.yLambda()) > confV0Rap) {
return false;
}
// if (std::abs(candidate.yLambda()) > confV0Rap) {
// return false;
// }
return true;
}

Expand Down Expand Up @@ -237,7 +237,7 @@
ROOT::Math::PxPyPzMVector lambdaDummy, pionDummy, protonDummy;

Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
Filter centralityFilter = (nabs(aod::cent::centFT0C) < cfgCutCentralityMax && nabs(aod::cent::centFT0C) > cfgCutCentralityMin);
// Filter centralityFilter = (nabs(aod::cent::centFT0C) < cfgCutCentralityMax && nabs(aod::cent::centFT0C) > cfgCutCentralityMin);

using EventCandidates = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::CentFT0Ms>>;
using AllTrackCandidates = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTPCFullPr>;
Expand Down Expand Up @@ -290,7 +290,7 @@
}
if (lambdaTag && aLambdaTag) {
doubleStatus.push_back(true);
if (std::abs(v0.mLambda() - 1.1154) < std::abs(v0.mAntiLambda() - 1.1154)) {
if (std::abs(v0.mLambda() - o2::constants::physics::MassLambda) < std::abs(v0.mAntiLambda() - o2::constants::physics::MassLambda)) {
lambdaTag = true;
aLambdaTag = false;
} else {
Expand Down Expand Up @@ -401,7 +401,7 @@
}
if (lambdaTag && aLambdaTag) {
doubleStatus.push_back(true);
if (std::abs(v0.mLambda() - 1.1154) < std::abs(v0.mAntiLambda() - 1.1154)) {

Check failure on line 404 in PWGLF/TableProducer/Strangeness/lambdaspincorrelation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
lambdaTag = true;
aLambdaTag = false;
} else {
Expand Down
131 changes: 102 additions & 29 deletions PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,8 @@
continue;
proton2 = ROOT::Math::PtEtaPhiMVector(v02.protonPt(), v02.protonEta(), v02.protonPhi(), o2::constants::physics::MassProton);
lambda2 = ROOT::Math::PtEtaPhiMVector(v02.lambdaPt(), v02.lambdaEta(), v02.lambdaPhi(), v02.lambdaMass());
histos.fill(HIST("deltaPhiSame"), RecoDecay::constrainAngle(v0.lambdaPhi() - v02.lambdaPhi(), -TMath::Pi(), harmonicDphi));
if ((v0.v0Status() == 0 && v02.v0Status() == 1) || (v0.v0Status() == 1 && v02.v0Status() == 0))
histos.fill(HIST("deltaPhiSame"), RecoDecay::constrainAngle(v0.lambdaPhi() - v02.lambdaPhi(), -TMath::Pi(), harmonicDphi));
// const int ptype = pairTypeCode(v0.v0Status(), v02.v0Status());
if (v0.v0Status() == 0 && v02.v0Status() == 0) {
fillHistograms(0, 0, lambda, lambda2, proton, proton2, 0, 1.0);
Expand All @@ -768,7 +769,7 @@
fillHistograms(0, 1, lambda, lambda2, proton, proton2, 0, 1.0);
}
if (v0.v0Status() == 1 && v02.v0Status() == 0) {
fillHistograms(1, 0, lambda, lambda2, proton, proton2, 0, 1.0);
fillHistograms(0, 1, lambda2, lambda, proton2, proton, 0, 1.0);
}
if (v0.v0Status() == 1 && v02.v0Status() == 1) {
fillHistograms(1, 1, lambda, lambda2, proton, proton2, 0, 1.0);
Expand Down Expand Up @@ -849,7 +850,7 @@
auto nBins = colBinning.getAllBinsCount();
std::vector<std::deque<std::pair<int, AllTrackCandidates>>> eventPools(nBins);

for (auto& collision1 : collisions) {

Check failure on line 853 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
const int bin = colBinning.getBin(std::make_tuple(collision1.posz(), collision1.cent()));
if (bin < 0) {
continue;
Expand All @@ -866,7 +867,7 @@
continue;
}

for (auto& [t1, t2] : soa::combinations(o2::soa::CombinationsFullIndexPolicy(poolA, poolA))) {

Check failure on line 870 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!selectionV0(t1) || !selectionV0(t2)) {
continue;
}
Expand Down Expand Up @@ -910,7 +911,7 @@
int nRepl1 = 0;
int nRepl2 = 0;

for (auto& tX : poolB) {

Check failure on line 914 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!selectionV0(tX)) {
continue;
}
Expand Down Expand Up @@ -940,10 +941,10 @@

const float wBase = 1.0f / static_cast<float>(totalRepl);

for (auto& pv : usable) {

Check failure on line 944 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
auto& poolB = *pv.pool;

for (auto& tX : poolB) {

Check failure on line 947 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!selectionV0(tX)) {
continue;
}
Expand Down Expand Up @@ -1301,11 +1302,18 @@
RecoDecay::constrainAngle(mcacc::lamPhi(v0) - mcacc::lamPhi(v02),
-TMath::Pi(), harmonicDphi));

// const int ptype = pairTypeCode(mcacc::v0Status(v0), mcacc::v0Status(v02));
// datatype=0 (same event)
fillHistograms(mcacc::v0Status(v0), mcacc::v0Status(v02),
lambda, lambda2, proton, proton2,
/*datatype=*/0, /*mixpairweight=*/1.0f);
const int s1 = mcacc::v0Status(v0);
const int s2 = mcacc::v0Status(v02);

if (s1 == 0 && s2 == 0) {
fillHistograms(0, 0, lambda, lambda2, proton, proton2, 0, 1.0f);
} else if (s1 == 0 && s2 == 1) {
fillHistograms(0, 1, lambda, lambda2, proton, proton2, 0, 1.0f);
} else if (s1 == 1 && s2 == 0) {
fillHistograms(0, 1, lambda2, lambda, proton2, proton, 0, 1.0f);
} else if (s1 == 1 && s2 == 1) {
fillHistograms(1, 1, lambda, lambda2, proton, proton2, 0, 1.0f);
}
}
}
}
Expand Down Expand Up @@ -1509,9 +1517,9 @@
auto collectFromBins = [&](const std::vector<int>& ptUseBins,
const std::vector<int>& etaUseBins,
const std::vector<int>& phiUseBins) {
for (int ptUse : ptUseBins) {

Check failure on line 1520 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
for (int etaUse : etaUseBins) {

Check failure on line 1521 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
for (int phiUse : phiUseBins) {

Check failure on line 1522 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
const auto& vec = buffer[linearKeyR(colBin, status, ptUse, etaUse, phiUse, mB, rB,
nStat, nPt, nEta, nPhi, nM, nR)];

Expand Down Expand Up @@ -1752,8 +1760,18 @@

const float meWeight = wSE;
const float dPhi = deltaPhiMinusPiToPi((float)lambda.Phi(), (float)lambda2.Phi());
histos.fill(HIST("deltaPhiMix"), dPhi, wSE);
fillHistograms(tX.v0Status(), t2.v0Status(), lambda, lambda2, proton, proton2, 1, meWeight, 1);
if ((tX.v0Status() == 0 && t2.v0Status() == 1) || (tX.v0Status() == 1 && t2.v0Status() == 0))
histos.fill(HIST("deltaPhiMix"), dPhi, wSE);
const int s1 = tX.v0Status();
const int s2 = t2.v0Status();

if (s1 == 0 && s2 == 1) {
fillHistograms(0, 1, lambda, lambda2, proton, proton2, 1, meWeight, 1);
} else if (s1 == 1 && s2 == 0) {
fillHistograms(0, 1, lambda2, lambda, proton2, proton, 1, meWeight, 2);
} else {
fillHistograms(s1, s2, lambda, lambda2, proton, proton2, 1, meWeight, 1);
}
}
}

Expand Down Expand Up @@ -1785,7 +1803,15 @@
const float meWeight = wSE;
const float dPhi = deltaPhiMinusPiToPi((float)lambda.Phi(), (float)lambda2.Phi());
histos.fill(HIST("deltaPhiMix"), dPhi, wSE);
fillHistograms(t1.v0Status(), tY.v0Status(), lambda, lambda2, proton, proton2, 1, meWeight, 2);
const int s1 = t1.v0Status();
const int s2 = tY.v0Status();
if (s1 == 0 && s2 == 1) {
fillHistograms(0, 1, lambda, lambda2, proton, proton2, 1, meWeight, 2);
} else if (s1 == 1 && s2 == 0) {
fillHistograms(0, 1, lambda2, lambda, proton2, proton, 1, meWeight, 1);
} else {
fillHistograms(s1, s2, lambda, lambda2, proton, proton2, 1, meWeight, 2);
}
}
}
}
Expand Down Expand Up @@ -1948,26 +1974,59 @@

collectFromBins(ptBins, etaBins, phiBins);

// 2) if exact bin does not give enough, top up from neighbors
// 2) if exact bin gives fewer than required matches, also search neighbors
const int targetMatches = (cfgV5MaxMatches.value > 0) ? cfgV5MaxMatches.value : 1;

if ((int)matches.size() < targetMatches) {
collectNeighborBinsClamp(ptB, nPt, nN_pt, ptBins);
collectNeighborBinsClamp(etaB, nEta, nN_eta, etaBins);
collectNeighborBinsPhi(phiB, nPhi, nN_phi, phiBins);
std::vector<int> ptBinsN, etaBinsN, phiBinsN;
collectNeighborBinsClamp(ptB, nPt, nN_pt, ptBinsN);
collectNeighborBinsClamp(etaB, nEta, nN_eta, etaBinsN);
collectNeighborBinsPhi(phiB, nPhi, nN_phi, phiBinsN);

collectFromBins(ptBins, etaBins, phiBins);
}
for (int ptUse : ptBinsN) {
for (int etaUse : etaBinsN) {
for (int phiUse : phiBinsN) {
if (ptUse == ptB && etaUse == etaB && phiUse == phiB) {
continue;
}

// if nothing found, then try neighboring bins
if (matches.empty()) {
collectNeighborBinsClamp(ptB, nPt, nN_pt, ptBins);
collectNeighborBinsClamp(etaB, nEta, nN_eta, etaBins);
collectNeighborBinsPhi(phiB, nPhi, nN_phi, phiBins);
const auto& vec = buffer[linearKeyR(colBin, status, ptUse, etaUse, phiUse, mB, rB,
nStat, nPt, nEta, nPhi, nM, nR)];

collectFromBins(ptBins, etaBins, phiBins);
}
for (auto const& bc : vec) {
if (bc.collisionIdx == curColIdx) {
continue;
}

auto tX = V0sMC.iteratorAt(static_cast<uint64_t>(bc.rowIndex));

if (!selectionV0MC(tX)) {
continue;
}
if (!checkKinematicsMC(tRep, tX)) {
continue;
}

if (tX.globalIndex() == tRep.globalIndex()) {
continue;
}
if (tX.globalIndex() == tKeep.globalIndex()) {
continue;
}

if (hasSharedDaughtersMC(tX, tKeep)) {
continue;
}
if (hasSharedDaughtersMC(tX, tRep)) {
continue;
}

matches.push_back(MatchRef{bc.collisionIdx, bc.rowIndex});
}
}
}
}
}
std::sort(matches.begin(), matches.end(),
[](auto const& a, auto const& b) {
return std::tie(a.collisionIdx, a.rowIndex) < std::tie(b.collisionIdx, b.rowIndex);
Expand Down Expand Up @@ -2124,9 +2183,16 @@
const float meWeight = wSE;
const float dPhi = deltaPhiMinusPiToPi((float)lX.Phi(), (float)l2.Phi());
histos.fill(HIST("deltaPhiMix"), dPhi, wSE);
fillHistograms(mcacc::v0Status(tX), mcacc::v0Status(t2),
lX, l2, pX, p2,
1, meWeight, 1);
const int s1 = mcacc::v0Status(tX);
const int s2 = mcacc::v0Status(t2);

if (s1 == 0 && s2 == 1) {
fillHistograms(0, 1, lX, l2, pX, p2, 1, meWeight, 1);
} else if (s1 == 1 && s2 == 0) {
fillHistograms(0, 1, l2, lX, p2, pX, 1, meWeight, 2);
} else {
fillHistograms(s1, s2, lX, l2, pX, p2, 1, meWeight, 1);
}
}
}
if (doMixLeg2 && nFill2 > 0) {
Expand Down Expand Up @@ -2162,9 +2228,16 @@
const float meWeight = wSE;
const float dPhi = deltaPhiMinusPiToPi((float)l1.Phi(), (float)lY.Phi());
histos.fill(HIST("deltaPhiMix"), dPhi, wSE);
fillHistograms(mcacc::v0Status(t1), mcacc::v0Status(tY),
l1, lY, p1, pY,
1, meWeight, 2);
const int s1 = mcacc::v0Status(t1);
const int s2 = mcacc::v0Status(tY);

if (s1 == 0 && s2 == 1) {
fillHistograms(0, 1, l1, lY, p1, pY, 1, meWeight, 2);
} else if (s1 == 1 && s2 == 0) {
fillHistograms(0, 1, lY, l1, pY, p1, 1, meWeight, 1);
} else {
fillHistograms(s1, s2, l1, lY, p1, pY, 1, meWeight, 2);
}
}
}
}
Expand Down
Loading