# Gas file error

**URL:** <https://root-forum.cern.ch/t/gas-file-error/49986>\
**Category:** Garfield++\
**Created:** [May 16, 2022, 9:12am UTC](https://root-forum.cern.ch/t/gas-file-error/49986 "2022-05-16T09:12:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![changjh12](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/cc9497/32.png) [@changjh12](https://root-forum.cern.ch/u/changjh12)\
**Post date:** [May 16, 2022, 9:12am UTC](https://root-forum.cern.ch/t/gas-file-error/49986/1 "2022-05-16T09:12:07Z")

</div>

Hello, when I was calculating the gas file, the program made an error in the figure below. I checked the user’s guide, but I couldn’t find a solution. How to solve this problem.

 ![Inked屏幕截图 2022-05-16 170149_LI](https://root-forum.cern.ch/uploads/default/original/3X/a/f/afa19b3d96c640934cd108eaffdaf47ffe0cb813.jpeg)

This is my code.

```auto
const double pressure = 15 * AtmosphericPressure;

  const double temperature = 293.15;

 

  // Setup the gas.

  MediumMagboltz gas;

  gas.SetComposition("Xe", 100.);

  gas.SetTemperature(temperature);

  gas.SetPressure(pressure);

  // Set the field range to be covered by the gas table.

  const size_t nE = 20;

  const double emin = 0.;

  const double emax = 2000000.;

  // Flag to request logarithmic spacing.

  constexpr bool useLog = true;

  gas.SetFieldGrid(emin, emax, nE, useLog);

  const int ncoll = 10;

  // Run Magboltz to generate the gas table.

  gas.GenerateGasTable(ncoll);

  // Save the table.

  gas.WriteGasFile("xe_15atm.gas");

```

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [May 16, 2022, 10:49am UTC](https://root-forum.cern.ch/t/gas-file-error/49986/2 "2022-05-16T10:49:58Z")

</div>

Hi @changjh12; I am sure @hschindl has an answer for this.

Cheers,  
J.

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [May 16, 2022, 7:48pm UTC](https://root-forum.cern.ch/t/gas-file-error/49986/3 "2022-05-16T19:48:19Z")

</div>

Hi,  
this does seem to happen occasionally in Magboltz. At what electric field does the error message appear? What sometimes helps is to slightly modify the electric field range…

---

<div class="post-metadata">

**Author:** ![changjh12](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/cc9497/32.png) [@changjh12](https://root-forum.cern.ch/u/changjh12)\
**Post date:** [May 17, 2022, 8:24am UTC](https://root-forum.cern.ch/t/gas-file-error/49986/4 "2022-05-17T08:24:34Z")

</div>

Thank you, I modified the electric field range. Then it can be calculated normally.

---

<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:** [May 31, 2022, 8:24am UTC](https://root-forum.cern.ch/t/gas-file-error/49986/5 "2022-05-31T08:24:55Z")

</div>

Closed on May 31, 2022, 8:24am UTC

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