Skip to content

Commit

Permalink
[PWGLF] Add centrality info, fix minor issues (#9025)
Browse files Browse the repository at this point in the history
Co-authored-by: ALICE Action Bot <[email protected]>
  • Loading branch information
mhartung71 and alibuild authored Dec 17, 2024
1 parent f85cf19 commit 1eccc8f
Show file tree
Hide file tree
Showing 3 changed files with 607 additions and 577 deletions.
72 changes: 39 additions & 33 deletions PWGLF/DataModel/LFHypernucleiKfTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,29 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
// authors Janik Ditzel <[email protected]> and Michael Hartung <[email protected]>

/// \file LFHypernucleiKfTables.h
/// \brief Slim hypernuclei kf tables
/// \author Janik Ditzel <[email protected]> and Michael Hartung <[email protected]>

#ifndef PWGLF_DATAMODEL_LFHYPERNUCLEIKFTABLES_H_
#define PWGLF_DATAMODEL_LFHYPERNUCLEIKFTABLES_H_

#include <cmath>
#include "Framework/ASoA.h"
#include "Framework/AnalysisDataModel.h"
#include "Common/DataModel/Centrality.h"
#include "Common/Core/RecoDecay.h"

namespace o2::aod
{
namespace hykfmcColl
namespace hykfmccoll
{
DECLARE_SOA_COLUMN(PassedEvSel, passedEvSel, bool); //!
}
DECLARE_SOA_TABLE(HypKfMcColls, "AOD", "HYPKFMCCOLL",
o2::soa::Index<>,
hykfmcColl::PassedEvSel,
hykfmccoll::PassedEvSel,
mccollision::PosX,
mccollision::PosY,
mccollision::PosZ);
Expand All @@ -40,9 +44,10 @@ DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); //!
DECLARE_SOA_COLUMN(Svx, svx, float); //!
DECLARE_SOA_COLUMN(Svy, svy, float); //!
DECLARE_SOA_COLUMN(Svz, svz, float); //!
DECLARE_SOA_COLUMN(Occupancy, occupancy, int); //!
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float px, float py) { return RecoDecay::pt(std::array{px, py}); });
DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float E, float pz) { return 0.5 * TMath::Log((E + pz) / (E - pz)); });
DECLARE_SOA_DYNAMIC_COLUMN(Mass, mass, [](float E, float px, float py, float pz) { return TMath::Sqrt(E * E - px * px - py * py - pz * pz); });
DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float E, float pz) { return 0.5 * std::log((E + pz) / (E - pz)); });
DECLARE_SOA_DYNAMIC_COLUMN(Mass, mass, [](float E, float px, float py, float pz) { return std::sqrt(E * E - px * px - py * py - pz * pz); });
DECLARE_SOA_DYNAMIC_COLUMN(IsMatter, isMatter, [](int pdgCode) { return pdgCode > 0; });
} // namespace hykfmc

Expand All @@ -67,56 +72,57 @@ using HypKfMcPart = HypKfMcParts::iterator;

DECLARE_SOA_TABLE(HypKfColls, "AOD", "HYPKFCOLL",
o2::soa::Index<>,
hykfmcColl::PassedEvSel,
hykfmccoll::PassedEvSel,
hykfmc::HypKfMcCollId,
collision::PosX,
collision::PosY,
collision::PosZ,
cent::CentFT0A,
cent::CentFT0C,
cent::CentFT0M);
cent::CentFT0M,
hykfmc::Occupancy);
using HypKfColl = HypKfColls::iterator;

namespace hykftrk
{
DECLARE_SOA_INDEX_COLUMN(HypKfColl, hypKfColl);
DECLARE_SOA_COLUMN(Rigidity, rigidity, float); //!
DECLARE_SOA_COLUMN(TPCnCluster, tpcNcluster, float); //!
DECLARE_SOA_COLUMN(TPCnSigma, tpcNsigma, float); //!
DECLARE_SOA_COLUMN(TPCnSigmaNhp, tpcNsigmaNhp, float); //!
DECLARE_SOA_COLUMN(TPCnSigmaNlp, tpcNsigmaNlp, float); //!
DECLARE_SOA_COLUMN(TOFMass, tofMass, float); //!
DECLARE_SOA_COLUMN(TpcNcluster, tpcNcluster, float); //!
DECLARE_SOA_COLUMN(TpcNsigma, tpcNsigma, float); //!
DECLARE_SOA_COLUMN(TpcNsigmaNhp, tpcNsigmaNhp, float); //!
DECLARE_SOA_COLUMN(TpcNsigmaNlp, tpcNsigmaNlp, float); //!
DECLARE_SOA_COLUMN(TofMass, tofMass, float); //!
DECLARE_SOA_COLUMN(IsPVContributor, isPVContributor, bool); //!
DECLARE_SOA_COLUMN(SubMass, subMass, float); //!
DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float pt, float phi) { return (double)pt * TMath::Cos(phi); });
DECLARE_SOA_DYNAMIC_COLUMN(Py, py, [](float pt, float phi) { return (double)pt * TMath::Sin(phi); });
DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, [](float pt, float eta) { return (double)pt * TMath::SinH(eta); });
DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) { return pt * TMath::CosH(eta); }); //
DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float pt, float eta, float mass) { return std::log((RecoDecay::sqrtSumOfSquares(mass, pt * TMath::CosH(eta)) + pt * TMath::SinH(eta)) / RecoDecay::sqrtSumOfSquares(mass, pt)); });
DECLARE_SOA_DYNAMIC_COLUMN(Lambda, lambda, [](float eta) { return 1. / TMath::CosH(eta); });
DECLARE_SOA_DYNAMIC_COLUMN(ITSnCluster, itsNcluster, [](uint32_t itsClusterSizes) {
DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float pt, float phi) { return (double)pt * std::cos(phi); });
DECLARE_SOA_DYNAMIC_COLUMN(Py, py, [](float pt, float phi) { return (double)pt * std::sin(phi); });
DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, [](float pt, float eta) { return (double)pt * std::sinh(eta); });
DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) { return pt * std::cosh(eta); }); //
DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float pt, float eta, float mass) { return std::log((RecoDecay::sqrtSumOfSquares(mass, pt * std::cosh(eta)) + pt * std::sinh(eta)) / RecoDecay::sqrtSumOfSquares(mass, pt)); });
DECLARE_SOA_DYNAMIC_COLUMN(Lambda, lambda, [](float eta) { return 1. / std::cosh(eta); });
DECLARE_SOA_DYNAMIC_COLUMN(ItsNcluster, itsNcluster, [](uint32_t itsClusterSizes) {
uint8_t n = 0;
for (uint8_t i = 0; i < 7; i++) {
if (itsClusterSizes >> (4 * i) & 15)
n++;
}
return n;
});
DECLARE_SOA_DYNAMIC_COLUMN(ITSfirstLayer, itsFirstLayer, [](uint32_t itsClusterSizes) {
DECLARE_SOA_DYNAMIC_COLUMN(ItsFirstLayer, itsFirstLayer, [](uint32_t itsClusterSizes) {
for (int i = 0; i < 8; i++) {
if (itsClusterSizes >> (4 * i) & 15)
return i;
}
return -999;
});
DECLARE_SOA_DYNAMIC_COLUMN(ITSmeanClsSize, itsMeanClsSize, [](uint32_t itsClusterSizes) {
DECLARE_SOA_DYNAMIC_COLUMN(ItsMeanClsSize, itsMeanClsSize, [](uint32_t itsClusterSizes) {
int sum = 0, n = 0;
for (int i = 0; i < 8; i++) {
sum += (itsClusterSizes >> (4 * i) & 15);
if (itsClusterSizes >> (4 * i) & 15)
n++;
}
return static_cast<float>(sum) / n;
return n > 0 ? static_cast<float>(sum) / n : 0.f;
});
} // namespace hykftrk

Expand All @@ -128,25 +134,25 @@ DECLARE_SOA_TABLE(HypKfTracks, "AOD", "HYPKFTRACK",
track::Phi,
track::DcaXY,
track::DcaZ,
hykftrk::TPCnCluster,
hykftrk::TpcNcluster,
track::TPCChi2NCl,
track::ITSClusterSizes,
track::ITSChi2NCl,
hykftrk::Rigidity,
track::TPCSignal,
hykftrk::TPCnSigma,
hykftrk::TPCnSigmaNhp,
hykftrk::TPCnSigmaNlp,
hykftrk::TOFMass,
hykftrk::TpcNsigma,
hykftrk::TpcNsigmaNhp,
hykftrk::TpcNsigmaNlp,
hykftrk::TofMass,
hykftrk::IsPVContributor,
hykftrk::Px<track::Pt, track::Phi>,
hykftrk::Py<track::Pt, track::Phi>,
hykftrk::Pz<track::Pt, track::Eta>,
hykftrk::P<track::Pt, track::Eta>,
hykftrk::Lambda<track::Eta>,
hykftrk::ITSnCluster<track::ITSClusterSizes>,
hykftrk::ITSfirstLayer<track::ITSClusterSizes>,
hykftrk::ITSmeanClsSize<track::ITSClusterSizes>);
hykftrk::ItsNcluster<track::ITSClusterSizes>,
hykftrk::ItsFirstLayer<track::ITSClusterSizes>,
hykftrk::ItsMeanClsSize<track::ITSClusterSizes>);
using HypKfTrack = HypKfTracks::iterator;

DECLARE_SOA_TABLE(HypKfSubDs, "AOD", "HYPKFSUBD",
Expand All @@ -168,10 +174,10 @@ namespace hykfhyp
{
DECLARE_SOA_INDEX_COLUMN(HypKfColl, hypKfColl);
DECLARE_SOA_INDEX_COLUMN(HypKfMcPart, hypKfMcPart);
DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfDaughtAdd, addons);
DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfTrack, daughterTracks);
DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfDaughtAdd, hypKfDaughtAdd);
DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfTrack, hypKfTrack);
DECLARE_SOA_SELF_INDEX_COLUMN_FULL(HypDaughter, hypDaughter, int, "HypKfHypNucs");
DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfSubD, subDaughters);
DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfSubD, hypKfSubD);
DECLARE_SOA_COLUMN(Primary, primary, bool); //!
DECLARE_SOA_COLUMN(Mass, mass, float); //!
DECLARE_SOA_COLUMN(Px, px, float); //!
Expand Down
Loading

0 comments on commit 1eccc8f

Please sign in to comment.