# How to set the gas gain

**URL:** <https://root-forum.cern.ch/t/how-to-set-the-gas-gain/47319>\
**Category:** Garfield++\
**Created:** [October 20, 2021, 12:59am UTC](https://root-forum.cern.ch/t/how-to-set-the-gas-gain/47319 "2021-10-20T00:59:06Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![lyp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@lyp](https://root-forum.cern.ch/u/lyp)\
**Post date:** [October 20, 2021, 12:59am UTC](https://root-forum.cern.ch/t/how-to-set-the-gas-gain/47319/1 "2021-10-20T00:59:06Z")

</div>

Excuse me， is that SetGainFluctuationsPolya() from driftlineRKF class to set the gas gain?

---

<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:** [October 20, 2021, 5:08am UTC](https://root-forum.cern.ch/t/how-to-set-the-gas-gain/47319/2 "2021-10-20T05:08:02Z")

</div>

Yes, it sets the avalanche size distribution to be used. The first argument is the shape parameter of the Polya function (θ = 0 corresponds to an exponential distribution, with increasing θ the distribution becomes more and more “rounded”). The second argument is the average gas gain.

---

<div class="post-metadata">

**Author:** ![lyp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@lyp](https://root-forum.cern.ch/u/lyp)\
**Post date:** [October 22, 2021, 8:59am UTC](https://root-forum.cern.ch/t/how-to-set-the-gas-gain/47319/3 "2021-10-22T08:59:12Z")

</div>

I have another problem. I want to plot a signalview of ion. So that i fixed my code like follow, but still coun’t get the ion signal, where is the wrong?

 ![2021-10-22 16-57-05 的屏幕截图](https://root-forum.cern.ch/uploads/default/original/3X/e/4/e4167cfc3c34d356e371142442abe44bc8c70bf3.png)

 ![2021-10-22 16-58-32屏幕截图](https://root-forum.cern.ch/uploads/default/original/3X/0/3/0368eff9a24fbd52a2344c1151faa36084c6bc7f.png)

---

<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:** [October 24, 2021, 10:00am UTC](https://root-forum.cern.ch/t/how-to-set-the-gas-gain/47319/4 "2021-10-24T10:00:36Z")

</div>

Hi,  
the signal from the “primary” ions is indeed quite small. To simulate the signal of the ions that are produced in the avalanche, please add a line `drift.EnableIonTail()` to the program (like [here]([Examples/DriftTube/mdt.C · master · garfield / garfieldpp · GitLab](https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/Examples/DriftTube/mdt.C#L93), but not commented out).

I also noticed that there was a bug with the plotting of the ion drift lines that are produced in the avalanche. I’ve just committed a fix, so you would need to `git pull` and rebuild the project to be able to visualise these drift lines correctly.

---

<div class="post-metadata">

**Author:** ![lyp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@lyp](https://root-forum.cern.ch/u/lyp)\
**Post date:** [October 25, 2021, 12:25am UTC](https://root-forum.cern.ch/t/how-to-set-the-gas-gain/47319/5 "2021-10-25T00:25:24Z")

</div>

You mean after I add drift.EnableIonTail(), the signal which are ploted is effected by both electron and ion? Also I saw that the drift line became to red, but not drifted to cathode, is that the bug you said? And what is git pull mean?

---

<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:** [October 25, 2021, 5:49am UTC](https://root-forum.cern.ch/t/how-to-set-the-gas-gain/47319/6 "2021-10-25T05:49:06Z")

</div>

> [@lyp](#):
>
> You mean after I add drift.EnableIonTail(), the signal which are plotted is effected by both electron and ion?

Yes (by the electrons and the ions that are produced in the avalanche).

> [@lyp](#):
>
> Also I saw that the drift line became to red, but not drifted to cathode, is that the bug you said?

Yes. To be precise, the ion drift lines were actually simulated, but not displayed correctly.

> [@lyp](#):
>
> And what is git pull mean?

Go to the directory to which you cloned the Garfield++ source code (the one that $GARFIELD\_HOME should point to), and type git pull, then re-build the project.

---

<div class="post-metadata">

**Author:** ![lyp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@lyp](https://root-forum.cern.ch/u/lyp)\
**Post date:** [October 25, 2021, 6:12am UTC](https://root-forum.cern.ch/t/how-to-set-the-gas-gain/47319/7 "2021-10-25T06:12:30Z")

</div>

Is there any options after command “get pull” ,it prompt me to choose a repository…

---

<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:** [October 25, 2021, 6:54am UTC](https://root-forum.cern.ch/t/how-to-set-the-gas-gain/47319/8 "2021-10-25T06:54:37Z")

</div>

Hmm, that’s strange… How did you get hold of the Garfield++ source code in the first place? I assume you typed `git clone ...` ?

---

<div class="post-metadata">

**Author:** ![lyp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@lyp](https://root-forum.cern.ch/u/lyp)\
**Post date:** [October 25, 2021, 7:02am UTC](https://root-forum.cern.ch/t/how-to-set-the-gas-gain/47319/9 "2021-10-25T07:02:28Z")

</div>

I downloaded the compressed package from the official website hahah 😆

---

<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:** [October 25, 2021, 7:17am UTC](https://root-forum.cern.ch/t/how-to-set-the-gas-gain/47319/10 "2021-10-25T07:17:11Z")

</div>

Ah, ok. In that case you have to download it again…

---

<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:** [November 8, 2021, 7:17am UTC](https://root-forum.cern.ch/t/how-to-set-the-gas-gain/47319/11 "2021-11-08T07:17:54Z")

</div>

Closed on November 8, 2021, 7:17am UTC

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