Skip to content
Draft
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
9 changes: 7 additions & 2 deletions PWGLF/DataModel/LFSpincorrelationTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

namespace lambdapair
{
DECLARE_SOA_INDEX_COLUMN(LambdaEvent, lambdaevent);

Check failure on line 38 in PWGLF/DataModel/LFSpincorrelationTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(V0Status, v0Status, int); //! Lambda or Anti-Lambda status
DECLARE_SOA_COLUMN(DoubleStatus, doubleStatus, bool); //! Double status
DECLARE_SOA_COLUMN(V0Cospa, v0Cospa, float); //! V0 Cospa
Expand All @@ -52,6 +52,8 @@
DECLARE_SOA_COLUMN(ProtonPhi, protonPhi, float); //! Proton Phi
DECLARE_SOA_COLUMN(ProtonIndex, protonIndex, int); //! Proton index
DECLARE_SOA_COLUMN(PionIndex, pionIndex, int); //! Pion index
DECLARE_SOA_COLUMN(DcaV0ToPV, dcaV0ToPV, float); //! DCA of V0 to primary vertex

} // namespace lambdapair
DECLARE_SOA_TABLE(LambdaPairs, "AOD", "LAMBDAPAIR",
o2::soa::Index<>,
Expand All @@ -71,7 +73,8 @@
lambdapair::ProtonEta,
lambdapair::ProtonPhi,
lambdapair::ProtonIndex,
lambdapair::PionIndex);
lambdapair::PionIndex,
lambdapair::DcaV0ToPV);

using LambdaPair = LambdaPairs::iterator;

Expand All @@ -88,7 +91,7 @@

namespace lambdapairmc
{
DECLARE_SOA_INDEX_COLUMN(LambdaEventmc, lambdaeventmc);

Check failure on line 94 in PWGLF/DataModel/LFSpincorrelationTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(V0Statusmc, v0Statusmc, int); //! Lambda or Anti-Lambda status in montecarlo
DECLARE_SOA_COLUMN(DoubleStatusmc, doubleStatusmc, bool); //! Double status in montecarlo
DECLARE_SOA_COLUMN(V0Cospamc, v0Cospamc, float); //! V0 Cospa in montecarlo
Expand All @@ -105,6 +108,7 @@
DECLARE_SOA_COLUMN(ProtonPhimc, protonPhimc, float); //! Proton Phi in montecarlo
DECLARE_SOA_COLUMN(ProtonIndexmc, protonIndexmc, int); //! Proton index in montecarlo
DECLARE_SOA_COLUMN(PionIndexmc, pionIndexmc, int); //! Pion index in montecarlo
DECLARE_SOA_COLUMN(DcaV0ToPVmc, dcaV0ToPVmc, float); //! DCA of V0 to primary vertex
} // namespace lambdapairmc
DECLARE_SOA_TABLE(LambdaPairmcs, "AOD", "LAMBDAPAIRMC",
o2::soa::Index<>,
Expand All @@ -124,7 +128,8 @@
lambdapairmc::ProtonEtamc,
lambdapairmc::ProtonPhimc,
lambdapairmc::ProtonIndexmc,
lambdapairmc::PionIndexmc);
lambdapairmc::PionIndexmc,
lambdapairmc::DcaV0ToPVmc);

using LambdaPairmc = LambdaPairmcs::iterator;

Expand Down
13 changes: 10 additions & 3 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 @@ -298,6 +298,7 @@
std::vector<int> positiveIndex = {};
std::vector<int> negativeIndex = {};
std::vector<float> dcaBetweenDaughter = {};
std::vector<float> dcaV0ToPV = {};
int numbV0 = 0;
// LOGF(info, "event collisions: (%d)", collision.index());
auto centrality = collision.centFT0C();
Expand Down Expand Up @@ -355,6 +356,7 @@
positiveIndex.push_back(postrack1.globalIndex());
negativeIndex.push_back(negtrack1.globalIndex());
v0Cospa.push_back(v0.v0cosPA());
dcaV0ToPV.push_back(std::abs(v0.dcav0topv()));
v0Radius.push_back(v0.v0radius());
dcaPositive.push_back(std::abs(v0.dcapostopv()));
dcaNegative.push_back(std::abs(v0.dcanegtopv()));
Expand Down Expand Up @@ -391,7 +393,7 @@
lambdaDummy = lambdaMother.at(i5);
protonDummy = protonDaughter.at(i5);
pionDummy = pionDaughter.at(i5);
lambdaPair(indexEvent, v0Status.at(i5), doubleStatus.at(i5), v0Cospa.at(i5), v0Radius.at(i5), dcaPositive.at(i5), dcaNegative.at(i5), dcaBetweenDaughter.at(i5), lambdaDummy.Pt(), lambdaDummy.Eta(), lambdaDummy.Phi(), lambdaDummy.M(), protonDummy.Pt(), protonDummy.Eta(), protonDummy.Phi(), positiveIndex.at(i5), negativeIndex.at(i5));
lambdaPair(indexEvent, v0Status.at(i5), doubleStatus.at(i5), v0Cospa.at(i5), v0Radius.at(i5), dcaPositive.at(i5), dcaNegative.at(i5), dcaBetweenDaughter.at(i5), lambdaDummy.Pt(), lambdaDummy.Eta(), lambdaDummy.Phi(), lambdaDummy.M(), protonDummy.Pt(), protonDummy.Eta(), protonDummy.Phi(), positiveIndex.at(i5), negativeIndex.at(i5), dcaV0ToPV.at(i5));
}
}
}
Expand All @@ -410,6 +412,7 @@
std::vector<int> positiveIndex = {};
std::vector<int> negativeIndex = {};
std::vector<float> dcaBetweenDaughter = {};
std::vector<float> dcaV0ToPV = {};
int numbV0 = 0;
// LOGF(info, "event collisions: (%d)", collision.index());
auto centrality = collision.centFT0C();
Expand Down Expand Up @@ -444,7 +447,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 450 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 All @@ -470,6 +473,7 @@
dcaPositive.push_back(std::abs(v0.dcapostopv()));
dcaNegative.push_back(std::abs(v0.dcanegtopv()));
dcaBetweenDaughter.push_back(std::abs(v0.dcaV0daughters()));
dcaV0ToPV.push_back(std::abs(v0.dcav0topv()));
if (lambdaTag) {
v0Status.push_back(0);
proton = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), o2::constants::physics::MassProton);
Expand Down Expand Up @@ -502,7 +506,7 @@
lambdaDummy = lambdaMother.at(i5);
protonDummy = protonDaughter.at(i5);
pionDummy = pionDaughter.at(i5);
lambdaPairmc(indexEvent, v0Status.at(i5), doubleStatus.at(i5), v0Cospa.at(i5), v0Radius.at(i5), dcaPositive.at(i5), dcaNegative.at(i5), dcaBetweenDaughter.at(i5), lambdaDummy.Pt(), lambdaDummy.Eta(), lambdaDummy.Phi(), lambdaDummy.M(), protonDummy.Pt(), protonDummy.Eta(), protonDummy.Phi(), positiveIndex.at(i5), negativeIndex.at(i5));
lambdaPairmc(indexEvent, v0Status.at(i5), doubleStatus.at(i5), v0Cospa.at(i5), v0Radius.at(i5), dcaPositive.at(i5), dcaNegative.at(i5), dcaBetweenDaughter.at(i5), lambdaDummy.Pt(), lambdaDummy.Eta(), lambdaDummy.Phi(), lambdaDummy.M(), protonDummy.Pt(), protonDummy.Eta(), protonDummy.Phi(), positiveIndex.at(i5), negativeIndex.at(i5), dcaV0ToPV.at(i5));
}
}
}
Expand Down Expand Up @@ -530,6 +534,7 @@
std::vector<int> positiveIndex = {};
std::vector<int> negativeIndex = {};
std::vector<float> dcaBetweenDaughter = {};
std::vector<float> dcaV0ToPV = {};
int numbV0 = 0;

auto centrality = collision.centFT0C();
Expand Down Expand Up @@ -610,6 +615,7 @@
negativeIndex.push_back(negtrack1.globalIndex());

v0Cospa.push_back(v0.v0cosPA());
dcaV0ToPV.push_back(std::abs(v0.dcav0topv()));
v0Radius.push_back(v0.v0radius());
dcaPositive.push_back(std::abs(v0.dcapostopv()));
dcaNegative.push_back(std::abs(v0.dcanegtopv()));
Expand Down Expand Up @@ -695,7 +701,8 @@
protonDummy.Eta(),
protonDummy.Phi(),
positiveIndex.at(i5),
negativeIndex.at(i5));
negativeIndex.at(i5),
dcaV0ToPV.at(i5));
}
}
}
Expand Down
63 changes: 43 additions & 20 deletions PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@
{
return t.pionIndexmc();
}

template <typename T>
static inline float dcaV0ToPVMC(const T& t)
{
return t.dcaV0ToPVmc();
}

} // namespace mcacc

// Optional fixed-leg correction pointers kept outside the task struct.
Expand Down Expand Up @@ -261,22 +268,28 @@
Configurable<bool> fillWeightQAHistos{"fillWeightQAHistos", false, "Fill weighted/final-weighted REP/FIX QA maps"};
Configurable<bool> fillAnalysisSparses{"fillAnalysisSparses", false, "Fill extra deltaR/deltaRap/deltaPhi Analysis THnSparse objects"};
Configurable<bool> fillAdditionalSparses{"fillAdditionalSparses", false, "Fill extra rapidity/dphi/pair-mass THnSparse objects"};

Configurable<bool> checkDoubleStatus{"checkDoubleStatus", 0, "Check Double status"};
Configurable<float> cosPA{"cosPA", 0.995, "Cosine Pointing Angle"};
Configurable<float> radiusMin{"radiusMin", 3, "Minimum V0 radius"};
Configurable<float> radiusMax{"radiusMax", 30, "Maximum V0 radius"};
Configurable<float> dcaProton{"dcaProton", 0.1, "DCA Proton"};
Configurable<float> dcaPion{"dcaPion", 0.2, "DCA Pion"};
Configurable<float> dcaDaughters{"dcaDaughters", 1.0, "DCA between daughters"};

Configurable<float> ptMin{"ptMin", 0.5, "V0 Pt minimum"};
Configurable<float> ptMax{"ptMax", 3.0, "V0 Pt maximum"};
Configurable<float> MassMin{"MassMin", 1.09, "V0 Mass minimum"};
Configurable<float> MassMax{"MassMax", 1.14, "V0 Mass maximum"};
Configurable<float> rapidity{"rapidity", 0.5, "Rapidity cut on lambda"};
Configurable<float> v0etaMixBuffer{"v0etaMixBuffer", 0.8, "Eta cut on mix event buffer"};
Configurable<float> rapidity{"rapidity", 0.5, "Rapidity cut on lambda"};
Configurable<float> v0eta{"v0eta", 0.8, "Eta cut on lambda"};

struct : ConfigurableGroup {
std::string prefix = "v0Configuration";
Configurable<float> cosPA{"cosPA", 0.995, "Cosine Pointing Angle"};
Configurable<float> radiusMin{"radiusMin", 3, "Minimum V0 radius"};
Configurable<float> radiusMax{"radiusMax", 30, "Maximum V0 radius"};
Configurable<float> dcaProton{"dcaProton", 0.1, "DCA Proton"};
Configurable<float> dcaPion{"dcaPion", 0.2, "DCA Pion"};
Configurable<float> dcaDaughters{"dcaDaughters", 1.0, "DCA between daughters"};
Configurable<float> dcaV0ToPV{"dcaV0ToPV", 1.2, "DCA V0 to PV cut on lambda"};

} v0Configurations;

// Event Mixing
Configurable<int> cosDef{"cosDef", 1, "Defination of cos"};

Expand Down Expand Up @@ -573,25 +586,30 @@
if (candidate.lambdaMass() < MassMin || candidate.lambdaMass() > MassMax) {
return false;
}
if (candidate.v0Cospa() < cosPA) {
if (candidate.v0Cospa() < v0Configurations.cosPA) {
return false;
}
if (checkDoubleStatus && candidate.doubleStatus()) {
return false;
}
if (candidate.v0Radius() > radiusMax) {
if (candidate.v0Radius() > v0Configurations.radiusMax) {
return false;
}
if (candidate.v0Radius() < radiusMin) {
if (candidate.v0Radius() < v0Configurations.radiusMin) {
return false;
}
if (candidate.dcaBetweenDaughter() > dcaDaughters) {
if (candidate.dcaBetweenDaughter() > v0Configurations.dcaDaughters) {
return false;
}

if (candidate.dcaV0ToPV() > v0Configurations.dcaV0ToPV) {
return false;
}
if (candidate.v0Status() == 0 && (std::abs(candidate.dcaPositive()) < dcaProton || std::abs(candidate.dcaNegative()) < dcaPion)) {

if (candidate.v0Status() == 0 && (std::abs(candidate.dcaPositive()) < v0Configurations.dcaProton || std::abs(candidate.dcaNegative()) < v0Configurations.dcaPion)) {
return false;
}
if (candidate.v0Status() == 1 && (std::abs(candidate.dcaPositive()) < dcaPion || std::abs(candidate.dcaNegative()) < dcaProton)) {
if (candidate.v0Status() == 1 && (std::abs(candidate.dcaPositive()) < v0Configurations.dcaPion || std::abs(candidate.dcaNegative()) < v0Configurations.dcaProton)) {
return false;
}
if (candidate.lambdaPt() < ptMin) {
Expand Down Expand Up @@ -1290,7 +1308,7 @@
auto nBins = colBinning.getAllBinsCount();
std::vector<std::deque<std::pair<int, AllTrackCandidates>>> eventPools(nBins);

for (auto& collision1 : collisions) {

Check failure on line 1311 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 @@ -1307,7 +1325,7 @@
continue;
}

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

Check failure on line 1328 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 @@ -1342,7 +1360,7 @@
int nRepl1 = 0;
int nRepl2 = 0;

for (auto& tX : poolB) {

Check failure on line 1363 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 @@ -1398,10 +1416,10 @@
static_cast<float>(totalRepl2) * wBase);
}

for (auto& pv : usable) {

Check failure on line 1419 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 1422 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 @@ -1836,25 +1854,30 @@
if (mcacc::lamMass(candidate) < MassMin || mcacc::lamMass(candidate) > MassMax) {
return false;
}
if (mcacc::v0CosPA(candidate) < cosPA) {
if (mcacc::v0CosPA(candidate) < v0Configurations.cosPA) {
return false;
}
if (checkDoubleStatus && mcacc::doubleStatus(candidate)) {
return false;
}
if (mcacc::v0Radius(candidate) > radiusMax) {
if (mcacc::v0Radius(candidate) > v0Configurations.radiusMax) {
return false;
}
if (mcacc::v0Radius(candidate) < radiusMin) {
if (mcacc::v0Radius(candidate) < v0Configurations.radiusMin) {
return false;
}
if (mcacc::dcaDau(candidate) > dcaDaughters) {
if (mcacc::dcaDau(candidate) > v0Configurations.dcaDaughters) {
return false;
}
if (mcacc::v0Status(candidate) == 0 && (std::abs(mcacc::dcaPos(candidate)) < dcaProton || std::abs(mcacc::dcaNeg(candidate)) < dcaPion)) {

if (mcacc::dcaV0ToPVMC(candidate) > v0Configurations.dcaV0ToPV) {
return false;
}

if (mcacc::v0Status(candidate) == 0 && (std::abs(mcacc::dcaPos(candidate)) < v0Configurations.dcaProton || std::abs(mcacc::dcaNeg(candidate)) < v0Configurations.dcaPion)) {
return false;
}
if (mcacc::v0Status(candidate) == 1 && (std::abs(mcacc::dcaPos(candidate)) < dcaPion || std::abs(mcacc::dcaNeg(candidate)) < dcaProton)) {
if (mcacc::v0Status(candidate) == 1 && (std::abs(mcacc::dcaPos(candidate)) < v0Configurations.dcaPion || std::abs(mcacc::dcaNeg(candidate)) < v0Configurations.dcaProton)) {
return false;
}
if (mcacc::lamPt(candidate) < ptMin) {
Expand Down Expand Up @@ -2216,7 +2239,7 @@
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 2242 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) {
for (int phiUse : phiUseBins) {
const auto& vec = buffer[linearKeyR(colBin, status, ptUse, etaUse, phiUse, mB, rB,
Expand Down
Loading