Replacing dEdX tables : adapting code from 4.10.7 to 4.11.1

Hello,
I’m a beginner with Geant4, so I apologize if my question is trivial.
In my code, which works fine in Geant4.10.7, I replace the dEdX table by default (ICRU73) in the following way :

for the ionIoni G4VProcess :
G4VEmModel * enmod ;
while((enmod = pIon->EmModel(i)) != (G4VEmModel *)0)
{
G4cout << "\t\t MAIN()::EM interaction LE model: " << enmod->GetName() << G4endl;
if(enmod->GetName() == “ParamICRU73”)
{
G4IonParametrisedLossModel * icru = (G4IonParametrisedLossModel *)enmod ;
G4DataVector cuts ;
icru->Initialise(particle,cuts) ; //particle is a G4ParticleDefinition “GenericIon”
icru->RemoveDEDXTable(“ICRU73”) ;
icru->AddDEDXTable(“myTable”, new G4IonStoppingData(“ion_stopping_data/myTab”,false), new G4IonDEDXScalingICRU73(93,102)) ;
}
}

In the 4.11.1 version I saw that enmod->GetName() returns “LindhardSorensen”, so I replaced “ParamICRU73” with “LindhardSorensen”, which works fine. However, I get a segmentation fault when trying to remove the DEDX table (icru->RemoveDEDXTable(“ICRU73”) ; ). I thought the name “ICRU73” changed, but how can I get the new name? Also in the G4EMLOW8.2/ion_stopping_dat repository, the available data are icru73 and icru90 and I thought the LindhardSorensen model also used icru73. Did the name change?

If it’s needed : I use the G4EmStandardPhysics_option4 physics list.

Thank you in advance
Best regards
Paola

1 Like

Hello,

in Geant4 11.1 we switch Opt4 EM physics to the Lindhard-Sorensen model, in which ICRU73 and ICRU90 data are used by default. If you want to change any of this data you should not change the code, use any reference physics list.

You may substitute any Geant4 data file with your custom file inside your local area if this is really needed.

VI