@@ -102,6 +102,7 @@ struct Filter2Prong {
102102 O2_DEFINE_CONFIGURABLE (cutTOFBeta, float , 0.5 , " TOF beta" );
103103 O2_DEFINE_CONFIGURABLE (confFakeKaonCut, float , 0.15 , " Cut based on track from momentum difference" );
104104 O2_DEFINE_CONFIGURABLE (removefaketrack, bool , true , " Flag to remove fake kaon" );
105+ O2_DEFINE_CONFIGURABLE (applyTOF, bool , false , " Flag for applying TOF" );
105106 } grpPhi;
106107
107108 HfHelper hfHelper;
@@ -432,6 +433,79 @@ struct Filter2Prong {
432433 return false ;
433434 }
434435
436+ template <typename T>
437+ bool selectionPID2 (const T& candidate)
438+ {
439+ double nsigmaTPC = candidate.tpcNSigmaKa ();
440+ double nsigmaTOF = candidate.tofNSigmaKa ();
441+
442+ if (grpPhi.applyTOF ) {
443+ if (!candidate.hasTOF () && TMath::Abs (nsigmaTPC) < grpPhi.nsigmaCutTPC ) {
444+ return true ;
445+ }
446+ if (candidate.p () > 0.5 && candidate.hasTOF () && TMath::Abs (nsigmaTPC) < grpPhi.nsigmaCutTPC ) {
447+ if (candidate.p () > 0.5 && candidate.p () < 1.6 && candidate.beta () > grpPhi.cutTOFBeta && nsigmaTOF > -5.0 && nsigmaTOF < 10.0 ) {
448+ return true ;
449+ }
450+ if (candidate.p () >= 1.6 && candidate.p () < 2.0 && candidate.beta () > grpPhi.cutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 10.0 ) {
451+ return true ;
452+ }
453+ if (candidate.p () >= 2.0 && candidate.p () < 2.5 && candidate.beta () > grpPhi.cutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 6.0 ) {
454+ return true ;
455+ }
456+ if (candidate.p () >= 2.5 && candidate.p () < 4.0 && candidate.beta () > grpPhi.cutTOFBeta && nsigmaTOF > -2.5 && nsigmaTOF < 4.0 ) {
457+ return true ;
458+ }
459+ if (candidate.p () >= 4.0 && candidate.p () < 5.0 && candidate.beta () > grpPhi.cutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 3.0 ) {
460+ return true ;
461+ }
462+ if (candidate.p () >= 5.0 && candidate.p () < 6.0 && candidate.beta () > grpPhi.cutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 2.5 ) {
463+ return true ;
464+ }
465+ if (candidate.p () >= 6.0 && candidate.beta () > grpPhi.cutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 3.0 ) {
466+ return true ;
467+ }
468+ }
469+ } else if (TMath::Abs (nsigmaTPC) < grpPhi.nsigmaCutTPC ) {
470+ return true ;
471+ }
472+ return false ;
473+ }
474+
475+ template <typename T>
476+ bool selectionPID3 (const T& candidate)
477+ {
478+ double nsigmaTPC = candidate.tpcNSigmaKa ();
479+ double nsigmaTOF = candidate.tofNSigmaKa ();
480+ if (candidate.p () < 0.7 && TMath::Abs (nsigmaTPC) < grpPhi.nsigmaCutTPC ) {
481+ return true ;
482+ }
483+ if (candidate.p () > 0.7 && candidate.hasTOF () && TMath::Abs (nsigmaTPC) < grpPhi.nsigmaCutTPC ) {
484+ if (candidate.p () > 0.7 && candidate.p () < 1.6 && candidate.beta () > grpPhi.cutTOFBeta && nsigmaTOF > -5.0 && nsigmaTOF < 10.0 ) {
485+ return true ;
486+ }
487+ if (candidate.p () >= 1.6 && candidate.p () < 2.0 && candidate.beta () > grpPhi.cutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 10.0 ) {
488+ return true ;
489+ }
490+ if (candidate.p () >= 2.0 && candidate.p () < 2.5 && candidate.beta () > grpPhi.cutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 6.0 ) {
491+ return true ;
492+ }
493+ if (candidate.p () >= 2.5 && candidate.p () < 4.0 && candidate.beta () > grpPhi.cutTOFBeta && nsigmaTOF > -2.5 && nsigmaTOF < 4.0 ) {
494+ return true ;
495+ }
496+ if (candidate.p () >= 4.0 && candidate.p () < 5.0 && candidate.beta () > grpPhi.cutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 3.0 ) {
497+ return true ;
498+ }
499+ if (candidate.p () >= 5.0 && candidate.p () < 6.0 && candidate.beta () > grpPhi.cutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 2.5 ) {
500+ return true ;
501+ }
502+ if (candidate.p () >= 6.0 && candidate.beta () > grpPhi.cutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 3.0 ) {
503+ return true ;
504+ }
505+ }
506+ return false ;
507+ }
508+
435509 // Generic 2-prong invariant mass method candidate finder. Only works for non-identical daughters of opposite charge for now.
436510 void processDataInvMass (aod::Collisions::iterator const &, aod::BCsWithTimestamps const &, aod::CFCollRefs const & cfcollisions, aod::CFTrackRefs const & cftracks, Filter2Prong::PIDTrack const & tracks)
437511 {
@@ -530,9 +604,9 @@ struct Filter2Prong {
530604 if (grpPhi.ITSPIDSelection && p1.p () < grpPhi.ITSPIDPthreshold .value && !(itsResponse.nSigmaITS <o2::track::PID::Kaon>(p1) > grpPhi.lowITSPIDNsigma .value && itsResponse.nSigmaITS <o2::track::PID::Kaon>(p1) < grpPhi.highITSPIDNsigma .value )) { // Check ITS PID condition
531605 continue ;
532606 }
533- if (!selectionPID (p1)) {
607+ /* if (!selectionPID(p1)) {
534608 continue;
535- }
609+ } */
536610 if (grpPhi.removefaketrack && isFakeTrack (p1)) { // Check if the track is a fake kaon
537611 continue ;
538612 }
@@ -548,9 +622,9 @@ struct Filter2Prong {
548622 if (!selectionTrack (p2)) {
549623 continue ;
550624 }
551- if (!selectionPID (p2)) {
625+ /* if (!selectionPID(p2)) {
552626 continue;
553- }
627+ } */
554628 if (grpPhi.ITSPIDSelection && p2.p () < grpPhi.ITSPIDPthreshold .value && !(itsResponse.nSigmaITS <o2::track::PID::Kaon>(p2) > grpPhi.lowITSPIDNsigma .value && itsResponse.nSigmaITS <o2::track::PID::Kaon>(p2) < grpPhi.highITSPIDNsigma .value )) { // Check ITS PID condition
555629 continue ;
556630 }
@@ -568,8 +642,18 @@ struct Filter2Prong {
568642 continue ;
569643 }
570644 float phi = RecoDecay::constrainAngle (s.Phi (), 0 .0f );
571- output2ProngTracks (cfcollisions.begin ().globalIndex (),
572- cftrack1.globalIndex (), cftrack2.globalIndex (), s.pt (), s.eta (), phi, s.M (), aod::cf2prongtrack::PhiToKK);
645+ if (selectionPID (p1) && selectionPID (p2)) {
646+ output2ProngTracks (cfcollisions.begin ().globalIndex (),
647+ cftrack1.globalIndex (), cftrack2.globalIndex (), s.pt (), s.eta (), phi, s.M (), aod::cf2prongtrack::PhiToKKPID1);
648+ }
649+ if (selectionPID2 (p1) && selectionPID2 (p2)) {
650+ output2ProngTracks (cfcollisions.begin ().globalIndex (),
651+ cftrack1.globalIndex (), cftrack2.globalIndex (), s.pt (), s.eta (), phi, s.M (), aod::cf2prongtrack::PhiToKKPID2);
652+ }
653+ if (selectionPID3 (p1) && selectionPID3 (p2)) {
654+ output2ProngTracks (cfcollisions.begin ().globalIndex (),
655+ cftrack1.globalIndex (), cftrack2.globalIndex (), s.pt (), s.eta (), phi, s.M (), aod::cf2prongtrack::PhiToKKPID3);
656+ }
573657 } // end of loop over second track
574658 } // end of loop over first track
575659 }
@@ -674,7 +758,7 @@ struct Filter2Prong {
674758 }
675759 float phi = RecoDecay::constrainAngle (s.Phi (), 0 .0f );
676760 output2ProngTracks (cfcollisions.begin ().globalIndex (),
677- cftrack1.globalIndex (), cftrack2.globalIndex (), s.pt (), s.eta (), phi, s.M (), aod::cf2prongtrack::PhiToKK );
761+ cftrack1.globalIndex (), cftrack2.globalIndex (), s.pt (), s.eta (), phi, s.M (), aod::cf2prongtrack::PhiToKKPID1 );
678762 } // end of loop over second track
679763 } // end of loop over first track
680764 }
0 commit comments