# Gas file for low pressure: PROGRAM STOPPED TOO MANY PRIMARIES

**URL:** <https://root-forum.cern.ch/t/gas-file-for-low-pressure-program-stopped-too-many-primaries/64262>\
**Category:** Garfield++\
**Created:** [September 30, 2025, 6:52pm UTC](https://root-forum.cern.ch/t/gas-file-for-low-pressure-program-stopped-too-many-primaries/64262 "2025-09-30T18:52:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![VictorM](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/victorm/32/36543_2.png) [@VictorM](https://root-forum.cern.ch/u/VictorM)\
**Post date:** [September 30, 2025, 6:52pm UTC](https://root-forum.cern.ch/t/gas-file-for-low-pressure-program-stopped-too-many-primaries/64262/1 "2025-09-30T18:52:48Z")

</div>

Hi,

I have a problem similar to what was discussed in this [post](https://root-forum.cern.ch/t/garfield-gas-file-error-program-stopped-too-many-primaries-iprim/55615) and this [post](https://root-forum.cern.ch/t/garfield-gas-file-error-program-stopped-too-many-primaries-iprim/55615).

I try to create a Gas File for 0.75 mbar propane gas. It worked out for 1 mbar, but at this pressure, I get, at 56.5124 V/cm, the error: PROGRAM STOPPED TOO MANY PRIMARIES IPRIM=\*\*\*\*\*\*\*

The solution in the other posts was to change the field range. But I actually need the range from low fields (a few V/cm) to high fields (about 4 kV/cm) at this low pressure.

I also varied the ncoll in gas.GenerateGasTable(ncoll), but the error persisted.

Is there any option to prevent this from happening?  
Is there an option to do a workaround when I only want to simulate ion drift trajectories with my ion mobility dataset?

Thank you for your help!

[generate.C](https://root-forum.cern.ch/uploads/short-url/xXpQkp9W5QOOhVciIB7MJb4vLil.C) (785 Bytes)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [October 1, 2025, 6:11am UTC](https://root-forum.cern.ch/t/gas-file-for-low-pressure-program-stopped-too-many-primaries/64262/2 "2025-10-01T06:11:57Z")

</div>

I guess @hschindl can help you.

---

<div class="post-metadata">

**Author:** ![Piet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/piet/32/12536_2.png) [@Piet](https://root-forum.cern.ch/u/Piet)\
**Post date:** [October 1, 2025, 8:29am UTC](https://root-forum.cern.ch/t/gas-file-for-low-pressure-program-stopped-too-many-primaries/64262/3 "2025-10-01T08:29:56Z")

</div>

Hi @VictorM

This error is typically related to a too high Townsend coefficient, which can happen at very high E/N values. You cannot solve this by playing with the ncoll parameter, as this governs only the precision of the calculation.

Well, if you are _only_ interested in the ion drift trajectories, and you do not need _any_ electron-gas interaction _at all_, then you do not need a gasfile. Your component holds the values of the electric field in your detector and you can just simulate your ion trajectories using the ion mobility dataset.

Instead if you need a gasfile, but you do not need high precision, you could think of calculating your gasfile up to a lower field value and then use the extrapolation at higher fields. Maybe you can make a plot of your electron drift velocity or townsend coefficient (if you need these observables) and see which extrapolation (cst, lin, exp) is implemented by default an see if it is reasonable for you. You can have a look at an example [here](https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/Examples/GasFile/plotExtrap.C) and try to make such a plot for your gasfile at 1mbar to understand the situation.

The electron-gas collisions depend on the reduced electric field value E/N, where N is the number density (atoms/cm3) and this depends on the pressure. So I am quite surprised that for 1mbar you would be able to calculate the gasfile for the full range (few V/cm to 4kV/cm), but for 25% less pressure you run into troubles already at 56V/cm.

Since it is just a matter of scaling, we should find a way to use a gasfile calculated at a certain pressure A and scale the swarm parameters to used at a pressure B. I am not sure whether this is already possible now, I let @hschindl comment, or I would invite you to have a look at the source code and try out (e.g. load your file at 1mbar and change the pressure afterwards and see if the swarm parameters are scaled accordingly).

greets  
Piet

---

<div class="post-metadata">

**Author:** ![VictorM](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/victorm/32/36543_2.png) [@VictorM](https://root-forum.cern.ch/u/VictorM)\
**Post date:** [October 7, 2025, 9:00pm UTC](https://root-forum.cern.ch/t/gas-file-for-low-pressure-program-stopped-too-many-primaries/64262/4 "2025-10-07T21:00:16Z")

</div>

Thank you, @Piet!

I will try to follow your advice and play around with the parameters.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [October 21, 2025, 9:00pm UTC](https://root-forum.cern.ch/t/gas-file-for-low-pressure-program-stopped-too-many-primaries/64262/5 "2025-10-21T21:00:29Z")

</div>

Closed on October 21, 2025, 9:00pm UTC

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