# Magboltz Gas Work function calculation

**URL:** <https://root-forum.cern.ch/t/magboltz-gas-work-function-calculation/32063>\
**Category:** Garfield++\
**Created:** [December 19, 2018, 7:41am UTC](https://root-forum.cern.ch/t/magboltz-gas-work-function-calculation/32063 "2018-12-19T07:41:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Javier\_Galan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/javier_galan/32/29662_2.png) [@Javier\_Galan](https://root-forum.cern.ch/u/Javier_Galan)\
**Post date:** [December 19, 2018, 7:41am UTC](https://root-forum.cern.ch/t/magboltz-gas-work-function-calculation/32063/1 "2018-12-19T07:41:30Z")

</div>

Hi,

when launching the gas generation in Garfield++, I define a given mixture, number of collisions, max electron energy, pressure, temperature, etc.

Then, I call

> MediumMagboltz::GenerateGasTable( collisions, true);

When the calculation is finished, I can retrieve the electron drift velocity and other gas parameters using the MediumMagboltz interface, i.e. using

> MediumMagbolz::ElectronVelocity(0., 0, -E, 0, 0, 0, vx, vy, vz);

I would like to obtain the value of W of the gas, which seems it should be stored in

> MediumMagboltz::GetW()

But the value I always get is 0.

There is a way to calculate the gas W, and get its value accessible through MediumMagboltz::GetW()?

Thanks

---

<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:** [December 19, 2018, 9:03am UTC](https://root-forum.cern.ch/t/magboltz-gas-work-function-calculation/32063/2 "2018-12-19T09:03:03Z")

</div>

Hi,

Magboltz doesn’t calculate the W value of the gas mixture, but you can get it from Heed. After calling TrackHeed::NewTrack (see, for instance, this example, [http://garfieldpp.web.cern.ch/garfieldpp/examples/heed/](http://garfieldpp.web.cern.ch/garfieldpp/examples/heed/)), you can retrieve the W value using TrackHeed::GetW.

Cheers,

Heinrich

---

<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:** [January 2, 2019, 9:03am UTC](https://root-forum.cern.ch/t/magboltz-gas-work-function-calculation/32063/3 "2019-01-02T09:03:06Z")

</div>

Closed on January 2, 2019, 9:03am UTC

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