@@ -44,13 +44,9 @@ struct Filter2Prong {
4444 O2_DEFINE_CONFIGURABLE (cfgYMax, float , -1 .0f , " Maximum candidate rapidity" )
4545 O2_DEFINE_CONFIGURABLE (cfgImPart1Mass, float , o2::constants::physics::MassKPlus, " Daughter particle 1 mass in GeV" )
4646 O2_DEFINE_CONFIGURABLE (cfgImPart2Mass, float , o2::constants::physics::MassKMinus, " Daughter particle 2 mass in GeV" )
47- O2_DEFINE_CONFIGURABLE (cfgImPart1PID, int , o2::track::PID::Kaon, " PID of daughter particle 1 (O2 PID ID)" )
48- O2_DEFINE_CONFIGURABLE (cfgImPart2PID, int , o2::track::PID::Kaon, " PID of daughter particle 2 (O2 PID ID)" )
4947 O2_DEFINE_CONFIGURABLE (cfgImCutPt, float , 0 .2f , " Minimal pT for candidates" )
5048 O2_DEFINE_CONFIGURABLE (cfgImMinInvMass, float , 0 .95f , " Minimum invariant mass (GeV)" )
5149 O2_DEFINE_CONFIGURABLE (cfgImMaxInvMass, float , 1 .07f , " Maximum invariant mass (GeV)" )
52- O2_DEFINE_CONFIGURABLE (cfgImSigmaFormula, std::string, " (z < 0.5 && x < 3.0) || (z >= 0.5 && x < 2.5 && y < 3.0)" , " pT dependent daughter track sigma pass condition (x = TPC sigma, y = TOF sigma, z = pT)" )
53-
5450 O2_DEFINE_CONFIGURABLE (cfgDoPhi, bool , false , " Store phi information" )
5551 O2_DEFINE_CONFIGURABLE (cfgDoV0, bool , true , " Store V0s candidates" )
5652 O2_DEFINE_CONFIGURABLE (tpcNClsCrossedRowsTrackMin, float , 70 , " Minimum number of crossed rows in TPC" )
@@ -85,6 +81,10 @@ struct Filter2Prong {
8581 O2_DEFINE_CONFIGURABLE (cfgDeepAngle, float , 0.04 , " deep angle cut" )
8682 O2_DEFINE_CONFIGURABLE (removefaketrack, bool , true , " flag to remove fake kaon" )
8783 O2_DEFINE_CONFIGURABLE (ConfFakeKaonCut, float , 0.1 , " Cut based on track from momentum difference" )
84+ O2_DEFINE_CONFIGURABLE (nsigmaCutTPC, float , 3 , " nsigma tpc" )
85+ O2_DEFINE_CONFIGURABLE (nsigmaCutTOF, float , 3 , " nsigma tof" )
86+ O2_DEFINE_CONFIGURABLE (cfgCutTOFBeta, float , 0.0 , " TOF beta" )
87+ O2_DEFINE_CONFIGURABLE (isTOFOnly, bool , false , " flag to select kaon with only TOF condition" )
8888
8989 HfHelper hfHelper;
9090 Produces<aod::CF2ProngTracks> output2ProngTracks;
@@ -101,12 +101,11 @@ struct Filter2Prong {
101101 template <class T >
102102 using HasMLProb = decltype (std::declval<T&>().mlProbD0());
103103
104- std::unique_ptr<TFormula> sigmaFormula;
104+ using PIDTrack = soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCPr, aod::pidTOFPi, aod::pidTOFKa, aod::pidTOFPr, aod::pidTOFbeta>;
105+ using ResoV0s = aod::V0Datas;
105106
106107 void init (InitContext&)
107108 {
108- if (doprocessDataInvMass)
109- sigmaFormula = std::make_unique<TFormula>(" sigmaFormula" , cfgImSigmaFormula.value .c_str ());
110109 }
111110
112111 template <class HFCandidatesType >
@@ -242,13 +241,10 @@ struct Filter2Prong {
242241 if (v0.mK0Short () < massK0Min || v0.mK0Short () > massK0Max) {
243242 return false ;
244243 }
245- if (v0.qtarm () < qtArmenterosMinForK0) {
246- return false ;
247- }
248- if (v0.v0radius () > radiusMax) {
244+ if ((v0.qtarm () / std::abs (v0.alpha ())) < qtArmenterosMinForK0) {
249245 return false ;
250246 }
251- if (v0.v0radius () < radiusMin) {
247+ if (v0.v0radius () > radiusMax || v0. v0radius () < radiusMin) {
252248 return false ;
253249 }
254250 if (v0.v0cosPA () < cosPaMin) {
@@ -287,13 +283,7 @@ struct Filter2Prong {
287283 (v0.mAntiLambda () < massLambdaMin || v0.mAntiLambda () > massLambdaMax)) {
288284 return false ;
289285 }
290- if (v0.qtarm () > qtArmenterosMaxForLambda) {
291- return false ;
292- }
293- if (v0.v0radius () > radiusMax) {
294- return false ;
295- }
296- if (v0.v0radius () < radiusMin) {
286+ if (v0.v0radius () > radiusMax || v0.v0radius () < radiusMin) {
297287 return false ;
298288 }
299289 if (v0.v0cosPA () < cosPaMin) {
@@ -350,8 +340,28 @@ struct Filter2Prong {
350340 return true ;
351341 }
352342
353- // Processing data for invariant mass analysis for 2-prong tracks, including V0s (K0s, Lambdas, Anti-Lambdas) and Phi mesons
354- using PIDTrack = soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCPr, aod::pidTOFPi, aod::pidTOFKa, aod::pidTOFPr>;
343+ template <typename T>
344+ bool selectionPID (const T& candidate)
345+ {
346+ if (!candidate.hasTOF () && TMath::Abs (candidate.tpcNSigmaKa ()) < nsigmaCutTPC) {
347+ return true ;
348+ }
349+ if (candidate.hasTOF () && candidate.beta () > cfgCutTOFBeta && TMath::Abs (candidate.tpcNSigmaKa ()) < nsigmaCutTPC && TMath::Abs (candidate.tofNSigmaKa ()) < nsigmaCutTOF) {
350+ return true ;
351+ }
352+ return false ;
353+ }
354+
355+ template <typename T>
356+ bool selectionPID2 (const T& candidate)
357+ {
358+ if (candidate.hasTOF () && candidate.beta () > cfgCutTOFBeta && TMath::Abs (candidate.tofNSigmaKa ()) < nsigmaCutTOF) {
359+ return true ;
360+ }
361+ return false ;
362+ }
363+
364+ // Generic 2-prong invariant mass method candidate finder. Only works for non-identical daughters of opposite charge for now.
355365 void processDataInvMass (aod::Collisions::iterator const & collision, aod::BCsWithTimestamps const &, aod::CFCollRefs const & cfcollisions, aod::CFTrackRefs const & cftracks, PIDTrack const & tracks, aod::V0Datas const & V0s)
356366 {
357367 if (cfcollisions.size () <= 0 || cftracks.size () <= 0 )
@@ -362,11 +372,18 @@ struct Filter2Prong {
362372 if (cfgDoPhi) { // Process Phi mesons
363373 for (const auto & cftrack1 : cftracks) { // Loop over first track
364374 const auto & p1 = tracks.iteratorAt (cftrack1.trackId () - tracks.begin ().globalIndex ());
365-
366375 if (p1.sign () != 1 ) // Only consider positive tracks
367376 continue ;
368- if (sigmaFormula->Eval (o2::aod::pidutils::tpcNSigma (cfgImPart1PID, p1), o2::aod::pidutils::tofNSigma (cfgImPart1PID, p1)) <= 0 .0f ) // Check if the track passes PID condition
377+ /* if (sigmaFormula->Eval(o2::aod::pidutils::tpcNSigma(cfgImPart1PID, p1), o2::aod::pidutils::tofNSigma(cfgImPart1PID, p1)) <= 0.0f)
378+ {
379+ continue;
380+ }*/
381+ if (!isTOFOnly && !selectionPID (p1)) {
382+ continue ;
383+ }
384+ if (isTOFOnly && !selectionPID2 (p1)) {
369385 continue ;
386+ }
370387 if (ITSPIDSelection && p1.p () < ITSPIDPthreshold.value && !(itsResponse.nSigmaITS <o2::track::PID::Kaon>(p1) > -ITSPIDNsigma.value && itsResponse.nSigmaITS <o2::track::PID::Kaon>(p1) < ITSPIDNsigma.value )) { // Check ITS PID condition
371388 continue ;
372389 }
@@ -381,8 +398,16 @@ struct Filter2Prong {
381398 const auto & p2 = tracks.iteratorAt (cftrack2.trackId () - tracks.begin ().globalIndex ());
382399 if (p2.sign () != -1 ) // Only consider negative tracks
383400 continue ;
384- if (sigmaFormula->Eval (o2::aod::pidutils::tpcNSigma (cfgImPart2PID, p2), o2::aod::pidutils::tofNSigma (cfgImPart2PID, p2)) <= 0 .0f ) // Check if the track passes PID condition
401+ /* if (sigmaFormula->Eval(o2::aod::pidutils::tpcNSigma(cfgImPart2PID, p2), o2::aod::pidutils::tofNSigma(cfgImPart2PID, p2)) <= 0.0f)
402+ {
403+ continue;
404+ }*/
405+ if (!isTOFOnly && !selectionPID (p2)) {
385406 continue ;
407+ }
408+ if (isTOFOnly && !selectionPID2 (p2)) {
409+ continue ;
410+ }
386411 if (ITSPIDSelection && p2.p () < ITSPIDPthreshold.value && !(itsResponse.nSigmaITS <o2::track::PID::Kaon>(p2) > -ITSPIDNsigma.value && itsResponse.nSigmaITS <o2::track::PID::Kaon>(p2) < ITSPIDNsigma.value )) { // Check ITS PID condition
387412 continue ;
388413 }
0 commit comments