@@ -273,6 +273,7 @@ struct HadNucleiFemto {
273273 // Candidate topology and kinematics
274274 {" hTrackSel" , " Accepted hadron tracks" , {HistType::kTH1F , {{Selections::kAll , -0.5 , static_cast <double >(Selections::kAll ) - 0.5 }}}},
275275 {" hTrackSelDe" , " Accepted deuteron tracks" , {HistType::kTH1F , {{Selections::kAll , -0.5 , static_cast <double >(Selections::kAll ) - 0.5 }}}},
276+ {" hDePairFlow" , " Deuteron pair-building flow;step;counts" , {HistType::kTH1F , {{3 , -0.5 , 2.5 }}}},
276277
277278 {" hdcaxyNu" , " ;DCA_{xy} (cm)" , {HistType::kTH1F , {{200 , -1 .0f , 1 .0f }}}},
278279 {" hdcazNu" , " ;DCA_{z} (cm)" , {HistType::kTH1F , {{200 , -1 .0f , 1 .0f }}}},
@@ -577,12 +578,45 @@ struct HadNucleiFemto {
577578 template <typename Ttrack>
578579 bool selectTrackHadron (const Ttrack& candidate)
579580 {
581+ if (settingHadPDGCode.value == static_cast <int >(PDG_t::kProton )) {
582+ return selectTrackProton (candidate);
583+ }
580584 if (useReferencePionCuts ()) {
581585 return selectTrackPionReference (candidate);
582586 }
583587 return selectTrack (candidate);
584588 }
585589
590+ template <typename Ttrack>
591+ bool selectTrackProton (const Ttrack& candidate)
592+ {
593+ constexpr float protonEtaMax = 0 .8f ;
594+ constexpr int protonTPCNClsFoundMin = 90 ;
595+ constexpr int protonTPCCrossedRowsMin = 80 ;
596+ constexpr float protonDCAzMax = 0 .2f ;
597+
598+ if (std::abs (candidate.eta ()) >= protonEtaMax) {
599+ return false ;
600+ }
601+
602+ const float absPt = std::abs (candidate.pt ());
603+ if (absPt <= 0 .f ) {
604+ return false ;
605+ }
606+
607+ if (candidate.tpcNClsFound () <= protonTPCNClsFoundMin ||
608+ candidate.tpcNClsCrossedRows () <= protonTPCCrossedRowsMin) {
609+ return false ;
610+ }
611+
612+ const float prDCAxyMax = 105 .e -3f + 30 .5e-3f / std::pow (absPt, 1 .1f );
613+ if (std::abs (candidate.dcaXY ()) >= prDCAxyMax || std::abs (candidate.dcaZ ()) >= protonDCAzMax) {
614+ return false ;
615+ }
616+
617+ return true ;
618+ }
619+
586620 template <typename Ttrack>
587621 bool selectTrackDe (const Ttrack& candidate)
588622 {
@@ -690,6 +724,51 @@ struct HadNucleiFemto {
690724 return isRejected;
691725 }
692726
727+ template <typename Ttrack>
728+ bool selectionPIDProton (const Ttrack& candidate)
729+ {
730+ constexpr float protonPtMin = 0 .5f ;
731+ constexpr float protonPtMax = 3 .0f ;
732+ constexpr float protonPCombMin = 0 .75f ;
733+ constexpr float protonTPCNsigmaMax = 3 .0f ;
734+ constexpr float protonCombNsigmaMax = 3 .0f ;
735+
736+ const float tpcNSigmaPr = candidate.tpcNSigmaPr ();
737+ mQaRegistry .fill (HIST (" h2NsigmaHadTPC_preselection" ), candidate.sign () * candidate.tpcInnerParam (), tpcNSigmaPr);
738+
739+ if (std::abs (candidate.pt ()) <= protonPtMin || std::abs (candidate.pt ()) >= protonPtMax) {
740+ return false ;
741+ }
742+
743+ const float absPin = std::abs (candidate.tpcInnerParam ());
744+ if (absPin < protonPCombMin) {
745+ if (std::abs (tpcNSigmaPr) > protonTPCNsigmaMax) {
746+ return false ;
747+ }
748+ mQaRegistry .fill (HIST (" h2NsigmaHadTPC" ), candidate.sign () * candidate.pt (), tpcNSigmaPr);
749+ mQaRegistry .fill (HIST (" h2dEdxHadcandidates" ), candidate.sign () * candidate.tpcInnerParam (), candidate.tpcSignal ());
750+ return true ;
751+ }
752+
753+ if (!candidate.hasTOF ()) {
754+ return false ;
755+ }
756+
757+ const float tofNSigmaPr = candidate.tofNSigmaPr ();
758+ const float combNsigma = std::sqrt (tpcNSigmaPr * tpcNSigmaPr + tofNSigmaPr * tofNSigmaPr);
759+ mQaRegistry .fill (HIST (" h2NsigmaHadTOF_preselection" ), candidate.sign () * candidate.pt (), tofNSigmaPr);
760+ mQaRegistry .fill (HIST (" h2NsigmaHadComb_preselection" ), candidate.sign () * candidate.pt (), combNsigma);
761+ if (combNsigma > protonCombNsigmaMax) {
762+ return false ;
763+ }
764+
765+ mQaRegistry .fill (HIST (" h2NsigmaHadTPC" ), candidate.sign () * candidate.pt (), tpcNSigmaPr);
766+ mQaRegistry .fill (HIST (" h2NsigmaHadTOF" ), candidate.sign () * candidate.pt (), tofNSigmaPr);
767+ mQaRegistry .fill (HIST (" h2NsigmaHadComb" ), candidate.sign () * candidate.pt (), combNsigma);
768+ mQaRegistry .fill (HIST (" h2dEdxHadcandidates" ), candidate.sign () * candidate.tpcInnerParam (), candidate.tpcSignal ());
769+ return true ;
770+ }
771+
693772 template <typename Ttrack>
694773 bool selectionPIDKaon (const Ttrack& candidate)
695774 {
@@ -840,12 +919,30 @@ struct HadNucleiFemto {
840919 } else if (settingHadPDGCode == PDG_t::kKPlus ) {
841920 PID = selectionPIDKaon (candidate);
842921 MassHad = o2::constants::physics::MassKPlus;
922+ } else if (settingHadPDGCode == PDG_t::kProton ) {
923+ PID = selectionPIDProton (candidate);
924+ MassHad = o2::constants::physics::MassProton;
843925 } else {
844926 LOG (info) << " invalid PDG code" ;
845927 }
846928 return PID ;
847929 }
848930
931+ template <typename Ttrack>
932+ float getHadronTPCNSigma (const Ttrack& candidate) const
933+ {
934+ if (settingHadPDGCode.value == static_cast <int >(PDG_t::kPiPlus )) {
935+ return candidate.tpcNSigmaPi ();
936+ }
937+ if (settingHadPDGCode.value == static_cast <int >(PDG_t::kKPlus )) {
938+ return candidate.tpcNSigmaKa ();
939+ }
940+ if (settingHadPDGCode.value == static_cast <int >(PDG_t::kProton )) {
941+ return candidate.tpcNSigmaPr ();
942+ }
943+ return -10 .f ;
944+ }
945+
849946 template <typename Ttrack>
850947 float computeNSigmaDe (const Ttrack& candidate)
851948 {
@@ -1018,7 +1115,7 @@ struct HadNucleiFemto {
10181115
10191116 hadNucand.nTPCClustersNu = trackDe.tpcNClsFound ();
10201117 hadNucand.nSigmaNu = computeNSigmaDe (trackDe);
1021- // hadNucand.nSigmaHad = trackHad.tpcNSigmaPi( );
1118+ hadNucand.nSigmaHad = getHadronTPCNSigma (trackHad );
10221119
10231120 hadNucand.chi2TPCNu = trackDe.tpcChi2NCl ();
10241121 hadNucand.chi2TPCHad = trackHad.tpcChi2NCl ();
@@ -1104,7 +1201,7 @@ struct HadNucleiFemto {
11041201 hadHypercand.tpcSignalHad = trackHad.tpcSignal ();
11051202 hadHypercand.tpcSignalNu = V0Hyper.tpcSignalHe ();
11061203 hadHypercand.momHadTPC = trackHad.tpcInnerParam ();
1107- hadHypercand.nSigmaHad = trackHad. tpcNSigmaPi ( );
1204+ hadHypercand.nSigmaHad = getHadronTPCNSigma (trackHad );
11081205 hadHypercand.nSigmaNu = V0Hyper.nSigmaHe ();
11091206 hadHypercand.chi2TPCHad = trackHad.tpcChi2NCl ();
11101207 hadHypercand.chi2TPCNu = V0Hyper.tpcChi2He ();
@@ -1146,6 +1243,10 @@ struct HadNucleiFemto {
11461243 mQaRegistry .fill (HIST (" hTrackSel" ), Selections::kPID );
11471244 mQaRegistry .fill (HIST (" hSingleNuPt" ), track0.pt () * track0.sign ());
11481245 mQaRegistry .fill (HIST (" hSingleNuPin" ), track0.tpcInnerParam () * track0.sign ());
1246+ mQaRegistry .fill (HIST (" hDePairFlow" ), 0 );
1247+
1248+ bool hasHadronSelected = false ;
1249+ bool hasStoredPair = false ;
11491250
11501251 for (const auto & track1 : tracks) {
11511252 if (track0 == track1) {
@@ -1164,6 +1265,7 @@ struct HadNucleiFemto {
11641265 if (!selectTrackHadron (track1) || !selectionPIDHadron (track1)) {
11651266 continue ;
11661267 }
1268+ hasHadronSelected = true ;
11671269 if (isClosePair (track0, track1)) {
11681270 continue ;
11691271 }
@@ -1175,6 +1277,14 @@ struct HadNucleiFemto {
11751277 CollBracket collBracket{collIdx, collIdx};
11761278 trackPair.collBracket = collBracket;
11771279 mTrackPairs .push_back (trackPair);
1280+ hasStoredPair = true ;
1281+ }
1282+
1283+ if (hasHadronSelected) {
1284+ mQaRegistry .fill (HIST (" hDePairFlow" ), 1 );
1285+ }
1286+ if (hasStoredPair) {
1287+ mQaRegistry .fill (HIST (" hDePairFlow" ), 2 );
11781288 }
11791289 }
11801290 }
@@ -1628,6 +1738,16 @@ PROCESS_SWITCH(HadNucleiFemto, processMixedEventHyper, "Process Mixed event", fa
16281738 mQaRegistry .fill (HIST (" purity/h2NsigmaHadTOF_preselection" ), track.sign () * track.pt (), tofNSigmaHad);
16291739 mQaRegistry .fill (HIST (" purity/h2NsigmaHadComb_preselection" ), track.sign () * track.pt (), combNsigmaHad);
16301740 }
1741+ } else if (passTrackHad && settingHadPDGCode == PDG_t::kProton ) {
1742+ constexpr float protonPCombMin = 0 .75f ;
1743+ const float tpcNSigmaHad = track.tpcNSigmaPr ();
1744+ mQaRegistry .fill (HIST (" purity/h2NsigmaHadTPC_preselection" ), track.sign () * track.pt (), tpcNSigmaHad);
1745+ if (track.hasTOF () && std::abs (track.tpcInnerParam ()) >= protonPCombMin) {
1746+ const float tofNSigmaHad = track.tofNSigmaPr ();
1747+ const float combNsigmaHad = std::sqrt (tofNSigmaHad * tofNSigmaHad + tpcNSigmaHad * tpcNSigmaHad);
1748+ mQaRegistry .fill (HIST (" purity/h2NsigmaHadTOF_preselection" ), track.sign () * track.pt (), tofNSigmaHad);
1749+ mQaRegistry .fill (HIST (" purity/h2NsigmaHadComb_preselection" ), track.sign () * track.pt (), combNsigmaHad);
1750+ }
16311751 }
16321752
16331753 if (passTrackDe) {
0 commit comments