@@ -82,6 +82,7 @@ struct Kstarqa {
8282
8383 struct : ConfigurableGroup {
8484 // Configurables for event selections
85+ Configurable<bool > isSquarePIDcut{" isSquarePIDcut" , false , " Apply square PID cut" };
8586 Configurable<bool > isINELgt0{" isINELgt0" , true , " INEL>0 selection" };
8687 Configurable<bool > isINELgt0Gen{" isINELgt0Gen" , false , " Apply INEL>0 in Gen direclty from collisions in addition to already applied from pwglf::inelGt" };
8788 Configurable<bool > isSel8{" isSel8" , false , " Event selection sel8" };
@@ -657,8 +658,14 @@ struct Kstarqa {
657658 return true ;
658659 }
659660 } else {
660- if (candidate.hasTOF () && (std::pow (candidate.tofNSigmaPi () - configGp.shiftInNsigmaTOFPi , 2 ) + std::pow (candidate.tpcNSigmaPi (), 2 )) < (std::pow (configGp.nsigmaCutCombinedPi , 2 ))) {
661- return true ;
661+ if (!configGp.isSquarePIDcut ) {
662+ if (candidate.hasTOF () && (std::pow (candidate.tofNSigmaPi () - configGp.shiftInNsigmaTOFPi , 2 ) + std::pow (candidate.tpcNSigmaPi (), 2 )) < (std::pow (configGp.nsigmaCutCombinedPi , 2 ))) {
663+ return true ;
664+ }
665+ } else {
666+ if (candidate.hasTOF () && std::abs (candidate.tofNSigmaPi () - configGp.shiftInNsigmaTOFPi ) < configGp.nsigmaCutCombinedPi && std::abs (candidate.tpcNSigmaPi ()) < configGp.nsigmaCutCombinedPi ) {
667+ return true ;
668+ }
662669 }
663670 if (!candidate.hasTOF () && std::abs (candidate.tpcNSigmaPi ()) < configGp.nsigmaCutTPCPi ) {
664671 return true ;
@@ -674,8 +681,14 @@ struct Kstarqa {
674681 return true ;
675682 }
676683 } else {
677- if (candidate.hasTOF () && (std::pow (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa , 2 ) + std::pow (candidate.tpcNSigmaKa (), 2 )) < (std::pow (configGp.nsigmaCutCombinedKa , 2 ))) {
678- return true ;
684+ if (!configGp.isSquarePIDcut ) {
685+ if (candidate.hasTOF () && (std::pow (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa , 2 ) + std::pow (candidate.tpcNSigmaKa (), 2 )) < (std::pow (configGp.nsigmaCutCombinedKa , 2 ))) {
686+ return true ;
687+ }
688+ } else {
689+ if (candidate.hasTOF () && std::abs (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa ) < configGp.nsigmaCutCombinedKa && std::abs (candidate.tpcNSigmaKa ()) < configGp.nsigmaCutCombinedKa ) {
690+ return true ;
691+ }
679692 }
680693 if (!candidate.hasTOF () && std::abs (candidate.tpcNSigmaKa ()) < configGp.nsigmaCutTPCKa ) {
681694 return true ;
@@ -723,8 +736,14 @@ struct Kstarqa {
723736 return true ;
724737 }
725738 } else {
726- if (candidate.hasTOF () && (std::pow (candidate.tofNSigmaPi () - configGp.shiftInNsigmaTOFPi , 2 ) + std::pow (candidate.tpcNSigmaPi (), 2 )) < (std::pow (configGp.nsigmaCutCombinedMID , 2 ))) {
727- return true ;
739+ if (!configGp.isSquarePIDcut ) {
740+ if (candidate.hasTOF () && (std::pow (candidate.tofNSigmaPi () - configGp.shiftInNsigmaTOFPi , 2 ) + std::pow (candidate.tpcNSigmaPi (), 2 )) < (std::pow (configGp.nsigmaCutCombinedMID , 2 ))) {
741+ return true ;
742+ }
743+ } else {
744+ if (candidate.hasTOF () && std::abs (candidate.tofNSigmaPi () - configGp.shiftInNsigmaTOFPi ) < configGp.nsigmaCutCombinedMID && std::abs (candidate.tpcNSigmaPi ()) < configGp.nsigmaCutCombinedMID ) {
745+ return true ;
746+ }
728747 }
729748 if (!candidate.hasTOF () && std::abs (candidate.tpcNSigmaPi ()) < configGp.nsigmaCutTPCMID ) {
730749 return true ;
@@ -740,8 +759,14 @@ struct Kstarqa {
740759 return true ;
741760 }
742761 } else {
743- if (candidate.hasTOF () && (std::pow (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa , 2 ) + std::pow (candidate.tpcNSigmaKa (), 2 )) < (std::pow (configGp.nsigmaCutCombinedMID , 2 ))) {
744- return true ;
762+ if (!configGp.isSquarePIDcut ) {
763+ if (candidate.hasTOF () && (std::pow (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa , 2 ) + std::pow (candidate.tpcNSigmaKa (), 2 )) < (std::pow (configGp.nsigmaCutCombinedMID , 2 ))) {
764+ return true ;
765+ }
766+ } else {
767+ if (candidate.hasTOF () && std::abs (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa ) < configGp.nsigmaCutCombinedMID && std::abs (candidate.tpcNSigmaKa ()) < configGp.nsigmaCutCombinedMID ) {
768+ return true ;
769+ }
745770 }
746771 if (!candidate.hasTOF () && std::abs (candidate.tpcNSigmaKa ()) < configGp.nsigmaCutTPCMID ) {
747772 return true ;
@@ -833,8 +858,14 @@ struct Kstarqa {
833858 return true ;
834859 }
835860 }
836- if (candidate.pt () >= configGp.lowPtCutPID && std::abs (candidate.tpcNSigmaPi ()) < configGp.nsigmaCutTPCPi && candidate.hasTOF () && (std::pow (candidate.tofNSigmaPi () - configGp.shiftInNsigmaTOFPi , 2 ) + std::pow (candidate.tpcNSigmaPi (), 2 )) < (std::pow (configGp.nsigmaCutCombinedPi , 2 ))) {
837- return true ;
861+ if (!configGp.isSquarePIDcut ) {
862+ if (candidate.pt () >= configGp.lowPtCutPID && std::abs (candidate.tpcNSigmaPi ()) < configGp.nsigmaCutTPCPi && candidate.hasTOF () && (std::pow (candidate.tofNSigmaPi () - configGp.shiftInNsigmaTOFPi , 2 ) + std::pow (candidate.tpcNSigmaPi (), 2 )) < (std::pow (configGp.nsigmaCutCombinedPi , 2 ))) {
863+ return true ;
864+ }
865+ } else {
866+ if (candidate.pt () >= configGp.lowPtCutPID && std::abs (candidate.tpcNSigmaPi ()) < configGp.nsigmaCutTPCPi && candidate.hasTOF () && std::abs (candidate.tofNSigmaPi () - configGp.shiftInNsigmaTOFPi ) < configGp.nsigmaCutCombinedPi ) {
867+ return true ;
868+ }
838869 }
839870 } else if (PID == PIDParticle::kKaon ) {
840871 if (candidate.pt () < configGp.lowPtCutPID && candidate.tpcNSigmaKa () > sigmaNeg2 && candidate.tpcNSigmaKa () < configGp.nsigmaCutTPCKa ) {
@@ -863,12 +894,23 @@ struct Kstarqa {
863894 return true ;
864895 }
865896 }
866- if (candidate.pt () >= configGp.lowPtCutPID && candidate.hasTOF ()) {
867- if (candidate.pt () < ptCut2 && std::abs (candidate.tpcNSigmaKa ()) < configGp.nsigmaCutTPCKa && (std::pow (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa , 2 ) + std::pow (candidate.tpcNSigmaKa (), 2 )) < (std::pow (configGp.nsigmaCutCombinedKa , 2 ))) {
868- return true ;
897+ if (!configGp.isSquarePIDcut ) {
898+ if (candidate.pt () >= configGp.lowPtCutPID && candidate.hasTOF ()) {
899+ if (candidate.pt () < ptCut2 && std::abs (candidate.tpcNSigmaKa ()) < configGp.nsigmaCutTPCKa && (std::pow (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa , 2 ) + std::pow (candidate.tpcNSigmaKa (), 2 )) < (std::pow (configGp.nsigmaCutCombinedKa , 2 ))) {
900+ return true ;
901+ }
902+ if (candidate.pt () >= ptCut2 && std::abs (candidate.tpcNSigmaKa ()) < configGp.nsigmaCutTPCKa && (std::pow (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa , 2 ) + std::pow (candidate.tpcNSigmaKa (), 2 )) < (std::pow (sigmaThreshold1, 2 ))) {
903+ return true ;
904+ }
869905 }
870- if (candidate.pt () >= ptCut2 && std::abs (candidate.tpcNSigmaKa ()) < configGp.nsigmaCutTPCKa && (std::pow (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa , 2 ) + std::pow (candidate.tpcNSigmaKa (), 2 )) < (std::pow (sigmaThreshold1, 2 ))) {
871- return true ;
906+ } else {
907+ if (candidate.pt () >= configGp.lowPtCutPID && candidate.hasTOF ()) {
908+ if (candidate.pt () < ptCut2 && std::abs (candidate.tpcNSigmaKa ()) < configGp.nsigmaCutTPCKa && std::abs (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa ) < configGp.nsigmaCutCombinedKa ) {
909+ return true ;
910+ }
911+ if (candidate.pt () >= ptCut2 && std::abs (candidate.tpcNSigmaKa ()) < configGp.nsigmaCutTPCKa && std::abs (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa ) < sigmaThreshold1) {
912+ return true ;
913+ }
872914 }
873915 }
874916 }
@@ -894,8 +936,14 @@ struct Kstarqa {
894936 return true ;
895937 }
896938 } else {
897- if (candidate.hasTOF () && (std::pow (candidate.tofNSigmaPi () - configGp.shiftInNsigmaTOFPi , 2 ) + std::pow (candidate.tpcNSigmaPi (), 2 )) < (configGp.nsigmaCutCombinedPi * configGp.nsigmaCutCombinedPi )) {
898- return true ;
939+ if (!configGp.isSquarePIDcut ) {
940+ if (candidate.hasTOF () && (std::pow (candidate.tofNSigmaPi () - configGp.shiftInNsigmaTOFPi , 2 ) + std::pow (candidate.tpcNSigmaPi (), 2 )) < (configGp.nsigmaCutCombinedPi * configGp.nsigmaCutCombinedPi )) {
941+ return true ;
942+ }
943+ } else {
944+ if (candidate.hasTOF () && std::abs (candidate.tofNSigmaPi () - configGp.shiftInNsigmaTOFPi ) < configGp.nsigmaCutCombinedPi && std::abs (candidate.tpcNSigmaPi ()) < configGp.nsigmaCutCombinedPi ) {
945+ return true ;
946+ }
899947 }
900948 }
901949 } else if (PID == PIDParticle::kKaon ) {
@@ -910,8 +958,14 @@ struct Kstarqa {
910958 return true ;
911959 }
912960 } else {
913- if (candidate.hasTOF () && (std::pow (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa , 2 ) + std::pow (candidate.tpcNSigmaKa (), 2 )) < (std::pow (configGp.nsigmaCutCombinedKa , 2 ))) {
914- return true ;
961+ if (!configGp.isSquarePIDcut ) {
962+ if (candidate.hasTOF () && (std::pow (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa , 2 ) + std::pow (candidate.tpcNSigmaKa (), 2 )) < (std::pow (configGp.nsigmaCutCombinedKa , 2 ))) {
963+ return true ;
964+ }
965+ } else {
966+ if (candidate.hasTOF () && std::abs (candidate.tofNSigmaKa () - configGp.shiftInNsigmaTOFKa ) < configGp.nsigmaCutCombinedKa && std::abs (candidate.tpcNSigmaKa ()) < configGp.nsigmaCutCombinedKa ) {
967+ return true ;
968+ }
915969 }
916970 }
917971 }
0 commit comments