Cannot create ions, GenericIon not ready

Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!

_Geant4 Version:11.1.3 (via conda)
_Operating System:
_Compiler/Version: gcc 13.2.0
_CMake Version: 3.24.1

Hi, I’m new to geant4. I’m tryng to run the ICRP145 phantom example with an internal source. I’ve used examples rdecay01 and exgps to try to add the ion information for Y90 to the macro file, but I am getting the error message below.

Error message:-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : PART105
issued by : G4IonTable::CreateIon()
Can not create ions because GenericIon is not ready
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : UIMAN0123
issued by : G4UImanager::ApplyCommand
Ion with Z=39 A=90 is not defined
Error code : 1
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

***** Illegal parameter (1) </gps/ion 39 90 0 0> *****

***** Batch is interrupted!! *****

Macro code: 
# Example macro file to run in the batch mode

# Set the verbose
/run/verbose 2

# Set the number of threads for multi-threading mode
/run/numberOfThreads 20

# Initialize
/gps/particle ion
/gps/ion 39 90 0 0

# Set the nps
/run/beamOn 335800

I’m wondering what might be missing from my code? I have also tried other atoms, with the same error message.

Hi @elizabethmorris945

You need to create a function in the physics list where you construct particles,

Particles can be

#include "G4BosonConstructor.hh"
#include "G4LeptonConstructor.hh"
#include "G4MesonConstructor.hh"
#include "G4BosonConstructor.hh"
#include "G4BaryonConstructor.hh"
#include "G4IonConstructor.hh"