Implementation of multiple particle sources

Hello everyone,

I’m would like to irradiate a sensor by simulating the output of an electron accelerator. I have been able to simulate and save the energy spectrum of the electrons at the exit window as well as the energy spectrum of the photons produced in the accelerator head and I was wondering if it was possible to generate a general source with these two particles. I excluded saving the phase space file of the accelerator since I need to irradiate a very small volume and I need to obtain good statistics.
My idea is to create two different gps sources and give the proportion of the electrons and photons by choosing properly the weights of the two energy spectrum histograms.
Can it be a good approach? Is there a smarter way of doing it that I am missing? When using “/run/beamOn 10”, 10 particles will be generated for each gps source?

Thank you,

This is a good approach.

If I understand GPS correctly, you will not get both particles in each event. You’ll get one particle from one of the two sources in each event. The relative proportions will be determined by the weights you set: suppose you assign a weight of 0.7 to the electrons, and 0.3 to the photons. Then if you run 1000 events, you would expect 700 with a primary electron, and 300 with a primary photon (with obvious random fluctuations).

If the real physics is supposed to have both electrons and photons, I think you might want to write your own PrimaryGeneratorAction (which I think could call down to GPS, if you want) to make the composite population with multiple primaries.

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