Skip to content

Commit

Permalink
PWGLF: Update lambda1520SpherocityAnalysis.cxx (AliceO2Group#4064)
Browse files Browse the repository at this point in the history
  • Loading branch information
yashpatley authored Dec 5, 2023
1 parent c994a0b commit 40d8db4
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions PWGLF/Tasks/lambda1520SpherocityAnalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ struct lambdaAnalysis {
Configurable<bool> cUseOnlyTOFTrackPr{"cUseOnlyTOFTrackPr", false, "Use only TOF track for PID selection"}; // Use only TOF track for Proton PID selection
Configurable<bool> cUseOnlyTOFTrackKa{"cUseOnlyTOFTrackKa", false, "Use only TOF track for PID selection"}; // Use only TOF track for Kaon PID selection
Configurable<bool> cUseTpcAndTof{"cUseTpcAndTof", true, "Use TPC and TOF PID selection"}; // TPC And TOF tracks
Configurable<bool> cUseTpcOnly{"cUseTpcOnly", false, "Use TPC Only tracks (No TOF Veto)"}; // TPC only selection
// Proton
Configurable<double> cMaxTPCnSigmaProton{"cMaxTPCnSigmaProton", 3.0, "TPC nSigma cut for Proton"}; // TPC
Configurable<double> cMaxTOFnSigmaProton{"cMaxTOFnSigmaProton", 3.0, "TOF nSigma cut for Proton"}; // TOF
Expand Down Expand Up @@ -192,7 +193,7 @@ struct lambdaAnalysis {
auto tpcPIDcut = static_cast<std::vector<float>>(protonTPCPIDcut);
int nitr = static_cast<int>(tpcPIDpt.size());

if (candidate.hasTOF()) {
if (!cUseTpcOnly && candidate.hasTOF()) {
if (std::abs(candidate.tofNSigmaPr()) < cMaxTOFnSigmaProton) {
tofPIDPassed = true;
}
Expand All @@ -207,12 +208,18 @@ struct lambdaAnalysis {
}
} else {
tofPIDPassed = true;
for (int i = 0; i < nitr - 1; ++i) {
if (candidate.pt() >= tpcPIDpt[i] && candidate.pt() < tpcPIDpt[i + 1] && std::abs(candidate.tpcNSigmaPr()) < tpcPIDcut[i]) {
if (cUseTpcOnly) {
if (std::abs(candidate.tpcNSigmaPr()) < cMaxTPCnSigmaProton) {
tpcPIDPassed = true;
}
if (!cUseTpcAndTof && candidate.pt() >= tpcPIDpt[nitr - 1] && std::abs(candidate.tpcNSigmaPr()) < tpcPIDcut[nitr - 2]) {
tpcPIDPassed = true;
} else {
for (int i = 0; i < nitr - 1; ++i) {
if (candidate.pt() >= tpcPIDpt[i] && candidate.pt() < tpcPIDpt[i + 1] && std::abs(candidate.tpcNSigmaPr()) < tpcPIDcut[i]) {
tpcPIDPassed = true;
}
if (!cUseTpcAndTof && candidate.pt() >= tpcPIDpt[nitr - 1] && std::abs(candidate.tpcNSigmaPr()) < tpcPIDcut[nitr - 2]) {
tpcPIDPassed = true;
}
}
}
}
Expand All @@ -229,7 +236,7 @@ struct lambdaAnalysis {
auto tpcPIDcut = static_cast<std::vector<float>>(kaonTPCPIDcut);
int nitr = static_cast<int>(tpcPIDpt.size());

if (candidate.hasTOF()) {
if (!cUseTpcOnly && candidate.hasTOF()) {
if (std::abs(candidate.tofNSigmaKa()) < cMaxTOFnSigmaKaon) {
tofPIDPassed = true;
}
Expand All @@ -244,12 +251,18 @@ struct lambdaAnalysis {
}
} else {
tofPIDPassed = true;
for (int i = 0; i < nitr - 1; ++i) {
if (candidate.pt() >= tpcPIDpt[i] && candidate.pt() < tpcPIDpt[i + 1] && std::abs(candidate.tpcNSigmaKa()) < tpcPIDcut[i]) {
if (cUseTpcOnly) {
if (std::abs(candidate.tpcNSigmaKa()) < cMaxTPCnSigmaKaon) {
tpcPIDPassed = true;
}
if (!cUseTpcAndTof && candidate.pt() >= tpcPIDpt[nitr - 1] && std::abs(candidate.tpcNSigmaKa()) < tpcPIDcut[nitr - 2]) {
tpcPIDPassed = true;
} else {
for (int i = 0; i < nitr - 1; ++i) {
if (candidate.pt() >= tpcPIDpt[i] && candidate.pt() < tpcPIDpt[i + 1] && std::abs(candidate.tpcNSigmaKa()) < tpcPIDcut[i]) {
tpcPIDPassed = true;
}
if (!cUseTpcAndTof && candidate.pt() >= tpcPIDpt[nitr - 1] && std::abs(candidate.tpcNSigmaKa()) < tpcPIDcut[nitr - 2]) {
tpcPIDPassed = true;
}
}
}
}
Expand Down Expand Up @@ -308,7 +321,7 @@ struct lambdaAnalysis {
histos.fill(HIST("QAafter/Proton/hPt"), trkPr.pt());
histos.fill(HIST("QAafter/Proton/hDcaZ"), trkPr.pt(), trkPr.dcaZ());
histos.fill(HIST("QAafter/Proton/hDcaXY"), trkPr.pt(), trkPr.dcaXY());
if (trkPr.hasTOF()) {
if (!cUseTpcOnly && trkPr.hasTOF()) {
histos.fill(HIST("QAafter/Proton/hTPCNsigmaTOF"), trkPr.pt(), trkPr.tpcNSigmaPr());
histos.fill(HIST("QAafter/Proton/hTOFNsigma"), trkPr.pt(), trkPr.tofNSigmaPr());
histos.fill(HIST("QAafter/Proton/hTpcTofNsigma"), trkPr.tpcNSigmaPr(), trkPr.tofNSigmaPr());
Expand All @@ -318,7 +331,7 @@ struct lambdaAnalysis {
histos.fill(HIST("QAafter/Kaon/hPt"), trkKa.pt());
histos.fill(HIST("QAafter/Kaon/hDcaZ"), trkKa.pt(), trkKa.dcaZ());
histos.fill(HIST("QAafter/Kaon/hDcaXY"), trkKa.pt(), trkKa.dcaXY());
if (trkKa.hasTOF()) {
if (!cUseTpcOnly && trkKa.hasTOF()) {
histos.fill(HIST("QAafter/Kaon/hTPCNsigmaTOF"), trkKa.pt(), trkKa.tpcNSigmaKa());
histos.fill(HIST("QAafter/Kaon/hTOFNsigma"), trkKa.pt(), trkKa.tofNSigmaKa());
histos.fill(HIST("QAafter/Kaon/hTpcTofNsigma"), trkKa.tpcNSigmaKa(), trkKa.tofNSigmaKa());
Expand Down

0 comments on commit 40d8db4

Please sign in to comment.