Problem 1273 - Secondary track weighting is now grossly wrong
Summary: Secondary track weighting is now grossly wrong
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: track (show other problems)
Version: 9.4
Hardware: All All
: P1 major
Assignee: kurasige
URL:
Depends on:
Blocks:
 
Reported: 2011-12-17 21:55 CET by Tom Roberts
Modified: 2011-12-22 03:37 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Tom Roberts 2011-12-17 21:55:13 CET
In bug 1243 I reported problems with track weighting. It was accepted and resolved by implementing my suggestions, and the change is present in Geant4.9.4.p03. It made significant revisions to the handling of weights for secondary tracks.

Unfortunately, this fix broke the basic track weighting -- standard processes such as Decay and delta-ray production now produce tracks with weight=1.0, independent of the weight of the parent track. They should have, and used to have, the weight of their parent.

The problem is in this aspect of the fix to bug 1243:
"C)SetSecondaryWeightByProcess() flag is set to true in default."
This makes the process code responsible for setting the weights of secondaries, but most processes do not do so, and the secondaries they produce get the G4Track constructor's default of 1.0.

I'm pretty sure this is an error: in Geant4.9.4, G4VParticleChange::fSetSecondaryWeightByProcess was initialized to false.
That makes the parent's weight be transferred to secondaries by default, which many processes depend upon (and those that don't call SetSecondaryWeightByProcess(true)).

Making this one-line change to G4VParticleChange.cc resolves the failures of several of my regression tests (they passed using Geant4.9.4 and Geant4.9.4.p02, and with this change now pass using Geant4.9.4.p03).

This probably needs to be carried forward to Geant4.9.5 (which I have not yet tried).
Comment 1 kurasige 2011-12-22 03:37:25 CET
Thank you for reporting the bug.
It's my mistake to change the basic behavior of secondary weight.
I'll fix it for 9.4 and 9.5 release.