-
Notifications
You must be signed in to change notification settings - Fork 45
Add options for constructing an ORANGE geometry #2045
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
Draft
elliottbiondo
wants to merge
2
commits into
celeritas-project:develop
Choose a base branch
from
elliottbiondo:options
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,11 +51,14 @@ class BIHBuilder | |
| //!@{ | ||
| //! \name Type aliases | ||
|
|
||
| //! Input parameters | ||
| struct Input | ||
| //! Options parameters | ||
| struct Options | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we move the struct, this'll become |
||
| { | ||
| //! Minimum number of bboxes needed to trigger a partitioning attempt | ||
| size_type min_split_size; | ||
| size_type min_split_size = 2; | ||
|
|
||
| //! Whether the options are valid | ||
| explicit operator bool() const { return min_split_size >= 2; } | ||
| }; | ||
|
|
||
| using VecBBox = std::vector<FastBBox>; | ||
|
|
@@ -64,8 +67,8 @@ class BIHBuilder | |
| //!@} | ||
|
|
||
| public: | ||
| // Construct from Storage and Input objects | ||
| BIHBuilder(Storage* storage, Input inp); | ||
| // Construct from Storage and Options objects | ||
| BIHBuilder(Storage* storage, Options options); | ||
|
|
||
| // Create BIH Nodes | ||
| BIHTree operator()(VecBBox&& bboxes, SetLocalVolId const& implicit_vol_id); | ||
|
|
@@ -94,7 +97,7 @@ class BIHBuilder | |
| CollectionBuilder<BIHInnerNode> inner_nodes_; | ||
| CollectionBuilder<BIHLeafNode> leaf_nodes_; | ||
|
|
||
| Input inp_; | ||
| Options options_; | ||
|
|
||
| //// HELPER FUNCTIONS //// | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might make it more messy in the short term, but I think the preferred pattern will look more like the newer celeritas code:
inp/Foo.hhhas the setup options forFoo. So we'd haveorange/inp/Bih.hhwhich would havestruct inp::Bihand that would replaceBihBuilder::Options. We'd likewise moveorange/gorg/Options.hhtoorange/inp/Converter.hh. Finally we'd also moveOrangeInputtoorange/inp/Model.hhor similar.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I think
Optionsmakes more sense, lest we overload the word "input"; we already have anorangeinpfolder. Likewise, below, I think semantically the input to theBIHBuilderare the bounding boxes, whereas themin_split_sizeis an option specifying how the process is done.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
orange/inpfolder doesn't currently exist. I can make, but I am still not clear on how InputBuilder::Options fits in (seems like that should be defined at theOrangeInputlevel).I also, I think
g4org::Optionsshould consist of: 1) a high-level struct will all general OrangeOptions, that is also used for a non-G4 workflow to specify all ORANGE options in one place, and 2) additional G4-specific options.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The weirdness/confusion is because we've been inconsistent in the past and are transitioning toward having an
inpnamespace that has all of the input structs that were formerly called Input/Options. This namespace is to be the primary interface with the outside parts of the code: see #2029.In a hypothetical/future refactorization that I am talking about:
celeritas::OrangeInput->celeritas::inp::Orangeceleritas::detail::BIHBuilder::Options->celeritas::inp::BihBuilderceleritas::g4org::Options->celeritas::inp::Converter(?)celeritas::orangeinp->celeritas::setup(?)celeritas::g4org->celeritas::setup::g4org(?)I don't know what's the right path between that future and our present, but I would at least like: