How to implement multiple sources via GPS in macro?

Hi All,

I understand how GPS is working to simulate a single source. In the case of a neutron source with spectra in spec1.dat, I use the following in my macro:

gps/particle neutron

# source
/gps/pos/type Volume
/gps/pos/shape Sphere
/gps/pos/centre 0. 0. 10. cm
/gps/pos/radius 0.1 mm

# angular distribution
/gps/ang/type iso

# energy distribution
/gps/ene/type User
/gps/hist/type energy
/control/execute spec1.dat

How can I implement two sources of different types/positions such that 50% of the time the first source is selected (and rest of the time the other)? Can that be implemented in macro?

1 Like

Resolved. I just implemented this using: examples/extended/eventgenerator/exgps/macros/test31.mac

Mentioning in case someone needs it in the future.

Dear would you please post here your the Macros file

@Halait-Ge : Here is something that worked for me. The developers guide provides a list of other commands that may be useful.

Sample macro file:

# one neutron spectra and other monoenergetic Cs-137 gammas
# source-1
/gps/source/add 1.
/gps/particle neutron

# pos/shape info
/gps/pos/type Point
/gps/pos/centre 10 0 0 cm

# angular distribution
/gps/ang/type iso
/gps/ang/mintheta 90 deg
/gps/ang/maxtheta 125 deg
/gps/ang/minphi -90 deg
/gps/ang/maxphi 90 deg

# energy distribution
/gps/ene/type User
/gps/hist/type energy
/control/execute spec.dat

# source-2
/gps/source/add 1.
/gps/particle gamma

# pos/shape info
/gps/pos/type Point
/gps/pos/centre 20 0 0 cm

# angular distribution
/gps/ang/type iso
/gps/ang/mintheta 90 deg
/gps/ang/maxtheta 125 deg
/gps/ang/minphi -90 deg
/gps/ang/maxphi 90 deg

# energy distribution
/gps/ene/type Mono
/gps/ene/mono 0.6617 MeV

/gps/source/list
/control/verbose 2
/run/verbose 2
/event/verbose 0

/run/beamOn 10000

Sample spec.dat:

/gps/hist/point 0.01 0
/gps/hist/point 0.25 0
/gps/hist/point 0.35 0
/gps/hist/point 0.45 0
/gps/hist/point 0.49 0
/gps/hist/point 0.5 1

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.