# Oversized avalanches with DriftLineRKF

**URL:** <https://root-forum.cern.ch/t/oversized-avalanches-with-driftlinerkf/53699>\
**Category:** Garfield++\
**Created:** [February 20, 2023, 2:49pm UTC](https://root-forum.cern.ch/t/oversized-avalanches-with-driftlinerkf/53699 "2023-02-20T14:49:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlRugger](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/ad7895/32.png) [@AlRugger](https://root-forum.cern.ch/u/AlRugger)\
**Post date:** [February 20, 2023, 2:49pm UTC](https://root-forum.cern.ch/t/oversized-avalanches-with-driftlinerkf/53699/1 "2023-02-20T14:49:02Z")

</div>

Greetings,

I’m having some issues with the simulation of a muon track signal in a drift chamber cell (similar to the one in [my previous topic](https://root-forum.cern.ch/t/driftlinerkf-lines-ending-inside-a-solidwire/53293)):

- The cell structure is defined using the native geometry (in particular using `SolidWire` for wires) and the electric field is then computed with `ComponentNeBem3d`.
- I use the `DriftLineRKF` class to simulate electron and ion drift and avalanches on the signal wire.

The “regular” electron avalanche size that I find is of `3*10^5` electrons and ions, which is consistent with the gain computation and corresponds to a signal plot of this type:

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/e/9/e9304c181db39a688023bf7cc7ab69c3a87681e9.png)

What I noticed is that in some runs, a small number of electrons (~3 out of all) have oversized avalanches with up to `10^10` particles produced, so the signal plots look like this:

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/c/1/c134201da00a89bda9590df02e1224c2cbd7c60d.png)

When this happens I get these warning messages:

```auto
DriftLineRKF::Avalanche:
    Cannot retrieve alpha at drift line point x, segment y
//or
DriftLineRKF::Avalanche:
    Warning: Integrating the Townsend coefficients would lead to exponential overflow.
    Avalanche truncated.

```

As I suspected I could be having issues in the avalanche simulation, I decided to output the avalanche parameters at each step of the computation in `DriftLineRKF::Avalanche()`:

- I’m printing the `logp`, `alpsum`, `etasum` and `d` parameters, from which the electron number is calculated (with exponent `exp`) and, for each step point, the distance `r` from the origin in the `x-y` plane and the electric field magnitude.
- Once the drift and avalanche simulation ends, I’m printing the final `r` and arrival time `te`, the gain estimated with `DriftLineRKF::GetGain()`, the avalanche size (n\_el, n\_ion) and the electric field magnitude at the endpoint.

The output below is for a regular avalanche behaviour:

 ![Screenshot 2023-02-20 alle 14.51.13](https://root-forum.cern.ch/uploads/default/original/3X/8/9/89b6355488673412ac532e2d2153b128b7180df1.png)

which seems sensible to me.

For the oversized avalanches the behaviour is different:

 ![Screenshot 2023-02-20 alle 15.11.52](https://root-forum.cern.ch/uploads/default/original/3X/5/c/5cf58e1b932ff8424e86c2bb43a8ff660289aa89.png)

As my signal wire has a radius of `0.002 cm`, the avalanche step seems to be getting inside the wire before moving back, at which point `alpsum` jumps by a factor of 10. This then leads to the oversized avalanches.

Is this the expected behaviour for the avalanche simulation? What could be a workaround apart from neglecting the oversized signals in that case?  
Any feedback that you may have would be greatly appreciated.

I’m attaching the code and gas file below.  
[camera\_signal\_simu.cpp](https://root-forum.cern.ch/uploads/short-url/auWU81cw4BmfvdwEcPEFDt42AzY.cpp) (8.3 KB)  
[ar\_85\_co2\_15\_1atm.txt.zip](https://root-forum.cern.ch/uploads/short-url/dvp4t4ufY8kRG176boIEyS0HmwJ.zip) (7.3 KB)

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [February 21, 2023, 2:48pm UTC](https://root-forum.cern.ch/t/oversized-avalanches-with-driftlinerkf/53699/2 "2023-02-21T14:48:29Z")

</div>

Hello @AlRugger ,

let’s see if @hschindl can help here 🙂

Cheers,  
Enrico

---

<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 9, 2023, 1:37pm UTC](https://root-forum.cern.ch/t/oversized-avalanches-with-driftlinerkf/53699/4 "2023-03-09T13:37:59Z")

</div>

Sorry! Thanks for sending the program. I can reproduce the issue but didn’t have time yet to look into it (will try to do it asap).

---

<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 23, 2023, 1:38pm UTC](https://root-forum.cern.ch/t/oversized-avalanches-with-driftlinerkf/53699/5 "2023-03-23T13:38:52Z")

</div>

Closed on March 23, 2023, 1:38pm UTC

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