In G4VProcess::PostStepDoit() and G4VProcess::AtRestDoIt(), the re-weighting of the parent (current) track is broken. That is, one cannot simply call G4VParticleChange::ProposeParentWeight() and expect it to be applied to the track. There is an unwelcome surprise: one must sometimes call stepData.GetPostStepPoint()->SetWeight() -- that is outrageous and obscure because stepData is a const parameter to the function. Moreover, this last is not always needed, and it is unclear to me when it is necessary (so my code always does both, and seems to work). In addition, there are two obscure fields in G4VParticleChange, fSetSecondaryWeightByProcess and fSetParentWeightByProcess. The comments in the header file are incomplete at best, and the design appears to me to be backwards for parent, because G4VParticleChange::ProposeParentWeight() is how a process would set the parent's weight; the comments also do not mention the dependency on stepData where one would expect a dependency on the track itself. Moreover, the default values for these fields differ between G4VParticleChange and G4ParticleChange (note the easy-to-miss difference in class names); this is undocumented. These fields affect weights in subtle ways, but my code now works with their default values (yes I hear you ask "Which default values?", which is part of the problem). Suggestion: a) remove fSetParentWeightByProcess and all related code. b) always set the parent track's weight to the value set by G4VParticleChange::ProposeParentWeight() if it was called, and leave it unchanged if not called. c) complete the documentation of SetSecondaryWeightByProcess() by stating that the secondary's weights are left unchanged if the flag is true, in which case the process code should handle the parent's weight. d) make the default values of these flags be the same in similarly-named general classes. e) After all process DoIt handling of the step, update the stepData's post-step weight (not the other way 'round, sometimes). That suggestion would leave secondary-track weighting unchanged but better documented, and would resolve the obscure dependency in the parent's weight in a way that is more clear to users, and consistent with all of the other Propose*() functions. This is at the core of the Geant4 process handling, and I expect you to tread warily. You will of course need to search for processes that call ProposeParentWeight(). Nevertheless, I believe the current design is broken. I also suspect the weights are rarely used, so this has gone unnoticed. Document the final result, including no change.
I forgot to mention that after each of the DoIt functions the track should always be updated, even if this process is killing it, so its values will be correct in PostUserTrackingAction().
Re-assigning to the "track" component, the location of ParticleChange.
Thank you for reporting the problems related to treatments of weight. Treatments of track weight in ParticleChange has not been checked long time. So, inconsistencies and remains as you pointed out. I modified G4VParticleChange and related classes as you suggested. A) always set the parent track's weight to the value set by ProposeParentWeight() method for all particle change classes. (I move ProposeWeight() method to G4VParticleChange but it is same as ProposeParentWeight()) B) remove fSetParentWeightByProcess and all related code. (related methods remains but they have no effects. Warning message appears if they are called.) C)SetSecondaryWeightByProcess() flag is set to true in default. And documentation has been fixed. D)Behaviours are same for all derived classes. (track-V09-04-09 is the bug fixed tag)