Problem 988 - GSPM generates an erroneous CDG spectrum.
Summary: GSPM generates an erroneous CDG spectrum.
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: event (show other problems)
Version: 9.0
Hardware: All All
: P3 normal
Assignee: flei
URL:
Depends on:
Blocks:
 
Reported: 2007-12-04 12:23 CET by ayut
Modified: 2008-01-31 16:22 CET (History)
2 users (show)

See Also:


Attachments
corrected source (35.73 KB, text/x-c++src)
2007-12-04 12:23 CET, ayut
Details

Note You need to log in before you can comment on or make changes to this problem.
Description ayut 2007-12-04 12:23:12 CET
Created attachment 10 [details]
corrected source

GSPM generates an erroneous CDG spectrum.
1. The break point of CDG spectrum is on 18 MeV instead of 18 keV.
2. The normalised cumulative histogram is calculated wrongly.

Misoperation of the module happens because when determing the breakpoint in G4SPSEneDistribution::GenerateCdgEnergies and at the calculating cumulative histogram in G4SPSEneDistribution::CalculateCdgSpectrum it is not specified, that energy should be in keV. After correction the module operates fine.

G4SPSEneDistribution::CalculateCdgSpectrum()

new:
<      CDGhist[i+1] = CDGhist[i] + (pfact[i]/omalpha)*
<      (std::pow(ene_line[i+1]/keV,omalpha)-std::pow(ene_line[i]/keV,omalpha));
---
old:
>      CDGhist[i+1] = CDGhist[i] + (pfact[i]/omalpha)*
>       (std::pow(ene_line[i+1],omalpha)-std::pow(ene_line[i],omalpha));

G4SPSEneDistribution::GenerateCdgEnergies()

896c896
new:
<       ene_line[1] = 18.*keV;
---
old:
>       ene_line[1] = 18.;


I have attached the corrected source to this report.

Best regards,
Alexey Tkachenko
Comment 1 asai 2007-12-04 18:03:09 CET
Thank you for reporting.
The problem is forwarded to the author of the code.
Comment 2 flei 2008-01-31 16:22:37 CET
The bug has been fixed in G4 9.1 release.