# How to calculate the induced signal caused by alpha in Gem

**URL:** <https://root-forum.cern.ch/t/how-to-calculate-the-induced-signal-caused-by-alpha-in-gem/54325>\
**Category:** Garfield++\
**Created:** [April 1, 2023, 3:19pm UTC](https://root-forum.cern.ch/t/how-to-calculate-the-induced-signal-caused-by-alpha-in-gem/54325 "2023-04-01T15:19:58Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![zql21](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zql21/32/33487_2.png) [@zql21](https://root-forum.cern.ch/u/zql21)\
**Post date:** [April 1, 2023, 3:19pm UTC](https://root-forum.cern.ch/t/how-to-calculate-the-induced-signal-caused-by-alpha-in-gem/54325/1 "2023-04-01T15:19:59Z")

</div>

Hi,based on [The questions about the induced current - #26 by XiCheng](https://root-forum.cern.ch/t/the-questions-about-the-induced-current/48314/26), I wrote a program to calculate the induced signal caused by alpha in air in the Gem detector.Here is some information about my code(attached below).  
I used Ansys to build a single-layer Gem model with cathode (0 Volt) at the bottom, gem in the middle, and anode (1500 volt) at the top. The drift region is 3 mm and the induction region is 1 mm. In addition, SRIM was used to calculate the ionization data of alpha in air (“EXYZ\_Helim\_inAir.txt”," Helium\_10keV-10MeV\_in\_Air.txt" ).

I want to simulate the ionization of alpha in the drift region, avalanche in the gem, then calculate the induced signal on the anode, and visualize the whole process using the driftView.But encountered the following problems.  
1.I ’ m not sure the weighting field is calculated correctly because fieldView.PlotContourWeightingField ( ’ anode ', ’ e ’ ) and fieldView.PlotContour ( ’ e ’ ) ; the results are very similar.  
2.I feel that TrackSrim and TrackSrim are very similar, so I use them separately. TrackTrim can output normally, but use TrackSrim to output ’ DriftLineRKF : : DriftLine : Cannot retrieve drift velocity at initial position (0.002369, -0.004027, -0.000000). \*\*\*Break \*\*\*\*segmentation violation '.  
( a ) What are the possible reasons for TrackSrim to cause error 'DriftLineRKF: : DriftLine:Cannot retrieve drift velocity at initial position ’ ? How should I solve it ?  
( b ) What are the advantages of TrackSrim and TrackSrim, I mean, how do I determine which one to choose ?  
3.The driftline is very strange, unlike the alpha ionization trajectory.Is something wrong with the code below?

 ![图片](https://root-forum.cern.ch/uploads/default/original/3X/9/1/9104f22c9455876d975b6dc9c5bb0817781d4c22.png)

```auto
 while (track.GetCluster(xc, yc, zc, tc, nc, ec, extra))
    {
      cout << "xc= " << xc << " yc= " << yc << " zc= " << zc << "nc= " << nc << '\n';
      drift.SetIonSignalScalingFactor(nc);
      drift.DriftIon(xc, yc, zc, tc);
      drift.SetElectronSignalScalingFactor(nc);
      drift.DriftElectron(xc, yc, zc, tc);
      // double xe = 0., ye = 0., ze = 0., te = 0.;
      // int status = 0;
      // drift.GetEndPoint(xe, ye, ze, te, status);
      // ze = -1.e-10;
      // drift.DriftElectron(xe, ye, ze, te); // ye
    }

```

4.On the basis of simulating alpha ionization, I want to simulate the avalanche of electrons in the gem, and then calculate the induction signal of the anode, how should I modify the original code？  
5.The calculated induction signal seems to be only caused by electrons. If I want to calculate the induction signal caused by ions, what should I do ?  
[srim.zip](https://root-forum.cern.ch/uploads/short-url/dhx6RKwYp8AzQOLyvVIx9u1ZzKk.zip) (985.5 KB)  
the file"EXYZ\_Helim\_inAir.txt" is too big to upload

---

<div class="post-metadata">

**Author:** ![zpdg\_root](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zpdg_root/32/31576_2.png) [@zpdg\_root](https://root-forum.cern.ch/u/zpdg_root)\
**Post date:** [April 2, 2023, 1:35am UTC](https://root-forum.cern.ch/t/how-to-calculate-the-induced-signal-caused-by-alpha-in-gem/54325/2 "2023-04-02T01:35:42Z")

</div>

I think @hschindl could help

---

<div class="post-metadata">

**Author:** ![zql21](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zql21/32/33487_2.png) [@zql21](https://root-forum.cern.ch/u/zql21)\
**Post date:** [April 4, 2023, 12:53am UTC](https://root-forum.cern.ch/t/how-to-calculate-the-induced-signal-caused-by-alpha-in-gem/54325/3 "2023-04-04T00:53:01Z")

</div>

Hi ! @hschindl,Sorry to disturb you.Can you give me some help?

---

<div class="post-metadata">

**Author:** ![zql21](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zql21/32/33487_2.png) [@zql21](https://root-forum.cern.ch/u/zql21)\
**Post date:** [April 4, 2023, 7:50am UTC](https://root-forum.cern.ch/t/how-to-calculate-the-induced-signal-caused-by-alpha-in-gem/54325/4 "2023-04-04T07:50:15Z")

</div>

Based on [Weird signal shape for proportional counter - #6 by hschindl](https://root-forum.cern.ch/t/weird-signal-shape-for-proportional-counter/45096/6)  
I used microscopic tracking and DriftLineRKF to calculate the induction signal generated by a single electron at anode separately, and the results are strange. I do not know whether the code is wrong or the drift electric field calculated by Ansys is wrong?  
[single\_eletron.txt](https://root-forum.cern.ch/uploads/short-url/5RdlssOXF6MutZwQhgtv6IwBSqo.txt) (4.6 KB)

---

<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:** [April 4, 2023, 8:07am UTC](https://root-forum.cern.ch/t/how-to-calculate-the-induced-signal-caused-by-alpha-in-gem/54325/5 "2023-04-04T08:07:00Z")

</div>

I had a quick look and I don’t see anything obviously wrong with the code…

---

<div class="post-metadata">

**Author:** ![zql21](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zql21/32/33487_2.png) [@zql21](https://root-forum.cern.ch/u/zql21)\
**Post date:** [April 4, 2023, 8:15am UTC](https://root-forum.cern.ch/t/how-to-calculate-the-induced-signal-caused-by-alpha-in-gem/54325/6 "2023-04-04T08:15:17Z")

</div>

But “ne” is calculated to be 1(using aval.AvalancheElectron),and to be 2.06835e-06 electrons(using DriftLineRKF). Is something wrong with the gas setting or the electric field calculated by ansys? Do you have time to take a look ?

---

<div class="post-metadata">

**Author:** ![zql21](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zql21/32/33487_2.png) [@zql21](https://root-forum.cern.ch/u/zql21)\
**Post date:** [April 4, 2023, 8:37am UTC](https://root-forum.cern.ch/t/how-to-calculate-the-induced-signal-caused-by-alpha-in-gem/54325/7 "2023-04-04T08:37:31Z")

</div>

This is my generate.C of gas.

```auto
#include <iostream>
#include "Garfield/MediumMagboltz.hh"
#include "Garfield/FundamentalConstants.hh"
using namespace Garfield;
int main(int argc, char *argv[])
{
  const double pressure = 760*2;
  const double temperature = 293.15; //
  MediumMagboltz gas("Ar", 0.94, "CO2", 0.03, "H2O", 0.03, "O2", 20.9, "N2", 78.1);
  gas.SetTemperature(temperature);
  gas.SetPressure(pressure);
  // Set the field range to be covered by the gas table.
  const size_t nE = 30;
  const double emin = 100.;
  const double emax = 100000.;
  // 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.
  const std::string filename = "gas_" + std::to_string(pressure) + ".gas";
  gas.WriteGasFile(filename.c_str());
}

```

and this is my setting of TRIM calc

 ![图片](https://root-forum.cern.ch/uploads/default/original/3X/8/0/80cbc4c699efc1fd7ba67b2a75bcf52ebb6d3fb9.jpeg)

---

<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:** [April 4, 2023, 8:47am UTC](https://root-forum.cern.ch/t/how-to-calculate-the-induced-signal-caused-by-alpha-in-gem/54325/8 "2023-04-04T08:47:47Z")

</div>

Apologies for the delayed reply (you are asking many questions at the same time not all of which are trivial/quick to answer).  
I will try to run your program and see if I can reproduce the `Cannot retrieve drift velocity...` error message. `TrackSrim` should not create clusters outside an active medium (and in any case shouldn’t see-fault) but there may be a bug; I’ll take a look.  
`TrackSrim` and `TrackTrim` are indeed similar in scope (and they both use output from the TRIM/SRIM family of programs).

`TrackSrim` takes the average properties (dE/dx, straggling parameters) computed by SRIM, distribute the energy loss over a discrete set of “clusters” and randomises the energy loss over a track segment (using a Landau, Vavilov or Gaussian distribution). `TrackTrim` takes directly a list of trajectories + energy losses for individual tracks from TRIM. For more details please see the examples on the website).

By default, `DriftLineRKF` should also calculate the avalanche growth (but just integrating the Townsend coefficient along the drift line, without taking into account the spatial growth/diffusion). If you switch on the calculation of the ion tail, the ion signal should, in theory, also be computed. In a GEM the signal is typically dominated by the electron component though (the GEM foil acts a bit as a shield).

---

<div class="post-metadata">

**Author:** ![zql21](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zql21/32/33487_2.png) [@zql21](https://root-forum.cern.ch/u/zql21)\
**Post date:** [April 4, 2023, 9:12am UTC](https://root-forum.cern.ch/t/how-to-calculate-the-induced-signal-caused-by-alpha-in-gem/54325/9 "2023-04-04T09:12:04Z")

</div>

> [@hschindl](#):
>
> I will try to run your program and see if I can reproduce the `Cannot retrieve drift velocity...` error message. `TrackSrim` should not create clusters outside an active medium (and in any case shouldn’t see-fault) but there may be a bug; I’ll take a look.  
> `TrackSrim` and `TrackTrim` are indeed similar in scope (and they both use output from the TRIM/SRIM family of programs).

Looking forward to your reproduce and reply!

> [@hschindl](#):
>
> `TrackSrim` takes the average properties (dE/dx, straggling parameters) computed by SRIM, distribute the energy loss over a discrete set of “clusters” and randomises the energy loss over a track segment (using a Landau, Vavilov or Gaussian distribution). `TrackTrim` takes directly a list of trajectories + energy losses for individual tracks from TRIM. For more details please see the examples on the website).

Thanks a lot! I’ll see the examples again

> [@hschindl](#):
>
> By default, `DriftLineRKF` should also calculate the avalanche growth (but just integrating the Townsend coefficient along the drift line, without taking into account the spatial growth/diffusion). If you switch on the calculation of the ion tail, the ion signal should, in theory, also be computed. In a GEM the signal is typically dominated by the electron component though (the GEM foil acts a bit as a shield).

Do you mean that DriftLineRKF can simulate avalanche of electrons in a gem without taking into account the spatial growth / diffusion? In my case ( the primary particle is alpha, and in gem detector ), finally want to get the induction signal on the anode, if only using DriftLineRKF, Is the calculation result accurate ?

---

<div class="post-metadata">

**Author:** ![zql21](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zql21/32/33487_2.png) [@zql21](https://root-forum.cern.ch/u/zql21)\
**Post date:** [April 4, 2023, 9:25am UTC](https://root-forum.cern.ch/t/how-to-calculate-the-induced-signal-caused-by-alpha-in-gem/54325/10 "2023-04-04T09:25:07Z")

</div>

[gas\_2atm\_10-100000-nE30 .gas.txt](https://root-forum.cern.ch/uploads/short-url/nH7rLpyuBqAdtFJKrc14PLSHuXv.txt) (108.0 KB)

Oh,This is my latest gasFile.

---

<div class="post-metadata">

**Author:** ![zql21](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zql21/32/33487_2.png) [@zql21](https://root-forum.cern.ch/u/zql21)\
**Post date:** [April 7, 2023, 12:57am UTC](https://root-forum.cern.ch/t/how-to-calculate-the-induced-signal-caused-by-alpha-in-gem/54325/11 "2023-04-07T00:57:46Z")

</div>

> [@zql21](#):
>
> Based on [Weird signal shape for proportional counter - #6 by hschindl](https://root-forum.cern.ch/t/weird-signal-shape-for-proportional-counter/45096/6)  
> I used microscopic tracking and DriftLineRKF to calculate the induction signal generated by a single electron at anode separately, and the results are strange. I do not know whether the code is wrong or the drift electric field calculated by Ansys is wrong?  
> [single\_eletron.txt](https://root-forum.cern.ch/uploads/short-url/5RdlssOXF6MutZwQhgtv6IwBSqo.txt) (4.6 KB)

@hschindl ,sorry to disturb you. Could you help me check what might be wrong?Thanks a lot.

---

<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:** [April 25, 2023, 8:34am UTC](https://root-forum.cern.ch/t/how-to-calculate-the-induced-signal-caused-by-alpha-in-gem/54325/13 "2023-04-25T08:34:03Z")

</div>

Closed on April 25, 2023, 8:34am UTC

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