# How to simulate ion signal induced charge for SeF6

**URL:** <https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164>\
**Category:** Garfield++\
**Created:** [March 19, 2025, 6:42am UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164 "2025-03-19T06:42:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![dm-leo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dm-leo/32/29761_2.png) [@dm-leo](https://root-forum.cern.ch/u/dm-leo)\
**Post date:** [March 19, 2025, 6:42am UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164/1 "2025-03-19T06:42:29Z")

</div>

Dear all,  
I want to simulate induced signal for SeF5- fly in SeF6. Following the suggestion, I use SF6 instead. My first question is that is it necessary to build gas file using Magboltz if the gas had been defined? I tried to generate gas file about SF6, but it mentioned me “PROGRAM STOPPED TOO MANY PRIMARIES IPRIM”. Although I enhanced the range of electric field.  
And the model was built by COMSOL, with also the weight potential.

```auto
        ComponentComsol fm;
        fm.Initialise("mesh_induced.mphtxt", "dielectric.dat", "Potential.txt", "mm");
        fm.PrintRange();

```

It was successful to load it. Next I want to load the mobility for SeF5- in SeF6 which was calculated by myself and load SF6 gas

```auto
        MediumMagboltz gas("sf6");
        gas.SetTemperature(293.15);
        gas.SetPressure(760.);
        gas.Initialise(true);

        gas.LoadIonMobility("/Users/tianyu/InducedCharge/SeF5-_SeF6.txt");
        fm.SetGas(&gas);
        fm.PrintMaterials();

```

And calculate the signal

```auto
        fm.SetWeightingField("WeightPotential.txt","anode");
        Sensor sensor(&fm);
        sensor.AddElectrode(&fm,"anode");
        const unsigned int nBins = 10000;
        sensor.SetTimeWindow(0, 2000, nBins);

        AvalancheMC drift;
        drift.SetSensor(&sensor);
        drift.UseWeightingPotential(true);
        drift.SetDistanceSteps(1e-4);
        drift.EnableSignalCalculation();

        drift.DriftIon(0,0,9.5,0);

```

My result is as shown.

 ![Screenshot 2025-03-19 at 14.34.36](https://root-forum.cern.ch/uploads/default/original/3X/5/8/58e16dbc00a4451ccba4716d73b997d15805022a.png)  
Of course it seems abnormal. So my second question is what’s wrong to my code?  
Another question is that the ion is negative ion, so when using drift.DriftNegativeIon(0,0,9.5,0), the induced charge is 0. Why such thing happens?  
Thanks  
[Induced.C](https://root-forum.cern.ch/uploads/short-url/3KHUfo1ZNCS3CHV2rsL69mem0GS.C) (3.1 KB)  
[Potential.txt](https://root-forum.cern.ch/uploads/short-url/7n8V0p6IqPL5y2O3Wf5u9y6vQmj.txt) (291.0 KB)  
[SeF5-\_SeF6.txt](https://root-forum.cern.ch/uploads/short-url/vezrckZLVXjC9siwsGOO7zsdNjy.txt) (309 Bytes)  
[WeightPotential.txt](https://root-forum.cern.ch/uploads/short-url/3rNuEsOkvCcf0pSyBLyHPaGU2N2.txt) (293.1 KB)

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [March 19, 2025, 6:59am UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164/2 "2025-03-19T06:59:25Z")

</div>

I’m sure @hschindl can help you

---

<div class="post-metadata">

**Author:** ![dm-leo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dm-leo/32/29761_2.png) [@dm-leo](https://root-forum.cern.ch/u/dm-leo)\
**Post date:** [March 19, 2025, 8:13am UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164/3 "2025-03-19T08:13:52Z")

</div>

BTW, I calculated the induced charge using COMSOL and Matlab, I guess that should be the expected result.

 ![d88d9ee2e91ad385d9f63018a17decfd](https://root-forum.cern.ch/uploads/default/original/3X/3/0/30c6a97a63b7be69b460edba9e06272111beba64.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:** [March 19, 2025, 8:48am UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164/4 "2025-03-19T08:48:20Z")

</div>

Hi,  
at what electric field did you get the “PROGRAM STOPPED…” error message from Magboltz? In pure SF6, electron attachment happens very quickly and you might be running the simulation at conditions where you don’t get meaningful macroscopic transport parameters (drift velocity etc.).

The plot you attached seems to be the induced charge as function of time (as opposed to the induced current). Can you explain in more detail why it looks abnormal?

Regarding the negative ion drift: where is the starting point (0, 0, 9.5) with respect to the readout electrode? Can you make a plot of the drift line?

---

<div class="post-metadata">

**Author:** ![dm-leo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dm-leo/32/29761_2.png) [@dm-leo](https://root-forum.cern.ch/u/dm-leo)\
**Post date:** [March 19, 2025, 9:22am UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164/5 "2025-03-19T09:22:20Z")

</div>

Hello,  
Here is the model and electric field generated by COMSOL.

 ![bf9396be153b36d91d1e97b1a76d32c0](https://root-forum.cern.ch/uploads/default/original/3X/1/3/1382693d60a5db75ecec529f9ec0e476f7cfd768.png)  
It is consisted by cathode (top), focus plane (a hole in the middle of plane) and anode (hexagon area). The voltage of cathode is -2000 V and the voltage of focusing plane is -1500 V.

Starting point (0, 0, 9.5) means the ion should be at the center and z = 95 mm.  
What I expected is that the induced charge should back to 0 as the increasing drift time. Besides, the drift velocity of ions is too slow, the time should be longer.  
Here is the result of induced current vs time. Looks like white noise.

 ![Screenshot 2025-03-19 at 17.10.48](https://root-forum.cern.ch/uploads/default/original/3X/5/6/56c1d0a266c7510d80be267d1823ed7c2ce9dc5b.png)

---

<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 19, 2025, 10:41am UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164/6 "2025-03-19T10:41:46Z")

</div>

Dear @dm-leo can you provide also your field files (mesh\_induced.mphtxt, dielectric.dat, Potential.txt) such that we can run your example code?  
Thanks  
Piet

---

<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:** [March 19, 2025, 8:59pm UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164/7 "2025-03-19T20:59:49Z")

</div>

Can you do some sanity checks?

- What is the electric field at the starting point of your ion? Assuming the region between the cathode and the focusing plane can be approximate by a parallel plate chamber, I guess the field will be around 500 V / 10 cm = 50 V / cm, which is quite low.
- What is the drift velocity that you expect at that field given the mobility value you are using? And what would be the drift time of the ion?

---

<div class="post-metadata">

**Author:** ![dm-leo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dm-leo/32/29761_2.png) [@dm-leo](https://root-forum.cern.ch/u/dm-leo)\
**Post date:** [March 20, 2025, 1:09am UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164/8 "2025-03-20T01:09:31Z")

</div>

[InducedCharge.zip](https://root-forum.cern.ch/uploads/short-url/fUjDWLj6kt8vvJuvUFJjTnCWahs.zip) (1.2 MB)  
All the file was packaged in attaching file.  
Thanks

---

<div class="post-metadata">

**Author:** ![dm-leo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dm-leo/32/29761_2.png) [@dm-leo](https://root-forum.cern.ch/u/dm-leo)\
**Post date:** [March 20, 2025, 1:13am UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164/9 "2025-03-20T01:13:18Z")

</div>

Hi, of course the electric field is quite low. The reduced mobility I calculated is about 0.444, so the velocity is about 2 cm/s. The time should be larger than 5 s. So at least us is not suitable.

---

<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:** [March 20, 2025, 6:24am UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164/10 "2025-03-20T06:24:03Z")

</div>

Hi,  
on the last plot you’ve posted (the one showing the induced current as function of time), the duration of the signal is ~9 ms, and it’s for the positive ion (so over a distance of 5 mm), so the order of magnitude doesn’t seem completely wrong. But I agree that the current looks a bit small. Can you try to switch off diffusion (function `DisableDiffusion` in `AvalancheMC`)? You might also want to increase the step size (1 μm seems a bit small for the scale of the device you are simulating).

---

<div class="post-metadata">

**Author:** ![dm-leo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dm-leo/32/29761_2.png) [@dm-leo](https://root-forum.cern.ch/u/dm-leo)\
**Post date:** [March 20, 2025, 6:59am UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164/11 "2025-03-20T06:59:17Z")

</div>

Hi, @hschindl  
After switching off the diffusion and change the step size into 0.01 μm, I could get both the signal of negative and positive signal.

 ![Screenshot 2025-03-20 at 14.50.42](https://root-forum.cern.ch/uploads/default/original/3X/7/f/7ff81bfdd18bc72b6c3bc01507bad7abfcc3ea76.png)  
 ![Screenshot 2025-03-20 at 14.51.46](https://root-forum.cern.ch/uploads/default/original/3X/7/4/74aac696e4669238a1abf40a8690a6a7fefad930.png)  
But the induced charge is still 0 when using

```auto
sensor.IntegrateSignals();
sensor.GetIonSignal("anode", nBins - 1) / ElementaryCharge;

```

for negative ions. Besides, the time seems not correct if the electric field is so small. Do you have any suggestions?

---

<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:** [March 20, 2025, 3:22pm UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164/12 "2025-03-20T15:22:55Z")

</div>

Ah, I see what you mean. `GetIonSignal` returns the signal induced by positive charge carriers, `GetElectronSignal` returns the signal induced by negative charge carriers, i. e. electrons and negative ions.

---

<div class="post-metadata">

**Author:** ![dm-leo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dm-leo/32/29761_2.png) [@dm-leo](https://root-forum.cern.ch/u/dm-leo)\
**Post date:** [March 21, 2025, 1:18am UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164/13 "2025-03-21T01:18:34Z")

</div>

Thanks 😀I think the problem was solved

---

<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 4, 2025, 1:19am UTC](https://root-forum.cern.ch/t/how-to-simulate-ion-signal-induced-charge-for-sef6/63164/14 "2025-04-04T01:19:20Z")

</div>

Closed on April 4, 2025, 1:19am UTC

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