Skip to content

Fix missing <cmath>/TMath.h includes for gcc15 + ROOT 6.40 - #109

Merged
jbeirer merged 1 commit into
mainfrom
main-fixMissingIncludes
Jul 23, 2026
Merged

Fix missing <cmath>/TMath.h includes for gcc15 + ROOT 6.40#109
jbeirer merged 1 commit into
mainfrom
main-fixMissingIncludes

Conversation

@jbeirer

@jbeirer jbeirer commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Refactor
    • Standardized mathematical calculations across simulation, histogram, interpolation, geometry, and shower-processing components.
    • Replaced legacy and unqualified math utilities with consistent C++ standard-library equivalents.
    • Preserved existing behavior, public interfaces, and numerical processing logic.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 269d4848-0977-481a-9ce2-44f119288cfe

📥 Commits

Reviewing files that changed from the base of the PR and between 1c9193b and 20806c6.

📒 Files selected for processing (23)
  • include/FastCaloSim/Core/TFCS2DFunctionTemplateInterpolationExpHistogram.h
  • include/FastCaloSim/Core/TFCSLateralShapeParametrizationHitBase.h
  • include/FastCaloSim/Core/TFCSPhiModulationCorrection.h
  • include/FastCaloSim/Geometry/MeanAndRMS.h
  • source/Core/TFCS1DFunctionHistogram.cxx
  • source/Core/TFCS1DFunctionInt16Histogram.cxx
  • source/Core/TFCS1DFunctionInt32Histogram.cxx
  • source/Core/TFCS2DFunctionHistogram.cxx
  • source/Core/TFCS2DFunctionLateralShapeParametrization.cxx
  • source/Core/TFCSBinnedShower.cxx
  • source/Core/TFCSBinnedShowerBase.cxx
  • source/Core/TFCSBinnedShowerONNX.cxx
  • source/Core/TFCSEnergyAndHitGANV2.cxx
  • source/Core/TFCSEnergyInterpolationPiecewiseLinear.cxx
  • source/Core/TFCSEnergyInterpolationSpline.cxx
  • source/Core/TFCSFlatLateralShapeParametrization.cxx
  • source/Core/TFCSHistoLateralShapeParametrizationFCal.cxx
  • source/Core/TFCSHitCellMappingWiggle.cxx
  • source/Core/TFCSLateralShapeParametrizationHitNumberFromE.cxx
  • source/Core/TFCSParametrizationAbsEtaSelectChain.cxx
  • source/Core/TFCSParametrizationEkinSelectChain.cxx
  • source/Core/TFCSPhiModulationCorrection.cxx
  • source/Core/TFCSVoxelHistoLateralCovarianceFluctuations.cxx

📝 Walkthrough

Walkthrough

This PR adds explicit <cmath> dependencies and replaces unqualified or ROOT TMath calls with std math functions across interpolation, histogram, shower, geometry, GAN, covariance, and correction implementations. Public APIs and control flow remain unchanged.

Changes

C++ math standardization

Layer / File(s) Summary
Header math dependencies
include/FastCaloSim/Core/*.h, include/FastCaloSim/Geometry/MeanAndRMS.h
Headers add explicit C++ math includes and qualify logarithmic, square-root, and hyperbolic operations with std.
Histogram and energy interpolation math
source/Core/TFCS1DFunctionHistogram.cxx, source/Core/TFCS*Histogram.cxx, source/Core/TFCSEnergyInterpolation*.cxx, source/Core/TFCSParametrization*SelectChain.cxx
Histogram checks and energy interpolation or selection calculations replace unqualified and ROOT math calls with standard-library equivalents.
Shower and coordinate calculations
source/Core/TFCSBinnedShower*.cxx, source/Core/TFCS*LateralShape*.cxx, source/Core/TFCSHitCellMappingWiggle.cxx, source/Core/TFCSLateralShapeParametrizationHitNumberFromE.cxx
Shower matching, inverse-CDF sampling, geometry, trigonometry, and fluctuation calculations use explicit std functions.
GAN, covariance, and correction math
source/Core/TFCSEnergyAndHitGANV2.cxx, source/Core/TFCSVoxelHistoLateralCovarianceFluctuations.cxx, source/Core/TFCSPhiModulationCorrection.cxx
GAN generation, covariance fluctuation, and phi-modulation calculations switch to standard-library algorithms and math functions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • fcs-proj/FastCaloSim#84: Introduced the binned-shower implementations whose ROOT math calls are standardized here.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the PR’s main change: adding missing math includes and aligning math usage for gcc15/ROOT 6.40 compatibility.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch main-fixMissingIncludes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 17.07317% with 68 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
source/Core/TFCSEnergyAndHitGANV2.cxx 0.00% 17 Missing ⚠️
...re/TFCSVoxelHistoLateralCovarianceFluctuations.cxx 0.00% 9 Missing ⚠️
source/Core/TFCSBinnedShower.cxx 0.00% 7 Missing ⚠️
...Core/TFCS2DFunctionLateralShapeParametrization.cxx 0.00% 5 Missing ⚠️
source/Core/TFCSBinnedShowerONNX.cxx 0.00% 5 Missing ⚠️
...ce/Core/TFCSEnergyInterpolationPiecewiseLinear.cxx 0.00% 5 Missing ⚠️
source/Core/TFCSBinnedShowerBase.cxx 0.00% 3 Missing ⚠️
source/Core/TFCSParametrizationEkinSelectChain.cxx 50.00% 3 Missing ⚠️
.../TFCS2DFunctionTemplateInterpolationExpHistogram.h 0.00% 2 Missing ⚠️
...oSim/Core/TFCSLateralShapeParametrizationHitBase.h 0.00% 2 Missing ⚠️
... and 7 more
Files with missing lines Coverage Δ
...ude/FastCaloSim/Core/TFCSPhiModulationCorrection.h 0.00% <ø> (ø)
.../Core/TFCSHistoLateralShapeParametrizationFCal.cxx 78.94% <100.00%> (+0.56%) ⬆️
source/Core/TFCSHitCellMappingWiggle.cxx 15.59% <100.00%> (ø)
.../TFCSLateralShapeParametrizationHitNumberFromE.cxx 40.35% <100.00%> (ø)
...urce/Core/TFCSParametrizationAbsEtaSelectChain.cxx 20.00% <100.00%> (ø)
source/Core/TFCS1DFunctionInt16Histogram.cxx 0.00% <0.00%> (ø)
source/Core/TFCS1DFunctionInt32Histogram.cxx 32.07% <0.00%> (ø)
source/Core/TFCS2DFunctionHistogram.cxx 32.75% <0.00%> (ø)
source/Core/TFCSEnergyInterpolationSpline.cxx 40.47% <50.00%> (-1.39%) ⬇️
.../TFCS2DFunctionTemplateInterpolationExpHistogram.h 0.00% <0.00%> (ø)
... and 12 more

@jbeirer
jbeirer merged commit 5691026 into main Jul 23, 2026
17 checks passed
@jbeirer
jbeirer deleted the main-fixMissingIncludes branch July 23, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant