Skip to content

feat: new segmentation class#4237

Open
asalzburger wants to merge 26 commits intoacts-project:mainfrom
asalzburger:feat-digitization-uses-directed-protoaxis
Open

feat: new segmentation class#4237
asalzburger wants to merge 26 commits intoacts-project:mainfrom
asalzburger:feat-digitization-uses-directed-protoaxis

Conversation

@asalzburger
Copy link
Copy Markdown
Contributor

@asalzburger asalzburger commented Apr 28, 2025

This PR introduces a new segmentation API, which will allow users to define their own segmentation as long as it does channelize correctly.

It also switches internally to this (and uses the grid instead of BinUtility).

It will be followed up by an API changing PR which will remove BinUtility from the Digitisation at all.

--- END COMMIT MESSAGE ---

Any further description goes here, @-mentions are ok here!

  • Use a conventional commits prefix: quick summary
    • We mostly use feat, fix, refactor, docs, chore and build types.
  • A milestone will be assigned by one of the maintainers

Summary by CodeRabbit

  • New Features

    • Introduced a 2D segmentation interface and Cartesian segmentation for detector surfaces, enabling precise mapping between spatial coordinates and segmentation bins.
    • Added new error handling for drift-related issues in digitization.
    • Extended interface support for querying bin indices and centers.
  • Bug Fixes

    • Improved error reporting for drift errors during digitization.
  • Tests

    • Added comprehensive unit tests for segmentation and planar surface drift, including enhanced geometry-aware scenarios and file outputs for visualization.
    • Introduced new segmentation tests and expanded test coverage for axis binning.
  • Refactor

    • Centralized and streamlined segmentation logic, reducing code duplication and improving maintainability.
    • Updated method signatures to enhance consistency and error handling.

@asalzburger asalzburger added this to the next milestone Apr 28, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 28, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Much change, this pull request brings. The Fatras digitization module receives new segmentation capabilities, introducing a CartesianSegmentation class and interface for 2D segmentation. Channelizer and PlanarSurfaceDrift interfaces are extended, with error handling for drift conditions improved. Axis interfaces in Core are updated, adding pure virtual binning methods. Test coverage expands, with new and enhanced tests for segmentation and planar drift, and build scripts updated to compile new sources. Implementation details for segmentation and channelization are refactored, centralizing logic and improving modularity. Error enums and messages gain new entries for drift-related failures.

Changes

File(s) Change Summary
Core/include/Acts/Utilities/Axis.hpp
Core/include/Acts/Utilities/IAxis.hpp
Axis interface extended: pure virtual methods getBin(double) and getBinCenter(std::size_t) added to IAxis. In Axis template specializations, these methods marked final.
Fatras/CMakeLists.txt Build configuration updated: new source files Channelizer.cpp and Segmentation.cpp added to ActsFatras library.
Fatras/include/ActsFatras/Digitization/Channelizer.hpp
Fatras/src/Digitization/Channelizer.cpp
Channelizer method channelize refactored: implementation moved to cpp, interface extended with minRelPerpDrift parameter (default 0.001). Method now computes drifted segments, applies masking and segmentation, handles activation scaling and drift errors.
Fatras/include/ActsFatras/Digitization/DigitizationError.hpp
Fatras/src/Digitization/DigitizationError.cpp
New error type DriftError added to DigitizationError enum and error category, with corresponding message.
Fatras/include/ActsFatras/Digitization/PlanarSurfaceDrift.hpp
Fatras/src/Digitization/PlanarSurfaceDrift.cpp
PlanarSurfaceDrift's toReadout method now returns a tuple of drifted 2D and original 3D segments wrapped in Acts::Result. Enhanced error handling for parallel-to-surface cases. Interface and documentation updated, with new type alias for 3D segment.
Fatras/include/ActsFatras/Digitization/Segmentation.hpp
Fatras/src/Digitization/Segmentation.cpp
New segmentation interface and implementation: ISegmentation abstract class and CartesianSegmentation for 2D binning, bin-to-position, and channel step computation.
Fatras/include/ActsFatras/Digitization/Segmentizer.hpp
Fatras/src/Digitization/Segmentizer.cpp
Segmentizer refactored: custom channel step logic removed, now relies on CartesianSegmentation::channelSteps for planar segmentation. Internal types and logic adjusted accordingly.
Tests/UnitTests/Core/Navigation/NavigationStateUpdatersTests.cpp TestAxis class updated to implement new getBin and getBinCenter methods, supporting interface changes.
Tests/UnitTests/Fatras/Digitization/PlanarSurfaceDriftTests.cpp PlanarSurfaceDrift tests split and expanded: new enhanced tests with 3D geometry, multiple drift scenarios, file outputs for visualization, and error case validation.
Tests/UnitTests/Fatras/Digitization/SegmentationTests.cpp
Tests/UnitTests/Fatras/Digitization/CMakeLists.txt
New unit test for CartesianSegmentation added, verifying binning and inverse mapping. Test target included in build configuration.

Sequence Diagram(s)

sequenceDiagram
    participant Hit
    participant Channelizer
    participant PlanarSurfaceDrift
    participant SurfaceMask
    participant Segmentizer
    participant Segmentation

    Hit->>Channelizer: channelize(hit, surface, gctx, drift, binutil, thickness, minRelPerpDrift)
    Channelizer->>PlanarSurfaceDrift: toReadout(gctx, surface, thickness, pos, dir, drift)
    PlanarSurfaceDrift-->>Channelizer: Result<(drifted2D, full3D)>
    Channelizer->>SurfaceMask: apply(drifted2D)
    SurfaceMask-->>Channelizer: masked2D
    Channelizer->>Segmentizer: segments(masked2D, binutil)
    Segmentizer->>Segmentation: channelSteps(start, end)
    Segmentation-->>Segmentizer: steps
    Segmentizer-->>Channelizer: channel segments
    Channelizer-->>Hit: vector<ChannelSegment>
Loading

Suggested labels

Component - Fatras, Component - Core, Changes Performance, automerge

Suggested reviewers

  • andiwand

Poem


Segments and bins, much order we bring,
Drift errors now handled—let the tests sing!
Surfaces planar, segmentation anew,
Channelizer’s wisdom, shining through.
Enhanced are the tests, with OBJ files in tow,
In the Force of geometry, much progress we show.
Approve this, you must—onward, we go!


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (21)
Core/include/Acts/Utilities/IAxis.hpp (1)

69-72: A minor documentation style inconsistency, I sense.

Mmm, notice do I that the documentation style differs slightly. While the first comment begins with @brief, this one does not. Consistent in documentation style, we should be.

-  // Get the bin center of the given bin
+  /// @brief Get the bin center of the given bin
Tests/UnitTests/Fatras/Digitization/SegmentationTests.cpp (1)

23-35: Test case for CartesianSegmentation, thorough it must be. Clarify comments, you should.

Created the test correctly, you have, but unclear comments I sense. "0 is underflow bin" - explain better this should. Expected position (-0.5, -0.5) - explain why this value is expected, you must.

Improve the comments with explanation like this, you could:

-  // Test binning - 0 is underflow bin
+  // Test binning - Bin indices are 1-based with 0 reserved for underflow
+  // Point (0.1, 0.1) should be in bin 10 for x-axis and bin 12 for y-axis
   auto bin = segmentation.bin(Vector2(0.1, 0.1));
   BOOST_CHECK_EQUAL(bin[0], 10);
   BOOST_CHECK_EQUAL(bin[1], 12);
-  // Test position
+  // Test position - Expected center of bin (10,12) is (-0.5,-0.5)
   auto pos = segmentation.position(bin);
   CHECK_CLOSE_ABS(pos.x(), -0.5, 1e-5);
   CHECK_CLOSE_ABS(pos.y(), -0.5, 1e-5);
Fatras/include/ActsFatras/Digitization/Channelizer.hpp (2)

11-13: Include only what you use, hmmm?

In this header no direct use of BinUtility I see; yet heavy include it still does. Compile time, it will slow. Forward-declare or move include to the .cpp file you should.


42-50: Default drift threshold hard-codes, perilous it is.

0.001 a magic number remains. Explain with constexpr named constant or documentation comment, you should. So future maintainers the Force will guide.

Fatras/src/Digitization/Segmentizer.cpp (1)

44-56: Segmentation object each call you forge; costly, it may be.

CartesianSegmentation constructed for every hit. For many hits on same surface, allocations pile up they will. Cache per‐surface instance or pass pre-built segmentation in, consider you should.

Core/include/Acts/Utilities/Axis.hpp (4)

310-313: Override keyword, forgotten it was.

final implies override, yet explicit override final clearer it is, and compiler warnings it quiets. Add, you should.

-  std::size_t getBin(double x) const final {
+  std::size_t getBin(double x) const final override {

355-357: Consistency in declaration, maintain you must.

Likewise for getBinCenter, add override keyword.

-  double getBinCenter(std::size_t bin) const final {
+  double getBinCenter(std::size_t bin) const final override {

622-626: Variable axis: same song, second verse.

getBin should mirror change.

-  std::size_t getBin(double x) const final {
+  std::size_t getBin(double x) const final override {

672-674: Variable axis: finish the quartet, yes.

For getBinCenter apply too.

-  double getBinCenter(std::size_t bin) const final {
+  double getBinCenter(std::size_t bin) const final override {
Fatras/src/Digitization/Channelizer.cpp (2)

27-29: Typos, clarity cloud they do.

fullSegement a miss-spelling is, hmmm. Readability it hurts and consistency breaks. Rename to fullSegment, you should.

-  const auto& [driftedSegment, fullSegement] = atReadoutPlane.value();
+  const auto& [driftedSegment, fullSegment] = atReadoutPlane.value();
...
-  double fullPathLength = (fullSegement[1] - fullSegement[0]).norm();
+  double fullPathLength = (fullSegment[1] - fullSegment[0]).norm();

49-54: Variable name, muddled it is.

sclale2Dto3D the eye confuses. scale2Dto3D call it, clear the Force will be.

-  double sclale2Dto3D = fullPathLength / driftedPathLength;
+  double scale2Dto3D = fullPathLength / driftedPathLength;
...
-    segment.activation *= sclale2Dto3D;
+    segment.activation *= scale2Dto3D;
Fatras/include/ActsFatras/Digitization/PlanarSurfaceDrift.hpp (1)

42-48: Docs and spelling, polished they must be.

alwayws and trailing slash / the reader distract. Also parameter spelled driftdir here, yet driftDir in the cpp it is. Align names you should, clarity it brings.

Fatras/src/Digitization/PlanarSurfaceDrift.cpp (1)

41-47: Large driftScale, potential imbalance I sense.

driftScale = 0.5 * thickness / driftDir.z();
Should driftDir.z() tiny positive but just above s_epsilon, enormous shift you create, detector geometry exceed it may. Clamp or early-return with error, consider.

Ask you I must: Verify maximal drift values foreseen are, or protection add.

Tests/UnitTests/Fatras/Digitization/PlanarSurfaceDriftTests.cpp (2)

120-200: Heavy file I/O in unit tests, unwise this is.

Many .obj files the test writes. CI environments slow it makes, filesystem permissions sometimes deny. Mock or guard such output behind debug flag you should, or remove.

-  std::ofstream fiout;
-  fiout.open("PlanarSurfaceDrift_segment_orig_3D.obj");
+  #ifdef ACTS_DEBUG_OUTPUT
+  std::ofstream fiout("PlanarSurfaceDrift_segment_orig_3D.obj");
+  #endif
...
-    std::ofstream fsout;
-    fsout.open("PlanarSurfaceDrift_" + surfaceNames[isf] + ".obj");
+    #ifdef ACTS_DEBUG_OUTPUT
+    std::ofstream fsout("PlanarSurfaceDrift_" + surfaceNames[isf] + ".obj");
+    #endif

Similar guards around all file writing apply.


50-70: Unused bindings, compile warnings spawn they may.

oSegment, dScale1 variables unused are. Replace with std::ignore or omit they should be to silence warnings.

-auto [noDriftSegment, oSegment] = ...
+auto [noDriftSegment, std::ignore] = ...
Fatras/src/Digitization/Segmentation.cpp (5)

11-11: Remove unused include, you must.

<iostream> included is, but used it is not. Remove unnecessary includes we should, to reduce compilation time and dependencies.

-#include <iostream>

13-15: Unnecessary base class initialization, I see.

Explicitly initializing ISegmentation() needed it is not. Default constructor of abstract base class automatically called it will be.

ActsFatras::CartesianSegmentation::CartesianSegmentation(
    const Acts::ProtoAxis& xAxis, const Acts::ProtoAxis& yAxis)
-    : ISegmentation(), m_xAxis(xAxis), m_yAxis(yAxis) {}
+    : m_xAxis(xAxis), m_yAxis(yAxis) {}

46-46: Spelling error in comment, fix you should.

Typo in comment there is. "The're change" written is, when "There's a change" it should be.

-  // The're change in the x direction
+  // There's a change in the x direction

61-61: Unclear comment, improve you should.

Comment "The lines channel segment lines along y" confusing it is. Clarity we need.

-  // The lines channel segment lines along y
+  // Handle channel segments crossing y-axis boundaries

74-75: Sort the channel steps, consider you should.

The ChannelStep struct has a comparison operator for path-based sorting, but steps not sorted are. For proper ordering by path length, sort before returning you should.

+  // Sort channel steps by path length
+  std::sort(cSteps.begin(), cSteps.end());
  return cSteps;

Also, include the necessary header:

+#include <algorithm>
Fatras/include/ActsFatras/Digitization/Segmentation.hpp (1)

25-25: Typo in comment, fix you must.

"patlength" written is, when "path length" it should be.

-  /// The patlength from the start
+  /// The path length from the start
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee4e5d4 and 89f7261.

📒 Files selected for processing (17)
  • Core/include/Acts/Utilities/Axis.hpp (4 hunks)
  • Core/include/Acts/Utilities/IAxis.hpp (1 hunks)
  • Fatras/CMakeLists.txt (1 hunks)
  • Fatras/include/ActsFatras/Digitization/Channelizer.hpp (2 hunks)
  • Fatras/include/ActsFatras/Digitization/DigitizationError.hpp (1 hunks)
  • Fatras/include/ActsFatras/Digitization/PlanarSurfaceDrift.hpp (2 hunks)
  • Fatras/include/ActsFatras/Digitization/Segmentation.hpp (1 hunks)
  • Fatras/include/ActsFatras/Digitization/Segmentizer.hpp (1 hunks)
  • Fatras/src/Digitization/Channelizer.cpp (1 hunks)
  • Fatras/src/Digitization/DigitizationError.cpp (1 hunks)
  • Fatras/src/Digitization/PlanarSurfaceDrift.cpp (2 hunks)
  • Fatras/src/Digitization/Segmentation.cpp (1 hunks)
  • Fatras/src/Digitization/Segmentizer.cpp (3 hunks)
  • Tests/UnitTests/Core/Navigation/NavigationStateUpdatersTests.cpp (1 hunks)
  • Tests/UnitTests/Fatras/Digitization/CMakeLists.txt (1 hunks)
  • Tests/UnitTests/Fatras/Digitization/PlanarSurfaceDriftTests.cpp (2 hunks)
  • Tests/UnitTests/Fatras/Digitization/SegmentationTests.cpp (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (4)
Core/include/Acts/Utilities/IAxis.hpp (3)
Tests/UnitTests/Core/Navigation/NavigationStateUpdatersTests.cpp (4)
  • x (130-130)
  • x (130-130)
  • bin (132-134)
  • bin (132-132)
Core/include/Acts/Utilities/Axis.hpp (22)
  • x (310-313)
  • x (310-310)
  • x (381-381)
  • x (381-381)
  • x (622-626)
  • x (622-622)
  • x (698-700)
  • x (698-698)
  • bin (268-272)
  • bin (268-269)
  • bin (280-284)
  • bin (280-281)
  • bin (292-298)
  • bin (292-293)
  • bin (330-332)
  • bin (330-330)
  • bin (344-346)
  • bin (344-344)
  • bin (355-357)
  • bin (355-355)
  • bin (580-584)
  • bin (580-581)
Core/include/Acts/Geometry/SurfaceArrayCreator.hpp (2)
  • x (69-80)
  • x (69-69)
Fatras/include/ActsFatras/Digitization/Channelizer.hpp (1)
Fatras/include/ActsFatras/Digitization/PlanarSurfaceDrift.hpp (1)
  • gctx (52-55)
Fatras/src/Digitization/Channelizer.cpp (1)
Fatras/include/ActsFatras/Digitization/Channelizer.hpp (1)
  • hit (45-49)
Fatras/src/Digitization/Segmentation.cpp (3)
Fatras/include/ActsFatras/Digitization/Segmentation.hpp (8)
  • CartesianSegmentation (73-74)
  • CartesianSegmentation (75-75)
  • bin (59-60)
  • bin (81-81)
  • pos (51-51)
  • pos (78-78)
  • start (67-68)
  • start (84-85)
Core/include/Acts/Utilities/IAxis.hpp (2)
  • bin (72-72)
  • x (67-67)
Core/include/Acts/Utilities/Axis.hpp (19)
  • bin (268-272)
  • bin (268-269)
  • bin (280-284)
  • bin (280-281)
  • bin (292-298)
  • bin (292-293)
  • bin (330-332)
  • bin (330-330)
  • bin (344-346)
  • bin (344-344)
  • bin (355-357)
  • x (310-313)
  • x (310-310)
  • x (381-381)
  • x (381-381)
  • x (622-626)
  • x (622-622)
  • x (698-700)
  • x (698-698)
🪛 Cppcheck (2.10-2)
Tests/UnitTests/Fatras/Digitization/SegmentationTests.cpp

[error] 17-17: There is an unknown macro here somewhere. Configuration is required. If BOOST_AUTO_TEST_SUITE is a macro then please configure it.

(unknownMacro)

Tests/UnitTests/Fatras/Digitization/PlanarSurfaceDriftTests.cpp

[error] 29-29: There is an unknown macro here somewhere. Configuration is required. If BOOST_AUTO_TEST_SUITE is a macro then please configure it.

(unknownMacro)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: CI Bridge / build_gnn_tensorrt
  • GitHub Check: merge-sentinel
🔇 Additional comments (12)
Core/include/Acts/Utilities/IAxis.hpp (1)

65-67: Add pure virtual methods to IAxis, a good decision this is!

Strong with the Force, this interface addition is. The getBin method, helpful it will be, for coordinate to bin index conversion. The binning logic, crucial for segmentation APIs it is.

Fatras/src/Digitization/DigitizationError.cpp (1)

34-35: Properly handle the new DriftError, you do.

Mmm, well implemented this error case is! Consistent with other error messages, your implementation remains. Simple yet informative, the message is, yes.

Tests/UnitTests/Fatras/Digitization/CMakeLists.txt (1)

8-8: Tests for new functionality, essential they are!

Wise you are, to include tests for the new segmentation implementation. Without tests, in darkness we would be. The naming convention, consistent it is with other test targets, hmm.

Fatras/include/ActsFatras/Digitization/DigitizationError.hpp (2)

22-22: Add DriftError enum value, you have. Good, this is.

To the Force, balance you bring by adding this error type. Detect drift-related issues, you now can. Clear and descriptive, the name is.


16-23:

Details

✅ Verification successful

Verify the DriftError implementation, we must.

The path to wisdom requires validation, yes. Make sure properly handled this error is, in code that uses it.


🏁 Script executed:

#!/bin/bash
# Find where DriftError is being used in the codebase
rg "DriftError" --type cpp

Length of output: 940


I seek clarity on DriftError’s handling in two places—PlanarSurfaceDrift.cpp and DigitizationError.cpp. Let us inspect them:


🏁 Script executed:

#!/bin/bash
# Inspect return of DriftError in PlanarSurfaceDrift.cpp
rg "DigitizationError::DriftError" -C3 Fatras/src/Digitization/PlanarSurfaceDrift.cpp

# Inspect case handling of DriftError in DigitizationError.cpp
rg "case DigitizationError::DriftError" -C3 Fatras/src/Digitization/DigitizationError.cpp

Length of output: 780


DriftError handling verified, properly implemented it is.

The DriftError return in PlanarSurfaceDrift.cpp and its mapping to “Drift error occurred.” in DigitizationError.cpp cover the error case as intended.

Fatras/CMakeLists.txt (1)

4-4: New source files, added correctly you have.

Noticed the addition of Channelizer.cpp and Segmentation.cpp to the build, I have. Good alignment with the PR objectives, this shows. New segmentation API, these files implement, mmm.

Also applies to: 8-9

Fatras/include/ActsFatras/Digitization/Segmentizer.hpp (1)

13-13: Include path, properly added it is.

Appropriate is this include of the new Segmentation.hpp header. Enables the extraction of the ChannelStep functionality from this file, it does. Wise refactoring, yes, mmmm.

Tests/UnitTests/Core/Navigation/NavigationStateUpdatersTests.cpp (1)

130-134: Implemented the required interface methods, you have. Good, this is.

The IAxis interface methods, correctly implemented they are. For getBin, returns 1 for negative values and 2 for non-negative values, it does. For getBinCenter, calculates center position of bin correctly, it does. Mark these as final, you wisely did, mmm.

Tests/UnitTests/Fatras/Digitization/SegmentationTests.cpp (1)

17-17: Test suite setup, correct it is.

Ignore the static analysis warning about unknown macro BOOST_AUTO_TEST_SUITE. Standard Boost.Test macro this is, mmm. False positive from static analyzer, it certainly is.

🧰 Tools
🪛 Cppcheck (2.10-2)

[error] 17-17: There is an unknown macro here somewhere. Configuration is required. If BOOST_AUTO_TEST_SUITE is a macro then please configure it.

(unknownMacro)

Fatras/src/Digitization/Segmentizer.cpp (3)

17-18: New segmentation header included, good this is.

Clarity and separation the change brings; concern none have I.


55-57: Out-of-range bins handled, ensure you must.

When cSegmentation.bin(start) returns {-1,-1} for under/overflow, undefined behaviour follow it might. Guard or document, wiser it is.


130-133: lastDelta type modernized, harmony I sense.

std::array<int,2> clear and safe; approve I do.

@github-actions github-actions bot added Component - Core Affects the Core module Component - Fatras Affects the Fatras module labels Apr 28, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 28, 2025

📊: Physics performance monitoring for 8d4152d

Full contents

physmon summary

@github-actions github-actions bot added Component - Examples Affects the Examples module Changes Performance labels Apr 28, 2025
@sonarqubecloud
Copy link
Copy Markdown

@github-actions github-actions bot added the Stale label May 30, 2025
@github-actions github-actions bot removed the Stale label Jul 3, 2025
@github-actions github-actions bot added the Stale label Aug 3, 2025
@paulgessinger
Copy link
Copy Markdown
Member

@asalzburger should we get this in? I think there were some output changes that I'm not sure we were expecting, an error running the code coverage calculation (this might go away if you rebase) and a few clang-tidy warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants