Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended {
Configurable<bool> isNsigmaRectangular{"isNsigmaRectangular", false, "Apply rectangular TPC and TOF nSigma cut, instead of a combined one (TPC<confNsigmaTPC, TOF<confNsigmaCombined)"};
Configurable<float> confNsigmaCombined{"confNsigmaCombined", 3.0f, "TPC and TOF Pion Sigma (combined) for momentum > confTOFpMin"};
Configurable<float> confNsigmaTPC{"confNsigmaTPC", 3.0f, "TPC Pion Sigma for momentum < confTOFpMin"};
Configurable<float> confNsigmaKaonRejection{"confNsigmaKaonRejection", 0, "In proton selection reject tracks with combined Nsigma <confNsigmaRejection"};
Configurable<float> confNsigmaPionRejection{"confNsigmaPionRejection", 0, "In proton selection reject tracks with combined Nsigma <confNsigmaRejection"};

Configurable<float> confTOFpMin{"confTOFpMin", 0.5f, "Min. momentum for which TOF is required for PID."};
Configurable<float> confEtaMax{"confEtaMax", 0.8f, "Higher limit for |Eta| (the same for both particles)"};

Expand Down Expand Up @@ -280,6 +283,30 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended {
return std::hypot(nsigmaTOF, nsigmaTPC) < twotracksconfigs.confNsigmaCombined;
}

bool isNSigmaProton(float mom, float nsigmaTPC, float nsigmaTOF, float nsigmaTPCkaon, float nsigmaTOFkaon, float nsigmaTPCpion, float nsigmaTOFpion)
{
// with additional nSigma kaon and pion rejection
if (mom < twotracksconfigs.confTOFpMin) {
if (std::abs(nsigmaTPCkaon) < twotracksconfigs.confNsigmaKaonRejection || std::abs(nsigmaTPCpion) < twotracksconfigs.confNsigmaPionRejection) {
return false;
}
} else if (std::hypot(nsigmaTOFkaon, nsigmaTPCkaon) < twotracksconfigs.confNsigmaKaonRejection || std::hypot(nsigmaTOFpion, nsigmaTPCpion) < twotracksconfigs.confNsigmaPionRejection) {
return false;
}

if (twotracksconfigs.isNsigmaRectangular) {
if (mom < twotracksconfigs.confTOFpMin) {
return std::abs(nsigmaTPC) < twotracksconfigs.confNsigmaTPC;
}
return (std::abs(nsigmaTPC) < twotracksconfigs.confNsigmaTPC && std::abs(nsigmaTOF) < twotracksconfigs.confNsigmaCombined);
}

if (mom < twotracksconfigs.confTOFpMin) {
return std::abs(nsigmaTPC) < twotracksconfigs.confNsigmaTPC;
}
return std::hypot(nsigmaTOF, nsigmaTPC) < twotracksconfigs.confNsigmaCombined;
}

/// TPC Kaon Sigma selection (stricter cuts for K+ and K-) -- based on Run2 results
bool isKaonNsigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
{
Expand Down Expand Up @@ -313,7 +340,7 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended {
switch (trackonefilter.confPDGCodePartOne) {
case kProton:
case kProtonBar:
return isNSigma(mom, nsigmaTPCPr, nsigmaTOFPr);
return isNSigmaProton(mom, nsigmaTPCPr, nsigmaTOFPr, nsigmaTPCK, nsigmaTOFK, nsigmaTPCPi, nsigmaTOFPi);
case kPiPlus:
case kPiMinus:
case kPi0:
Expand All @@ -331,7 +358,7 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended {
switch (tracktwofilter.confPDGCodePartTwo) {
case kProton:
case kProtonBar:
return isNSigma(mom, nsigmaTPCPr, nsigmaTOFPr);
return isNSigmaProton(mom, nsigmaTPCPr, nsigmaTOFPr, nsigmaTPCK, nsigmaTOFK, nsigmaTPCPi, nsigmaTOFPi);
case kPiPlus:
case kPiMinus:
case kPi0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,15 @@
Configurable<float> confDcaXYCustom2FilterCut{"confDcaXYCustom2FilterCut", 0, "Value for [2] custom DCAxy cut -> |DCAxy| < [1] + [2]/pT (if stricter than in Producer)"};
} ConfTrkSelection;

Configurable<float> confmom{"confmom", 0.5, "momentum threshold for particle identification using TOF"};
Configurable<float> confNsigmaTPCParticle{"confNsigmaTPCParticle", 3.0, "TPC Sigma for particle momentum < confmom"};
Configurable<float> confNsigmaTPCDaughter{"confNsigmaTPCDaughter", 3.0, "TPC Sigma for daughter"};
Configurable<float> confNsigmaTOFParticle{"confNsigmaTOFParticle", 3.0, "TOF Sigma for particle (daugh & bach) momentum > Confmom"};
Configurable<float> confNsigmaCombinedParticle{"confNsigmaCombinedParticle", 3.0, "TPC and TOF Sigma (combined) for particle momentum > confmom"};
struct : o2::framework::ConfigurableGroup {
Configurable<float> confmom{"confmom", 0.5, "momentum threshold for particle identification using TOF"};
Configurable<float> confNsigmaTPCParticle{"confNsigmaTPCParticle", 3.0, "TPC Sigma for particle momentum < ConfNSigmaSelection.confmom"};
Configurable<float> confNsigmaTPCDaughter{"confNsigmaTPCDaughter", 3.0, "TPC Sigma for daughter"};
Configurable<float> confNsigmaTOFParticle{"confNsigmaTOFParticle", 3.0, "TOF Sigma for particle (daugh & bach) momentum > ConfNSigmaSelection.confmom"};
Configurable<float> confNsigmaCombinedParticle{"confNsigmaCombinedParticle", 3.0, "TPC and TOF Sigma (combined) for particle momentum > ConfNSigmaSelection.confmom"};
Configurable<float> confNsigmaKaonRejection{"confNsigmaKaonRejection", 0, "In proton selection reject tracks with kaon Nsigma <confNsigmaRejection"};
Configurable<float> confNsigmaPionRejection{"confNsigmaPionRejection", 0, "In proton selection reject tracks with pion Nsigma <confNsigmaRejection"};
} ConfNSigmaSelection;

Filter collisionFilter = (nabs(aod::collision::posZ) < confZVertexCut);
using FilteredFDCollisions = soa::Filtered<o2::aod::FdCollisions>;
Expand Down Expand Up @@ -255,19 +259,19 @@

bool isNSigmaCombined(float mom, float nsigmaTPCParticle, float nsigmaTOFParticle, bool hasTOF)
{
if (mom <= confmom) {
return (std::abs(nsigmaTPCParticle) < confNsigmaTPCParticle);
if (mom <= ConfNSigmaSelection.confmom) {
return (std::abs(nsigmaTPCParticle) < ConfNSigmaSelection.confNsigmaTPCParticle);
}
if (hasTOF) {
return (std::hypot(nsigmaTOFParticle, nsigmaTPCParticle) < confNsigmaCombinedParticle);
return (std::hypot(nsigmaTOFParticle, nsigmaTPCParticle) < ConfNSigmaSelection.confNsigmaCombinedParticle);
}
return false;
}

template <typename T>
bool isNSigmaCombinedBitmask(float mom, const T& part)
{
if (mom <= confmom) {
if (mom <= ConfNSigmaSelection.confmom) {
return ((part.pidCut() & (1u << ConfTrkSelection.confTrackChoicePartOne)) != 0);
}
if ((part.pidCut() & 512u) != 0) {
Expand All @@ -293,14 +297,14 @@

bool isNSigmaTPC(float nsigmaTPCParticle)
{
return std::abs(nsigmaTPCParticle) < confNsigmaTPCDaughter;
return std::abs(nsigmaTPCParticle) < ConfNSigmaSelection.confNsigmaTPCDaughter;
}

bool isNSigmaTOF(float mom, float nsigmaTOFParticle, bool hasTOF)
{
// Cut only on daughter tracks, that have TOF signal
if (mom > confmom && hasTOF) {
return std::abs(nsigmaTOFParticle) < confNsigmaTOFParticle;
if (mom > ConfNSigmaSelection.confmom && hasTOF) {
return std::abs(nsigmaTOFParticle) < ConfNSigmaSelection.confNsigmaTOFParticle;
}
return true;
}
Expand All @@ -310,7 +314,19 @@
{
const std::array<float, 3> tpcNSigmas = {aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePi()), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStoreKa())};
const std::array<float, 3> tofNSigmas = {aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePi()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStoreKa())};
enum particleID { protonId,
pionId,
kaonId };

if (id == protonId) {
if (part.p() < ConfNSigmaSelection.confmom) {
if (std::abs(tpcNSigmas[kaonId]) < ConfNSigmaSelection.confNsigmaKaonRejection || std::abs(tpcNSigmas[pionId]) < ConfNSigmaSelection.confNsigmaPionRejection) {
return false;
}
} else if (std::hypot(tofNSigmas[kaonId], tpcNSigmas[kaonId]) < ConfNSigmaSelection.confNsigmaKaonRejection || std::hypot(tofNSigmas[pionId], tpcNSigmas[pionId]) < ConfNSigmaSelection.confNsigmaPionRejection) {
return false;
}
}
return isNSigmaCombined(part.p(), tpcNSigmas[id], tofNSigmas[id], (part.pidCut() & 512u) != 0);
}

Expand Down Expand Up @@ -540,7 +556,7 @@
}

if (ConfV0Selection.confUseStrangenessTOF) {
if (((ConfV0Selection.confV0Type1 == 0) && (part.pidCut() & 3) != 3) || ((ConfV0Selection.confV0Type1 == 1) && (part.pidCut() & 12) != 12) || ((ConfV0Selection.confV0Type1 == 2) && (part.pidCut() & 48) != 48)) {

Check failure on line 559 in PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}
} else {
Expand All @@ -560,7 +576,7 @@
const std::array<float, 3> tpcNSigmas = {aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePi()), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStoreKa())};
const std::array<float, 3> tofNSigmas = {aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePi()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStoreKa())};

if (!isNSigmaCombined(part.p(), tpcNSigmas[ConfTrkSelection.confTrackChoicePartOne], tofNSigmas[ConfTrkSelection.confTrackChoicePartOne], (part.pidCut() & 512u) != 0)) {
if (!isParticleCombined(part, ConfTrkSelection.confTrackChoicePartOne)) {
continue;
}
if (part.sign() > 0) {
Expand Down Expand Up @@ -632,7 +648,7 @@
}

if (ConfV0Selection.confUseStrangenessTOF) {
if (((ConfV0Selection.confV0Type1 == 0) && (p2.pidCut() & 3) != 3) || ((ConfV0Selection.confV0Type1 == 1) && (p2.pidCut() & 12) != 12) || ((ConfV0Selection.confV0Type1 == 2) && (p2.pidCut() & 48) != 48)) {

Check failure on line 651 in PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}
} else {
Expand Down Expand Up @@ -705,7 +721,7 @@
continue;
}
if (ConfV0Selection.confUseStrangenessTOF) {
if (((ConfV0Selection.confV0Type1 == 0) && (part.pidCut() & 3) != 3) || ((ConfV0Selection.confV0Type1 == 1) && (part.pidCut() & 12) != 12) || ((ConfV0Selection.confV0Type1 == 2) && (part.pidCut() & 48) != 48)) {

Check failure on line 724 in PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}
} else {
Expand Down Expand Up @@ -755,7 +771,7 @@
continue;
}
if (ConfV0Selection.confUseStrangenessTOF) {
if (((ConfV0Selection.confV0Type2 == 0) && (part.pidCut() & 3) != 3) || ((ConfV0Selection.confV0Type1 == 1) && (part.pidCut() & 12) != 12) || ((ConfV0Selection.confV0Type2 == 2) && (part.pidCut() & 48) != 48)) {

Check failure on line 774 in PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}
} else {
Expand Down Expand Up @@ -836,7 +852,7 @@
return false;
}
if (ConfV0Selection.confUseStrangenessTOF) {
if (((ConfV0Selection.confV0Type1 == 0) && (p1.pidCut() & 3) != 3) || ((ConfV0Selection.confV0Type1 == 1) && (p1.pidCut() & 12) != 12) || ((ConfV0Selection.confV0Type1 == 2) && (p1.pidCut() & 48) != 48)) {

Check failure on line 855 in PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return false;
}
} else {
Expand Down Expand Up @@ -868,7 +884,7 @@
return false;
}
if (ConfV0Selection.confUseStrangenessTOF) {
if (((ConfV0Selection.confV0Type2 == 0) && (p2.pidCut() & 3) != 3) || ((ConfV0Selection.confV0Type2 == 1) && (p2.pidCut() & 12) != 12) || ((ConfV0Selection.confV0Type2 == 2) && (p2.pidCut() & 48) != 48)) {

Check failure on line 887 in PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return false;
}
} else {
Expand Down Expand Up @@ -1157,7 +1173,7 @@
continue;
}
if (ConfV0Selection.confUseStrangenessTOF) {
if (((ConfV0Selection.confV0Type1 == 0) && (p2.pidCut() & 3) != 3) || ((ConfV0Selection.confV0Type1 == 1) && (p2.pidCut() & 12) != 12) || ((ConfV0Selection.confV0Type1 == 2) && (p2.pidCut() & 48) != 48)) {

Check failure on line 1176 in PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}
} else {
Expand Down Expand Up @@ -1257,7 +1273,7 @@
continue;
}
if (ConfV0Selection.confUseStrangenessTOF) {
if (((ConfV0Selection.confV0Type1 == 0) && (p1.pidCut() & 3) != 3) || ((ConfV0Selection.confV0Type1 == 1) && (p1.pidCut() & 12) != 12) || ((ConfV0Selection.confV0Type1 == 2) && (p1.pidCut() & 48) != 48)) {

Check failure on line 1276 in PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}
} else {
Expand Down Expand Up @@ -1289,7 +1305,7 @@
continue;
}
if (ConfV0Selection.confUseStrangenessTOF) {
if (((ConfV0Selection.confV0Type2 == 0) && (p2.pidCut() & 3) != 3) || ((ConfV0Selection.confV0Type2 == 1) && (p2.pidCut() & 12) != 12) || ((ConfV0Selection.confV0Type2 == 2) && (p2.pidCut() & 48) != 48)) {

Check failure on line 1308 in PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}
} else {
Expand Down Expand Up @@ -1832,10 +1848,7 @@
}

for (const auto& part : groupPartsOne) {
const std::array<float, 3> tpcNSigmas = {aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePi()), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStoreKa())};
const std::array<float, 3> tofNSigmas = {aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePi()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStoreKa())};

if (!isNSigmaCombined(part.p(), tpcNSigmas[ConfTrkSelection.confTrackChoicePartOne], tofNSigmas[ConfTrkSelection.confTrackChoicePartOne], (part.pidCut() & 512u) != 0)) {
if (!isParticleCombined(part, ConfTrkSelection.confTrackChoicePartOne)) {
continue;
}
registryMCreco.fill(HIST("mothersReco/motherParticleTrack"), part.motherPDG());
Expand Down Expand Up @@ -1909,7 +1922,7 @@
}

if (ConfV0Selection.confUseStrangenessTOF) {
if ((part.pidCut() & 3) != 3) {

Check failure on line 1925 in PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}
} else {
Expand Down
Loading