# Error analysis for Magboltz or gas file

**URL:** <https://root-forum.cern.ch/t/error-analysis-for-magboltz-or-gas-file/64622>\
**Category:** Garfield++\
**Created:** [January 31, 2026, 11:12am UTC](https://root-forum.cern.ch/t/error-analysis-for-magboltz-or-gas-file/64622 "2026-01-31T11:12:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wjsdms0721](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/e5b9ba/32.png) [@wjsdms0721](https://root-forum.cern.ch/u/wjsdms0721)\
**Post date:** [January 31, 2026, 11:12am UTC](https://root-forum.cern.ch/t/error-analysis-for-magboltz-or-gas-file/64622/1 "2026-01-31T11:12:45Z")

</div>

Hello.

I am curious about something analysing `.gas` file data.  
I have understood that `ncoll` in `gas.GenerateGasTable(ncoll)` defines the number of collision multiplied by `1e+7` while an electron moves through the gas. However, in my opinion, since Magboltz is based on the Monte-Carlo simulation, numerous times of simulations or independent events are required to form error bar or analyse it. Is my opinion wrong or not useful?

I think I do insufficiently understood the principle of `Magboltz` or gas file.

---

<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:** [February 1, 2026, 1:14pm UTC](https://root-forum.cern.ch/t/error-analysis-for-magboltz-or-gas-file/64622/2 "2026-02-01T13:14:56Z")

</div>

Hi,  
thanks for your question! With a suitable choice of the initial conditions (in particular the initial kinetic energy), the time average approach (following a single electron over many collisions) and the ensemble average approach should be equivalent, i. e. give statistically compatible results for the transport parameters (drift velocity, diffusion coefficients, etc.).

---

<div class="post-metadata">

**Author:** ![wjsdms0721](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/e5b9ba/32.png) [@wjsdms0721](https://root-forum.cern.ch/u/wjsdms0721)\
**Post date:** [February 4, 2026, 12:12pm UTC](https://root-forum.cern.ch/t/error-analysis-for-magboltz-or-gas-file/64622/3 "2026-02-04T12:12:49Z")

</div>

I am really appreciate to your kind answer.

And I have a question, how does `vzerr` in Magboltz have been calculated without general process evaluating standard deviations for each independent event? Since I have never seen this kind of Monte-Carlo, I am really curious about it!

---

<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:** [February 4, 2026, 1:12pm UTC](https://root-forum.cern.ch/t/error-analysis-for-magboltz-or-gas-file/64622/4 "2026-02-04T13:12:36Z")

</div>

Dear @wjsdms0721

I am not sure I understand your question. Note that “event” for Magboltz means an electron-atom scatter/collision, not the rigorous tracking of a single electron through the gas. `vzerr` is calculated based on the standard deviation of `vz` over many electron-atom collisions. If you like to know more, I would invite you to have a look at the Magboltz articles [1,2] or the very instructive PyBoltz article [3]. The last one is authored by scientists that have rewritten the orginal Fortran Code in Python together with Steve Biagi, and is very instructive to understand how the code works [3]:

 ![Screenshot 2026-02-04 at 14.09.26](https://root-forum.cern.ch/uploads/default/original/3X/c/1/c1684bb7b72a07a409f62ac8405cd61340ef313e.png)

Kind regards  
Piet

[1] [https://doi.org/10.1016/0168-9002(89)91446-0](https://doi.org/10.1016/0168-9002(89)91446-0 "Persistent link using digital object identifier")  
[2] [https://doi.org/10.1016/S0168-9002(98)01233-9](https://doi.org/10.1016/S0168-9002(98)01233-9 "Persistent link using digital object identifier")  
[3] [https://doi.org/10.1016/j.cpc.2020.107357](https://doi.org/10.1016/j.cpc.2020.107357 "Persistent link using digital object identifier")

---

<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:** [February 18, 2026, 1:13pm UTC](https://root-forum.cern.ch/t/error-analysis-for-magboltz-or-gas-file/64622/5 "2026-02-18T13:13:25Z")

</div>

Closed on February 18, 2026, 1:13pm UTC

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