@@ -138,9 +138,29 @@ struct Lambdastarproxy {
138138 Configurable<float > lstarCutNsigmaTOFPr{" lstarCutNsigmaTOFPr" , float {NsigmaTOFDefault}, " |nSigma^{TOF}_{p}| cut" };
139139 Configurable<float > lstarCutNsigmaTPCKaon{" lstarCutNsigmaTPCKaon" , float {NsigmaTPCDefault}, " |nSigma^{TPC}_{K}| cut" };
140140 Configurable<float > lstarCutNsigmaTOFKaon{" lstarCutNsigmaTOFKaon" , float {NsigmaTOFDefault}, " |nSigma^{TOF}_{K}| cut" };
141+ // Opt-in kaon-only window in the upper part of the TPC-only pT branch.
142+ // Disabled by default so existing data and reconstructed-MC selections are reproducible.
143+ Configurable<int > lstarEnableKaonTPCAsym{" lstarEnableKaonTPCAsym" , 0 , " Enable the asymmetric kaon TPC window below lstarPidPtRefKaon" };
144+ Configurable<float > lstarKaonTPCAsymPtMin{" lstarKaonTPCAsymPtMin" , 0 .3f , " Measured kaon-track pT where the asymmetric TPC window starts (GeV/c)" };
145+ Configurable<float > lstarKaonTPCAsymMin{" lstarKaonTPCAsymMin" , -2 .f , " Strict lower TPC nSigma_K bound in the asymmetric window" };
146+ Configurable<float > lstarKaonTPCAsymMax{" lstarKaonTPCAsymMax" , 5 .f , " Strict upper TPC nSigma_K bound in the asymmetric window" };
141147 Configurable<float > lstarCutNsigmaTPCDe{" lstarCutNsigmaTPCDe" , float {NsigmaTPCDefault}, " |nSigma^{TPC}_{d}| cut" };
142148 Configurable<float > lstarCutNsigmaTOFDe{" lstarCutNsigmaTOFDe" , float {NsigmaTOFDefault}, " |nSigma^{TOF}_{d}| cut" };
143149 Configurable<int > lstarEnableTOFNsigmaCutDe{" lstarEnableTOFNsigmaCutDe" , 0 , " Enable deuteron-only TOF nSigma cut in PID strategy 2" };
150+ // Group new settings to stay within the framework's top-level member limit.
151+ // The configurable names remain flat; all features are opt-in.
152+ struct : ConfigurableGroup {
153+ Configurable<int > lstarEnableProtonTPCAsym{" lstarEnableProtonTPCAsym" , 0 , " Enable the asymmetric proton TPC window below lstarPidPtRefPr" };
154+ Configurable<float > lstarProtonTPCAsymPtMin{" lstarProtonTPCAsymPtMin" , 0 .5f , " Measured proton-track pT where the asymmetric TPC window starts (GeV/c)" };
155+ Configurable<float > lstarProtonTPCAsymMin{" lstarProtonTPCAsymMin" , -2 .f , " Strict lower TPC nSigma_p bound in the asymmetric window" };
156+ Configurable<float > lstarProtonTPCAsymMax{" lstarProtonTPCAsymMax" , 5 .f , " Strict upper TPC nSigma_p bound in the asymmetric window" };
157+ // Strategy 2 only: existing TOF and ITS requirements still apply.
158+ Configurable<int > lstarEnableDeuteronTPCAsym{" lstarEnableDeuteronTPCAsym" , 0 , " Enable an asymmetric deuteron TPC window in PID strategy 2" };
159+ Configurable<float > lstarDeuteronTPCAsymPtMin{" lstarDeuteronTPCAsymPtMin" , 0 .f , " Measured deuteron-track pT where the asymmetric TPC window starts (GeV/c)" };
160+ Configurable<float > lstarDeuteronTPCAsymPtMax{" lstarDeuteronTPCAsymPtMax" , -1 .f , " Exclusive upper measured deuteron-track pT for the asymmetric window; negative means no upper limit" };
161+ Configurable<float > lstarDeuteronTPCAsymMin{" lstarDeuteronTPCAsymMin" , -2 .f , " Strict lower TPC nSigma_d bound in the asymmetric window" };
162+ Configurable<float > lstarDeuteronTPCAsymMax{" lstarDeuteronTPCAsymMax" , 4 .f , " Strict upper TPC nSigma_d bound in the asymmetric window" };
163+ } asymmetricTPCPID;
144164 Configurable<int > lstarProxyUseProtonPIDAsDeuteron{" lstarProxyUseProtonPIDAsDeuteron" , 0 , " Closure/control test: keep proxy candidates that pass the normal deuteron selection and are also proton-like, then build p_proxy = p_track/2" };
145165 // Optional deuteron-only TOF auxiliary selections.
146166 // Defaults are OFF, so strategy 2 remains TPC nSigma only for deuterons.
@@ -619,6 +639,9 @@ struct Lambdastarproxy {
619639 }
620640 validateDeuteronRefinements ();
621641 validatePtDependentDcaZ ();
642+ validateKaonTPCAsym ();
643+ validateProtonTPCAsym ();
644+ validateDeuteronTPCAsym ();
622645 if (trackSpectraConfig.lstarEnableTrackSpectra .value != 0 &&
623646 ((!doprocess.value && !doprocessMCReco.value ) || !std::isfinite (trackSpectraConfig.lstarTrackSpectraAbsYMax .value ) || trackSpectraConfig.lstarTrackSpectraAbsYMax .value <= 0 .f )) {
624647 LOGF (fatal, " Track spectra require data or reconstructed MC and a positive finite spectra rapidity window" );
@@ -1699,12 +1722,11 @@ struct Lambdastarproxy {
16991722 probe.charge = static_cast <int >(track.sign ());
17001723 probe.tid = track.globalIndex ();
17011724 if (role == 0 ) {
1702- const bool passProton = passFinalCandidatePID (track.pt (), track.tpcNSigmaPr (), track.tofNSigmaPr (), true ,
1703- lstarCutNsigmaTPCPr.value , lstarCutNsigmaTOFPr.value , lstarPidCircularCutPr.value , lstarPidPtRefPr.value );
1704- probe.nominal = passFinalCandidatePID (track.pt (), tpc[role], tof[role], true , lstarCutNsigmaTPCDe.value , lstarCutNsigmaTOFDe.value , lstarPidCircularCutDe.value , lstarPidPtRefDe.value , true ) &&
1725+ const bool passProton = passProtonCandidatePID (track.pt (), track.tpcNSigmaPr (), track.tofNSigmaPr (), true );
1726+ probe.nominal = passDeuteronCandidatePID (track.pt (), tpc[role], tof[role], true ) &&
17051727 passOptionalDeuteronTOFExtras (track) && passDeuteronRefinements (track) && (lstarProxyUseProtonPIDAsDeuteron.value == 0 || passProton);
17061728 } else {
1707- probe.nominal = passFinalCandidatePID (track.pt (), tpc[role], tof[role], true , lstarCutNsigmaTPCKaon. value , lstarCutNsigmaTOFKaon. value , lstarPidCircularCutKaon. value , lstarPidPtRefKaon. value );
1729+ probe.nominal = passKaonCandidatePID (track.pt (), tpc[role], tof[role], true );
17081730 }
17091731 if constexpr (IsMC) {
17101732 probe.truth = trackTruth (track, collisionId);
@@ -2086,6 +2108,108 @@ struct Lambdastarproxy {
20862108 return true ;
20872109 }
20882110
2111+ void validateKaonTPCAsym () const
2112+ {
2113+ if (lstarEnableKaonTPCAsym.value == 0 ) {
2114+ return ;
2115+ }
2116+ if (!std::isfinite (lstarKaonTPCAsymPtMin.value ) || lstarKaonTPCAsymPtMin.value < 0 .f ||
2117+ !std::isfinite (lstarPidPtRefKaon.value ) || lstarKaonTPCAsymPtMin.value >= lstarPidPtRefKaon.value ||
2118+ !std::isfinite (lstarKaonTPCAsymMin.value ) || !std::isfinite (lstarKaonTPCAsymMax.value ) ||
2119+ lstarKaonTPCAsymMin.value >= lstarKaonTPCAsymMax.value ||
2120+ !std::isfinite (lstarCutNsigmaTPCKaon.value ) || lstarCutNsigmaTPCKaon.value <= 0 .f ) {
2121+ LOGF (fatal, " Asymmetric kaon TPC PID requires finite ordered nSigma bounds, a positive symmetric cut, and 0 <= lstarKaonTPCAsymPtMin < lstarPidPtRefKaon" );
2122+ }
2123+ }
2124+
2125+ bool passKaonCandidatePID (float pt, float nsTPC, float nsTOF, bool hasTof) const
2126+ {
2127+ if (lstarEnableKaonTPCAsym.value != 0 && pt >= lstarKaonTPCAsymPtMin.value && pt < lstarPidPtRefKaon.value ) {
2128+ return std::isfinite (nsTPC) && nsTPC > lstarKaonTPCAsymMin.value && nsTPC < lstarKaonTPCAsymMax.value ;
2129+ }
2130+ return passFinalCandidatePID (pt, nsTPC, nsTOF, hasTof,
2131+ lstarCutNsigmaTPCKaon.value , lstarCutNsigmaTOFKaon.value ,
2132+ lstarPidCircularCutKaon.value , lstarPidPtRefKaon.value );
2133+ }
2134+
2135+ void validateProtonTPCAsym () const
2136+ {
2137+ if (asymmetricTPCPID.lstarEnableProtonTPCAsym .value == 0 ) {
2138+ return ;
2139+ }
2140+ if (!std::isfinite (asymmetricTPCPID.lstarProtonTPCAsymPtMin .value ) || asymmetricTPCPID.lstarProtonTPCAsymPtMin .value < 0 .f ||
2141+ !std::isfinite (lstarPidPtRefPr.value ) || asymmetricTPCPID.lstarProtonTPCAsymPtMin .value >= lstarPidPtRefPr.value ||
2142+ !std::isfinite (asymmetricTPCPID.lstarProtonTPCAsymMin .value ) || !std::isfinite (asymmetricTPCPID.lstarProtonTPCAsymMax .value ) ||
2143+ asymmetricTPCPID.lstarProtonTPCAsymMin .value >= asymmetricTPCPID.lstarProtonTPCAsymMax .value ||
2144+ !std::isfinite (lstarCutNsigmaTPCPr.value ) || lstarCutNsigmaTPCPr.value <= 0 .f ) {
2145+ LOGF (fatal, " Asymmetric proton TPC PID requires finite ordered nSigma bounds, a positive symmetric cut, and 0 <= lstarProtonTPCAsymPtMin < lstarPidPtRefPr" );
2146+ }
2147+ }
2148+
2149+ bool passProtonTPCWindow (float pt, float nsTPC) const
2150+ {
2151+ if (asymmetricTPCPID.lstarEnableProtonTPCAsym .value != 0 && pt >= asymmetricTPCPID.lstarProtonTPCAsymPtMin .value && pt < lstarPidPtRefPr.value ) {
2152+ return std::isfinite (nsTPC) && nsTPC > asymmetricTPCPID.lstarProtonTPCAsymMin .value && nsTPC < asymmetricTPCPID.lstarProtonTPCAsymMax .value ;
2153+ }
2154+ return std::abs (nsTPC) < lstarCutNsigmaTPCPr.value ;
2155+ }
2156+
2157+ bool passProtonCandidatePID (float pt, float nsTPC, float nsTOF, bool hasTof) const
2158+ {
2159+ if (asymmetricTPCPID.lstarEnableProtonTPCAsym .value != 0 && pt >= asymmetricTPCPID.lstarProtonTPCAsymPtMin .value && pt < lstarPidPtRefPr.value ) {
2160+ return passProtonTPCWindow (pt, nsTPC);
2161+ }
2162+ return passFinalCandidatePID (pt, nsTPC, nsTOF, hasTof,
2163+ lstarCutNsigmaTPCPr.value , lstarCutNsigmaTOFPr.value ,
2164+ lstarPidCircularCutPr.value , lstarPidPtRefPr.value );
2165+ }
2166+
2167+ void validateDeuteronTPCAsym () const
2168+ {
2169+ if (asymmetricTPCPID.lstarEnableDeuteronTPCAsym .value == 0 ) {
2170+ return ;
2171+ }
2172+ if (lstarPidStrategy.value != PidStrategyNucleiDeuteronTPC ||
2173+ !std::isfinite (asymmetricTPCPID.lstarDeuteronTPCAsymPtMin .value ) || asymmetricTPCPID.lstarDeuteronTPCAsymPtMin .value < 0 .f ||
2174+ !std::isfinite (asymmetricTPCPID.lstarDeuteronTPCAsymPtMax .value ) ||
2175+ (asymmetricTPCPID.lstarDeuteronTPCAsymPtMax .value >= 0 .f && asymmetricTPCPID.lstarDeuteronTPCAsymPtMax .value <= asymmetricTPCPID.lstarDeuteronTPCAsymPtMin .value ) ||
2176+ !std::isfinite (asymmetricTPCPID.lstarDeuteronTPCAsymMin .value ) || !std::isfinite (asymmetricTPCPID.lstarDeuteronTPCAsymMax .value ) ||
2177+ asymmetricTPCPID.lstarDeuteronTPCAsymMin .value >= asymmetricTPCPID.lstarDeuteronTPCAsymMax .value ||
2178+ !std::isfinite (lstarCutNsigmaTPCDe.value ) || lstarCutNsigmaTPCDe.value <= 0 .f ) {
2179+ LOGF (fatal, " Asymmetric deuteron TPC PID requires strategy 2, finite ordered nSigma bounds, a positive symmetric cut, and a valid measured-pT interval; negative maximum disables its upper limit" );
2180+ }
2181+ }
2182+
2183+ bool useDeuteronTPCAsym (float pt) const
2184+ {
2185+ return asymmetricTPCPID.lstarEnableDeuteronTPCAsym .value != 0 && pt >= asymmetricTPCPID.lstarDeuteronTPCAsymPtMin .value &&
2186+ (asymmetricTPCPID.lstarDeuteronTPCAsymPtMax .value < 0 .f || pt < asymmetricTPCPID.lstarDeuteronTPCAsymPtMax .value );
2187+ }
2188+
2189+ bool passDeuteronTPCWindow (float pt, float nsTPC) const
2190+ {
2191+ if (useDeuteronTPCAsym (pt)) {
2192+ return std::isfinite (nsTPC) && nsTPC > asymmetricTPCPID.lstarDeuteronTPCAsymMin .value && nsTPC < asymmetricTPCPID.lstarDeuteronTPCAsymMax .value ;
2193+ }
2194+ return std::isfinite (nsTPC) && std::abs (nsTPC) < lstarCutNsigmaTPCDe.value ;
2195+ }
2196+
2197+ bool passDeuteronCandidatePID (float pt, float nsTPC, float nsTOF, bool hasTof) const
2198+ {
2199+ if (useDeuteronTPCAsym (pt)) {
2200+ if (!passDeuteronTPCWindow (pt, nsTPC)) {
2201+ return false ;
2202+ }
2203+ if (lstarEnableTOFNsigmaCutDe.value != 0 && hasTof) {
2204+ return std::abs (nsTOF) < lstarCutNsigmaTOFDe.value ;
2205+ }
2206+ return true ;
2207+ }
2208+ return passFinalCandidatePID (pt, nsTPC, nsTOF, hasTof,
2209+ lstarCutNsigmaTPCDe.value , lstarCutNsigmaTOFDe.value ,
2210+ lstarPidCircularCutDe.value , lstarPidPtRefDe.value , true );
2211+ }
2212+
20892213 bool passFinalCandidatePID (float pt, float nsTPC, float nsTOF, bool hasTof,
20902214 float tpcCut, float tofCut, float circularCut,
20912215 float ptRef, bool isDeuteron = false ) const
@@ -2378,7 +2502,7 @@ struct Lambdastarproxy {
23782502
23792503 if (deuteronPID.lstarEnableDeuteronPurityQA .value != 0 ) {
23802504 fillDeuteronPurityQA<IsMC>(trkD, DeuteronPIDStage::BeforePID);
2381- if (std::isfinite (trkD.tpcNSigmaDe ()) && std::abs ( trkD.tpcNSigmaDe ()) < lstarCutNsigmaTPCDe. value ) {
2505+ if (passDeuteronTPCWindow (trkD.pt (), trkD.tpcNSigmaDe ())) {
23822506 fillDeuteronPurityQA<IsMC>(trkD, DeuteronPIDStage::AfterTPC);
23832507 }
23842508 }
@@ -2404,10 +2528,7 @@ struct Lambdastarproxy {
24042528 continue ;
24052529 }
24062530
2407- const bool passesDeuteronSelection = passFinalCandidatePID (ptD, nsTPCDe, nsTOFDe, hasTofDe,
2408- lstarCutNsigmaTPCDe.value , lstarCutNsigmaTOFDe.value ,
2409- lstarPidCircularCutDe.value , lstarPidPtRefDe.value ,
2410- true );
2531+ const bool passesDeuteronSelection = passDeuteronCandidatePID (ptD, nsTPCDe, nsTOFDe, hasTofDe);
24112532 if (!passesDeuteronSelection) {
24122533 continue ;
24132534 }
@@ -2421,17 +2542,7 @@ struct Lambdastarproxy {
24212542 const float nsTOFPrAsProxy =
24222543 trkD.tofNSigmaPr ();
24232544
2424- const bool passesProtonSelection =
2425- passFinalCandidatePID (
2426- ptD,
2427- nsTPCPrAsProxy,
2428- nsTOFPrAsProxy,
2429- hasTofDe,
2430- lstarCutNsigmaTPCPr.value ,
2431- lstarCutNsigmaTOFPr.value ,
2432- lstarPidCircularCutPr.value ,
2433- lstarPidPtRefPr.value ,
2434- false );
2545+ const bool passesProtonSelection = passProtonCandidatePID (ptD, nsTPCPrAsProxy, nsTOFPrAsProxy, hasTofDe);
24352546
24362547 if (useProtonAsProxy &&
24372548 !passesProtonSelection) {
@@ -2510,7 +2621,7 @@ struct Lambdastarproxy {
25102621
25112622 if (lstarEnableSparse.value != 0 && lstarEnableProxyControls.value != 0 ) {
25122623 histos.fill (HIST (" hLambdaStarProxySelectedTrackControlSparse" ), ptD, hasTofDe,
2513- passesProtonSelection, std::abs ( nsTPCPrAsProxy) < lstarCutNsigmaTPCPr. value );
2624+ passesProtonSelection, passProtonTPCWindow (ptD, nsTPCPrAsProxy));
25142625 }
25152626
25162627 proxyCands.push_back (
@@ -2526,7 +2637,7 @@ struct Lambdastarproxy {
25262637 .protonLike =
25272638 passesProtonSelection,
25282639 .hasTOF = hasTofDe,
2529- .protonTPCCompatible = std::abs ( nsTPCPrAsProxy) < lstarCutNsigmaTPCPr. value ,
2640+ .protonTPCCompatible = passProtonTPCWindow (ptD, nsTPCPrAsProxy),
25302641
25312642 .charge =
25322643 static_cast <int >(
@@ -2558,14 +2669,7 @@ struct Lambdastarproxy {
25582669 const float nsTPCPr = trkP.tpcNSigmaPr ();
25592670 const float nsTOFPr = trkP.tofNSigmaPr ();
25602671 const bool hasTofPr = hasTOFMatch (trkP);
2561- const bool isProton = passFinalCandidatePID (ptP,
2562- nsTPCPr,
2563- nsTOFPr,
2564- hasTofPr,
2565- lstarCutNsigmaTPCPr.value ,
2566- lstarCutNsigmaTOFPr.value ,
2567- lstarPidCircularCutPr.value ,
2568- lstarPidPtRefPr.value , false );
2672+ const bool isProton = passProtonCandidatePID (ptP, nsTPCPr, nsTOFPr, hasTofPr);
25692673 if (!isProton) {
25702674 continue ;
25712675 }
@@ -2630,14 +2734,7 @@ struct Lambdastarproxy {
26302734 const float nsTPCK = trkK.tpcNSigmaKa ();
26312735 const float nsTOFK = trkK.tofNSigmaKa ();
26322736 const bool hasTofK = hasTOFMatch (trkK);
2633- const bool isKaon = passFinalCandidatePID (ptK,
2634- nsTPCK,
2635- nsTOFK,
2636- hasTofK,
2637- lstarCutNsigmaTPCKaon.value ,
2638- lstarCutNsigmaTOFKaon.value ,
2639- lstarPidCircularCutKaon.value ,
2640- lstarPidPtRefKaon.value , false );
2737+ const bool isKaon = passKaonCandidatePID (ptK, nsTPCK, nsTOFK, hasTofK);
26412738 if (!isKaon) {
26422739 continue ;
26432740 }
0 commit comments