Skip to content

Commit

Permalink
PWGLF: Move V0 analysis to derived data format, add etas for cascs (A…
Browse files Browse the repository at this point in the history
…liceO2Group#4278)

* Move V0 analysis to derived data format, add etas for cascs

* Please consider the following formatting changes (#214)

* Add sel8 criteria

---------

Co-authored-by: ALICE Builder <[email protected]>
  • Loading branch information
ddobrigk and alibuild authored Jan 13, 2024
1 parent a23ec43 commit 8b16cd6
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 197 deletions.
58 changes: 55 additions & 3 deletions PWGLF/DataModel/LFStrangenessTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "Framework/AnalysisDataModel.h"
#include "Common/Core/RecoDecay.h"
#include "CommonConstants/PhysicsConstants.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/Qvectors.h"

Expand All @@ -29,6 +30,8 @@ DECLARE_SOA_TABLE(StraCollisions, "AOD", "STRACOLLISION", //! basic collision pr
DECLARE_SOA_TABLE(StraCents, "AOD", "STRACENTS", //! centrality percentiles
cent::CentFT0M, cent::CentFT0A,
cent::CentFT0C, cent::CentFV0A);
DECLARE_SOA_TABLE(StraEvSels, "AOD", "STRAEVSELS", //! event selection: sel8
evsel::Sel8);
DECLARE_SOA_TABLE(StraEPs, "AOD", "STRAEPS", //! centrality percentiles
qvec::QvecFT0ARe, qvec::QvecFT0AIm, qvec::SumAmplFT0A,
qvec::QvecFT0CRe, qvec::QvecFT0CIm, qvec::SumAmplFT0C,
Expand Down Expand Up @@ -698,6 +701,25 @@ DECLARE_SOA_DYNAMIC_COLUMN(Rapidity, rapidity, //! rapidity (0, 1: Xi; 2, 3: Ome
return RecoDecay::y(std::array{Px, Py, Pz}, o2::constants::physics::MassOmegaMinus);
return 0.0f;
});

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(BachelorPt, bachelorpt, //! bachelor 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); });
DECLARE_SOA_DYNAMIC_COLUMN(BachelorEta, bacheloreta, //! bachelor daughter eta
[](float PxPos, float PyPos, float PzPos) -> float { return RecoDecay::eta(std::array{PxPos, PyPos, PzPos}); });
DECLARE_SOA_DYNAMIC_COLUMN(BachelorPhi, bachelorphi, //! bachelor daughter phi
[](float PxPos, float PyPos) -> float { return RecoDecay::phi(PxPos, PyPos); });
} // namespace cascdata

//______________________________________________________
Expand Down Expand Up @@ -792,7 +814,17 @@ DECLARE_SOA_TABLE(StoredCascCores, "AOD", "CASCCORE", //! core information about
// Longitudinal
cascdata::YXi<cascdata::Px, cascdata::Py, cascdata::Pz>,
cascdata::YOmega<cascdata::Px, cascdata::Py, cascdata::Pz>,
cascdata::Rapidity<cascdata::Px, cascdata::Py, cascdata::Pz>);
cascdata::Rapidity<cascdata::Px, cascdata::Py, cascdata::Pz>,

cascdata::NegativePt<cascdata::PxNeg, cascdata::PyNeg>,
cascdata::PositivePt<cascdata::PxPos, cascdata::PyPos>,
cascdata::BachelorPt<cascdata::PxBach, cascdata::PyBach>,
cascdata::NegativeEta<cascdata::PxNeg, cascdata::PyNeg, cascdata::PzNeg>,
cascdata::NegativePhi<cascdata::PxNeg, cascdata::PyNeg>,
cascdata::PositiveEta<cascdata::PxPos, cascdata::PyPos, cascdata::PzPos>,
cascdata::PositivePhi<cascdata::PxPos, cascdata::PyPos>,
cascdata::BachelorEta<cascdata::PxBach, cascdata::PyBach, cascdata::PzBach>,
cascdata::BachelorPhi<cascdata::PxBach, cascdata::PyBach>);

DECLARE_SOA_TABLE(StoredKFCascCores, "AOD", "KFCASCCORE", //!
cascdata::Sign, cascdata::MXi, cascdata::MOmega,
Expand Down Expand Up @@ -820,7 +852,17 @@ DECLARE_SOA_TABLE(StoredKFCascCores, "AOD", "KFCASCCORE", //!

// Longitudinal
cascdata::YXi<cascdata::Px, cascdata::Py, cascdata::Pz>,
cascdata::YOmega<cascdata::Px, cascdata::Py, cascdata::Pz>);
cascdata::YOmega<cascdata::Px, cascdata::Py, cascdata::Pz>,

cascdata::NegativePt<cascdata::PxNeg, cascdata::PyNeg>,
cascdata::PositivePt<cascdata::PxPos, cascdata::PyPos>,
cascdata::BachelorPt<cascdata::PxBach, cascdata::PyBach>,
cascdata::NegativeEta<cascdata::PxNeg, cascdata::PyNeg, cascdata::PzNeg>,
cascdata::NegativePhi<cascdata::PxNeg, cascdata::PyNeg>,
cascdata::PositiveEta<cascdata::PxPos, cascdata::PyPos, cascdata::PzPos>,
cascdata::PositivePhi<cascdata::PxPos, cascdata::PyPos>,
cascdata::BachelorEta<cascdata::PxBach, cascdata::PyBach, cascdata::PzBach>,
cascdata::BachelorPhi<cascdata::PxBach, cascdata::PyBach>);

DECLARE_SOA_TABLE(StoredTraCascCores, "AOD", "TRACASCCORE", //!
cascdata::Sign, cascdata::MXi, cascdata::MOmega,
Expand Down Expand Up @@ -848,7 +890,17 @@ DECLARE_SOA_TABLE(StoredTraCascCores, "AOD", "TRACASCCORE", //!

// Longitudinal
cascdata::YXi<cascdata::Px, cascdata::Py, cascdata::Pz>,
cascdata::YOmega<cascdata::Px, cascdata::Py, cascdata::Pz>);
cascdata::YOmega<cascdata::Px, cascdata::Py, cascdata::Pz>,

cascdata::NegativePt<cascdata::PxNeg, cascdata::PyNeg>,
cascdata::PositivePt<cascdata::PxPos, cascdata::PyPos>,
cascdata::BachelorPt<cascdata::PxBach, cascdata::PyBach>,
cascdata::NegativeEta<cascdata::PxNeg, cascdata::PyNeg, cascdata::PzNeg>,
cascdata::NegativePhi<cascdata::PxNeg, cascdata::PyNeg>,
cascdata::PositiveEta<cascdata::PxPos, cascdata::PyPos, cascdata::PzPos>,
cascdata::PositivePhi<cascdata::PxPos, cascdata::PyPos>,
cascdata::BachelorEta<cascdata::PxBach, cascdata::PyBach, cascdata::PzBach>,
cascdata::BachelorPhi<cascdata::PxBach, cascdata::PyBach>);

DECLARE_SOA_TABLE(CascMCCores, "AOD", "CASCMCCORE", //! bachelor-baryon correlation variables
cascdata::PDGCode, cascdata::PDGCodeMother, cascdata::PDGCodeV0, cascdata::IsPhysicalPrimary,
Expand Down
7 changes: 5 additions & 2 deletions PWGLF/TableProducer/strangederivedbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ struct strangederivedbuilder {
// fundamental building blocks of derived data
Produces<aod::StraCollision> strangeColl; // characterises collisions
Produces<aod::StraCents> strangeCents; // characterises collisions / centrality
Produces<aod::StraEvSels> strangeEvSels; // characterises collisions / sel8 selection
Produces<aod::StraStamps> strangeStamps; // provides timestamps, run numbers
Produces<aod::V0CollRefs> v0collref; // references collisions from V0s
Produces<aod::CascCollRefs> casccollref; // references collisions from cascades
Expand Down Expand Up @@ -152,7 +153,7 @@ struct strangederivedbuilder {
histos.add("h2dNVerticesVsCentrality", "h2dNVerticesVsCentrality", kTH2D, {axisCentrality, axisNVertices});
}

void processCollisionsV0sOnly(soa::Join<aod::Collisions, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFV0As> const& collisions, aod::V0Datas const& V0s, aod::BCsWithTimestamps const&)
void processCollisionsV0sOnly(soa::Join<aod::Collisions, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFV0As, aod::EvSels> const& collisions, aod::V0Datas const& V0s, aod::BCsWithTimestamps const&)
{
for (const auto& collision : collisions) {
const uint64_t collIdx = collision.globalIndex();
Expand All @@ -163,6 +164,7 @@ struct strangederivedbuilder {
strangeColl(collision.posX(), collision.posY(), collision.posZ());
strangeCents(collision.centFT0M(), collision.centFT0A(),
collision.centFT0C(), collision.centFV0A());
strangeEvSels(collision.sel8());
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
strangeStamps(bc.runNumber(), bc.timestamp());
}
Expand All @@ -171,7 +173,7 @@ struct strangederivedbuilder {
}
}

void processCollisions(soa::Join<aod::Collisions, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFV0As> const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, aod::BCsWithTimestamps const&)
void processCollisions(soa::Join<aod::Collisions, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFV0As, aod::EvSels> const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, aod::BCsWithTimestamps const&)
{
for (const auto& collision : collisions) {
const uint64_t collIdx = collision.globalIndex();
Expand All @@ -188,6 +190,7 @@ struct strangederivedbuilder {
strangeColl(collision.posX(), collision.posY(), collision.posZ());
strangeCents(collision.centFT0M(), collision.centFT0A(),
collision.centFT0C(), collision.centFV0A());
strangeEvSels(collision.sel8());
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
strangeStamps(bc.runNumber(), bc.timestamp());
}
Expand Down
Loading

0 comments on commit 8b16cd6

Please sign in to comment.