Skip to content

Commit 598740c

Browse files
Handle NaN and Inf values in kCORR2REF and kCORR4REF calculations (AliceO2Group#7893)
* Handle NaN and Inf values in kCORR2REF and kCORR4REF calculations * clang-format
1 parent 53bc0fd commit 598740c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

PWGDQ/Core/VarManager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3833,6 +3833,8 @@ void VarManager::FillQVectorFromGFW(C const& /*collision*/, A const& compA11, A
38333833
values[kM1111REF] = S41A - 6. * S12A * S21A + 8. * S13A * S11A + 3. * S22A - 6. * S14A;
38343834
values[kCORR2REF] = (norm(compA21) - S12A) / values[kM11REF];
38353835
values[kCORR4REF] = (pow(norm(compA21), 2) + norm(compA42) - 2. * (compA42 * conj(compA21) * conj(compA21)).real() + 8. * (compA23 * conj(compA21)).real() - 4. * S12A * norm(compA21) - 6. * S14A - 2. * S22A) / values[kM1111REF];
3836+
values[kCORR2REF] = std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) ? 0 : values[kCORR2REF];
3837+
values[kCORR4REF] = std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) ? 0 : values[kCORR4REF];
38363838

38373839
// TODO: provide different computations for R
38383840
// Compute the R factor using the 2 sub-events technique for second and third harmonic

0 commit comments

Comments
 (0)