@@ -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