From a6f6c2f2f063115c8a3064ed4943e8f97b22069d Mon Sep 17 00:00:00 2001 From: xbai Date: Thu, 13 Jun 2024 19:15:03 +0200 Subject: [PATCH 1/2] make the V0 selector cofigrable --- PWGDQ/Tasks/v0selector.cxx | 57 +++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/PWGDQ/Tasks/v0selector.cxx b/PWGDQ/Tasks/v0selector.cxx index 45c352ee386..16c08b53196 100644 --- a/PWGDQ/Tasks/v0selector.cxx +++ b/PWGDQ/Tasks/v0selector.cxx @@ -74,20 +74,39 @@ struct v0selector { // float qt = qtarmv0(ppos, pneg); // Gamma cuts - const float cutAlphaG = 0.4; - const float cutQTG = 0.03; - const float cutAlphaG2[2] = {0.4, 0.8}; - const float cutQTG2 = 0.02; - + Configurable cutAlphaG{"cutAlphaG", 0.4, "cutAlphaG"}; + Configurable cutQTG{"cutQTG", 0.03, "cutQTG"}; + Configurable cutAlphaGLow{"cutAlphaGLow", 0.4, "cutAlphaGLow"}; + Configurable cutAlphaGHigh{"cutAlphaGHigh", 0.8, "cutAlphaGHigh"}; + Configurable cutQTG2{"cutQTG2", 0.02, "cutQTG2"}; // K0S cuts - const float cutQTK0S[2] = {0.1075, 0.215}; - const float cutAPK0S[2] = {0.199, 0.8}; // parameters for curved QT cut - + Configurable cutQTK0SLow{"cutQTK0SLow", 0.1075, "cutQTK0SLow"}; + Configurable cutQTK0SHigh{"cutQTK0SHigh", 0.215, "cutQTK0SHigh"}; + Configurable cutAPK0SLow{"cutAPK0SLow", 0.199, "cutAPK0SLow"}; + Configurable cutAPK0SHigh{"cutAPK0SHigh", 0.8, "cutAPK0SHigh"}; // Lambda & A-Lambda cuts - const float cutQTL = 0.03; - const float cutAlphaL[2] = {0.35, 0.7}; - const float cutAlphaAL[2] = {-0.7, -0.35}; - const float cutAPL[3] = {0.107, -0.69, 0.5}; // parameters for curved QT cut + Configurable cutQTL{"cutQTL", 0.03, "cutQTL"}; + Configurable cutAlphaLLow{"cutAlphaLLow", 0.35, "cutAlphaLLow"}; + Configurable cutAlphaLHigh{"cutAlphaLHigh", 0.7, "cutAlphaLHigh"}; + Configurable cutAPL1{"cutAPL1", 0.107, "cutAPL1"}; + Configurable cutAPL2{"cutAPL2", -0.69, "cutAPL2"}; + Configurable cutAPL3{"cutAPL3", 0.5, "cutAPL3"}; + + // // Gamma cuts + // const float cutAlphaG = 0.4; + // const float cutQTG = 0.03; + // const float cutAlphaG2[2] = {0.4, 0.8}; + // const float cutQTG2 = 0.02; + + // // K0S cuts + // const float cutQTK0S[2] = {0.1075, 0.215}; + // const float cutAPK0S[2] = {0.199, 0.8}; // parameters for curved QT cut + + // // Lambda & A-Lambda cuts + // const float cutQTL = 0.03; + // const float cutAlphaL[2] = {0.35, 0.7}; + // const float cutAlphaAL[2] = {-0.7, -0.35}; + // const float cutAPL[3] = {0.107, -0.69, 0.5}; // parameters for curved QT cut // Check for Gamma candidates if (qt < cutQTG) { @@ -97,26 +116,26 @@ struct v0selector { } if (qt < cutQTG2) { // additional region - should help high pT gammas - if ((TMath::Abs(alpha) > cutAlphaG2[0]) && (TMath::Abs(alpha) < cutAlphaG2[1])) { + if ((TMath::Abs(alpha) > cutAlphaGLow) && (TMath::Abs(alpha) < cutAlphaGHigh)) { return kGamma; } } // Check for K0S candidates - float q = cutAPK0S[0] * TMath::Sqrt(TMath::Abs(1 - alpha * alpha / (cutAPK0S[1] * cutAPK0S[1]))); - if ((qt > cutQTK0S[0]) && (qt < cutQTK0S[1]) && (qt > q)) { + float q = cutAPK0SLow * TMath::Sqrt(TMath::Abs(1 - alpha * alpha / (cutAPK0SHigh * cutAPK0SHigh))); + if ((qt > cutQTK0SLow) && (qt < cutQTK0SHigh) && (qt > q)) { return kK0S; } // Check for Lambda candidates - q = cutAPL[0] * TMath::Sqrt(TMath::Abs(1 - ((alpha + cutAPL[1]) * (alpha + cutAPL[1])) / (cutAPL[2] * cutAPL[2]))); - if ((alpha > cutAlphaL[0]) && (alpha < cutAlphaL[1]) && (qt > cutQTL) && (qt < q)) { + q = cutAPL1 * TMath::Sqrt(TMath::Abs(1 - ((alpha + cutAPL2) * (alpha + cutAPL2)) / (cutAPL3 * cutAPL3))); + if ((alpha > cutAlphaLLow) && (alpha < cutAlphaLHigh) && (qt > cutQTL) && (qt < q)) { return kLambda; } // Check for AntiLambda candidates - q = cutAPL[0] * TMath::Sqrt(TMath::Abs(1 - ((alpha - cutAPL[1]) * (alpha - cutAPL[1])) / (cutAPL[2] * cutAPL[2]))); - if ((alpha > cutAlphaAL[0]) && (alpha < cutAlphaAL[1]) && (qt > cutQTL) && (qt < q)) { + q = cutAPL1 * TMath::Sqrt(TMath::Abs(1 - ((alpha - cutAPL2) * (alpha - cutAPL2)) / (cutAPL3 * cutAPL3))); + if ((alpha > cutAlphaLLow) && (alpha < cutAlphaLHigh) && (qt > cutQTL) && (qt < q)) { return kAntiLambda; } From c1d5ff38d7ae5547111abc0097cbcf6ef495f2c4 Mon Sep 17 00:00:00 2001 From: xbai Date: Thu, 13 Jun 2024 19:34:12 +0200 Subject: [PATCH 2/2] run the clang-format --- PWGDQ/Tasks/v0selector.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGDQ/Tasks/v0selector.cxx b/PWGDQ/Tasks/v0selector.cxx index 16c08b53196..ec65ae7ab6e 100644 --- a/PWGDQ/Tasks/v0selector.cxx +++ b/PWGDQ/Tasks/v0selector.cxx @@ -91,7 +91,7 @@ struct v0selector { Configurable cutAPL1{"cutAPL1", 0.107, "cutAPL1"}; Configurable cutAPL2{"cutAPL2", -0.69, "cutAPL2"}; Configurable cutAPL3{"cutAPL3", 0.5, "cutAPL3"}; - + // // Gamma cuts // const float cutAlphaG = 0.4; // const float cutQTG = 0.03;