Problem 1765

Summary: Density effect does not change with density
Product: Geant4 Reporter: Valentin <niess>
Component: materialsAssignee: Vladimir.Ivantchenko
Status: RESOLVED FIXED    
Severity: normal    
Priority: P5    
Version: 10.1   
Hardware: All   
OS: All   

Description Valentin 2015-07-03 15:33:02 CEST
This seems to be a bug, if not a wrong usage of G4Materials on my side.

In G4IonisParamMat::ComputeDensityEffect, when using a custom material with a single atomic element the table index 'idx' is not NULL but the base material 'bmat' is. Consequently, the density correction 'corr' is not applied to Sternheimer's density effect parameters.

This can make significant differences (~10-20%) on the dE/dX for 10-100 GeV in dense materials, the like StandardRock, with non standard densities: 1-1.5 g/cm^3 instead of 2.65 g/cm^3.
Comment 1 Valentin 2015-07-03 19:51:05 CEST
Correcting: 20% is the total magnitude of the density effect at 100 GeV in Standard Rocks (2.65 g/cm^3), for a muon. Going from 2.65 g/cm^3 to let's say 1 g/cm^3 makes a ~2-3% difference on the dE/dX. So except for very exotic cases (Standard Rock with ~0 density) the impact would be mild in this case, a few percent.
Comment 2 Vladimir.Ivantchenko 2015-07-07 21:02:59 CEST
Hello,

There is no enough information to make a conclusion. Please, provide file with material definition or extract those lines in which problematic material is described.

VI
Comment 3 Valentin 2015-07-08 09:18:15 CEST
Hello,



G4Element *RockElement = new G4Element("StandardRock", 
            "StandardRock", 11., 22.*CLHEP::g/CLHEP::mole);
	material = new G4Material("StandardRock",
            2.65*CLHEP::g/CLHEP::cm3, 1, kStateSolid);
        material->AddElement(RockElement, 1);
	G4IonisParamMat *parameters = material->GetIonisation();
        parameters->SetMeanExcitationEnergy(136.4*CLHEP::eV);
Comment 4 Valentin 2015-07-08 09:26:59 CEST
Sorry, something went wrong. So, in previous comment is the material definition that I use. Then I check the Sternheimer parameters for example as:

    G4IonisParamMat *parameters = material->GetIonisation();
    fprintf(stdout, "Sternheimer coefficients:\n"
        "a      k=m_s  x_0    x_1    I[eV]  Cbar   delta0\n");
    fprintf(stdout, "%.4f %.4f %.4f %.4f %.1f  %.4f %.2f\n",
        parameters->GetAdensity(), parameters->GetMdensity(),
        parameters->GetX0density(), parameters->GetX1density(),
        parameters->GetMeanExcitationEnergy()/CLHEP::eV,
        parameters->GetCdensity(), parameters->GetD0density());

If I change the density the Sternheimer parameters are unchanged. I also checked with simulations that the average muon range is unchanged.

My understanding is that the problem is in G4IonisParamMat::ComputeDensityEffect. There is a test "if(idx < 0 && 1 == nelm) {" that takes the Sternheimer parameters from a tabulation in this case (nelm == 1) but after probably that bmat is NULL such that the density correction factor is not applied.
Comment 5 Vladimir.Ivantchenko 2015-08-11 10:48:02 CEST
Hello,

thank you for the report. Now the problem is fixed and fixed code will be available in the next public release of Geant4. For the time being you may use base material concept allowing to create your concrete material from closest NIST material (in a particular case G4_Na). Alternatively you may ask for private version of files with the fix.

Vladimir