Skip to content

Commit 6cf8e4a

Browse files
committed
Added different running mode + reworked assoc particle selection
1 parent 090227f commit 6cf8e4a

File tree

3 files changed

+327
-36
lines changed

3 files changed

+327
-36
lines changed

PWGLF/DataModel/LFPhiStrangeCorrelationTables.h

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,18 @@ DECLARE_SOA_COLUMN(NSigmaTOF, nSigmaTOF, float);
148148
DECLARE_SOA_COLUMN(Pt, pt, float);
149149
DECLARE_SOA_COLUMN(Y, y, float);
150150
DECLARE_SOA_COLUMN(Phi, phi, float);
151+
DECLARE_SOA_COLUMN(HasTOF, hasTOF, bool);
152+
153+
DECLARE_SOA_DYNAMIC_COLUMN(InNSigmaRegion, inNSigmaRegion,
154+
[](float nSigmaTPC, float pt, bool hasTOF, float nSigmaTOF, float pidTPCMax, float tofPIDThreshold, float pidTOFMax) -> bool {
155+
if (std::abs(nSigmaTPC) >= pidTPCMax) {
156+
return false; // TPC check failed
157+
}
158+
if (pt >= tofPIDThreshold && hasTOF && std::abs(nSigmaTOF) >= pidTOFMax) {
159+
return false; // TOF check failed
160+
}
161+
return true;
162+
});
151163
} // namespace lf_selection_pion_track
152164

153165
DECLARE_SOA_TABLE(PionTracksData, "AOD", "PITRACKSDATA",
@@ -157,7 +169,10 @@ DECLARE_SOA_TABLE(PionTracksData, "AOD", "PITRACKSDATA",
157169
lf_selection_pion_track::NSigmaTOF,
158170
lf_selection_pion_track::Pt,
159171
lf_selection_pion_track::Y,
160-
lf_selection_pion_track::Phi);
172+
lf_selection_pion_track::Phi,
173+
lf_selection_pion_track::HasTOF,
174+
lf_selection_pion_track::InNSigmaRegion<lf_selection_pion_track::NSigmaTPC, lf_selection_pion_track::Pt,
175+
lf_selection_pion_track::HasTOF, lf_selection_pion_track::NSigmaTOF>);
161176

162177
DECLARE_SOA_TABLE(PionTracksMcReco, "AOD", "PITRACKSMCRECO",
163178
soa::Index<>,
@@ -166,7 +181,10 @@ DECLARE_SOA_TABLE(PionTracksMcReco, "AOD", "PITRACKSMCRECO",
166181
lf_selection_pion_track::NSigmaTOF,
167182
lf_selection_pion_track::Pt,
168183
lf_selection_pion_track::Y,
169-
lf_selection_pion_track::Phi);
184+
lf_selection_pion_track::Phi,
185+
lf_selection_pion_track::HasTOF,
186+
lf_selection_pion_track::InNSigmaRegion<lf_selection_pion_track::NSigmaTPC, lf_selection_pion_track::Pt,
187+
lf_selection_pion_track::HasTOF, lf_selection_pion_track::NSigmaTOF>);
170188
} // namespace o2::aod
171189

172190
#endif // PWGLF_DATAMODEL_LFPHISTRANGECORRELATIONTABLES_H_

PWGLF/TableProducer/Strangeness/phiStrangeCorrelator.cxx

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,9 @@ struct K0sReducedCandProducer {
419419
{
420420
AxisSpec binnedmultAxis{(std::vector<double>)binsMult, "centFT0M"};
421421
AxisSpec binnedpTK0SAxis{(std::vector<double>)binspTK0S, "#it{p}_{T} (GeV/#it{c})"};
422-
AxisSpec massK0sAxis = {200, 0.4f, 0.6f, "#it{M}_{inv} [GeV/#it{c}^{2}]"};
422+
AxisSpec massK0SAxis = {200, 0.45f, 0.55f, "#it{M}_{inv} [GeV/#it{c}^{2}]"};
423423

424-
histos.add("h3K0sCandidatesMass", "K^{0}_{S} candidate invariant mass", kTH3F, {binnedmultAxis, binnedpTK0SAxis, massK0sAxis});
424+
histos.add("h3K0sCandidatesMass", "K^{0}_{S} candidate invariant mass", kTH3F, {binnedmultAxis, binnedpTK0SAxis, massK0SAxis});
425425
}
426426

427427
// Single track selection for strangeness sector
@@ -527,7 +527,7 @@ struct PionTrackProducer {
527527
HistogramRegistry histos{"pionTracks", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
528528

529529
// Configurable for analysis mode
530-
Configurable<int> analysisMode{"analysisMode", 1, "Analysis mode: 0 - old method with online normalization, 1 - new method with correlations"};
530+
// Configurable<int> analysisMode{"analysisMode", 1, "Analysis mode: 0 - old method with online normalization, 1 - new method with correlations"};
531531

532532
// Configurable on multiplicity bins
533533
Configurable<std::vector<double>> binsMult{"binsMult", {0.0, 1.0, 5.0, 10.0, 15.0, 20.0, 30.0, 40.0, 50.0, 70.0, 100.0}, "Multiplicity bin limits"};
@@ -547,11 +547,11 @@ struct PionTrackProducer {
547547
Configurable<int> minTPCnClsFound{"minTPCnClsFound", 70, "min number of found TPC clusters"};
548548
Configurable<int> minITSnCls{"minITSnCls", 4, "min number of ITS clusters"};
549549

550-
Configurable<bool> forceTOF{"forceTOF", false, "force the TOF signal for the PID"};
550+
// Configurable<bool> forceTOF{"forceTOF", false, "force the TOF signal for the PID"};
551551
Configurable<float> tofPIDThreshold{"tofPIDThreshold", 0.5, "minimum pT after which TOF PID is applicable"};
552-
Configurable<std::vector<int>> trkPIDspecies{"trkPIDspecies", std::vector<int>{o2::track::PID::Pion, o2::track::PID::Kaon, o2::track::PID::Proton}, "Trk sel: Particles species for PID, proton, pion, kaon"};
553-
Configurable<std::vector<float>> pidTPCMax{"pidTPCMax", std::vector<float>{2.0f, 2.0f, 2.0f}, "maximum nSigma TPC"};
554-
Configurable<std::vector<float>> pidTOFMax{"pidTOFMax", std::vector<float>{2.0f, 2.0f, 2.0f}, "maximum nSigma TOF"};
552+
Configurable<std::vector<int>> trkPIDspecies{"trkPIDspecies", std::vector<int>{o2::track::PID::Kaon, o2::track::PID::Proton}, "Trk sel: Particles species for PID rejection, kaon, proton"};
553+
Configurable<std::vector<float>> pidTPCMax{"pidTPCMax", std::vector<float>{2.0f, 2.0f}, "maximum nSigma TPC"};
554+
Configurable<std::vector<float>> pidTOFMax{"pidTOFMax", std::vector<float>{2.0f, 2.0f}, "maximum nSigma TOF"};
555555

556556
Configurable<float> cfgYAcceptance{"cfgYAcceptance", 0.5f, "Rapidity acceptance"};
557557
} trackConfigs;
@@ -590,7 +590,7 @@ struct PionTrackProducer {
590590
histos.add("h2RecMCDCAxySecMaterialPi", "Dcaxy distribution vs pt for Secondary Pions from Material", kTH2F, {binnedpTPiAxis, {2000, -0.05, 0.05, "DCA_{xy} (cm)"}});
591591
}
592592

593-
// PID selection for Pions
593+
/*// PID selection for Pions
594594
template <typename T>
595595
bool pidSelectionPion(const T& track)
596596
{
@@ -626,6 +626,29 @@ struct PionTrackProducer {
626626
}
627627
}
628628
629+
return true;
630+
}*/
631+
632+
// PID Hypotheses rejection for Pions
633+
template <typename T>
634+
bool pidHypothesesRejection(const T& track)
635+
{
636+
for (size_t speciesIndex = 0; speciesIndex < trackConfigs.trkPIDspecies->size(); ++speciesIndex) {
637+
auto const& pid = trackConfigs.trkPIDspecies->at(speciesIndex);
638+
auto nSigmaTPC = aod::pidutils::tpcNSigma(pid, track);
639+
640+
if (std::abs(nSigmaTPC) < trackConfigs.pidTPCMax->at(speciesIndex)) { // Check TPC nSigma first
641+
if (track.hasTOF()) {
642+
auto nSigmaTOF = aod::pidutils::tofNSigma(pid, track);
643+
if (std::abs(nSigmaTOF) < trackConfigs.pidTOFMax->at(speciesIndex)) {
644+
return false; // Reject if both TPC and TOF are within thresholds
645+
}
646+
} else {
647+
return false; // Reject if only TPC is within threshold and TOF is unavailable
648+
}
649+
}
650+
}
651+
629652
return true;
630653
}
631654

@@ -657,7 +680,10 @@ struct PionTrackProducer {
657680
if (trackConfigs.cfgIsTOFChecked && track.pt() >= trackConfigs.tofPIDThreshold && !track.hasTOF())
658681
return false;
659682

660-
if (analysisMode == 1 && !pidSelectionPion(track))
683+
/*if (analysisMode == 1 && !pidSelectionPion(track))
684+
return false;*/
685+
686+
if (!pidHypothesesRejection(track))
661687
return false;
662688

663689
/*
@@ -685,7 +711,7 @@ struct PionTrackProducer {
685711
histos.fill(HIST("h3PionTPCnSigma"), collision.centFT0M(), track.pt(), track.tpcNSigmaPi());
686712
histos.fill(HIST("h3PionTOFnSigma"), collision.centFT0M(), track.pt(), track.tofNSigmaPi());
687713

688-
pionTracksData(collision.globalIndex(), track.tpcNSigmaPi(), track.tofNSigmaPi(), track.pt(), track.rapidity(massPi), track.phi());
714+
pionTracksData(collision.globalIndex(), track.tpcNSigmaPi(), track.tofNSigmaPi(), track.pt(), track.rapidity(massPi), track.phi(), track.hasTOF());
689715
}
690716
}
691717

@@ -715,7 +741,7 @@ struct PionTrackProducer {
715741
continue;
716742
}
717743

718-
pionTracksMcReco(collision.globalIndex(), track.tpcNSigmaPi(), track.tofNSigmaPi(), track.pt(), track.rapidity(massPi), track.phi());
744+
pionTracksMcReco(collision.globalIndex(), track.tpcNSigmaPi(), track.tofNSigmaPi(), track.pt(), track.rapidity(massPi), track.phi(), track.hasTOF());
719745
}
720746
}
721747

0 commit comments

Comments
 (0)