From 1d45984dd2466e09d5c275c27c3ca451e5f319e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 25 Nov 2024 10:46:05 +0100 Subject: [PATCH] [PWGCF] Add PID with ITS to STS (#8441) Co-authored-by: ALICE Builder --- PWGCF/Femto3D/DataModel/singletrackselector.h | 32 +++++++++++ .../TableProducer/singleTrackSelector.cxx | 56 +++++++++++++++---- 2 files changed, 78 insertions(+), 10 deletions(-) diff --git a/PWGCF/Femto3D/DataModel/singletrackselector.h b/PWGCF/Femto3D/DataModel/singletrackselector.h index afb4fc3f615..a49293f1b7a 100644 --- a/PWGCF/Femto3D/DataModel/singletrackselector.h +++ b/PWGCF/Femto3D/DataModel/singletrackselector.h @@ -208,15 +208,35 @@ DECLARE_SOA_COLUMN(StoredTPCNSigmaHe, storedTpcNSigmaHe, binning::nsigma::binned DECLARE_SOA_COLUMN(StoredTOFNSigmaPi_v1, storedTofNSigmaPi_v1, binning::nsigma::binned_t); // (v1) DECLARE_SOA_COLUMN(StoredTPCNSigmaPi_v1, storedTpcNSigmaPi_v1, binning::nsigma::binned_t); // (v1) + DECLARE_SOA_COLUMN(StoredTOFNSigmaKa_v1, storedTofNSigmaKa_v1, binning::nsigma::binned_t); // (v1) DECLARE_SOA_COLUMN(StoredTPCNSigmaKa_v1, storedTpcNSigmaKa_v1, binning::nsigma::binned_t); // (v1) + DECLARE_SOA_COLUMN(StoredTOFNSigmaPr_v1, storedTofNSigmaPr_v1, binning::nsigma::binned_t); // (v1) DECLARE_SOA_COLUMN(StoredTPCNSigmaPr_v1, storedTpcNSigmaPr_v1, binning::nsigma::binned_t); // (v1) + DECLARE_SOA_COLUMN(StoredTOFNSigmaDe_v1, storedTofNSigmaDe_v1, binning::nsigma::binned_t); // (v1) DECLARE_SOA_COLUMN(StoredTPCNSigmaDe_v1, storedTpcNSigmaDe_v1, binning::nsigma::binned_t); // (v1) + DECLARE_SOA_COLUMN(StoredTOFNSigmaHe_v1, storedTofNSigmaHe_v1, binning::nsigma::binned_t); // (v1) DECLARE_SOA_COLUMN(StoredTPCNSigmaHe_v1, storedTpcNSigmaHe_v1, binning::nsigma::binned_t); // (v1) +DECLARE_SOA_COLUMN(StoredITSNSigmaPi_v1, storedItsNSigmaPi_v1, binning::nsigma::binned_t); // (v1) +DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaPi_v1, itsNSigmaPi, + [](binning::nsigma_v1::binned_t nsigma_binned) -> float { return singletrackselector::unPackSymmetric(nsigma_binned); }); +DECLARE_SOA_COLUMN(StoredITSNSigmaKa_v1, storedItsNSigmaKa_v1, binning::nsigma::binned_t); // (v1) +DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaKa_v1, itsNSigmaKa, + [](binning::nsigma_v1::binned_t nsigma_binned) -> float { return singletrackselector::unPackSymmetric(nsigma_binned); }); +DECLARE_SOA_COLUMN(StoredITSNSigmaPr_v1, storedItsNSigmaPr_v1, binning::nsigma::binned_t); // (v1) +DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaPr_v1, itsNSigmaPr, + [](binning::nsigma_v1::binned_t nsigma_binned) -> float { return singletrackselector::unPackSymmetric(nsigma_binned); }); +DECLARE_SOA_COLUMN(StoredITSNSigmaDe_v1, storedItsNSigmaDe_v1, binning::nsigma::binned_t); // (v1) +DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaDe_v1, itsNSigmaDe, + [](binning::nsigma_v1::binned_t nsigma_binned) -> float { return singletrackselector::unPackSymmetric(nsigma_binned); }); +DECLARE_SOA_COLUMN(StoredITSNSigmaHe_v1, storedItsNSigmaHe_v1, binning::nsigma::binned_t); // (v1) +DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaHe_v1, itsNSigmaHe, + [](binning::nsigma_v1::binned_t nsigma_binned) -> float { return singletrackselector::unPackSymmetric(nsigma_binned); }); + DECLARE_SOA_DYNAMIC_COLUMN(Energy, energy, [](float p, float mass) -> float { return sqrt(p * p + mass * mass); }); DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float p, float eta) -> float { return p / std::cosh(eta); }); DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float p, float eta, float phi) -> float { return (p / std::cosh(eta)) * std::sin(phi); }); @@ -487,6 +507,18 @@ DECLARE_SOA_TABLE(SinglePIDEls, "AOD", "SINGLEPIDEL", singletrackselector::StoredTPCNSigmaEl, singletrackselector::TPCNSigmaEl); +DECLARE_SOA_TABLE(SinglePIDsITSPi, "AOD", "STSPIDITSPI", + singletrackselector::StoredITSNSigmaPi_v1, + singletrackselector::ITSNSigmaPi_v1); + +DECLARE_SOA_TABLE(SinglePIDsITSKa, "AOD", "STSPIDITSKA", + singletrackselector::StoredITSNSigmaKa_v1, + singletrackselector::ITSNSigmaKa_v1); + +DECLARE_SOA_TABLE(SinglePIDsITSPr, "AOD", "STSPIDITSPR", + singletrackselector::StoredITSNSigmaPr_v1, + singletrackselector::ITSNSigmaPr_v1); + namespace singletrackselector { DECLARE_SOA_COLUMN(PdgCode, pdgCode, int); diff --git a/PWGCF/Femto3D/TableProducer/singleTrackSelector.cxx b/PWGCF/Femto3D/TableProducer/singleTrackSelector.cxx index 0bec4d3cf40..538daf6cbb2 100644 --- a/PWGCF/Femto3D/TableProducer/singleTrackSelector.cxx +++ b/PWGCF/Femto3D/TableProducer/singleTrackSelector.cxx @@ -17,6 +17,8 @@ #include #include +#include +#include #include "EventFiltering/Zorro.h" #include "EventFiltering/ZorroSummary.h" @@ -30,6 +32,7 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Centrality.h" +#include "Common/DataModel/PIDResponseITS.h" #include "Common/CCDB/ctpRateFetcher.h" #include "DetectorsBase/Propagator.h" @@ -98,6 +101,9 @@ struct singleTrackSelector { Produces tableRow; Produces tableRowExtra; Produces tableRowPIDEl; + Produces tableRowPIDITSPi; + Produces tableRowPIDITSKa; + Produces tableRowPIDITSPr; Produces tableRowMC; Filter eventFilter = (applyEvSel.node() == 0) || @@ -187,8 +193,8 @@ struct singleTrackSelector { d_bz = 0.1 * d_bz; } - template - inline void fillTrackTables(Trks const& tracks) + template + inline void fillTrackTables(TracksType const& tracks) { bool skip_track = false; // flag used for track rejection @@ -248,6 +254,9 @@ struct singleTrackSelector { track.beta()); tableRowPIDEl(singletrackselector::packSymmetric(track.tpcNSigmaEl())); + tableRowPIDITSPi(singletrackselector::packSymmetric(track.itsNSigmaPi())); + tableRowPIDITSKa(singletrackselector::packSymmetric(track.itsNSigmaKa())); + tableRowPIDITSPr(singletrackselector::packSymmetric(track.itsNSigmaPr())); if constexpr (isMC) { int origin = -1; @@ -274,8 +283,15 @@ struct singleTrackSelector { } } - void processDataRun2(soa::Filtered::iterator const& collision, soa::Filtered const& tracks, aod::BCsWithTimestamps const&) + void processDataRun2(soa::Filtered::iterator const& collision, + soa::Filtered const& tracks, + aod::BCsWithTimestamps const&) { + + auto tracksWithITSPid = soa::Attach(tracks); auto bc = collision.bc_as(); initCCDB(bc); @@ -304,13 +320,19 @@ struct singleTrackSelector { collision.posZ(), d_bz); - fillTrackTables(tracks); + fillTrackTables(tracksWithITSPid); } } PROCESS_SWITCH(singleTrackSelector, processDataRun2, "process data Run2", false); - void processDataRun3(soa::Filtered::iterator const& collision, soa::Filtered const& tracks, aod::BCsWithTimestamps const&) + void processDataRun3(soa::Filtered::iterator const& collision, + soa::Filtered const& tracks, + aod::BCsWithTimestamps const&) { + auto tracksWithITSPid = soa::Attach(tracks); auto bc = collision.bc_as(); initCCDB(bc); @@ -381,13 +403,20 @@ struct singleTrackSelector { hadronicRate, occupancy); - fillTrackTables(tracks); + fillTrackTables(tracksWithITSPid); } } PROCESS_SWITCH(singleTrackSelector, processDataRun3, "process data Run3", true); - void processMCRun2(soa::Filtered::iterator const& collision, soa::Filtered> const& tracks, aod::McParticles const&, aod::BCsWithTimestamps const&) + void processMCRun2(soa::Filtered::iterator const& collision, + soa::Filtered> const& tracks, + aod::McParticles const&, aod::BCsWithTimestamps const&) { + + auto tracksWithITSPid = soa::Attach, + aod::pidits::ITSNSigmaPi, + aod::pidits::ITSNSigmaKa, + aod::pidits::ITSNSigmaPr>(tracks); auto bc = collision.bc_as(); initCCDB(bc); @@ -415,13 +444,20 @@ struct singleTrackSelector { collision.posZ(), d_bz); - fillTrackTables(tracks); + fillTrackTables(tracksWithITSPid); } } PROCESS_SWITCH(singleTrackSelector, processMCRun2, "process MC Run2", false); - void processMCRun3(soa::Filtered::iterator const& collision, aod::McCollisions const&, soa::Filtered> const& tracks, aod::McParticles const& mcParticles, aod::BCsWithTimestamps const&) + void processMCRun3(soa::Filtered::iterator const& collision, aod::McCollisions const&, + soa::Filtered> const& tracks, + aod::McParticles const& mcParticles, + aod::BCsWithTimestamps const&) { + auto tracksWithITSPid = soa::Attach, + aod::pidits::ITSNSigmaPi, + aod::pidits::ITSNSigmaKa, + aod::pidits::ITSNSigmaPr>(tracks); auto bc = collision.bc_as(); initCCDB(bc); double hadronicRate = 0.; @@ -483,7 +519,7 @@ struct singleTrackSelector { hadronicRate, occupancy); - fillTrackTables(tracks); + fillTrackTables(tracksWithITSPid); if (!enable_gen_info) { return;