Skip to content

Commit

Permalink
More minor adjustments to data model (AliceO2Group#4022)
Browse files Browse the repository at this point in the history
* Final adjustments to data model

* Please consider the following formatting changes (#193)

* Update strangederivedbuilder.cxx

---------

Co-authored-by: ALICE Builder <[email protected]>
  • Loading branch information
ddobrigk and alibuild authored Nov 29, 2023
1 parent b5dd95d commit db5cfc2
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 288 deletions.
47 changes: 15 additions & 32 deletions PWGLF/DataModel/LFStrangenessPIDTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,25 @@

namespace o2::aod
{
namespace v0data
namespace dautrack
{
// ==== TPC INFORMATION ===
DECLARE_SOA_COLUMN(PosTPCSignal, posTPCSignal, float); //! positive track signal
DECLARE_SOA_COLUMN(NegTPCSignal, negTPCSignal, float); //! negative track signal
DECLARE_SOA_COLUMN(TPCSignal, tpcSignal, float); //! track signal

DECLARE_SOA_COLUMN(TPCNSigmaEl, tpcNSigmaEl, float); //! Nsigma proton
DECLARE_SOA_COLUMN(TPCNSigmaPi, tpcNSigmaPi, float); //! Nsigma proton
DECLARE_SOA_COLUMN(TPCNSigmaKa, tpcNSigmaKa, float); //! Nsigma proton
DECLARE_SOA_COLUMN(TPCNSigmaPr, tpcNSigmaPr, float); //! Nsigma proton
DECLARE_SOA_COLUMN(TPCNSigmaHe, tpcNSigmaHe, float); //! Nsigma proton
} // namespace dautrack

DECLARE_SOA_COLUMN(PosTPCNSigmaPr, posTPCNSigmaPr, float); //! positive track Nsigma proton
DECLARE_SOA_COLUMN(PosTPCNSigmaPi, posTPCNSigmaPi, float); //! positive track Nsigma pion
DECLARE_SOA_COLUMN(NegTPCNSigmaPr, negTPCNSigmaPr, float); //! negative track Nsigma proton
DECLARE_SOA_COLUMN(NegTPCNSigmaPi, negTPCNSigmaPi, float); //! negative track Nsigma pion
DECLARE_SOA_TABLE(DauTrackTPCPIDs, "AOD", "DAUTRACKTPCPID", // nsigma table (for analysis)
dautrack::TPCSignal, dautrack::TPCNSigmaEl,
dautrack::TPCNSigmaPi, dautrack::TPCNSigmaKa,
dautrack::TPCNSigmaPr, dautrack::TPCNSigmaHe);

namespace v0data
{
// ==== TOF INFORMATION ===
// lengths as stored in the AO2D for TOF calculations
DECLARE_SOA_COLUMN(PosTOFLength, posTOFLength, float); //! positive track length
Expand All @@ -55,12 +63,6 @@ DECLARE_SOA_COLUMN(PosNSigmaK0Pi, posNSigmaK0Pi, float); //! positive track NSig
DECLARE_SOA_COLUMN(NegNSigmaK0Pi, negNSigmaK0Pi, float); //! positive track NSigma from pion <- k0short expectation
} // namespace v0data

DECLARE_SOA_TABLE(V0TPC, "AOD", "V0TPC", // raw information table (for debug, etc)
v0data::PosTPCSignal, v0data::NegTPCSignal);
DECLARE_SOA_TABLE(V0TPCPID, "AOD", "V0TPCPID", // raw information table (for debug, etc)
v0data::PosTPCNSigmaPr, v0data::PosTPCNSigmaPi,
v0data::NegTPCNSigmaPr, v0data::NegTPCNSigmaPi);

DECLARE_SOA_TABLE(V0TOF, "AOD", "V0TOF", // raw information table (for debug, etc)
v0data::PosTOFLength, v0data::NegTOFLength,
v0data::PosTOFDeltaTLaPi, v0data::PosTOFDeltaTLaPr,
Expand All @@ -73,18 +75,6 @@ DECLARE_SOA_TABLE(V0TOFPID, "AOD", "V0TOFPID", // nsigma table (for analysis)

namespace cascdata
{
// ==== TPC INFORMATION ===
DECLARE_SOA_COLUMN(PosTPCSignal, posTPCSignal, float); //! positive track signal
DECLARE_SOA_COLUMN(NegTPCSignal, negTPCSignal, float); //! negative track signal
DECLARE_SOA_COLUMN(BachTPCSignal, bachTPCSignal, float); //! negative track signal

DECLARE_SOA_COLUMN(PosTPCNSigmaPr, posTPCNSigmaPr, float); //! positive track Nsigma proton
DECLARE_SOA_COLUMN(PosTPCNSigmaPi, posTPCNSigmaPi, float); //! positive track Nsigma pion
DECLARE_SOA_COLUMN(NegTPCNSigmaPr, negTPCNSigmaPr, float); //! negative track Nsigma proton
DECLARE_SOA_COLUMN(NegTPCNSigmaPi, negTPCNSigmaPi, float); //! negative track Nsigma pion
DECLARE_SOA_COLUMN(BachTPCNSigmaKa, bachTPCNSigmaKa, float); //! negative track Nsigma proton
DECLARE_SOA_COLUMN(BachTPCNSigmaPi, bachTPCNSigmaPi, float); //! negative track Nsigma pion

// ==== TOF INFORMATION ===
// lengths as stored in the AO2D for TOF calculations
DECLARE_SOA_COLUMN(PosTOFLength, posTOFLength, float); //! positive track length
Expand Down Expand Up @@ -116,13 +106,6 @@ DECLARE_SOA_COLUMN(NegNSigmaOmPr, negNSigmaOmPr, float); //! negative tr
DECLARE_SOA_COLUMN(BachNSigmaOmKa, bachNSigmaOmKa, float); //! bachelor track NSigma from kaon <- omega expectation
} // namespace cascdata

DECLARE_SOA_TABLE(CascTPC, "AOD", "CASCTPC", // raw information table (for debug, etc)
cascdata::PosTPCSignal, cascdata::NegTPCSignal, cascdata::BachTPCSignal);
DECLARE_SOA_TABLE(CascTPCPID, "AOD", "CASCTPCPID", // raw information table (for debug, etc)
cascdata::PosTPCNSigmaPr, cascdata::PosTPCNSigmaPi,
cascdata::NegTPCNSigmaPr, cascdata::NegTPCNSigmaPi,
cascdata::BachTPCNSigmaKa, cascdata::BachTPCNSigmaPi);

DECLARE_SOA_TABLE(CascTOF, "AOD", "CascTOF", // raw information table (for debug, etc)
cascdata::PosTOFLength, cascdata::NegTOFLength, cascdata::BachTOFLength,
cascdata::PosTOFDeltaTXiPi, cascdata::PosTOFDeltaTXiPr,
Expand Down
88 changes: 36 additions & 52 deletions PWGLF/DataModel/LFStrangenessTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,28 @@
#include "Common/Core/RecoDecay.h"
#include "CommonConstants/PhysicsConstants.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/Qvectors.h"

namespace o2::aod
{
//______________________________________________________
// Collision declarations for derived data analysis
// this is optional but will ensure full flexibility
// if required (for 2pc, etc)
DECLARE_SOA_TABLE(StraCollisions, "AOD", "STRACOLLISION", //! track X positions at minima when using AO2Ds
collision::PosX, collision::PosY, collision::PosZ,
DECLARE_SOA_TABLE(StraCollisions, "AOD", "STRACOLLISION", //! basic collision properties: position
collision::PosX, collision::PosY, collision::PosZ);
DECLARE_SOA_TABLE(StraCents, "AOD", "STRACENTS", //! centrality percentiles
cent::CentFT0M, cent::CentFT0A,
cent::CentFT0C, cent::CentFV0A, o2::soa::Marker<2>);
cent::CentFT0C, cent::CentFV0A);
DECLARE_SOA_TABLE(StraEPs, "AOD", "STRAEPS", //! centrality percentiles
qvec::QvecFT0ARe, qvec::QvecFT0AIm, qvec::SumAmplFT0A,
qvec::QvecFT0CRe, qvec::QvecFT0CIm, qvec::SumAmplFT0C,
qvec::QvecFT0MRe, qvec::QvecFT0MIm, qvec::SumAmplFT0M,
qvec::QvecFV0ARe, qvec::QvecFV0AIm, qvec::SumAmplFV0A);

using StraCollision = StraCollisions::iterator;
using StraCent = StraCents::iterator;
using StraEP = StraEPs::iterator;

namespace dautrack
{
Expand Down Expand Up @@ -451,6 +460,7 @@ DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
DECLARE_SOA_INDEX_COLUMN_FULL(PosTrackExtra, posTrackExtra, int, DauTrackExtras, "_PosExtra"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(NegTrackExtra, negTrackExtra, int, DauTrackExtras, "_NegExtra"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(BachTrackExtra, bachTrackExtra, int, DauTrackExtras, "_BachExtra"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(StrangeTrackExtra, strangeTrackExtra, int, DauTrackExtras, "_StrangeExtra"); //!
DECLARE_SOA_INDEX_COLUMN(StraCollision, straCollision); //!

//______________________________________________________
Expand Down Expand Up @@ -519,21 +529,6 @@ DECLARE_SOA_COLUMN(MatchingChi2, matchingChi2, float); //!
DECLARE_SOA_COLUMN(TopologyChi2, topologyChi2, float); //!
DECLARE_SOA_COLUMN(ItsClsSize, itsCluSize, float); //!

//______________________________________________________
// REGULAR COLUMNS FOR CASCEXTRAS
DECLARE_SOA_COLUMN(PosTrackDetectorMap, posTrackDetectorMap, uint8_t); //! detector map for reference
DECLARE_SOA_COLUMN(NegTrackDetectorMap, negTrackDetectorMap, uint8_t); //! detector map for reference
DECLARE_SOA_COLUMN(BachTrackDetectorMap, bachTrackDetectorMap, uint8_t); //! detector map for reference
DECLARE_SOA_COLUMN(PosTrackITSClusterSizes, posTrackITSClusterSizes, uint32_t); //! ITS cluster sizes per layer
DECLARE_SOA_COLUMN(NegTrackITSClusterSizes, negTrackITSClusterSizes, uint32_t); //! ITS cluster sizes per layer
DECLARE_SOA_COLUMN(BachTrackITSClusterSizes, bachTrackITSClusterSizes, uint32_t); //! ITS cluster sizes per layer
DECLARE_SOA_COLUMN(PosTrackTPCClusters, posTrackTPCClusters, uint8_t); //! N TPC clusters
DECLARE_SOA_COLUMN(NegTrackTPCClusters, negTrackTPCClusters, uint8_t); //! N TPC clusters
DECLARE_SOA_COLUMN(BachTrackTPCClusters, bachTrackTPCClusters, uint8_t); //! N TPC clusters
DECLARE_SOA_COLUMN(PosTrackTPCCrossedRows, posTrackTPCCrossedRows, uint8_t); //! N TPC clusters
DECLARE_SOA_COLUMN(NegTrackTPCCrossedRows, negTrackTPCCrossedRows, uint8_t); //! N TPC clusters
DECLARE_SOA_COLUMN(BachTrackTPCCrossedRows, bachTrackTPCCrossedRows, uint8_t); //! N TPC clusters

//______________________________________________________
// REGULAR COLUMNS FOR CASCMCCORES
DECLARE_SOA_COLUMN(PDGCode, pdgCode, int); //! cascade PDG Code
Expand Down Expand Up @@ -669,7 +664,7 @@ DECLARE_SOA_TABLE(KFCascExtras, "AOD", "KFCASCEXTRA", //! optional table to refe
cascdata::BachTrackExtraId, o2::soa::Marker<2>);
DECLARE_SOA_TABLE(TraCascExtras, "AOD", "TRACASCEXTRA", //! optional table to refer to custom track extras
o2::soa::Index<>, cascdata::PosTrackExtraId, cascdata::NegTrackExtraId,
cascdata::BachTrackExtraId, o2::soa::Marker<3>);
cascdata::BachTrackExtraId, cascdata::StrangeTrackExtraId);

DECLARE_SOA_TABLE(StoredCascCores, "AOD", "CASCCORE", //! core information about decay, viable with AO2Ds or derived
cascdata::Sign, cascdata::MXi, cascdata::MOmega,
Expand Down Expand Up @@ -762,35 +757,10 @@ DECLARE_SOA_TABLE(CascMCCores, "AOD", "CASCMCCORE", //! bachelor-baryon correlat
cascdata::PxPosMC, cascdata::PyPosMC, cascdata::PzPosMC,
cascdata::PxNegMC, cascdata::PyNegMC, cascdata::PzNegMC,
cascdata::PxBachMC, cascdata::PyBachMC, cascdata::PzBachMC,
cascdata::PxMC, cascdata::PyMC, cascdata::PzMC,
o2::soa::Marker<1>);
DECLARE_SOA_TABLE(KFCascMCCores, "AOD", "KFCASCMCCORE", //! bachelor-baryon correlation variables
cascdata::PDGCode, cascdata::PDGCodeMother, cascdata::PDGCodeV0, cascdata::IsPhysicalPrimary,
cascdata::PDGCodePositive, cascdata::PDGCodeNegative, cascdata::PDGCodeBachelor,
cascdata::XMC, cascdata::YMC, cascdata::ZMC,
cascdata::XlambdaMC, cascdata::YlambdaMC, cascdata::ZlambdaMC,
cascdata::PxPosMC, cascdata::PyPosMC, cascdata::PzPosMC,
cascdata::PxNegMC, cascdata::PyNegMC, cascdata::PzNegMC,
cascdata::PxBachMC, cascdata::PyBachMC, cascdata::PzBachMC,
cascdata::PxMC, cascdata::PyMC, cascdata::PzMC,
o2::soa::Marker<2>);
DECLARE_SOA_TABLE(TraCascMCCores, "AOD", "TRACASCMCCORE", //! bachelor-baryon correlation variables
cascdata::PDGCode, cascdata::PDGCodeMother, cascdata::PDGCodeV0, cascdata::IsPhysicalPrimary,
cascdata::PDGCodePositive, cascdata::PDGCodeNegative, cascdata::PDGCodeBachelor,
cascdata::XMC, cascdata::YMC, cascdata::ZMC,
cascdata::XlambdaMC, cascdata::YlambdaMC, cascdata::ZlambdaMC,
cascdata::PxPosMC, cascdata::PyPosMC, cascdata::PzPosMC,
cascdata::PxNegMC, cascdata::PyNegMC, cascdata::PzNegMC,
cascdata::PxBachMC, cascdata::PyBachMC, cascdata::PzBachMC,
cascdata::PxMC, cascdata::PyMC, cascdata::PzMC,
o2::soa::Marker<3>);
cascdata::PxMC, cascdata::PyMC, cascdata::PzMC);

DECLARE_SOA_TABLE(CascBBs, "AOD", "CASCBB", //! bachelor-baryon correlation variables
cascdata::BachBaryonCosPA, cascdata::BachBaryonDCAxyToPV, o2::soa::Marker<1>)
DECLARE_SOA_TABLE(KFCascBBs, "AOD", "KFCASCBB", //! bachelor-baryon correlation variables, KF
cascdata::BachBaryonCosPA, cascdata::BachBaryonDCAxyToPV, o2::soa::Marker<2>)
DECLARE_SOA_TABLE(TraCascBBs, "AOD", "TRACASCBB", //! bachelor-baryon correlation variables, tracked
cascdata::BachBaryonCosPA, cascdata::BachBaryonDCAxyToPV, o2::soa::Marker<3>)
cascdata::BachBaryonCosPA, cascdata::BachBaryonDCAxyToPV)

DECLARE_SOA_TABLE_FULL(CascCovs, "CascCovs", "AOD", "CASCCOVS", //!
cascdata::PositionCovMat, cascdata::MomentumCovMat);
Expand All @@ -812,6 +782,24 @@ DECLARE_SOA_EXTENDED_TABLE_USER(TraCascCores, StoredTraCascCores, "TraCascDATAEX
cascdataext::PxLambda, cascdataext::PyLambda, cascdataext::PzLambda,
cascdataext::Pt, cascdataext::P, cascdataext::Eta, cascdataext::Phi);

namespace cascdata
{
// For cross-linking all cascade kinds
DECLARE_SOA_INDEX_COLUMN_FULL(TrackedCascade, trackedCascade, int, TraCascCores, "_Refs"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(KFCascade, kfCascade, int, KFCascCores, "_Refs"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(StandardCascade, standardCascade, int, CascCores, "_Refs"); //!
} // namespace cascdata

// interlink different cascade types
DECLARE_SOA_TABLE(CascToTraRefs, "AOD", "CASCTOTRAREFS", //! standard -> tracked
o2::soa::Index<>, cascdata::TrackedCascadeId);
DECLARE_SOA_TABLE(CascToKFRefs, "AOD", "CASCTOKFREFS", //! standard -> KF
o2::soa::Index<>, cascdata::KFCascadeId);
DECLARE_SOA_TABLE(TraToCascRefs, "AOD", "TRATOCASCREFS", //! standard -> KF
o2::soa::Index<>, cascdata::StandardCascadeId, o2::soa::Marker<1>);
DECLARE_SOA_TABLE(KFToCascRefs, "AOD", "KFTOCASCREFS", //! standard -> KF
o2::soa::Index<>, cascdata::StandardCascadeId, o2::soa::Marker<2>);

using CascIndex = CascIndices::iterator;
using CascCore = CascCores::iterator;
using KFCascIndex = KFCascIndices::iterator;
Expand All @@ -820,8 +808,8 @@ using TraCascIndex = TraCascIndices::iterator;
using TraCascCore = TraCascCores::iterator;

using CascDatas = soa::Join<CascIndices, CascBBs, CascCores>;
using KFCascDatas = soa::Join<KFCascIndices, KFCascBBs, KFCascCores>;
using TraCascDatas = soa::Join<TraCascIndices, TraCascBBs, TraCascCores>;
using KFCascDatas = soa::Join<KFCascIndices, KFCascCores>;
using TraCascDatas = soa::Join<TraCascIndices, TraCascCores>;

using CascData = CascDatas::iterator;
using KFCascData = KFCascDatas::iterator;
Expand Down Expand Up @@ -961,11 +949,7 @@ DECLARE_EQUIVALENT_FOR_INDEX(aod::CascIndices, aod::CascCores);
DECLARE_EQUIVALENT_FOR_INDEX(aod::CascIndices, aod::CascBBs);
DECLARE_EQUIVALENT_FOR_INDEX(aod::CascCores, aod::CascBBs);
DECLARE_EQUIVALENT_FOR_INDEX(aod::KFCascIndices, aod::KFCascCores);
DECLARE_EQUIVALENT_FOR_INDEX(aod::KFCascIndices, aod::KFCascBBs);
DECLARE_EQUIVALENT_FOR_INDEX(aod::KFCascCores, aod::KFCascBBs);
DECLARE_EQUIVALENT_FOR_INDEX(aod::TraCascIndices, aod::TraCascCores);
DECLARE_EQUIVALENT_FOR_INDEX(aod::TraCascIndices, aod::TraCascBBs);
DECLARE_EQUIVALENT_FOR_INDEX(aod::TraCascCores, aod::TraCascBBs);
} // namespace o2::soa

#endif // PWGLF_DATAMODEL_LFSTRANGENESSTABLES_H_
4 changes: 0 additions & 4 deletions PWGLF/TableProducer/cascadebuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ struct cascadeBuilder {
Produces<aod::StoredKFCascCores> kfcascdata;
Produces<aod::StoredTraCascCores> trackedcascdata;
Produces<aod::CascBBs> cascbb;
Produces<aod::KFCascBBs> kfcascbb;
Produces<aod::TraCascBBs> trackedcascbb;
Produces<aod::CascCovs> casccovs; // if requested by someone
Produces<aod::KFCascCovs> kfcasccovs; // if requested by someone
Service<o2::ccdb::BasicCCDBManager> ccdb;
Expand Down Expand Up @@ -1331,7 +1329,6 @@ struct cascadeBuilder {
cascadecandidate.v0dcapostopv, cascadecandidate.v0dcanegtopv,
cascadecandidate.bachDCAxy, cascadecandidate.cascDCAxy, cascadecandidate.cascDCAz,
cascadecandidate.kfMLambda, cascadecandidate.kfV0Chi2, cascadecandidate.kfCascadeChi2);
kfcascbb(cascadecandidate.bachBaryonCosPA, cascadecandidate.bachBaryonDCAxyToPV);

if (createCascCovMats) {
gpu::gpustd::array<float, 15> covmatrix;
Expand Down Expand Up @@ -1526,7 +1523,6 @@ struct cascadeBuilder {
cascadecandidate.v0dcapostopv, cascadecandidate.v0dcanegtopv,
cascadecandidate.bachDCAxy, cascadecandidate.cascDCAxy, cascadecandidate.cascDCAz, // <--- stratrack (cascDCAxy/z)
trackedCascade.matchingChi2(), trackedCascade.topologyChi2(), trackedCascade.itsClsSize()); // <--- stratrack fit info
trackedcascbb(cascadecandidate.bachBaryonCosPA, cascadecandidate.bachBaryonDCAxyToPV);
}
}
// En masse filling at end of process call
Expand Down
Loading

0 comments on commit db5cfc2

Please sign in to comment.