Skip to content
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

Fix Materials.cc when scaling scint pdf #142

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix Materials.cc when scaling scint pdf
When transforming a ratdb entry describing the scintillation or wavelength shifting pdf as a function of wavelength to energy for sampling, the jacobian element hc/E^2 was omitted causing there to be an unphysical distortion in the output spectrum.  This transformation is now implemented
  • Loading branch information
gmwendel authored Jul 3, 2024
commit deec4b1564cd1c11482a22e2e58bc7e35ef251aa
1 change: 1 addition & 0 deletions src/geo/src/Materials.cc
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ G4MaterialPropertyVector *Materials::LoadProperty(DBLinkPtr table, std::string n
if (E_value != 0.0) {
double lam = E_value;
E_value = CLHEP::twopi * CLHEP::hbarc / (lam * CLHEP::nanometer);
if (wavelength_opt == 1) p_value *= 1.0 / (E_value * E_value);
if (wavelength_opt == 2) p_value *= lam / E_value;
} else {
warn << "Materials property std::vector zero wavelength!" << newline;
Expand Down