Problem 128 - Possible bug in G4NeutronHPCapture::ApplyYourself
Summary: Possible bug in G4NeutronHPCapture::ApplyYourself
Status: CLOSED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/hadronic (show other problems)
Version: 2.0
Hardware: PC Linux
: P2 normal
Assignee: Hans-Peter.Wellisch
URL:
Depends on:
Blocks:
 
Reported: 2000-07-12 11:02 CEST by mgb
Modified: 2012-02-15 05:03 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 mgb 2000-07-12 11:02:33 CEST
In the method G4NeutronCapture::ApplyYourself,
a G4Element on which capture occurs is chosen based on it's capture cross
section.
I believe the cross section here should be weighted by the
number density (per unit volume) of the given element.
Consider for example H2O. The current implementation
will choose either Hydrogen or Oxygen based only on their relative
capture cross sections, where the cross section on hydrogen should
have twice the weight.

The original code reads as follows:

for (i=0; i<n; i++)
    {
      index = theMaterial->GetElement(i)->GetIndex();
      xSec[i] = theCapture[index].GetXsec(aTrack.GetKineticEnergy());
      sum+=xSec[i];
    }

I have modified it to read:


 G4double * NumAtomsPerVolume = theMaterial->GetVecNbOfAtomsPerVolume();
 G4double rWeight;
 for (i=0; i<n; i++)
    {
      index = theMaterial->GetElement(i)->GetIndex();
      rWeight = NumAtomsPerVolume[i];
      xSec[i] = theCapture[index].GetXsec(aTrack.GetKineticEnergy());
      xSec[i] *= rWeight;
      sum+=xSec[i];
    }

The same applies to the ApplyYourself methods of G4NeutronHPInelastic,
G4NeutronHPElastic, and G4NeutronHPFission.

--Mark.
Comment 1 Hans-Peter.Wellisch 2000-07-17 07:45:59 CEST
You are absolutely right. Thank you for finding this one.

Many greetings,

Hans-Peter.
Comment 2 Hans-Peter.Wellisch 2000-07-19 13:27:59 CEST
fixed along with a bug in G4NeutronHPPartial in the neu-V02-00-00 tag
of hadronic/models/neutron_hp
This tag also includes optimization of the initialization and sampling.
Init of neutron code should be better by a factor of 3.5; sampling only
slightly (slightly less than 2).
I have a .tar file of this in
/afs/cern.ch/user/h/hpw/public/neutron_hp_3.tar.gz