Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support safety and reentrant boundaries for multi-universe ORANGE #1140

Merged
merged 9 commits into from
Mar 9, 2024

Conversation

elliottbiondo
Copy link
Contributor

@elliottbiondo elliottbiondo commented Mar 4, 2024

This MR adds support for reentrant cross_boundary() calls when a particle resides on boundary between geometric universes. In addition, safety distance calculations are updated to find the minimum safety distance over multiple levels. A TestEM3 unit test is added, using universes. This version of the this test problem supports simple safety. Finally, a bug in UnitInserter is fixed, in which volume flags were being erroneously unset.

@elliottbiondo elliottbiondo added the minor Minor internal changes or fixes (including CI updates) label Mar 4, 2024
@elliottbiondo elliottbiondo changed the title Add support for reentrant boundary crossing with multi-universe tracking Add support for reentrant boundary crossing and safety distance calculations with multi-universe tracking Mar 5, 2024
@elliottbiondo elliottbiondo marked this pull request as draft March 5, 2024 02:28
@elliottbiondo
Copy link
Contributor Author

@sethrj you can remove draft and begin your review

@sethrj sethrj marked this pull request as ready for review March 7, 2024 11:41

!#### LEVEL 0 UNIVERSE ####!

[UNIVERSE][SHAPE=cuboid full]
Copy link
Member

Choose a reason for hiding this comment

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

To be consistent with the gdml and "flat" geometry, could you rename this calorimeter, and add a cell called world that's outside it and inside a box with halfwidth 24?

    {
        '_type': "box",
        'widths': [48, 48, 48],
        'name': "world",
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, noting that the world cell will have an internal region, meaning supports_safety_ will now be false

Copy link
Contributor Author

@elliottbiondo elliottbiondo Mar 8, 2024

Choose a reason for hiding this comment

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

I don't know if its worth keeping the original geom as well in order to test that this returns true for it:

    supports_safety_
        = std::all_of(
              host_data.simple_units[AllItems<SimpleUnitRecord>()].begin(),
              host_data.simple_units[AllItems<SimpleUnitRecord>()].end(),
              [](SimpleUnitRecord const& su) { return su.simple_safety; })
          && host_data.rect_arrays.empty();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Model updated to include world

test/orange/Orange.test.cc Outdated Show resolved Hide resolved
test/orange/Orange.test.cc Show resolved Hide resolved
src/orange/OrangeTrackView.hh Outdated Show resolved Hide resolved
@sethrj sethrj added enhancement New feature or request orange Work on ORANGE geometry engine and removed minor Minor internal changes or fixes (including CI updates) labels Mar 7, 2024
@sethrj sethrj changed the title Add support for reentrant boundary crossing and safety distance calculations with multi-universe tracking Support safety and reentrant boundaries for multi-universe ORANGE Mar 7, 2024
@elliottbiondo
Copy link
Contributor Author

@sethrj this is ready for another look

Copy link
Member

@sethrj sethrj left a comment

Choose a reason for hiding this comment

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

Nice!

@sethrj sethrj enabled auto-merge (squash) March 9, 2024 04:27
@sethrj sethrj merged commit 18144c5 into develop Mar 9, 2024
21 checks passed
@sethrj sethrj deleted the reentrant branch March 9, 2024 04:56
sethrj pushed a commit to sethrj/celeritas that referenced this pull request Jun 20, 2024
…leritas-project#1140)

* Add support for reentrant boundary crossing with multi-universe tracking
* Fixing set_dir such that it queries the correct universe for finding the normal
* Update safety distance for multiple levels
* Add testem3 style unit test for safety distance calculation
* Fix safety distance on multiple levels
* Address comments from merge request
* TestEM3 model updated to include world volume
sethrj pushed a commit that referenced this pull request Jun 21, 2024
)

* Add support for reentrant boundary crossing with multi-universe tracking
* Fixing set_dir such that it queries the correct universe for finding the normal
* Update safety distance for multiple levels
* Add testem3 style unit test for safety distance calculation
* Fix safety distance on multiple levels
* Address comments from merge request
* TestEM3 model updated to include world volume
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request orange Work on ORANGE geometry engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants