@@ -136,6 +136,7 @@ struct Kstar0analysis {
136136 Configurable<float > pidnSigmaPreSelectionCut{" pidnSigmaPreSelectionCut" , 4 .0f , " pidnSigma Cut for pre-selection of tracks" };
137137 Configurable<bool > cByPassTOF{" cByPassTOF" , false , " By pass TOF PID selection" }; // By pass TOF PID selection
138138 Configurable<int > cPIDcutType{" cPIDcutType" , 2 , " cPIDcutType = 1 for square cut, 2 for circular cut" }; // By pass TOF PID selection
139+ Configurable<bool > ispTdepPID{" ispTdepPID" , false , " enable pT dependent PID" };
139140
140141 // Kaon
141142 Configurable<std::vector<float >> kaonTPCPIDpTintv{" kaonTPCPIDpTintv" , {0 .5f }, " pT intervals for Kaon TPC PID cuts" };
@@ -597,6 +598,24 @@ struct Kstar0analysis {
597598 return false ;
598599 }
599600
601+ template <typename T>
602+ bool selectionPIDPion (const T& candidate)
603+ {
604+ auto vPionTPCPIDcuts = configPID.pionTPCPIDcuts .value ;
605+ auto vPionTPCTOFCombinedPIDcuts = configPID.pionTPCTOFCombinedPIDcuts .value ;
606+
607+ if (!configPID.cByPassTOF && candidate.hasTOF () && (candidate.tofNSigmaPi () * candidate.tofNSigmaPi () + candidate.tpcNSigmaPi () * candidate.tpcNSigmaPi ()) < (vPionTPCTOFCombinedPIDcuts[0 ] * vPionTPCTOFCombinedPIDcuts[0 ])) {
608+ return true ;
609+ }
610+ if (!configPID.cByPassTOF && !candidate.hasTOF () && std::abs (candidate.tpcNSigmaPi ()) < vPionTPCPIDcuts[0 ]) {
611+ return true ;
612+ }
613+ if (configPID.cByPassTOF && std::abs (candidate.tpcNSigmaPi ()) < vPionTPCPIDcuts[0 ]) {
614+ return true ;
615+ }
616+ return false ;
617+ }
618+
600619 template <typename T>
601620 bool ptDependentPidKaon (const T& candidate)
602621 {
@@ -669,6 +688,24 @@ struct Kstar0analysis {
669688 return false ;
670689 }
671690
691+ template <typename T>
692+ bool selectionPIDKaon (const T& candidate)
693+ {
694+ auto vKaonTPCPIDcuts = configPID.kaonTPCPIDcuts .value ;
695+ auto vKaonTPCTOFCombinedPIDcuts = configPID.kaonTPCTOFCombinedPIDcuts .value ;
696+
697+ if (!configPID.cByPassTOF && candidate.hasTOF () && (candidate.tofNSigmaKa () * candidate.tofNSigmaKa () + candidate.tpcNSigmaKa () * candidate.tpcNSigmaKa ()) < (vKaonTPCTOFCombinedPIDcuts[0 ] * vKaonTPCTOFCombinedPIDcuts[0 ])) {
698+ return true ;
699+ }
700+ if (!configPID.cByPassTOF && !candidate.hasTOF () && std::abs (candidate.tpcNSigmaKa ()) < vKaonTPCPIDcuts[0 ]) {
701+ return true ;
702+ }
703+ if (configPID.cByPassTOF && std::abs (candidate.tpcNSigmaKa ()) < vKaonTPCPIDcuts[0 ]) {
704+ return true ;
705+ }
706+ return false ;
707+ }
708+
672709 auto static constexpr MinPtforProtonRejection = 1 .0f ;
673710 auto static constexpr MaxPtforProtonRejection = 2 .0f ;
674711 auto static constexpr MaxnSigmaforProtonRejection = 2 .0f ;
@@ -786,7 +823,10 @@ struct Kstar0analysis {
786823 if (crejectProton && rejectProton (trk2)) // to remove proton contamination from the kaon track
787824 continue ;
788825
789- if (!ptDependentPidPion (trk1) || !ptDependentPidKaon (trk2))
826+ if (configPID.ispTdepPID && (!ptDependentPidPion (trk1) || !ptDependentPidKaon (trk2)))
827+ continue ;
828+
829+ if (!configPID.ispTdepPID && (!selectionPIDPion (trk1) || !selectionPIDKaon (trk2)))
790830 continue ;
791831
792832 // // QA plots after the selection
@@ -1313,22 +1353,6 @@ struct Kstar0analysis {
13131353 // =========================
13141354 if (std::abs (part.pdgCode ()) == Pdg::kK0Star892 ) {
13151355
1316- std::vector<int > daughterPDGs;
1317- if (part.has_daughters ()) {
1318- auto daughter01 = mcParticles.rawIteratorAt (part.daughtersIds ()[0 ] - mcParticles.offset ());
1319- auto daughter02 = mcParticles.rawIteratorAt (part.daughtersIds ()[1 ] - mcParticles.offset ());
1320- daughterPDGs = {daughter01.pdgCode (), daughter02.pdgCode ()};
1321- } else {
1322- daughterPDGs = {-1 , -1 };
1323- }
1324-
1325- bool pass1 = std::abs (daughterPDGs[0 ]) == kKPlus || std::abs (daughterPDGs[1 ]) == kKPlus ; // At least one decay to Kaon
1326- bool pass2 = std::abs (daughterPDGs[0 ]) == kPiPlus || std::abs (daughterPDGs[1 ]) == kPiPlus ; // At least one decay to Pion
1327-
1328- // Checking if we have both decay products
1329- if (!pass1 || !pass2)
1330- continue ;
1331-
13321356 if (part.pdgCode () > 0 )
13331357 histos.fill (HIST (" Result/SignalLoss/GenTruek892pt_den" ), part.pt (), centrality);
13341358 else
0 commit comments