Skip to content

Commit c5ba4c5

Browse files
committed
[PWGLF] Fix cppcheck redundantInitialization in K1 micro PID selection
Initialize the TPC n-sigma once from the species instead of overwriting a NaN default in both branches. The selection is unchanged.
1 parent 0f08498 commit c5ba4c5

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎PWGLF/Core/K1AnalysisMicroCore.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,15 +683,13 @@ class K1AnalysisMicroCore
683683
return false;
684684
}
685685
const bool hasTOF = track.hasTOF();
686-
double tpcNSigma = std::numeric_limits<double>::quiet_NaN();
686+
const double tpcNSigma = (S == Species::Pion) ? track.tpcNSigmaPi() : track.tpcNSigmaKa();
687687
double tofNSigma = std::numeric_limits<double>::quiet_NaN(); // TOF value is only valid with hasTOF
688688
if constexpr (S == Species::Pion) {
689-
tpcNSigma = track.tpcNSigmaPi();
690689
if (hasTOF) {
691690
tofNSigma = track.tofNSigmaPi();
692691
}
693692
} else {
694-
tpcNSigma = track.tpcNSigmaKa();
695693
if (hasTOF) {
696694
tofNSigma = track.tofNSigmaKa();
697695
}

0 commit comments

Comments
 (0)