# Suppress Penning Transfer G++ Warning?

**URL:** <https://root-forum.cern.ch/t/suppress-penning-transfer-g-warning/64730>\
**Category:** Garfield++\
**Tags:** garfield\
**Created:** [March 3, 2026, 9:36am UTC](https://root-forum.cern.ch/t/suppress-penning-transfer-g-warning/64730 "2026-03-03T09:36:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamesIV](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/919ad9/32.png) [@JamesIV](https://root-forum.cern.ch/u/JamesIV)\
**Post date:** [March 3, 2026, 9:36am UTC](https://root-forum.cern.ch/t/suppress-penning-transfer-g-warning/64730/1 "2026-03-03T09:36:07Z")

</div>

Hey! Real quick question. Is it possible to suppress the following warning message in Garfield++?

“MediumMagboltz::EnablePenningTransfer:  
Warning: present gas table has no ionisation rates.  
Ignore this message if you are using microscopic tracking only.”

I am using microscopic tracking, so there is no issue, but I am tired of always seeing it pop up in my logs whenever I run a simulation. Does it have a designated warning code?

Thanks in advance for any insight you can provide.

---

<div class="post-metadata">

**Author:** ![StephanH](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@StephanH](https://root-forum.cern.ch/u/StephanH)\
**Post date:** [March 3, 2026, 11:12am UTC](https://root-forum.cern.ch/t/suppress-penning-transfer-g-warning/64730/2 "2026-03-03T11:12:26Z")

</div>

Hello, I invite @hschindl to have a look.

---

<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:** [March 4, 2026, 3:27pm UTC](https://root-forum.cern.ch/t/suppress-penning-transfer-g-warning/64730/3 "2026-03-04T15:27:53Z")

</div>

Dear @JamesIV

This warning originates from `MediumGas::EnablePenningTransfer`:

[https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/Source/MediumGas.cc#L2550-L2579](https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/Source/MediumGas.cc#L2550-L2579)

However, your `mediumGas` object does not know whether in your `sensor` object you use objects of either `AvalanceMC`, `driftLineRKF` or `AvalancheMicroscopic` classes. I would invite you to hack around and see if you can come up with a reasonable solution. In that case please let us know ;-). If you just want a brute-force suppression and you don’t care about losing debug information, just comment out lines 2566-2571 and recompile.

Piet

---

<div class="post-metadata">

**Author:** ![gabrielribcesario](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/gabrielribcesario/32/38927_2.png) [@gabrielribcesario](https://root-forum.cern.ch/u/gabrielribcesario)\
**Post date:** [March 5, 2026, 8:23pm UTC](https://root-forum.cern.ch/t/suppress-penning-transfer-g-warning/64730/4 "2026-03-05T20:23:42Z")

</div>

Hello,

I guess they could also try the following if they only want to suppress the warning for specific function calls/programs:

```cpp
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <Garfield/MediumMagboltz.hh>

using namespace Garfield;

int main(void) {
  MediumMagboltz gas("Ar", .9, "CO2", .1);
  
  auto EnablePenningTransferWrapper = [&gas]() -> bool {
    std::ofstream nullStream("/dev/null");

    // Swap the buffer of cerr with null stream
    std::streambuf* oldBuffer = std::cerr.rdbuf(nullStream.rdbuf());

    bool ret = gas.EnablePenningTransfer();

    // Restore the original buffer
    std::cerr.rdbuf(oldBuffer);

    return ret;
  };

  return EnablePenningTransferWrapper() ? EXIT_SUCCESS : EXIT_FAILURE;
}

```

Output:

```bash
MediumMagboltz::SetComposition: Ar/CO2 (90/10)
MediumMagboltz::EnablePenningTransfer:
    Penning transfer probability for 44 Ar excitation levels set to r = 0.456061

```

Cheers,

Gabriel

---

<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:** [March 19, 2026, 8:23pm UTC](https://root-forum.cern.ch/t/suppress-penning-transfer-g-warning/64730/5 "2026-03-19T20:23:47Z")

</div>

Closed on March 19, 2026, 8:23pm UTC

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