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
153 changes: 151 additions & 2 deletions ALICE3/DataModel/OTFStrangeness.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#define ALICE3_DATAMODEL_OTFSTRANGENESS_H_

// O2 includes
#include "Common/Core/RecoDecay.h"

#include "Framework/AnalysisDataModel.h"

namespace o2::aod
Expand All @@ -33,8 +35,8 @@
DECLARE_SOA_INDEX_COLUMN_FULL(BachTrack, bachTrack, int, Tracks, "_Bach"); //!

// topo vars
DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0Daughters, float);

Check failure on line 38 in ALICE3/DataModel/OTFStrangeness.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(DCACascadeDaughters, dcaCascadeDaughters, float);

Check failure on line 39 in ALICE3/DataModel/OTFStrangeness.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(V0Radius, v0Radius, float);
DECLARE_SOA_COLUMN(CascRadius, cascRadius, float);
DECLARE_SOA_COLUMN(CascRadiusMC, cascRadiusMC, float);
Expand Down Expand Up @@ -70,10 +72,10 @@
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
DECLARE_SOA_INDEX_COLUMN_FULL(PosTrack, posTrack, int, Tracks, "_Pos"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg"); //!
DECLARE_SOA_INDEX_COLUMN(V0, v0); //!
DECLARE_SOA_INDEX_COLUMN(V0, v0); //! index of the mc particle corresponding to the V0

// topo vars
DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0Daughters, float);

Check failure on line 78 in ALICE3/DataModel/OTFStrangeness.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(V0Radius, v0Radius, float);
DECLARE_SOA_COLUMN(MLambda, mLambda, float);
DECLARE_SOA_COLUMN(MAntiLambda, mAntiLambda, float);
Expand All @@ -86,6 +88,7 @@
DECLARE_SOA_TABLE(UpgradeV0s, "AOD", "UPGRADEV0S",
o2::soa::Index<>,
otfv0::CollisionId,
otfv0::V0Id,
otfv0::PosTrackId,
otfv0::NegTrackId,
otfv0::DCAV0Daughters,
Expand All @@ -96,6 +99,152 @@
otfv0::Pt);

using UpgradeV0 = UpgradeV0s::iterator;
} // namespace o2::aod

namespace candidatev0
{
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
DECLARE_SOA_INDEX_COLUMN_FULL(PosTrack, posTrack, int, Tracks, "_Pos"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg"); //!
DECLARE_SOA_INDEX_COLUMN(V0, v0); //!

// General V0 properties: position, momentum
DECLARE_SOA_COLUMN(PosX, posX, float); //! positive track X at min
DECLARE_SOA_COLUMN(NegX, negX, float); //! negative track X at min
DECLARE_SOA_COLUMN(PxPos, pxpos, float); //! positive track px at min

Check failure on line 113 in ALICE3/DataModel/OTFStrangeness.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(PyPos, pypos, float); //! positive track py at min

Check failure on line 114 in ALICE3/DataModel/OTFStrangeness.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(PzPos, pzpos, float); //! positive track pz at min

Check failure on line 115 in ALICE3/DataModel/OTFStrangeness.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(PxNeg, pxneg, float); //! negative track px at min

Check failure on line 116 in ALICE3/DataModel/OTFStrangeness.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(PyNeg, pyneg, float); //! negative track py at min

Check failure on line 117 in ALICE3/DataModel/OTFStrangeness.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(PzNeg, pzneg, float); //! negative track pz at min

Check failure on line 118 in ALICE3/DataModel/OTFStrangeness.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(X, x, float); //! decay position X
DECLARE_SOA_COLUMN(Y, y, float); //! decay position Y
DECLARE_SOA_COLUMN(Z, z, float); //! decay position Z

// topo vars
DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0Daughters, float);

Check failure on line 124 in ALICE3/DataModel/OTFStrangeness.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(CosPA, cosPA, float);
DECLARE_SOA_COLUMN(DCAPosToPV, dcaPosToPV, float);
DECLARE_SOA_COLUMN(DCANegToPV, dcaNegToPV, float);
DECLARE_SOA_COLUMN(DCAV0ToPV, dcaV0ToPV, float);

//______________________________________________________
// DYNAMIC COLUMNS

DECLARE_SOA_DYNAMIC_COLUMN(Px, px, //! V0 px
[](float pxPos, float pxNeg) -> float { return pxPos + pxNeg; });
DECLARE_SOA_DYNAMIC_COLUMN(Py, py, //! V0 py
[](float pyPos, float pyNeg) -> float { return pyPos + pyNeg; });
DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, //! V0 pz
[](float pzPos, float pzNeg) -> float { return pzPos + pzNeg; });
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, //! Transverse momentum in GeV/c
[](float pxPos, float pyPos, float pxNeg, float pyNeg) -> float {
return RecoDecay::sqrtSumOfSquares(pxPos + pxNeg, pyPos + pyNeg);
});
DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! Total momentum in GeV/c
[](float pxPos, float pyPos, float pzPos, float pxNeg, float pyNeg, float pzNeg) -> float {
return RecoDecay::sqrtSumOfSquares(pxPos + pxNeg, pyPos + pyNeg, pzPos + pzNeg);
});
DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, //! Phi in the range [0, 2pi)
[](float pxPos, float pyPos, float pxNeg, float pyNeg) -> float { return RecoDecay::phi(pxPos + pxNeg, pyPos + pyNeg); });
DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, //! Pseudorapidity, conditionally defined to avoid FPEs
[](float pxPos, float pyPos, float pzPos, float pxNeg, float pyNeg, float pzNeg) -> float {
return RecoDecay::eta(std::array{pxPos + pxNeg, pyPos + pyNeg, pzPos + pzNeg});
});
// Length quantities
DECLARE_SOA_DYNAMIC_COLUMN(V0Radius, v0radius, //! V0 decay radius (2D, centered at zero)
[](float x, float y) -> float { return RecoDecay::sqrtSumOfSquares(x, y); });

// Distance Over To Mom
DECLARE_SOA_DYNAMIC_COLUMN(DistOverTotMom, distovertotmom, //! PV to V0decay distance over total momentum
[](float X, float Y, float Z, float pxPos, float pyPos, float pzPos, float pxNeg, float pyNeg, float pzNeg, float pvX, float pvY, float pvZ) {
float P = RecoDecay::sqrtSumOfSquares(pxPos + pxNeg, pyPos + pyNeg, pzPos + pzNeg);
return std::sqrt(std::pow(X - pvX, 2) + std::pow(Y - pvY, 2) + std::pow(Z - pvZ, 2)) / (P + 1E-10);
});

// Armenteros-Podolanski variables
DECLARE_SOA_DYNAMIC_COLUMN(Alpha, alpha, //! Armenteros Alpha
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) {
float momTot = RecoDecay::p(pxpos + pxneg, pypos + pyneg, pzpos + pzneg);
float lQlNeg = RecoDecay::dotProd(std::array{pxneg, pyneg, pzneg}, std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}) / momTot;
float lQlPos = RecoDecay::dotProd(std::array{pxpos, pypos, pzpos}, std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}) / momTot;
return (lQlPos - lQlNeg) / (lQlPos + lQlNeg); // alphav0
});

DECLARE_SOA_DYNAMIC_COLUMN(QtArm, qtarm, //! Armenteros Qt
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) {
float momTot = RecoDecay::p2(pxpos + pxneg, pypos + pyneg, pzpos + pzneg);
float dp = RecoDecay::dotProd(std::array{pxneg, pyneg, pzneg}, std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg});
return std::sqrt(RecoDecay::p2(pxneg, pyneg, pzneg) - dp * dp / momTot); // qtarm
});
// Mass assumption
DECLARE_SOA_DYNAMIC_COLUMN(MLambda, mLambda, //! mass under lambda hypothesis
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
return RecoDecay::m(std::array{std::array{pxpos, pypos, pzpos}, std::array{pxneg, pyneg, pzneg}}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged});
});
DECLARE_SOA_DYNAMIC_COLUMN(MAntiLambda, mAntiLambda, //! mass under antilambda hypothesis
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
return RecoDecay::m(std::array{std::array{pxpos, pypos, pzpos}, std::array{pxneg, pyneg, pzneg}}, std::array{o2::constants::physics::MassPionCharged, o2::constants::physics::MassProton});
});
DECLARE_SOA_DYNAMIC_COLUMN(MK0Short, mK0Short, //! mass under K0short hypothesis
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
return RecoDecay::m(std::array{std::array{pxpos, pypos, pzpos}, std::array{pxneg, pyneg, pzneg}}, std::array{o2::constants::physics::MassPionCharged, o2::constants::physics::MassPionCharged});
});
// Rapidity
DECLARE_SOA_DYNAMIC_COLUMN(YK0Short, yK0Short, //! V0 y with K0short hypothesis
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
return RecoDecay::y(std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}, o2::constants::physics::MassKaonNeutral);
});
DECLARE_SOA_DYNAMIC_COLUMN(YLambda, yLambda, //! V0 y with lambda or antilambda hypothesis
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
return RecoDecay::y(std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}, o2::constants::physics::MassLambda);
});
// Daughter track momenta
DECLARE_SOA_DYNAMIC_COLUMN(NegativePt, negativept, //! negative daughter pT
[](float pxneg, float pyneg) -> float { return RecoDecay::sqrtSumOfSquares(pxneg, pyneg); });
DECLARE_SOA_DYNAMIC_COLUMN(PositivePt, positivept, //! positive daughter pT
[](float pxpos, float pypos) -> float { return RecoDecay::sqrtSumOfSquares(pxpos, pypos); });
DECLARE_SOA_DYNAMIC_COLUMN(NegativeEta, negativeeta, //! negative daughter eta
[](float PxNeg, float PyNeg, float PzNeg) -> float { return RecoDecay::eta(std::array{PxNeg, PyNeg, PzNeg}); });
DECLARE_SOA_DYNAMIC_COLUMN(NegativePhi, negativephi, //! negative daughter phi
[](float PxNeg, float PyNeg) -> float { return RecoDecay::phi(PxNeg, PyNeg); });
DECLARE_SOA_DYNAMIC_COLUMN(PositiveEta, positiveeta, //! positive daughter eta
[](float PxPos, float PyPos, float PzPos) -> float { return RecoDecay::eta(std::array{PxPos, PyPos, PzPos}); });
DECLARE_SOA_DYNAMIC_COLUMN(PositivePhi, positivephi, //! positive daughter phi
[](float PxPos, float PyPos) -> float { return RecoDecay::phi(PxPos, PyPos); });
} // namespace candidatev0
DECLARE_SOA_TABLE(V0CandidateIndices, "AOD", "V0CANDIDATEINDEX", //! index table
o2::soa::Index<>, candidatev0::CollisionId, candidatev0::PosTrackId, candidatev0::NegTrackId);

DECLARE_SOA_TABLE(V0CandidateCores, "AOD", "V0CANDIDATECORE",
o2::soa::Index<>,
candidatev0::X, candidatev0::Y, candidatev0::Z,
candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos,
candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg,
candidatev0::DCAV0Daughters, candidatev0::DCAPosToPV, candidatev0::DCANegToPV,
candidatev0::CosPA, candidatev0::DCAV0ToPV,
candidatev0::Px<candidatev0::PxPos, candidatev0::PxNeg>,
candidatev0::Py<candidatev0::PyPos, candidatev0::PyNeg>,
candidatev0::Pz<candidatev0::PzPos, candidatev0::PzNeg>,
candidatev0::Pt<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PxNeg, candidatev0::PyNeg>,
candidatev0::P<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
candidatev0::Phi<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PxNeg, candidatev0::PyNeg>,
candidatev0::Eta<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
candidatev0::V0Radius<candidatev0::X, candidatev0::Y>,
candidatev0::DistOverTotMom<candidatev0::X, candidatev0::Y, candidatev0::Z, candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
candidatev0::Alpha<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
candidatev0::QtArm<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
candidatev0::MLambda<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
candidatev0::MAntiLambda<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
candidatev0::MK0Short<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
candidatev0::YK0Short<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
candidatev0::YLambda<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
candidatev0::NegativePt<candidatev0::PxNeg, candidatev0::PyNeg>,
candidatev0::PositivePt<candidatev0::PxPos, candidatev0::PyPos>,
candidatev0::NegativeEta<candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
candidatev0::NegativePhi<candidatev0::PxNeg, candidatev0::PyNeg>,
candidatev0::PositiveEta<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos>,
candidatev0::PositivePhi<candidatev0::PxPos, candidatev0::PyPos>);

using V0CandidateCore = V0CandidateCores::iterator;
} // namespace o2::aod
#endif // ALICE3_DATAMODEL_OTFSTRANGENESS_H_
5 changes: 5 additions & 0 deletions ALICE3/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,8 @@ o2physics_add_dpl_workflow(alice3-tracking-translator
SOURCES alice3TrackingTranslator.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-strangeness-finder
SOURCES alice3-strangenessFinder.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
3 changes: 3 additions & 0 deletions ALICE3/TableProducer/OTF/onTheFlyTracker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ struct OnTheFlyTracker {
struct v0candidate {
int positiveId; // track index in the Tracks table
int negativeId; // track index in the Tracks table
int mcParticleId; // mc particle index

float pt;

Expand Down Expand Up @@ -1193,6 +1194,7 @@ struct OnTheFlyTracker {
// n-2: negative Track from V0
thisV0.positiveId = lastTrackIndex + tracksAlice3.size() - 1;
thisV0.negativeId = lastTrackIndex + tracksAlice3.size() - 2;
thisV0.mcParticleId = mcParticle.globalIndex();
// use DCA fitters
int nCand = 0;
bool dcaFitterOK_V0 = true;
Expand Down Expand Up @@ -1535,6 +1537,7 @@ struct OnTheFlyTracker {
// populate V0s
for (const auto& v0 : v0sAlice3) {
tableUpgradeV0s(tableCollisions.lastIndex(), // now we know the collision index -> populate table
v0.mcParticleId,
v0.positiveId,
v0.negativeId,
v0.dcaV0dau,
Expand Down
Loading
Loading