Trouble with setting ion properties in Geant4 Macro File

Hi there,

I am fairly new to using the Geant commands and I have a task to be able to set a given ion to different metastable excited states. The macro I am using is pasted below for reference. For some reason the /gps/ionLvl command is only working for me when I set the final parameter to 0. Otherwise it outputs “Illegal Command”. Any ideas as to why this is?

/gps/verbose 0
#/gps/particle proton #USE THIS TO SHOOT A PARTICLE
/gps/particle ion
#/gps/ion 27 33 27 #default 20 40 20 4000 #43P
#/gps/ion 6 12 6 #carbon 12
/gps/ionLvl 20 40 20 0 #ca-40 #issue with this line only works with last argument set to 0

/gps/pos/type Plane
/gps/pos/shape Circle #sets shape of particles ORIGINAL (Annulus)
#/gps/post/type Point #ADDED
#/gps/pos/centre 0. 0. 0. cm #ADDED to see one beam
/gps/pos/rot1 0. 0. 1.
/gps/pos/rot2 0. 1. 0.
/gps/pos/radius 1 cm #sets outer radius of beams (35.5 cm)
#/gps/pos/inner_radius 30.5 cm #sets inner radius of beams
/gps/pos/centre 780.1 0. 0. cm
/gps/ang/type iso #ORIGNAL ON
/gps/ang/maxtheta 0. deg #ORIGNAL ON

#/gps/ene/type Mono ORIGINAL
#/gps/ene/mono 0.5 MeV ORIGINAL
/gps/ene/type Gauss #Sets Distribution
/gps/ene/mono 20 MeV #3000 MeV 3000 eV 6000 MeV 20 MeV
/gps/ene/sigma 1 MeV #300 MeV 150 eV 800 MeV 1 MeV

#/gps/time 0 s #sets initial time t0 of particle
#/particle/select ions
#/particle/property/lifetime 0.1 s #set particle lifetime - don’t see Ca40 on list
#/grdm/selectVolume Detector_L

#/gps/source/list

/run/beamOn 1000

#/process/dump
indent preformatted text by 4 spaces