-
Notifications
You must be signed in to change notification settings - Fork 35
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
Import muon pair production sampling table from Geant4 #1419
Import muon pair production sampling table from Geant4 #1419
Conversation
* \todo Prior to version 11.1.0, Geant4 used the \c G4BetheBlochModel for muon | ||
* ionization between 200 keV and 1 GeV and the \c G4MuBetheBlochModel above 1 | ||
* GeV. Since version 11.1.0, the \c G4MuBetheBlochModel is used for all | ||
* energies above 200 keV. |
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.
One slight complication is that different Geant4 versions use different models for muon ionization...
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.
Is the newer model available in both? Or should we just default to the same models available in the selected version of G4?
Ummmm....
|
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.
Great! Nice work.
* \todo Prior to version 11.1.0, Geant4 used the \c G4BetheBlochModel for muon | ||
* ionization between 200 keV and 1 GeV and the \c G4MuBetheBlochModel above 1 | ||
* GeV. Since version 11.1.0, the \c G4MuBetheBlochModel is used for all | ||
* energies above 200 keV. |
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.
Is the newer model available in both? Or should we just default to the same models available in the selected version of G4?
Yeah I'm not sure what's up with that test, and I don't have Celeritas built with Geant4 11.2 yet... |
The good news is it's reproducible on my machine with 11.2.1; the bad news is that |
Ah excellent, thanks @sethrj! I'll look into it... |
Wait wait wait, it's not too late, but we almost missed the opportunity to call that Element Table a |
Ok it looks like in v11.2+ |
@amandalund Yeah, so the ElementTable is designed to have the index be the element ID, but the MuPPET is fixed at size 5 (an implementation detail) and those are just indices (index of ZDATPAIR) rather than Z number (value in ZDATPAIR). There appears to be no way to get the size (the private data member I think the solution is for the muppet code to hard-code Z = 5? I can submit a PR to add an accessor to the table limits. |
Haha lord, ok, using the index to set it rather than Z (and access it... sometimes?) is also new since v11.2. Thanks for looking into that more; I'll update the import for the newer versions and I guess just hardcode the size... 🐸 🐷 |
Oh, so on older versions the table actually is indexed by element (and just has null for the ones that it's interpolating between?) That makes more sense and is a totally different implementation than the current one. See my update that it is actually using just entries 0 through 4; the current version does not expose the |
Yeah, the older versions used the table in a more intuitive way/how it was designed to be used.
I'm tempted at this point ;) |
It is still erroneously accessing the tables by the Z number in |
Ah indeed, I got confused because I'd changed some lines but not all. Clearly no one used or tested that method... |
This imports the table used for sampling the electron-positron pair energy from the Geant4 muon pair production model.