@@ -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 {
@@ -479,6 +553,10 @@ struct Filter2Prong {
479553 if (cfcollisions.size () <= 0 )
480554 return ; // rejected collision
481555
556+ LOG (info) << " ****************************************" ;
557+ LOG (info) << " STARTING EVENT LOOP" ;
558+ LOG (info) << " ****************************************" ;
559+
482560 // V0
483561 for (const auto & v0 : V0s) { // Loop over V0 candidates
484562 if (!isV0TrackSelected (v0)) { // Quality selection for V0 prongs
@@ -530,9 +608,9 @@ struct Filter2Prong {
530608 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
531609 continue ;
532610 }
533- if (!selectionPID (p1)) {
611+ /* if (!selectionPID(p1)) {
534612 continue;
535- }
613+ } */
536614 if (grpPhi.removefaketrack && isFakeTrack (p1)) { // Check if the track is a fake kaon
537615 continue ;
538616 }
@@ -548,9 +626,9 @@ struct Filter2Prong {
548626 if (!selectionTrack (p2)) {
549627 continue ;
550628 }
551- if (!selectionPID (p2)) {
629+ /* if (!selectionPID(p2)) {
552630 continue;
553- }
631+ } */
554632 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
555633 continue ;
556634 }
@@ -568,8 +646,18 @@ struct Filter2Prong {
568646 continue ;
569647 }
570648 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);
649+ if (selectionPID (p1) && selectionPID (p2)) {
650+ output2ProngTracks (cfcollisions.begin ().globalIndex (),
651+ cftrack1.globalIndex (), cftrack2.globalIndex (), s.pt (), s.eta (), phi, s.M (), aod::cf2prongtrack::PhiToKKPID1);
652+ }
653+ if (selectionPID2 (p1) && selectionPID2 (p2)) {
654+ output2ProngTracks (cfcollisions.begin ().globalIndex (),
655+ cftrack1.globalIndex (), cftrack2.globalIndex (), s.pt (), s.eta (), phi, s.M (), aod::cf2prongtrack::PhiToKKPID2);
656+ }
657+ if (selectionPID3 (p1) && selectionPID3 (p2)) {
658+ output2ProngTracks (cfcollisions.begin ().globalIndex (),
659+ cftrack1.globalIndex (), cftrack2.globalIndex (), s.pt (), s.eta (), phi, s.M (), aod::cf2prongtrack::PhiToKKPID3);
660+ }
573661 } // end of loop over second track
574662 } // end of loop over first track
575663 }
@@ -674,7 +762,7 @@ struct Filter2Prong {
674762 }
675763 float phi = RecoDecay::constrainAngle (s.Phi (), 0 .0f );
676764 output2ProngTracks (cfcollisions.begin ().globalIndex (),
677- cftrack1.globalIndex (), cftrack2.globalIndex (), s.pt (), s.eta (), phi, s.M (), aod::cf2prongtrack::PhiToKK );
765+ cftrack1.globalIndex (), cftrack2.globalIndex (), s.pt (), s.eta (), phi, s.M (), aod::cf2prongtrack::PhiToKKPID1 );
678766 } // end of loop over second track
679767 } // end of loop over first track
680768 }
0 commit comments