-
Notifications
You must be signed in to change notification settings - Fork 5
Choose between MeV and MeV/nucl in Beam configuration #2252
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
Conversation
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.
Pull Request Overview
This PR refactors the particle type handling to use a unified Particle interface instead of the separate ParticleType interface, adds mass number (a) and charge (z) properties to particle definitions, and introduces dynamic energy unit conversion functionality (MeV vs MeV/nucl) based on particle properties.
Key changes:
- Consolidates particle type definitions into a single
Particleinterface with optionalaandzproperties - Adds mass and charge data to specific particle types (Neutron, Proton, Deuteron, Triton, Helium-3, Helium-4, Alpha, 12C, Heavy ions)
- Implements dynamic energy unit conversion with a toggle between MeV and MeV/nucl based on particle mass number
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/Particle.ts | Converts Particle from type to interface, adds optional a and z properties, populates mass/charge data for nuclear particles, removes import of deprecated ParticleType |
| src/ThreeEditor/components/Sidebar/properties/category/BeamConfiguration.tsx | Implements energy unit state management and conversion, reorders UI components, adds toggle for energy units, updates particle selection to use full particle data |
| src/ThreeEditor/components/Select/ParticleSelect.tsx | Removes local ParticleType interface in favor of importing Particle from central types |
| src/ThreeEditor/Simulation/Scoring/ParticleFilter.ts | Updates to use Particle type with Omit<Particle, 'massNumber'> constraint |
| src/ThreeEditor/Simulation/Scoring/GeantScoringFilter.ts | Updates import to use Particle instead of ParticleType |
| src/ThreeEditor/Simulation/Physics/Beam.ts | Simplifies particle data type from inline definition to Particle interface, removes formatting issue in import |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/ThreeEditor/components/Sidebar/properties/category/BeamConfiguration.tsx
Outdated
Show resolved
Hide resolved
src/ThreeEditor/components/Sidebar/properties/category/BeamConfiguration.tsx
Outdated
Show resolved
Hide resolved
src/ThreeEditor/components/Sidebar/properties/category/BeamConfiguration.tsx
Outdated
Show resolved
Hide resolved
|
I believe everything should be fixed by 9424d3e And yes, converter needs to follow with separate PR |
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.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/ThreeEditor/components/Sidebar/properties/category/BeamConfiguration.tsx
Outdated
Show resolved
Hide resolved
src/ThreeEditor/components/Sidebar/properties/category/BeamConfiguration.tsx
Show resolved
Hide resolved
a3bfe25 to
0fc3857
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.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/ThreeEditor/components/Sidebar/properties/category/BeamConfiguration.tsx
Outdated
Show resolved
Hide resolved
src/ThreeEditor/components/Sidebar/properties/category/BeamConfiguration.tsx
Outdated
Show resolved
Hide resolved
src/ThreeEditor/components/Sidebar/properties/category/BeamConfiguration.tsx
Show resolved
Hide resolved
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.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.




This PR reorganizes fields in Beam configuration panel to be more logical with options depending on each other from top to bottom. It adds a toggle between MeV and MeV/nucl units that change depending on particle selected, and automatically update specified energies. It also adds Heavy Ions to Geant4, but it needs converter update to work.