# Using carbon ion beam

**URL:** <https://allpix-squared-forum.web.cern.ch/t/using-carbon-ion-beam/423>\
**Category:** Uncategorized\
**Created:** [May 25, 2023, 8:57pm UTC](https://allpix-squared-forum.web.cern.ch/t/using-carbon-ion-beam/423 "2023-05-25T20:57:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fajer](https://allpix-squared-forum.web.cern.ch/letter_avatar_proxy/v4/letter/f/e47774/32.png) [@Fajer](https://allpix-squared-forum.web.cern.ch/u/Fajer)\
**Post date:** [May 25, 2023, 8:57pm UTC](https://allpix-squared-forum.web.cern.ch/t/using-carbon-ion-beam/423/1 "2023-05-25T20:57:39Z")

</div>

Hello experts,  
I am new to Allpix2 and trying to simulate carbon ions beam but I haven’t managed to simulate it yet because it gives me error in the particle type each time I run it.  
I tried to set the particle type to:  
[DepositionGeant4]  
particle\_type = “ion”  
ion\_type = “6 12 6”  
number\_of\_particles = 10000

tryied also:  
particle\_type = “ion”  
ion\_type = “6 12 6”

and:  
particle\_type = “ion”  
ion\_type = “carbon 12 6”

and also:  
particle\_type = “GenericIon”  
particle\_type\_Z = 6  
particle\_type\_A = 12  
particle\_type\_Q = 6

and:  
particle\_type = “C12”

but none of these worked yet 😭  
can any one help me how to set the particle type to carbon ions beam?  
I know it is selly question but I need an urgent help in that please  
many thanks in advance

---

<div class="post-metadata">

**Author:** ![hwennlof](https://allpix-squared-forum.web.cern.ch/letter_avatar_proxy/v4/letter/h/3ab097/32.png) [@hwennlof](https://allpix-squared-forum.web.cern.ch/u/hwennlof)\
**Post date:** [May 26, 2023, 7:41am UTC](https://allpix-squared-forum.web.cern.ch/t/using-carbon-ion-beam/423/2 "2023-05-26T07:41:23Z")

</div>

Hi!

The way to do this in `[DepositionGeant4]` is by setting `particle_type` to `ion/Z/A/Q/E/D`. The example in the manual is `particle_type = "ion/54/132/0/0eV/false"`, which gives a Xenon-132 ion with zero charge. The “false” means that decay is not simulated for it. The “E” argument is the excitation energy.

So, in your case, you could put `particle_type = "ion/6/12/6/0eV/false"` if you want the ion itself to have a charge of 6.  
This utilises the Geant4 `G4IonTable::GetIon()` method.

Kind regards,  
Håkan

---

<div class="post-metadata">

**Author:** ![simonspa](https://allpix-squared-forum.web.cern.ch/user_avatar/allpix-squared-forum.web.cern.ch/simonspa/32/597_2.png) [@simonspa](https://allpix-squared-forum.web.cern.ch/u/simonspa)\
**Post date:** [May 27, 2023, 2:37pm UTC](https://allpix-squared-forum.web.cern.ch/t/using-carbon-ion-beam/423/3 "2023-05-27T14:37:20Z")

</div>

@Fajer check the manual:

> **[DepositionGeant4](https://allpix-squared.docs.cern.ch/docs/08_modules/depositiongeant4/#particles-ions-and-radioactive-decays)**
>
> Energy deposition with Geant4

---

<div class="post-metadata">

**Author:** ![Fajer](https://allpix-squared-forum.web.cern.ch/letter_avatar_proxy/v4/letter/f/e47774/32.png) [@Fajer](https://allpix-squared-forum.web.cern.ch/u/Fajer)\
**Post date:** [May 29, 2023, 10:55am UTC](https://allpix-squared-forum.web.cern.ch/t/using-carbon-ion-beam/423/4 "2023-05-29T10:55:30Z")

</div>

Thanks a lot all for your helpful answers
