Skip to content

add gean4 selection #2039

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add gean4 selection #2039

wants to merge 1 commit into from

Conversation

lkwinta
Copy link
Contributor

@lkwinta lkwinta commented Apr 23, 2025

No description provided.

@lkwinta lkwinta force-pushed the 2003-add-gean4-selection branch from f12055f to 42e7e9a Compare April 23, 2025 09:12
@grzanka grzanka requested a review from Copilot April 23, 2025 18:20
@grzanka grzanka added the Webassembly Bachelor 2025 label Apr 23, 2025
"generator": "YaptideEditor.toJSON"
},
"project": {
"title": "Empty Geant 4 project",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"title": "Empty Geant 4 project",
"title": "Empty Geant4 project",

Copy link

@Copilot Copilot AI left a 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 adds GEANT4 as a new simulator option, updating both type definitions and UI labels while also extending scoring configuration support.

  • Introduces GEANT4 in the SimulatorType enum and updates the mapping in SimulatorNames.
  • Adds GEANT4-specific UI description in the sidebar and extends the SCORING_OPTIONS to include a GEANT4 key.
  • Updates relevant files to align with the new GEANT4 support.

Reviewed Changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.

File Description
src/types/RequestTypes.ts Added GEANT4 to SimulatorType enum and SimulatorNames map.
src/ThreeEditor/components/Sidebar/EditorSidebar.tsx Added a GEANT4-specific label in simulatorDescriptions.
src/ThreeEditor/Simulation/Scoring/ScoringOutputTypes.ts Added an empty GEANT4 configuration to SCORING_OPTIONS.
Files not reviewed (2)
  • public/examples/ex8.json: Language not supported
  • src/examples/exampleMap.json: Language not supported

Comment on lines +583 to 585
DETECTOR: {},
ZONE: {}
}
Copy link
Preview

Copilot AI Apr 23, 2025

Choose a reason for hiding this comment

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

The GEANT4 entry in SCORING_OPTIONS is empty, which may lead to runtime issues if scoring options are accessed. Consider providing a default structure for GEANT4 similar to the one for FLUKA or updating the downstream logic to handle empty configurations.

Suggested change
DETECTOR: {},
ZONE: {}
}
DETECTOR: {
Fluence: {
configuration: new Set([CONFIGURATION_OPTIONS.PER_PRIMARY]),
modifiers: new Set([])
},
Dose: {
configuration: new Set([CONFIGURATION_OPTIONS.PER_PRIMARY]),
modifiers: new Set([])
}
},
ZONE: {
Fluence: {
configuration: new Set([CONFIGURATION_OPTIONS.PER_PRIMARY]),
modifiers: new Set([SCORING_MODIFIERS.E, SCORING_MODIFIERS.ENUC])
},
Dose: {
configuration: new Set([CONFIGURATION_OPTIONS.PER_PRIMARY]),
modifiers: new Set([])
}
}

Copilot uses AI. Check for mistakes.

@@ -105,7 +105,8 @@ export function EditorSidebar(props: EditorSidebarProps) {
const simulatorDescriptions = {
[SimulatorType.COMMON]: 'Common options for Fluka and SHIELD-HIT12A',
[SimulatorType.FLUKA]: 'Fluka specific options',
[SimulatorType.SHIELDHIT]: 'SHIELD-HIT12A specific options'
[SimulatorType.SHIELDHIT]: 'SHIELD-HIT12A specific options',
[SimulatorType.GEANT4]: 'Geant4 specific options'
Copy link
Preview

Copilot AI Apr 23, 2025

Choose a reason for hiding this comment

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

GEANT4 has been added to the simulatorDescriptions, but corresponding handling in functions like getGeometryTabElements is missing. This may result in an empty or inconsistent UI when GEANT4 is selected; consider integrating GEANT4 into the relevant switch cases.

Copilot uses AI. Check for mistakes.

@@ -11,5 +11,8 @@
},
"common": {
"Beam of protons with lead collimator": "ex6.json"
},
"geant4": {
"Empty geant4 project": "ex8.json"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"Empty geant4 project": "ex8.json"
"Empty Geant4 project": "ex8.json"

Comment on lines +195 to +199
"energyLoss": 0.03,
"enableNuclearReactions": true,
"energyModelStraggling": "Vavilov",
"multipleScattering": "Moliere",
"stoppingPowerTable": "ICRU91"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"energyLoss": 0.03,
"enableNuclearReactions": true,
"energyModelStraggling": "Vavilov",
"multipleScattering": "Moliere",
"stoppingPowerTable": "ICRU91"

can we keep that empty ? those options are not applicable to Geant4, they are SHIELD-HIT12A specific

Copy link
Contributor

@grzanka grzanka left a comment

Choose a reason for hiding this comment

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

See mine and copilot inline comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Webassembly Bachelor 2025
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants