From c0f6a62f3dca1a181853d9ab7ea3385e826c6f71 Mon Sep 17 00:00:00 2001 From: Bong-Hwi Lim Date: Wed, 11 Dec 2024 23:52:53 +0100 Subject: [PATCH] Integrate data table --- PWGLF/DataModel/LFResonanceTables.h | 63 +++++++ PWGLF/DataModel/LFResonanceTablesMergeDF.h | 158 ------------------ .../Resonances/LFResonanceMergeDF.cxx | 18 +- PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx | 11 +- 4 files changed, 78 insertions(+), 172 deletions(-) delete mode 100644 PWGLF/DataModel/LFResonanceTablesMergeDF.h diff --git a/PWGLF/DataModel/LFResonanceTables.h b/PWGLF/DataModel/LFResonanceTables.h index b72dd1e745f..a446b97abc0 100644 --- a/PWGLF/DataModel/LFResonanceTables.h +++ b/PWGLF/DataModel/LFResonanceTables.h @@ -15,6 +15,8 @@ /// Inspired by StrangenessTables.h, FemtoDerived.h /// /// \author Bong-Hwi Lim +/// \author Nasir Mehdi Malik +/// #ifndef PWGLF_DATAMODEL_LFRESONANCETABLES_H_ #define PWGLF_DATAMODEL_LFRESONANCETABLES_H_ @@ -113,6 +115,25 @@ DECLARE_SOA_TABLE(ResoEvtPlCollisions, "AOD", "RESOEVTPLCOLL", resocollision::EvtPlResBC); using ResoEvtPlCollision = ResoEvtPlCollisions::iterator; +// For DF mixing study +DECLARE_SOA_TABLE(ResoCollisionDFs, "AOD", "RESOCOLLISIONDF", + o2::soa::Index<>, + resocollision::CollisionId, + o2::aod::mult::MultNTracksPV, + collision::PosX, + collision::PosY, + collision::PosZ, + resocollision::Cent, + resocollision::Spherocity, + resocollision::EvtPl, + resocollision::EvtPlResAB, + resocollision::EvtPlResAC, + resocollision::EvtPlResBC, + resocollision::BMagField, + timestamp::Timestamp, + evsel::NumTracksInTimeRange); +using ResoCollisionDF = ResoCollisionDFs::iterator; + // Resonance Daughters // inspired from PWGCF/DataModel/FemtoDerived.h namespace resodaughter @@ -230,6 +251,48 @@ DECLARE_SOA_TABLE(ResoTracks, "AOD", "RESOTRACKS", o2::aod::track::TPCChi2NCl); using ResoTrack = ResoTracks::iterator; +// For DF mixing study +DECLARE_SOA_TABLE(ResoTrackDFs, "AOD", "RESOTRACKDFs", + o2::soa::Index<>, + resodaughter::ResoCollisionId, + resodaughter::TrackId, + resodaughter::Pt, + resodaughter::Px, + resodaughter::Py, + resodaughter::Pz, + resodaughter::Eta, + resodaughter::Phi, + resodaughter::Sign, + resodaughter::TPCNClsCrossedRows, + resodaughter::TPCNClsFound, + resodaughter::ITSNCls, + o2::aod::track::DcaXY, + o2::aod::track::DcaZ, + o2::aod::track::X, + o2::aod::track::Alpha, + resodaughter::HasITS, + resodaughter::HasTPC, + resodaughter::HasTOF, + o2::aod::pidtpc::TPCNSigmaPi, + o2::aod::pidtpc::TPCNSigmaKa, + o2::aod::pidtpc::TPCNSigmaPr, + o2::aod::pidtpc::TPCNSigmaEl, + o2::aod::pidtof::TOFNSigmaPi, + o2::aod::pidtof::TOFNSigmaKa, + o2::aod::pidtof::TOFNSigmaPr, + o2::aod::pidtof::TOFNSigmaEl, + o2::aod::track::TPCSignal, + o2::aod::track::PassedITSRefit, + o2::aod::track::PassedTPCRefit, + resodaughter::IsGlobalTrackWoDCA, + resodaughter::IsGlobalTrack, + resodaughter::IsPrimaryTrack, + resodaughter::IsPVContributor, + resodaughter::TPCCrossedRowsOverFindableCls, + o2::aod::track::ITSChi2NCl, + o2::aod::track::TPCChi2NCl); +using ResoTrackDF = ResoTrackDFs::iterator; + DECLARE_SOA_TABLE(ResoV0s, "AOD", "RESOV0S", o2::soa::Index<>, resodaughter::ResoCollisionId, diff --git a/PWGLF/DataModel/LFResonanceTablesMergeDF.h b/PWGLF/DataModel/LFResonanceTablesMergeDF.h deleted file mode 100644 index 00ec4741956..00000000000 --- a/PWGLF/DataModel/LFResonanceTablesMergeDF.h +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// 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. - -/// \file LFResonanceTables.h -/// \brief Definitions of tables of resonance decay candidates -/// -/// Inspired by StrangenessTables.h, FemtoDerived.h -/// -/// \author Bong-Hwi Lim -/// Nasir Mehdi Malik - -#ifndef PWGLF_DATAMODEL_LFRESONANCETABLESMERGEDF_H_ -#define PWGLF_DATAMODEL_LFRESONANCETABLESMERGEDF_H_ - -#include -#include - -#include "Common/DataModel/PIDResponse.h" -#include "Common/Core/RecoDecay.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisDataModel.h" - -namespace o2::aod -{ -/// Resonance Collisions -namespace resocollisiondf -{ -DECLARE_SOA_COLUMN(Cent, cent, float); //! Centrality (Multiplicity) percentile (Default: FT0M) -DECLARE_SOA_COLUMN(Spherocity, spherocity, float); //! Spherocity of the event -DECLARE_SOA_COLUMN(EvtPl, evtPl, float); //! Second harmonic event plane -DECLARE_SOA_COLUMN(EvtPlResAB, evtPlResAB, float); //! Second harmonic event plane resolution of A-B sub events -DECLARE_SOA_COLUMN(EvtPlResAC, evtPlResAC, float); //! Second harmonic event plane resolution of A-C sub events -DECLARE_SOA_COLUMN(EvtPlResBC, evtPlResBC, float); //! Second harmonic event plane resolution of B-C sub events -DECLARE_SOA_COLUMN(BMagField, bMagField, float); //! Magnetic field -} // namespace resocollisiondf -DECLARE_SOA_TABLE(ResoCollisionDFs, "AOD", "RESOCOLLISIONDF", - o2::soa::Index<>, - o2::aod::mult::MultNTracksPV, - collision::PosX, - collision::PosY, - collision::PosZ, - resocollisiondf::Cent, - resocollisiondf::Spherocity, - resocollisiondf::EvtPl, - resocollisiondf::EvtPlResAB, - resocollisiondf::EvtPlResAC, - resocollisiondf::EvtPlResBC, - resocollisiondf::BMagField, - timestamp::Timestamp, - evsel::NumTracksInTimeRange); -using ResoCollisionDF = ResoCollisionDFs::iterator; - -// Resonance Daughters -// inspired from PWGCF/DataModel/FemtoDerived.h -namespace resodaughterdf -{ - -DECLARE_SOA_INDEX_COLUMN(ResoCollisionDF, resoCollisiondf); -DECLARE_SOA_COLUMN(Pt, pt, float); //! p_T (GeV/c) -DECLARE_SOA_COLUMN(Px, px, float); //! p_x (GeV/c) -DECLARE_SOA_COLUMN(Py, py, float); //! p_y (GeV/c) -DECLARE_SOA_COLUMN(Pz, pz, float); //! p_z (GeV/c) -DECLARE_SOA_COLUMN(Eta, eta, float); //! Eta -DECLARE_SOA_COLUMN(Phi, phi, float); //! Phi -DECLARE_SOA_COLUMN(PartType, partType, uint8_t); //! Type of the particle, according to resodaughter::ParticleType -DECLARE_SOA_COLUMN(TempFitVar, tempFitVar, float); //! Observable for the template fitting (Track: DCA_xy, V0: CPA) -DECLARE_SOA_COLUMN(Indices, indices, int[2]); //! Field for the track indices to remove auto-correlations -DECLARE_SOA_COLUMN(CascadeIndices, cascIndices, int[3]); //! Field for the track indices to remove auto-correlations (ordered: positive, negative, bachelor) -DECLARE_SOA_COLUMN(Sign, sign, int8_t); //! Sign of the track charge -DECLARE_SOA_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows, uint8_t); //! Number of TPC crossed rows -DECLARE_SOA_COLUMN(TPCNClsFound, tpcNClsFound, uint8_t); //! Number of TPC clusters found -DECLARE_SOA_COLUMN(ITSNCls, itsNCls, uint8_t); //! Number of ITS clusters found -DECLARE_SOA_COLUMN(IsGlobalTrackWoDCA, isGlobalTrackWoDCA, bool); //! Is global track without DCA -DECLARE_SOA_COLUMN(IsGlobalTrack, isGlobalTrack, bool); //! Is global track -DECLARE_SOA_COLUMN(IsPrimaryTrack, isPrimaryTrack, bool); //! Is primary track -DECLARE_SOA_COLUMN(IsPVContributor, isPVContributor, bool); //! Is primary vertex contributor -DECLARE_SOA_COLUMN(HasITS, hasITS, bool); -DECLARE_SOA_COLUMN(HasTPC, hasTPC, bool); -DECLARE_SOA_COLUMN(HasTOF, hasTOF, bool); //! Has TOF -DECLARE_SOA_COLUMN(TPCCrossedRowsOverFindableCls, tpcCrossedRowsOverFindableCls, float); -DECLARE_SOA_COLUMN(DaughDCA, daughDCA, float); //! DCA between daughters -DECLARE_SOA_COLUMN(CascDaughDCA, cascdaughDCA, float); //! DCA between daughters from cascade -DECLARE_SOA_COLUMN(V0CosPA, v0CosPA, float); //! V0 Cosine of Pointing Angle -DECLARE_SOA_COLUMN(CascCosPA, cascCosPA, float); //! Cascade Cosine of Pointing Angle -DECLARE_SOA_COLUMN(MLambda, mLambda, float); //! The invariant mass of V0 candidate, assuming lambda -DECLARE_SOA_COLUMN(MAntiLambda, mAntiLambda, float); //! The invariant mass of V0 candidate, assuming antilambda -DECLARE_SOA_COLUMN(MK0Short, mK0Short, float); //! The invariant mass of V0 candidate, assuming k0s -DECLARE_SOA_COLUMN(MXi, mXi, float); //! The invariant mass of Xi candidate -DECLARE_SOA_COLUMN(TransRadius, transRadius, float); //! Transverse radius of the decay vertex -DECLARE_SOA_COLUMN(CascTransRadius, casctransRadius, float); //! Transverse radius of the decay vertex from cascade -DECLARE_SOA_COLUMN(DecayVtxX, decayVtxX, float); //! X position of the decay vertex -DECLARE_SOA_COLUMN(DecayVtxY, decayVtxY, float); //! Y position of the decay vertex -DECLARE_SOA_COLUMN(DecayVtxZ, decayVtxZ, float); //! Z position of the decay vertex -// For MC -DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! Index of the corresponding MC particle -DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); -DECLARE_SOA_COLUMN(ProducedByGenerator, producedByGenerator, bool); -DECLARE_SOA_COLUMN(MothersId, motherId, int); //! Id of the mother particle -DECLARE_SOA_COLUMN(MotherPDG, motherPDG, int); //! PDG code of the mother particle -DECLARE_SOA_COLUMN(DaughterPDG1, daughterPDG1, int); //! PDG code of the first Daughter particle -DECLARE_SOA_COLUMN(DaughterPDG2, daughterPDG2, int); //! PDG code of the second Daughter particle -DECLARE_SOA_COLUMN(DaughterID1, daughterId1, int); //! Id of the first Daughter particle -DECLARE_SOA_COLUMN(DaughterID2, daughterId2, int); //! Id of the second Daughter particle -DECLARE_SOA_COLUMN(SiblingIds, siblingIds, int[2]); //! Index of the particles with the same mother -DECLARE_SOA_COLUMN(BachTrkID, bachtrkID, int); //! Id of the bach track from cascade -DECLARE_SOA_COLUMN(V0ID, v0ID, int); //! Id of the V0 from cascade -} // namespace resodaughterdf -DECLARE_SOA_TABLE(ResoTrackDFs, "AOD", "RESOTRACKDFs", - o2::soa::Index<>, - resodaughterdf::ResoCollisionDFId, - resodaughterdf::Pt, - resodaughterdf::Px, - resodaughterdf::Py, - resodaughterdf::Pz, - resodaughterdf::Eta, - resodaughterdf::Phi, - resodaughterdf::Sign, - resodaughterdf::TPCNClsCrossedRows, - resodaughterdf::TPCNClsFound, - resodaughterdf::ITSNCls, - o2::aod::track::DcaXY, - o2::aod::track::DcaZ, - o2::aod::track::X, - o2::aod::track::Alpha, - resodaughterdf::HasITS, - resodaughterdf::HasTPC, - resodaughterdf::HasTOF, - o2::aod::pidtpc::TPCNSigmaPi, - o2::aod::pidtpc::TPCNSigmaKa, - o2::aod::pidtpc::TPCNSigmaPr, - o2::aod::pidtpc::TPCNSigmaEl, - o2::aod::pidtof::TOFNSigmaPi, - o2::aod::pidtof::TOFNSigmaKa, - o2::aod::pidtof::TOFNSigmaPr, - o2::aod::pidtof::TOFNSigmaEl, - o2::aod::track::TPCSignal, - o2::aod::track::PassedITSRefit, - o2::aod::track::PassedTPCRefit, - resodaughterdf::IsGlobalTrackWoDCA, - resodaughterdf::IsGlobalTrack, - resodaughterdf::IsPrimaryTrack, - resodaughterdf::IsPVContributor, - resodaughterdf::TPCCrossedRowsOverFindableCls, - o2::aod::track::ITSChi2NCl, - o2::aod::track::TPCChi2NCl); -using ResoTrackDF = ResoTrackDFs::iterator; - -} // namespace o2::aod -#endif // PWGLF_DATAMODEL_LFRESONANCETABLESMERGEDF_H_ diff --git a/PWGLF/TableProducer/Resonances/LFResonanceMergeDF.cxx b/PWGLF/TableProducer/Resonances/LFResonanceMergeDF.cxx index 9850a7bf23a..3d27c68d40e 100644 --- a/PWGLF/TableProducer/Resonances/LFResonanceMergeDF.cxx +++ b/PWGLF/TableProducer/Resonances/LFResonanceMergeDF.cxx @@ -44,7 +44,6 @@ #include "Framework/runDataProcessing.h" #include "Framework/O2DatabasePDGPlugin.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/DataModel/LFResonanceTablesMergeDF.h" #include "PWGLF/DataModel/LFResonanceTables.h" #include "PWGLF/Utils/collisionCuts.h" #include "ReconstructionDataFormats/Track.h" @@ -89,8 +88,8 @@ struct reso2dfmerged { Produces reso2trksdf; int df = 0; - std::vector> vecOfTuples; - std::vector> vecOfTuples; + std::vector(tuple)); - resoCollisionsdf(0, std::get<0>(tuple), std::get<1>(tuple), std::get<2>(tuple), std::get<3>(tuple), std::get<4>(tuple), std::get<5>(tuple), 0., 0., 0., 0., 0, collision.trackOccupancyInTimeRange()); + resoCollisionsdf(std::get<0>(tuple), 0, std::get<1>(tuple), std::get<2>(tuple), std::get<3>(tuple), std::get<4>(tuple), std::get<5>(tuple), std::get<6>(tuple), 0., 0., 0., 0., 0, collision.trackOccupancyInTimeRange()); // LOGF(info, "collisions: Index = %d ) %f - %f - %f %f %d -- %d", std::get<0>(tuple).globalIndex(),std::get<1>(tuple),std::get<2>(tuple), std::get<3>(tuple), std::get<4>(tuple), std::get<5>(tuple).size(),resoCollisionsdf.lastIndex()); for (const auto& tuple : innerVector) { @@ -223,7 +223,8 @@ struct reso2dfmerged { std::get<31>(tuple), std::get<32>(tuple), std::get<33>(tuple), - std::get<34>(tuple)); + std::get<34>(tuple), + std::get<35>(tuple)); } } @@ -242,7 +243,7 @@ struct reso2dfmerged { histos.fill(HIST("Event/h1d_ft0_mult_percentile"), collision.cent()); - resoCollisionsdf(0, collision.posX(), collision.posY(), collision.posZ(), collision.cent(), collision.spherocity(), collision.evtPl(), 0., 0., 0., 0., 0, collision.trackOccupancyInTimeRange()); + resoCollisionsdf(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), collision.cent(), collision.spherocity(), collision.evtPl(), 0., 0., 0., 0., 0, collision.trackOccupancyInTimeRange()); for (auto& track : tracks) { if (isPrimary && !track.isPrimaryTrack()) @@ -270,6 +271,7 @@ struct reso2dfmerged { continue; reso2trksdf(resoCollisionsdf.lastIndex(), + track.globalIndex(), track.pt(), track.px(), track.py(), diff --git a/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx b/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx index 74234cb8bd1..e7fc0ee3de9 100644 --- a/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx @@ -13,7 +13,7 @@ /// /// Invariant Mass Reconstruction of Lambda(1520) Resonance. /// /// \author Yash Patley -/// \author Nasir Mehdi Malik +/// \author Nasir Mehdi Malik #include #include @@ -30,7 +30,6 @@ #include "Framework/ASoAHelpers.h" #include "Framework/runDataProcessing.h" #include "PWGLF/DataModel/LFResonanceTables.h" -#include "PWGLF/DataModel/LFResonanceTablesMergeDF.h" #include "CommonConstants/PhysicsConstants.h" using namespace o2; @@ -654,9 +653,9 @@ struct lambdaAnalysis_pb { PROCESS_SWITCH(lambdaAnalysis_pb, processMix, "Process for Mixed Events", false); - Preslice perRColdf = aod::resodaughterdf::resoCollisiondfId; + Preslice perRColdf = aod::resodaughter::resoCollisionId; - using resoColDFs = aod::ResoCollisionDFs; + using resoColDFs = aod::ResoCollisions; using resoTrackDFs = aod::ResoTrackDFs; void processDatadf(resoColDFs::iterator const& collision, resoTrackDFs const& tracks) @@ -673,7 +672,7 @@ struct lambdaAnalysis_pb { PROCESS_SWITCH(lambdaAnalysis_pb, processDatadf, "Process for data merged DF", false); - using BinningTypeDF = ColumnBinningPolicy; + using BinningTypeDF = ColumnBinningPolicy; void processMixDF(resoColDFs& collisions, resoTrackDFs const& tracks) { if (doprocessMix) @@ -696,7 +695,7 @@ struct lambdaAnalysis_pb { PROCESS_SWITCH(lambdaAnalysis_pb, processMixDF, "Process for merged DF Mixed Events", false); - using BinningTypeEP = ColumnBinningPolicy; + using BinningTypeEP = ColumnBinningPolicy; void processMixepDF(resoColDFs& collisions, resoTrackDFs const& tracks) { if (doprocessMix || doprocessMixDF)