Skip to content

Port upstream Athena improvements from main - #106

Merged
jbeirer merged 2 commits into
mainfrom
main-portUpstreamImprovements
Jul 9, 2026
Merged

Port upstream Athena improvements from main#106
jbeirer merged 2 commits into
mainfrom
main-portUpstreamImprovements

Conversation

@jbeirer

@jbeirer jbeirer commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Ports upstream Athena changes in preparation for full migration:

  • Detach GAN binning histograms from gDirectory and guard GAN inference
    with a mutex (ATLASSIM-7031 thread-safety fixes)
  • Fix libxml2 attribute leaks and add robustness to binning.xml parsing
  • Fix memory leaks: histo_to_array, TFCSHitCellMappingWiggle
    re-initialization, TFile handling in TFCSGANEtaSlice/TFCSBinnedShowerONNX
  • Initialize members: Hit::m_z, GAN/shape-parametrization headers,
    FCS_Cell structs, CylinderIntersections
  • Guard against division by zero in TFCS1DFunction::get_maxdev and
    TFCSEnergyBinParametrization
  • Modernize: std::abs/std::isnan over fabs/TMath, static_cast over
    C-style casts, const-ref getters/parameters, std::move on push_backs

Summary by CodeRabbit

  • Bug Fixes

    • Improved stability in histogram, GAN, and simulation workflows by preventing divide-by-zero cases, adding safer file parsing/loading checks, and initializing previously uninitialized values.
    • Reduced the chance of runtime issues by tightening memory and ownership handling in several data-loading paths.
  • Refactor

    • Streamlined several public interfaces to avoid unnecessary data copying, which should improve performance and responsiveness.
    • Added safer thread handling in energy processing and cleaned up internal state management across multiple components.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jbeirer, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 28 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 211eade1-e3b3-4580-9e14-78968621500d

📥 Commits

Reviewing files that changed from the base of the PR and between acaa807 and 8529bc7.

📒 Files selected for processing (8)
  • include/FastCaloSim/Core/TFCS1DFunctionHistogram.h
  • include/FastCaloSim/Core/TFCSBinnedShower.h
  • include/FastCaloSim/Core/TFCSBinnedShowerONNX.h
  • include/FastCaloSim/Core/TFCSGANEtaSlice.h
  • include/FastCaloSim/Core/TFCSHitCellMappingWiggle.h
  • source/Core/TFCS1DFunctionHistogram.cxx
  • source/Core/TFCSGANEtaSlice.cxx
  • source/Core/TFCSGANXMLParameters.cxx
📝 Walkthrough

Walkthrough

This PR performs a broad const-correctness and ownership refactor across FastCaloSim Core, Param, and Extrapolation headers/sources: converting value-returning/passing APIs to const-reference and move semantics, replacing typedef structs with named structs, adding default member initializers, switching to std:: math functions, and adding null/zero-division guards.

Changes

API ownership, initialization, and safety refactor

Layer / File(s) Summary
Histogram sampling ownership
include/.../TFCS1DFunctionHistogram.h, source/Core/TFCS1DFunctionHistogram.cxx
histo_to_array returns std::unique_ptr<double[]>; border/content getters return const references; sampling functions updated accordingly.
BinnedShower struct/API refactor
include/.../TFCSBinnedShower.h, source/Core/TFCSBinnedShower.cxx
Typedef structs become named structs with default init; setters/getters switch to const-ref/move semantics; boundary/energy loaders use std::move.
BinnedShowerONNX mirroring
include/.../TFCSBinnedShowerONNX.h, source/Core/TFCSBinnedShowerONNX.cxx
Same const-ref/move pattern applied to ONNX variant; error path uses FCS_MSG_ERROR with explicit file cleanup.
BinnedShowerBase cleanup
source/Core/TFCSBinnedShowerBase.cxx
Unused parameter annotated in signature; trig calls use std::cos/std::sin.
GANV2 thread safety and casts
include/.../TFCSEnergyAndHitGANV2.h, source/Core/TFCSEnergyAndHitGANV2.cxx
Adds mutex-guarded network output access, const-ref accessor, structured-binding iteration, static_cast replacements, std::abs/std::sqrt usage.
GANEtaSlice RAII and const-ref API
include/.../TFCSGANEtaSlice.h, source/Core/TFCSGANEtaSlice.cxx
Deletes copy semantics; getters return const references; file handling uses std::unique_ptr<TFile> with exceptions on failure; std::isnan/std::abs adopted.
GAN XML parsing hardening
include/.../TFCSGANXMLParameters.h, source/Core/TFCSGANXMLParameters.cxx
Reduced includes; const-ref getters; new XML attribute helpers; guards against parse failure and empty/zero bins; detaches histograms from ROOT directory.
HitCellMappingWiggle cleanup
include/.../TFCSHitCellMappingWiggle.h, source/Core/TFCSHitCellMappingWiggle.cxx
Adds clear() used by destructor and both initialize() overloads; getters return const references.
MLCalorimeterSimulator param cleanup
include/.../TFCSMLCalorimeterSimulator.h, source/Core/TFCSMLCalorimeterSimulator.cxx
Named structs; loadSimulator takes const ref; predictVoxels loops refactored.
PhiModulationCorrection const-ref API
include/.../TFCSPhiModulationCorrection.h, source/Core/TFCSPhiModulationCorrection.cxx
Filename and vector getters switch to const-reference.
Network/handler move semantics
source/Core/TFCSNetworkFactory.cxx, TFCSONNXHandler.cxx, TFCSSimpleLWTNNHandler.cxx, TFCSGANLWTNNHandler.cxx, VNetworkLWTNN.cxx
Iteration by const reference; member storage populated via std::move.
Math/init fixes and zero-division guards
source/Core/TFCS1DFunction.cxx, TFCS2DFunction.cxx, TFCS1DFunctionRegression.cxx, TFCSEnergyBinParametrization.cxx, param/.../FCS_Cell.h, and misc headers
Switch to std::abs/std::fabs; guard against zero totals/integrals; default-initialize members; static_cast replacements; literal operator spacing fix.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • fcs-proj/FastCaloSim#84: Both PRs modify the same binned-shower APIs in TFCSBinnedShower.h, including struct refactoring and const-reference getter/setter semantics.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.38% 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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the changeset: it describes porting upstream Athena improvements from main.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch main-portUpstreamImprovements

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.

@jbeirer jbeirer changed the title fix(lib): Port upstream Athena improvements fix(lib): Port upstream Athena improvements from main Jul 9, 2026
@jbeirer jbeirer changed the title fix(lib): Port upstream Athena improvements from main Port upstream Athena improvements from main Jul 9, 2026
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
source/Core/TFCSGANXMLParameters.cxx 0.00% 54 Missing ⚠️
source/Core/TFCSEnergyAndHitGANV2.cxx 0.00% 24 Missing ⚠️
source/Core/TFCSGANEtaSlice.cxx 0.00% 19 Missing ⚠️
source/Core/TFCSBinnedShowerONNX.cxx 0.00% 11 Missing ⚠️
source/Core/TFCSMLCalorimeterSimulator.cxx 0.00% 11 Missing ⚠️
source/Core/TFCS1DFunctionHistogram.cxx 0.00% 10 Missing ⚠️
source/Core/TFCSHitCellMappingWiggle.cxx 0.00% 10 Missing ⚠️
source/Core/TFCS1DFunction.cxx 0.00% 9 Missing ⚠️
source/Core/TFCSBinnedShower.cxx 0.00% 8 Missing ⚠️
source/Core/TFCSBinnedShowerBase.cxx 0.00% 6 Missing ⚠️
... and 16 more
Files with missing lines Coverage Δ
include/FastCaloSim/Core/TFCS1DFunctionHistogram.h 100.00% <ø> (ø)
...lude/FastCaloSim/Core/TFCS1DFunctionRegressionTF.h 0.00% <ø> (ø)
include/FastCaloSim/Core/TFCSEnergyAndHitGANV2.h 0.00% <ø> (ø)
...CaloSim/Core/TFCSFlatLateralShapeParametrization.h 0.00% <ø> (ø)
...nclude/FastCaloSim/Core/TFCSHitCellMappingWiggle.h 42.85% <ø> (ø)
...m/Core/TFCSLateralShapeParametrizationFluctChain.h 0.00% <ø> (ø)
...oSim/Core/TFCSLateralShapeParametrizationHitBase.h 83.67% <ø> (ø)
...ude/FastCaloSim/Core/TFCSPhiModulationCorrection.h 0.00% <ø> (ø)
include/FastCaloSim/Core/TFCSSimulationState.h 89.13% <100.00%> (ø)
...Core/TFCSVoxelHistoLateralCovarianceFluctuations.h 0.00% <ø> (ø)
... and 29 more

... and 1 file with indirect coverage changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
source/Core/TFCS1DFunctionHistogram.cxx (1)

27-35: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Guard against zero-total-weight histograms and use RAII for the clone. h_clone->Scale(1.0 / h_clone->Integral()) will produce inf/NaN when the histogram integral is zero and poison histoVals. Replacing the raw TH1D*/delete pair with std::unique_ptr<TH1D> would also make this exception-safe.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@source/Core/TFCS1DFunctionHistogram.cxx` around lines 27 - 35, The histogram
normalization in TFCS1DFunctionHistogram is unsafe when the source integral is
zero and it also manages the cloned TH1D manually. Update the cloning and
normalization logic around the hist/h_clone block to compute the integral first,
skip or handle the zero-total-weight case before calling Scale, and replace the
raw TH1D* plus delete with a std::unique_ptr<TH1D> so the clone is RAII-managed
and exception-safe. Keep the existing histoVals population logic in place after
the normalization guard.
source/Core/TFCSGANXMLParameters.cxx (1)

48-142: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Use RAII for xmlDocPtr to prevent leak on exception.

xmlFreeDoc(doc) at line 142 is unreachable if std::stoi (line 34) or std::stod (line 95) throws during parsing, leaking the XML document. This is now reachable because the PR switched from atoi/atof (which never throw) to std::stoi/std::stod (which throw on malformed input).

Proposed fix using unique_ptr with custom deleter
   xmlDocPtr doc = xmlParseFile(xmlFullFileName.c_str());
   if (!doc) {
     FCS_MSG_WARNING("Failed to parse XML file: " << xmlFullFileName);
     return;
   }
+  auto docGuard = std::unique_ptr<xmlDoc, decltype(&xmlFreeDoc)>(
+      doc, &xmlFreeDoc);

Then remove the manual xmlFreeDoc(doc) at line 142; the unique_ptr destructor handles it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@source/Core/TFCSGANXMLParameters.cxx` around lines 48 - 142, The XML document
in TFCSGANXMLParameters.cxx is manually freed with xmlFreeDoc, but that cleanup
is skipped if parsing of attributes or edge values throws from the numeric
conversions used in the XML traversal. Wrap the xmlParseFile result in an RAII
owner with a custom deleter in TFCSGANXMLParameters::ReadXML (or the equivalent
parsing routine), so the document is always released even when
std::stoi/std::stod fail, and remove the explicit xmlFreeDoc call at the end.
🧹 Nitpick comments (4)
include/FastCaloSim/Core/TFCS1DFunctionHistogram.h (1)

36-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Const-qualify these read-only accessors.

get_HistoBorders()/get_HistoContents() only return const references to members but are declared as non-const member functions, so they can't be invoked on a const TFCS1DFunctionHistogram&. Marking them const makes the accessors usable from const contexts without changing behavior.

♻️ Proposed change
-  const std::vector<float>& get_HistoBorders() { return m_HistoBorders; };
-  const std::vector<float>& get_HistoContents() { return m_HistoContents; };
+  const std::vector<float>& get_HistoBorders() const { return m_HistoBorders; };
+  const std::vector<float>& get_HistoContents() const { return m_HistoContents; };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@include/FastCaloSim/Core/TFCS1DFunctionHistogram.h` around lines 36 - 37, The
read-only accessors in TFCS1DFunctionHistogram are missing const qualification,
so they cannot be called on const instances. Update get_HistoBorders() and
get_HistoContents() to be const member functions while keeping their return
types as const references to m_HistoBorders and m_HistoContents, so the class
remains unchanged in behavior but usable from const contexts.
include/FastCaloSim/Core/TFCSHitCellMappingWiggle.h (1)

42-46: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Mark the reference-returning accessors const.

get_functions() and get_bin_low_edges() return const references but are non-const member functions, unlike get_function(int) and get_bin_low_edge(int) right above them. This blocks calling them through a const TFCSHitCellMappingWiggle&. Add const for consistency and to keep these usable from const contexts.

♻️ Proposed fix
-  const std::vector<const TFCS1DFunction*>& get_functions()
-  {
-    return m_functions;
-  };
-  const std::vector<float>& get_bin_low_edges() { return m_bin_low_edge; };
+  const std::vector<const TFCS1DFunction*>& get_functions() const
+  {
+    return m_functions;
+  };
+  const std::vector<float>& get_bin_low_edges() const { return m_bin_low_edge; };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@include/FastCaloSim/Core/TFCSHitCellMappingWiggle.h` around lines 42 - 46,
The reference-returning accessors in TFCSHitCellMappingWiggle are missing const
qualification, which prevents using them on const instances. Update
get_functions() and get_bin_low_edges() in TFCSHitCellMappingWiggle to be const
member functions, matching the style of get_function(int) and
get_bin_low_edge(int), so callers can access these references from const
contexts.
source/Core/TFCSGANEtaSlice.cxx (1)

108-108: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use std::move for consistency with other create() calls.

Lines 92, 100, and 115 all use std::move(inputFileName), but line 108 passes inputFileName by copy. The string is reassigned at line 112, so moving is safe.

Proposed fix
-    m_net_high = TFCSNetworkFactory::create(inputFileName);
+    m_net_high = TFCSNetworkFactory::create(std::move(inputFileName));
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@source/Core/TFCSGANEtaSlice.cxx` at line 108, The create() call in
TFCSGANEtaSlice::createNetworkData uses inputFileName inconsistently by passing
it by copy instead of move. Update the m_net_high assignment to use
std::move(inputFileName), matching the other TFCSNetworkFactory::create calls in
this method and keeping ownership transfer consistent before the variable is
reassigned later.
source/Core/TFCSEnergyAndHitGANV2.cxx (1)

142-145: 🚀 Performance & Scalability | 🔵 Trivial | 🏗️ Heavy lift

Consider narrowing the mutex lock scope for multi-threaded performance.

The std::scoped_lock at line 144 is held through the entire fillEnergy function (lines 144–527), serializing not just GAN inference but all hit creation, random number generation, and chain simulation. The comment states the goal is to "protect the GAN inference and network outputs," but outputs is already a local copy (line 145). If m_slice and m_param are stable during simulation (i.e., LoadGAN is only called during initialization), the lock could potentially be released after GetNetworkOutputs and GetFitResults are retrieved, allowing concurrent hit simulation with separate simulstate/truth per thread.

This requires verifying that chain elements accessed via simulate_hit (lines 259, 481) are either stateless or independently thread-safe. If they have mutable per-call state, the broad lock is necessary.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@source/Core/TFCSEnergyAndHitGANV2.cxx` around lines 142 - 145, The mutex in
fillEnergy is broader than needed and currently serializes the whole simulation
path. Keep the lock only around the shared GAN access in
TFCSEnergyAndHitGANV2::fillEnergy, specifically the
GetNetworkOutputs/GetFitResults retrieval from m_slice/m_param, and release it
before hit creation, random generation, and chain simulation if those operations
only use per-call state. Verify any simulate_hit chain elements are thread-safe
or stateless before narrowing the scope.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@include/FastCaloSim/Core/TFCSBinnedShower.h`:
- Around line 128-135: `TFCSBinnedShower::get_eventlibrary()` and
`TFCSBinnedShower::get_coordinates()` are missing `const` on the member function
even though they return const references. Update both getters in
`TFCSBinnedShower` to be const-qualified, matching the existing const-correct
accessors like `get_hdf5_path()`, `get_sub_bin_distribution()`, and
`get_upscaling_energies()`, so they can be called on const instances.

In `@include/FastCaloSim/Core/TFCSBinnedShowerONNX.h`:
- Line 78: Add a const qualifier to the TFCSBinnedShowerONNX::get_coordinates()
accessor so it matches the other read-only getters and the existing const
overloads. Update the declaration in TFCSBinnedShowerONNX to make the method
const while keeping the return type as a const reference, and ensure any callers
still compile with the new const-correct signature.

In `@include/FastCaloSim/Core/TFCSGANEtaSlice.h`:
- Around line 55-58: The `GetExtrapolatorWeights()` accessor in
`TFCSGANEtaSlice` is missing a `const` qualifier, unlike `GetFitResults()`, so
update the method signature to make it callable on a `const TFCSGANEtaSlice&`
and keep the class consistent with the PR’s const-correctness. Locate the
non-const `GetExtrapolatorWeights()` method and change only its
declaration/definition so it remains a read-only accessor returning
`m_extrapolatorWeights`.

In `@source/Core/TFCSGANEtaSlice.cxx`:
- Around line 139-140: The histogram lookup in TFCSGANEtaSlice::GetHisto uses
file->Get(histoName.c_str()) without checking for a null result before calling
h1->Integral(), which can dereference a missing histogram. Add a null check
immediately after the Get call in TFCSGANEtaSlice::GetHisto, and if h1 is
nullptr, throw a std::runtime_error consistent with the existing bad-file
handling before any Integral() access.

In `@source/Core/TFCSGANXMLParameters.cxx`:
- Around line 94-96: Update the r_edges parsing loop in TFCSGANXMLParameters so
it does not pass empty or malformed tokens directly into std::stod. In the
tokenization logic that fills edges, add handling to skip empty tokens
(including cases from trailing or repeated commas) before conversion, or
otherwise guard the std::stod call with error handling so malformed input does
not throw. Keep the fix localized to the parsing block that uses std::getline
and edges.push_back.

---

Outside diff comments:
In `@source/Core/TFCS1DFunctionHistogram.cxx`:
- Around line 27-35: The histogram normalization in TFCS1DFunctionHistogram is
unsafe when the source integral is zero and it also manages the cloned TH1D
manually. Update the cloning and normalization logic around the hist/h_clone
block to compute the integral first, skip or handle the zero-total-weight case
before calling Scale, and replace the raw TH1D* plus delete with a
std::unique_ptr<TH1D> so the clone is RAII-managed and exception-safe. Keep the
existing histoVals population logic in place after the normalization guard.

In `@source/Core/TFCSGANXMLParameters.cxx`:
- Around line 48-142: The XML document in TFCSGANXMLParameters.cxx is manually
freed with xmlFreeDoc, but that cleanup is skipped if parsing of attributes or
edge values throws from the numeric conversions used in the XML traversal. Wrap
the xmlParseFile result in an RAII owner with a custom deleter in
TFCSGANXMLParameters::ReadXML (or the equivalent parsing routine), so the
document is always released even when std::stoi/std::stod fail, and remove the
explicit xmlFreeDoc call at the end.

---

Nitpick comments:
In `@include/FastCaloSim/Core/TFCS1DFunctionHistogram.h`:
- Around line 36-37: The read-only accessors in TFCS1DFunctionHistogram are
missing const qualification, so they cannot be called on const instances. Update
get_HistoBorders() and get_HistoContents() to be const member functions while
keeping their return types as const references to m_HistoBorders and
m_HistoContents, so the class remains unchanged in behavior but usable from
const contexts.

In `@include/FastCaloSim/Core/TFCSHitCellMappingWiggle.h`:
- Around line 42-46: The reference-returning accessors in
TFCSHitCellMappingWiggle are missing const qualification, which prevents using
them on const instances. Update get_functions() and get_bin_low_edges() in
TFCSHitCellMappingWiggle to be const member functions, matching the style of
get_function(int) and get_bin_low_edge(int), so callers can access these
references from const contexts.

In `@source/Core/TFCSEnergyAndHitGANV2.cxx`:
- Around line 142-145: The mutex in fillEnergy is broader than needed and
currently serializes the whole simulation path. Keep the lock only around the
shared GAN access in TFCSEnergyAndHitGANV2::fillEnergy, specifically the
GetNetworkOutputs/GetFitResults retrieval from m_slice/m_param, and release it
before hit creation, random generation, and chain simulation if those operations
only use per-call state. Verify any simulate_hit chain elements are thread-safe
or stateless before narrowing the scope.

In `@source/Core/TFCSGANEtaSlice.cxx`:
- Line 108: The create() call in TFCSGANEtaSlice::createNetworkData uses
inputFileName inconsistently by passing it by copy instead of move. Update the
m_net_high assignment to use std::move(inputFileName), matching the other
TFCSNetworkFactory::create calls in this method and keeping ownership transfer
consistent before the variable is reassigned later.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 34e4db32-4b0d-4d80-8cda-726899008e28

📥 Commits

Reviewing files that changed from the base of the PR and between c81760d and acaa807.

📒 Files selected for processing (39)
  • include/FastCaloSim/Core/TFCS1DFunctionHistogram.h
  • include/FastCaloSim/Core/TFCS1DFunctionRegressionTF.h
  • include/FastCaloSim/Core/TFCSBinnedShower.h
  • include/FastCaloSim/Core/TFCSBinnedShowerONNX.h
  • include/FastCaloSim/Core/TFCSEnergyAndHitGANV2.h
  • include/FastCaloSim/Core/TFCSFlatLateralShapeParametrization.h
  • include/FastCaloSim/Core/TFCSGANEtaSlice.h
  • include/FastCaloSim/Core/TFCSGANXMLParameters.h
  • include/FastCaloSim/Core/TFCSHitCellMappingWiggle.h
  • include/FastCaloSim/Core/TFCSLateralShapeParametrizationFluctChain.h
  • include/FastCaloSim/Core/TFCSLateralShapeParametrizationHitBase.h
  • include/FastCaloSim/Core/TFCSMLCalorimeterSimulator.h
  • include/FastCaloSim/Core/TFCSPhiModulationCorrection.h
  • include/FastCaloSim/Core/TFCSSimulationState.h
  • include/FastCaloSim/Core/TFCSVoxelHistoLateralCovarianceFluctuations.h
  • include/FastCaloSim/Extrapolation/FastCaloSimCaloExtrapolation.h
  • param/include/FastCaloSimParam/FCS_Cell.h
  • source/Core/TFCS1DFunction.cxx
  • source/Core/TFCS1DFunctionHistogram.cxx
  • source/Core/TFCS1DFunctionRegression.cxx
  • source/Core/TFCS2DFunction.cxx
  • source/Core/TFCSBinnedShower.cxx
  • source/Core/TFCSBinnedShowerBase.cxx
  • source/Core/TFCSBinnedShowerONNX.cxx
  • source/Core/TFCSEnergyAndHitGANV2.cxx
  • source/Core/TFCSEnergyBinParametrization.cxx
  • source/Core/TFCSGANEtaSlice.cxx
  • source/Core/TFCSGANLWTNNHandler.cxx
  • source/Core/TFCSGANXMLParameters.cxx
  • source/Core/TFCSHitCellMappingWiggle.cxx
  • source/Core/TFCSMLCalorimeterSimulator.cxx
  • source/Core/TFCSNetworkFactory.cxx
  • source/Core/TFCSONNXHandler.cxx
  • source/Core/TFCSParametrizationBase.cxx
  • source/Core/TFCSParametrizationChain.cxx
  • source/Core/TFCSPhiModulationCorrection.cxx
  • source/Core/TFCSSimpleLWTNNHandler.cxx
  • source/Core/TFCSVoxelHistoLateralCovarianceFluctuations.cxx
  • source/Core/VNetworkLWTNN.cxx

Comment thread include/FastCaloSim/Core/TFCSBinnedShower.h Outdated
Comment thread include/FastCaloSim/Core/TFCSBinnedShowerONNX.h Outdated
Comment thread include/FastCaloSim/Core/TFCSGANEtaSlice.h Outdated
Comment thread source/Core/TFCSGANEtaSlice.cxx Outdated
Comment thread source/Core/TFCSGANXMLParameters.cxx
@jbeirer
jbeirer merged commit 161a471 into main Jul 9, 2026
14 checks passed
@jbeirer
jbeirer deleted the main-portUpstreamImprovements branch July 9, 2026 10:06
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