-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix memory corruption in scoring (#326)
This PR fixes a major memory corruption problem in the scoring: Previously, the + 1 here: ``` ::new (toucheableHandleStorage) G4TouchableHandle{::new (toucheableHistoryStorage + 1) G4TouchableHistory}; ``` Was a too small offset. Thus, the `fPostG4TouchableHistoryHandle` overlapped with the `fPreG4TouchableHistoryHandle` and overwrote its values. This is now fixed. The error broke the physics validation (note: the physics validation was done using the latest version of G4HepEm which will be made available via #324): Before this PR: ![Screenshot from 2024-12-11 16-55-26](https://github.com/user-attachments/assets/cce5bcc8-2fcb-4361-b683-6361b7ddd1e2) (the absolute scale here is off due to a change in the number of particles that was not incorporated into the plot, the relative error is correct) After this PR: ![Screenshot from 2024-12-13 15-47-10](https://github.com/user-attachments/assets/99afb009-85f3-4a7c-becf-e3586d313620) Additionally, some quality of life improvements are added: 1. The way of accessing the correct ID was reduced from: ``` hitID = fScoringMap[aStep->GetPreStepPoint()->GetTouchable()->GetHistory()->GetTopVolume()->GetInstanceID()]; ``` to ``` std::size_t hitID = fScoringMap[aStep->GetPreStepPoint()->GetPhysicalVolume()->GetInstanceID()]; ``` 2. some unused functions were removed 3. some doubled includes were removed 4. a new option of `--accumulated_events` was added to the integrationBenchmark example. Using that option, the edep of all events is written to a single line in the output.csv.
- Loading branch information
1 parent
1f11a00
commit 4fec3c6
Showing
13 changed files
with
58 additions
and
62 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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