I need to read out the cross section for compton scattering in water in geant4.9.5
I tried this:
G4Element* H = new G4Element("Hydrogen" , "H" , z= 1. , a= 1.01*g/mole );
G4Element* O = new G4Element("Oxygen" , "O" , z= 8. , a= 16.00*g/mole );
G4Material* H2O = new G4Material("Water", density= 1.000*g/cm3, ncomponents=2);
H2O->AddElement(H, natoms=2);
H2O->AddElement(O, natoms=1);
// overwrite computed meanExcitationEnergy with ICRU recommended value
H2O->GetIonisation()->SetMeanExcitationEnergy(78.0*eV);
G4double massSigma;
G4EmCalculator emCalculator;
G4double tempDensity = H2O->GetDensity();
G4ParticleDefinition* particle = G4ParticleTable::GetParticleTable()->FindParticle("gamma");
for(G4double energyIT=1; energyIT<=10; energyIT+=1){
massSigma = emCalculator.ComputeCrossSectionPerVolume(energyIT*keV,particle,"compt",H2O)/tempDensity;
G4cout << G4BestUnit(massSigma, "Surface/Mass") << G4endl;
}
All needed includes and variable definition is done. Compiling using gcc doesn’t return any errors.
Starting the simulation returns only ZERO values for cross section.
Output looks like this:
*************************************************************
Geant4 version Name: geant4-09-05-patch-02 (22-October-2012)
Copyright : Geant4 Collaboration
Reference : NIM A 506 (2003), 250-303
WWW : http://cern.ch/geant4
*************************************************************
0 cm2/g
0 cm2/g
0 cm2/g
0 cm2/g
0 cm2/g
0 cm2/g
0 cm2/g
0 cm2/g
0 cm2/g
0 cm2/g
Does anyone have an idea what is wrong here?