| Message: Program Crashes when Compton Scatter in Air | Not Logged In (login) |
|
Hello all,
I've having an issue with my program that I don't understand. The program runs fine if the Compton scattering process is removed or the material Air is replaced with something else. Other wise it crashes. Therefore I believe there to be some sort of issue with the compton scatter process in air. Relevant Code:
-------------------------In DetectorConstruction.cc--------------------- const G4int nEntries = 38;
G4double RefractiveIndex2[nEntries] =
{ 1.00028393, 1.00028332, 1.00028276, 1.00028225, 1.00028177, 1.00028133, 1.00028091, 1.00028053, 1.00028018, 1.00027985, 1.00027954, 1.00027925, 1.00027897, 1.00027872, 1.00027848, 1.00027825, 1.00027804, 1.00027784, 1.00027765, 1.00027747, 1.0002773, 1.00027714, 1.00027698, 1.00027684, 1.0002767, 1.00027657, 1.00027644, 1.00027632, 1.00027621, 1.0002761, 1.000276, 1.0002759, 1.0002758, 1.00027571, 1.00027563, 1.00027554, 1.00027546, 1.00027539};
G4MaterialPropertiesTable* myMPT2 = new G4MaterialPropertiesTable();
myMPT2->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex2, nEntries);
G4double z;
G4double a;
G4double density;
//Air
G4Element* N = new G4Element("Nitrogen", "N", z=7., a= 14.01*g/mole);
G4Element* O = new G4Element("Oxygen" , "O", z=8., a= 16.00*g/mole);
G4Material* Air = new G4Material("Air", density= 0.00129*g/cm3, 2);
Air->AddElement(N,0.7);
Air->AddElement(O,0.3);
Air->SetMaterialPropertiesTable(myMPT2);
--------------------------------------------------------------------- ---------------------In PhysicsList.cc-------------------------------
#include "G4ComptonScattering.hh" #include "G4GammaConversion.hh" #include "G4PhotoElectricEffect.hh"
if (particleName == "gamma") {
// gamma
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
pmanager->AddDiscreteProcess(new G4ComptonScattering);
pmanager->AddDiscreteProcess(new G4GammaConversion);
} else if ........ ---------------------------------------------------------------------- Like I said, if I comment out pmanager->AddDiscreteProcess(new G4ComptonScattering) or if I replace air from the logic volumes it is contained in with some other material, this runs fine. But as is this crashes every time. Any ideas? Thanks!
|
| Inline Depth: | Outline Depth: | Add message: |
|
to: |