Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PWGHF/HFC/DataModel/CorrelationTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ DECLARE_SOA_COLUMN(PiNsigmTPC, piNsigmTPC, float); //! Associated Par
DECLARE_SOA_COLUMN(PrNsigmTOF, prNsigmTOF, float); //! Associated Particle TOF nSigma Proton
DECLARE_SOA_COLUMN(KaNsigmTOF, kaNsigmTOF, float); //! Associated Particle TOF nSigma Kaon
DECLARE_SOA_COLUMN(PiNsigmTOF, piNsigmTOF, float); //! Associated Particle TOF nSigma Pion
DECLARE_SOA_COLUMN(ChargeLc, chargeLc, int8_t); //! Associated Particle TOF nSigma Pion
DECLARE_SOA_COLUMN(ChargeTrk, chargeTrk, int8_t); //! Associated Particle TOF nSigma Pion
DECLARE_SOA_COLUMN(ChargeLc, chargeLc, int8_t); //! Associated Particle TOF nSigma Pion
DECLARE_SOA_COLUMN(ChargeTrk, chargeTrk, int8_t); //! Associated Particle TOF nSigma Pion
} // namespace hf_correlation_lc_hadron

DECLARE_SOA_TABLE(LcHadronPair, "AOD", "LCHPAIR", //! Lc-Hadrons pairs Informations
Expand Down
75 changes: 38 additions & 37 deletions PWGHF/HFC/Utils/utilsCorrelations.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,50 +41,51 @@ Region getRegion(T const deltaPhi)
return Transverse;
}
}
//apply PID selection on associated tracks
// apply PID selection on associated tracks
template <typename Atrack, typename SpeciesContainer, typename T1, typename T2>
bool passPIDSelection(Atrack const& track, SpeciesContainer const& mPIDspecies,
T1 const maxTPC, T2 const maxTOF, double ptThreshold = 0.75) {
size_t speciesIndex = 0;
bool passPIDSelection(Atrack const& track, SpeciesContainer const& mPIDspecies,
T1 const maxTPC, T2 const maxTOF, double ptThreshold = 0.75)
{
size_t speciesIndex = 0;

// Ensure size consistency
if (mPIDspecies.size() != maxTPC.value.size() || mPIDspecies.size() != maxTOF.value.size()) {
LOGF(error, "Size of particle species and corresponding nSigma selection array should be same");
}
// Ensure size consistency
if (mPIDspecies.size() != maxTPC.value.size() || mPIDspecies.size() != maxTOF.value.size()) {
LOGF(error, "Size of particle species and corresponding nSigma selection array should be same");
}

for (auto const& pid : mPIDspecies) {
auto nSigmaTPC = o2::aod::pidutils::tpcNSigma(pid, track);
if (std::abs(nSigmaTPC) > maxTPC->at(speciesIndex)) {
return false;
}
for (auto const& pid : mPIDspecies) {
auto nSigmaTPC = o2::aod::pidutils::tpcNSigma(pid, track);
if (std::abs(nSigmaTPC) > maxTPC->at(speciesIndex)) {
return false;
}

if (track.pt() > ptThreshold && track.hasTOF()) {
auto nSigmaTOF = o2::aod::pidutils::tofNSigma(pid, track);
if (std::abs(nSigmaTOF) > maxTOF->at(speciesIndex)) {
return false;
}
}
//std::cout<<"species "<<pid<<" number i "<<speciesIndex<<" tpcSigmaMax "<<maxTPC->at(speciesIndex)<<" tofSigmaMax "<<maxTOF->at(speciesIndex)<<std::endl;
//std::cout<<"proton nSigma TPC "<<track.tpcNSigmaPr()<<" "<<nSigmaTPC<<" tof "<<track.tofNSigmaPr()<<std::endl;
++speciesIndex;
if (track.pt() > ptThreshold && track.hasTOF()) {
auto nSigmaTOF = o2::aod::pidutils::tofNSigma(pid, track);
if (std::abs(nSigmaTOF) > maxTOF->at(speciesIndex)) {
return false;
}
}
return true;
// std::cout<<"species "<<pid<<" number i "<<speciesIndex<<" tpcSigmaMax "<<maxTPC->at(speciesIndex)<<" tofSigmaMax "<<maxTOF->at(speciesIndex)<<std::endl;
// std::cout<<"proton nSigma TPC "<<track.tpcNSigmaPr()<<" "<<nSigmaTPC<<" tof "<<track.tofNSigmaPr()<<std::endl;
++speciesIndex;
}
return true;
}

//template <typename Atrack, typename species, typename T1, typename T2>
//void passPIDSelction(Atrack const& track, species const mPIDspecies, T1 const maxTPC, T2 maxTOF){
// int iSpecie =0;
// for (auto pid : mPIDspecies){
// auto nSigmaTPC = o2::aod::pidutils::tpcNSigma(pid, track);
// auto nSigmaTOF = o2::aod::pidutils::tofNSigma(pid, track);
// if(std::abs(nSigmaTPC) > maxTPC->at(iSpecie)) continue;
// if(track.pt() > 0.75 && track.hasTOF()){
// if(std::abs(nSigmaTOF) > maxTOF->at(iSpecie)) continue;
// }
// iSpecie++;
// }
//}
// ========= Find Leading Particle ==============
// template <typename Atrack, typename species, typename T1, typename T2>
// void passPIDSelction(Atrack const& track, species const mPIDspecies, T1 const maxTPC, T2 maxTOF){
// int iSpecie =0;
// for (auto pid : mPIDspecies){
// auto nSigmaTPC = o2::aod::pidutils::tpcNSigma(pid, track);
// auto nSigmaTOF = o2::aod::pidutils::tofNSigma(pid, track);
// if(std::abs(nSigmaTPC) > maxTPC->at(iSpecie)) continue;
// if(track.pt() > 0.75 && track.hasTOF()){
// if(std::abs(nSigmaTOF) > maxTOF->at(iSpecie)) continue;
// }
// iSpecie++;
// }
// }
// ========= Find Leading Particle ==============
template <typename TTracks, typename T1, typename T2, typename T3>
int findLeadingParticle(TTracks const& tracks, T1 const dcaXYTrackMax, T2 const dcaZTrackMax, T3 const etaTrackMax)
{
Expand Down
Loading