# Multiple sources

**URL:** <https://geant4-forum.web.cern.ch/t/multiple-sources/12193>\
**Category:** Particles, Track, Event, Run and Biasing\
**Created:** [May 2, 2024, 4:48am UTC](https://geant4-forum.web.cern.ch/t/multiple-sources/12193 "2024-05-02T04:48:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Fulcher](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/tim_fulcher/32/5023_2.png) [@Tim\_Fulcher](https://geant4-forum.web.cern.ch/u/Tim_Fulcher)\
**Post date:** [May 2, 2024, 4:48am UTC](https://geant4-forum.web.cern.ch/t/multiple-sources/12193/1 "2024-05-02T04:48:32Z")

</div>

\_Geant4 Version: 10.04.p03  
\_Operating System:\_Ubuntu 16.04  
\_Compiler/Version:\_gcc 5.4  
\_CMake Version:\_3.5.2

Hi again,

If I create multiple sources is it possible to define the proportion of primaries emanating from each? Eg if I create 2 can I make 70% emanate from source 1 and 30% emanate from source 2?

Regards

Tim

* * *

---

<div class="post-metadata">

**Author:** ![bmorgan](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/bmorgan/32/7_2.png) [@bmorgan](https://geant4-forum.web.cern.ch/u/bmorgan)\
**Post date:** [May 3, 2024, 12:26pm UTC](https://geant4-forum.web.cern.ch/t/multiple-sources/12193/2 "2024-05-03T12:26:01Z")

</div>

If this is with the `G4GeneralParticleSource` then yes, this can be done with the `/gps/source/add <intensity>` command. This adds a new source with a _relative_ intensity, e.g. if you add three sources with `1` as the intensity, each would be sampled 1/3 of the time.

If you’re writing your own particle gun, then it’s up to you to sample appropriately.

---

<div class="post-metadata">

**Author:** ![Tim\_Fulcher](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/tim_fulcher/32/5023_2.png) [@Tim\_Fulcher](https://geant4-forum.web.cern.ch/u/Tim_Fulcher)\
**Post date:** [May 7, 2024, 11:35pm UTC](https://geant4-forum.web.cern.ch/t/multiple-sources/12193/3 "2024-05-07T23:35:28Z")

</div>

Thanks Ben. Much appreciated.
