Skip to content

Commit 9fdac63

Browse files
Refactor particle correlation conditions for clarity
1 parent 3b0a321 commit 9fdac63

1 file changed

Lines changed: 4 additions & 27 deletions

File tree

‎PWGCF/TwoParticleCorrelations/Tasks/hParticleCorrelation.cxx‎

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4537,39 +4537,16 @@ struct HParticleCorrelationMixedEvent {
45374537
float tofNSigma = 0.0f;
45384538
float massHypothesis = 0.0f;
45394539

4540-
if constexpr (pairType == kHPhi) {
4541-
tpcNSigma = track.tpcNSigmaKa();
4542-
tofNSigma = track.tofNSigmaKa();
4543-
massHypothesis = MassKPlus;
4544-
} else if constexpr (pairType == kHKStar && dauType == kPosDau) {
4540+
if constexpr (pairType == kHPhi || (pairType == kHKStar && dauType == kPosDau) || (pairType == kHKStarBar && dauType == kNegDau) ||
4541+
(pairType == kHLambda && dauType == kNegDau) || (pairType == kHLambdaBar && dauType == kPosDau)) {
45454542
tpcNSigma = track.tpcNSigmaKa();
45464543
tofNSigma = track.tofNSigmaKa();
45474544
massHypothesis = MassKPlus;
4548-
} else if constexpr (pairType == kHKStar && dauType == kNegDau) {
4549-
tpcNSigma = track.tpcNSigmaPi();
4550-
tofNSigma = track.tofNSigmaPi();
4551-
massHypothesis = MassPiPlus;
4552-
} else if constexpr (pairType == kHKStarBar && dauType == kPosDau) {
4545+
} else if constexpr ((pairType == kHKStar && dauType == kNegDau) || (pairType == kHKStarBar && dauType == kPosDau)) {
45534546
tpcNSigma = track.tpcNSigmaPi();
45544547
tofNSigma = track.tofNSigmaPi();
45554548
massHypothesis = MassPiPlus;
4556-
} else if constexpr (pairType == kHKStarBar && dauType == kNegDau) {
4557-
tpcNSigma = track.tpcNSigmaKa();
4558-
tofNSigma = track.tofNSigmaKa();
4559-
massHypothesis = MassKPlus;
4560-
} else if constexpr (pairType == kHLambda && dauType == kPosDau) {
4561-
tpcNSigma = track.tpcNSigmaPr();
4562-
tofNSigma = track.tofNSigmaPr();
4563-
massHypothesis = MassProton;
4564-
} else if constexpr (pairType == kHLambda && dauType == kNegDau) {
4565-
tpcNSigma = track.tpcNSigmaKa();
4566-
tofNSigma = track.tofNSigmaKa();
4567-
massHypothesis = MassKPlus;
4568-
} else if constexpr (pairType == kHLambdaBar && dauType == kPosDau) {
4569-
tpcNSigma = track.tpcNSigmaKa();
4570-
tofNSigma = track.tofNSigmaKa();
4571-
massHypothesis = MassKPlus;
4572-
} else if constexpr (pairType == kHLambdaBar && dauType == kNegDau) {
4549+
} else if constexpr ((pairType == kHLambda && dauType == kPosDau) || (pairType == kHLambdaBar && dauType == kNegDau)) {
45734550
tpcNSigma = track.tpcNSigmaPr();
45744551
tofNSigma = track.tofNSigmaPr();
45754552
massHypothesis = MassProton;

0 commit comments

Comments
 (0)