-
Notifications
You must be signed in to change notification settings - Fork 98
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
Allow for 3D box in FairBoxGenerator #1576
Conversation
WalkthroughWalkthroughThe Changes
Recent review detailsConfiguration used: CodeRabbit UI Files ignored due to path filters (1)
Files selected for processing (2)
Files skipped from review due to trivial changes (1)
Additional comments not posted (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? |
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
fairroot/generators/FairBoxGenerator.h (1)
115-116
: Update method calls to match the new signatureThe method calls to
SetBoxXYZ
in the following files do not match the new signature and need to be updated:
examples/simulation/Tutorial4/macros/run_tutorial4.C
examples/simulation/Tutorial4/macros/run_tutorial4_createMatrices.C
examples/simulation/Tutorial4/macros/run_tutorial4_createGeometryFile.C
Ensure all calls to
SetBoxXYZ
match the new signature:SetBoxXYZ(Double32_t x1 = 0, Double32_t y1 = 0, Double32_t z1 = 0, Double32_t x2 = 0, Double32_t y2 = 0, Double32_t z2 = 0);
Analysis chain
LGTM! But verify the method usage in the codebase.
The method signature change is consistent with the implementation in the
.cxx
file.However, ensure that all calls to
SetBoxXYZ
match the new signature.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all method calls to `SetBoxXYZ` match the new signature. # Test: Search for the method usage. Expect: Only occurrences of the new signature. rg --type cpp -A 5 $'SetBoxXYZ'Length of output: 3315
@cvilelahep , can you please apply |
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
fairroot/generators/FairBoxGenerator.cxx (1)
109-128
: Action Required: Update or Deprecate Overloaded MethodSetBoxXYZ
.The overloaded
SetBoxXYZ(x1, y1, x2, y2, z)
method is still in use in the following example files and should be updated or deprecated to ensure consistency with the new method signature:
examples/simulation/Tutorial4/macros/run_tutorial4_createMatrices.C
examples/simulation/Tutorial4/macros/run_tutorial4.C
examples/simulation/Tutorial4/macros/run_tutorial4_createGeometryFile.C
Additionally, the header file and implementation file still contain the old method signature:
fairroot/generators/FairBoxGenerator.h
fairroot/generators/FairBoxGenerator.cxx
Please update these instances to use the new
SetBoxXYZ
method that supports two z-coordinates.Analysis chain
Approved: Enhancement to support 3D box in
SetBoxXYZ
.The
SetBoxXYZ
method has been correctly updated to support two z-coordinates for generating particles within a 3D box.Ensure that the usage of the overloaded method
SetBoxXYZ(x1, y1, x2, y2, z)
has been updated or deprecated as needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the overloaded method `SetBoxXYZ(x1, y1, x2, y2, z)`. # Test: Search for the function usage. Expect: No usage or deprecation comments. rg --type cpp -A 5 $'SetBoxXYZ($_, $_, $_, $_, $_)'Length of output: 52
Script:
#!/bin/bash # Description: Verify the usage of the overloaded method `SetBoxXYZ`. # Test: Search for the function usage. Expect: No usage or deprecation comments. rg --type cpp 'SetBoxXYZ'Length of output: 1238
@karabowi done. |
There is a problem with your function. It is in conflict with the old function
Maybe remove default values? |
Ah, of course, sorry for missing this. I removed the default values. |
@cvilelahep , sine your changes you should apply |
With this commit, it is now possible to generate particles randomly within a 3D box. Previously, the depth of the box was hard-coded to zero and therefore it was only possible to generate particles within a rectangle in a plane.
2fd2d52
to
81b409d
Compare
31733bc
to
67ac496
Compare
67ac496
to
08726b4
Compare
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.
LGTM.
@karabowi we maybe should update one example with the new feature (and keep another with the old one)?
Most of the failing tests look good to me.
- One could be resolved by rebasing to latest dev branch.
@ChristianTackeGSI good idea, I have created an issue not to forget. |
The current FairBoxGenerator allows only for generating particles over a plane as the depth of the box,
dZ
, is hard-coded to be 0.In this pull request, the
SetBoxXYZ
method is overloaded to accept also two values of z (z1
andz2
) from whichdZ
is computed in the same way asdX
anddY
.Checklist: