Skip to content

Commit

Permalink
[PWGCF] Add PID with ITS to STS (AliceO2Group#8441)
Browse files Browse the repository at this point in the history
Co-authored-by: ALICE Builder <[email protected]>
  • Loading branch information
njacazio and alibuild authored Nov 25, 2024
1 parent 3c4912d commit 1d45984
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 10 deletions.
32 changes: 32 additions & 0 deletions PWGCF/Femto3D/DataModel/singletrackselector.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<binning::nsigma_v1>(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<binning::nsigma_v1>(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<binning::nsigma_v1>(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<binning::nsigma_v1>(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<binning::nsigma_v1>(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); });
Expand Down Expand Up @@ -487,6 +507,18 @@ DECLARE_SOA_TABLE(SinglePIDEls, "AOD", "SINGLEPIDEL",
singletrackselector::StoredTPCNSigmaEl,
singletrackselector::TPCNSigmaEl<singletrackselector::StoredTPCNSigmaEl>);

DECLARE_SOA_TABLE(SinglePIDsITSPi, "AOD", "STSPIDITSPI",
singletrackselector::StoredITSNSigmaPi_v1,
singletrackselector::ITSNSigmaPi_v1<singletrackselector::StoredITSNSigmaPi_v1>);

DECLARE_SOA_TABLE(SinglePIDsITSKa, "AOD", "STSPIDITSKA",
singletrackselector::StoredITSNSigmaKa_v1,
singletrackselector::ITSNSigmaKa_v1<singletrackselector::StoredITSNSigmaKa_v1>);

DECLARE_SOA_TABLE(SinglePIDsITSPr, "AOD", "STSPIDITSPR",
singletrackselector::StoredITSNSigmaPr_v1,
singletrackselector::ITSNSigmaPr_v1<singletrackselector::StoredITSNSigmaPr_v1>);

namespace singletrackselector
{
DECLARE_SOA_COLUMN(PdgCode, pdgCode, int);
Expand Down
56 changes: 46 additions & 10 deletions PWGCF/Femto3D/TableProducer/singleTrackSelector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <Framework/AnalysisDataModel.h>

#include <vector>
#include <string>
#include <utility>

#include "EventFiltering/Zorro.h"
#include "EventFiltering/ZorroSummary.h"
Expand All @@ -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"
Expand Down Expand Up @@ -98,6 +101,9 @@ struct singleTrackSelector {
Produces<o2::aod::SingleTrackSels> tableRow;
Produces<o2::aod::SingleTrkExtras> tableRowExtra;
Produces<o2::aod::SinglePIDEls> tableRowPIDEl;
Produces<o2::aod::SinglePIDsITSPi> tableRowPIDITSPi;
Produces<o2::aod::SinglePIDsITSKa> tableRowPIDITSKa;
Produces<o2::aod::SinglePIDsITSPr> tableRowPIDITSPr;
Produces<o2::aod::SingleTrkMCs> tableRowMC;

Filter eventFilter = (applyEvSel.node() == 0) ||
Expand Down Expand Up @@ -187,8 +193,8 @@ struct singleTrackSelector {
d_bz = 0.1 * d_bz;
}

template <bool isMC, typename Trks>
inline void fillTrackTables(Trks const& tracks)
template <bool isMC, typename TracksType>
inline void fillTrackTables(TracksType const& tracks)
{
bool skip_track = false; // flag used for track rejection

Expand Down Expand Up @@ -248,6 +254,9 @@ struct singleTrackSelector {
track.beta());

tableRowPIDEl(singletrackselector::packSymmetric<singletrackselector::binning::nsigma>(track.tpcNSigmaEl()));
tableRowPIDITSPi(singletrackselector::packSymmetric<singletrackselector::binning::nsigma>(track.itsNSigmaPi()));
tableRowPIDITSKa(singletrackselector::packSymmetric<singletrackselector::binning::nsigma>(track.itsNSigmaKa()));
tableRowPIDITSPr(singletrackselector::packSymmetric<singletrackselector::binning::nsigma>(track.itsNSigmaPr()));

if constexpr (isMC) {
int origin = -1;
Expand All @@ -274,8 +283,15 @@ struct singleTrackSelector {
}
}

void processDataRun2(soa::Filtered<CollRun2>::iterator const& collision, soa::Filtered<Trks> const& tracks, aod::BCsWithTimestamps const&)
void processDataRun2(soa::Filtered<CollRun2>::iterator const& collision,
soa::Filtered<Trks> const& tracks,
aod::BCsWithTimestamps const&)
{

auto tracksWithITSPid = soa::Attach<Trks,
aod::pidits::ITSNSigmaPi,
aod::pidits::ITSNSigmaKa,
aod::pidits::ITSNSigmaPr>(tracks);
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
initCCDB(bc);

Expand Down Expand Up @@ -304,13 +320,19 @@ struct singleTrackSelector {
collision.posZ(),
d_bz);

fillTrackTables<false>(tracks);
fillTrackTables<false>(tracksWithITSPid);
}
}
PROCESS_SWITCH(singleTrackSelector, processDataRun2, "process data Run2", false);

void processDataRun3(soa::Filtered<CollRun3>::iterator const& collision, soa::Filtered<Trks> const& tracks, aod::BCsWithTimestamps const&)
void processDataRun3(soa::Filtered<CollRun3>::iterator const& collision,
soa::Filtered<Trks> const& tracks,
aod::BCsWithTimestamps const&)
{
auto tracksWithITSPid = soa::Attach<Trks,
aod::pidits::ITSNSigmaPi,
aod::pidits::ITSNSigmaKa,
aod::pidits::ITSNSigmaPr>(tracks);
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
initCCDB(bc);

Expand Down Expand Up @@ -381,13 +403,20 @@ struct singleTrackSelector {
hadronicRate,
occupancy);

fillTrackTables<false>(tracks);
fillTrackTables<false>(tracksWithITSPid);
}
}
PROCESS_SWITCH(singleTrackSelector, processDataRun3, "process data Run3", true);

void processMCRun2(soa::Filtered<CollRun2>::iterator const& collision, soa::Filtered<soa::Join<Trks, aod::McTrackLabels>> const& tracks, aod::McParticles const&, aod::BCsWithTimestamps const&)
void processMCRun2(soa::Filtered<CollRun2>::iterator const& collision,
soa::Filtered<soa::Join<Trks, aod::McTrackLabels>> const& tracks,
aod::McParticles const&, aod::BCsWithTimestamps const&)
{

auto tracksWithITSPid = soa::Attach<soa::Join<Trks, aod::McTrackLabels>,
aod::pidits::ITSNSigmaPi,
aod::pidits::ITSNSigmaKa,
aod::pidits::ITSNSigmaPr>(tracks);
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
initCCDB(bc);

Expand Down Expand Up @@ -415,13 +444,20 @@ struct singleTrackSelector {
collision.posZ(),
d_bz);

fillTrackTables<true>(tracks);
fillTrackTables<true>(tracksWithITSPid);
}
}
PROCESS_SWITCH(singleTrackSelector, processMCRun2, "process MC Run2", false);

void processMCRun3(soa::Filtered<CollRun3MC>::iterator const& collision, aod::McCollisions const&, soa::Filtered<soa::Join<Trks, aod::McTrackLabels>> const& tracks, aod::McParticles const& mcParticles, aod::BCsWithTimestamps const&)
void processMCRun3(soa::Filtered<CollRun3MC>::iterator const& collision, aod::McCollisions const&,
soa::Filtered<soa::Join<Trks, aod::McTrackLabels>> const& tracks,
aod::McParticles const& mcParticles,
aod::BCsWithTimestamps const&)
{
auto tracksWithITSPid = soa::Attach<soa::Join<Trks, aod::McTrackLabels>,
aod::pidits::ITSNSigmaPi,
aod::pidits::ITSNSigmaKa,
aod::pidits::ITSNSigmaPr>(tracks);
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
initCCDB(bc);
double hadronicRate = 0.;
Expand Down Expand Up @@ -483,7 +519,7 @@ struct singleTrackSelector {
hadronicRate,
occupancy);

fillTrackTables<true>(tracks);
fillTrackTables<true>(tracksWithITSPid);

if (!enable_gen_info) {
return;
Expand Down

0 comments on commit 1d45984

Please sign in to comment.