# How to get information about the arbitrary position of an electron in the track of a drifting avalanche process

**URL:** <https://root-forum.cern.ch/t/how-to-get-information-about-the-arbitrary-position-of-an-electron-in-the-track-of-a-drifting-avalanche-process/49071>\
**Category:** Garfield++\
**Created:** [March 7, 2022, 12:55pm UTC](https://root-forum.cern.ch/t/how-to-get-information-about-the-arbitrary-position-of-an-electron-in-the-track-of-a-drifting-avalanche-process/49071 "2022-03-07T12:55:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![WAQ](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/e95f7d/32.png) [@WAQ](https://root-forum.cern.ch/u/WAQ)\
**Post date:** [March 7, 2022, 12:55pm UTC](https://root-forum.cern.ch/t/how-to-get-information-about-the-arbitrary-position-of-an-electron-in-the-track-of-a-drifting-avalanche-process/49071/1 "2022-03-07T12:55:16Z")

</div>

Hello!  
I know get the information the end point of the electron like  
aval.GetElectronEndpoint(j, xe1, ye1, ze1, te1, e1, xe2, ye2, ze2, te2, e2, status);  
But I want to get information like x, y , z , energy, t about the arbitrary position of an electron in the track of a drifting avalanche process. Does Garfield++ allow us to do this?  
Thanks for your help!

---

<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 7, 2022, 1:35pm UTC](https://root-forum.cern.ch/t/how-to-get-information-about-the-arbitrary-position-of-an-electron-in-the-track-of-a-drifting-avalanche-process/49071/2 "2022-03-07T13:35:48Z")

</div>

Hi,  
yes, you can use call-back functions (“user handles”) for this purpose. As an illustration  
In [this example](https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/Examples/Electroluminescence/userHandle.C) such a function is to plot the z-coordinates of all excitations in the avalanche.  
Currently, there are hooks available for calling a function at every step, at every collision, and for specific types of collisions.

---

<div class="post-metadata">

**Author:** ![WAQ](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/e95f7d/32.png) [@WAQ](https://root-forum.cern.ch/u/WAQ)\
**Post date:** [March 8, 2022, 7:11am UTC](https://root-forum.cern.ch/t/how-to-get-information-about-the-arbitrary-position-of-an-electron-in-the-track-of-a-drifting-avalanche-process/49071/3 "2022-03-08T07:11:30Z")

</div>

Hi,  
Thank you for your reply.  
I have found a function ( AvalancheMicroscopic::GetElectronDriftLinePoint) . In this function I can get the coordinates include x y, z , t in the avalanche .Does this function meet my needs？  
Also I will give the functions(“user handles”) a try.  
Best wishes!  
Anqi

---

<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 8, 2022, 7:29am UTC](https://root-forum.cern.ch/t/how-to-get-information-about-the-arbitrary-position-of-an-electron-in-the-track-of-a-drifting-avalanche-process/49071/4 "2022-03-08T07:29:10Z")

</div>

Hi,  
yes, good point, `GetElectronDriftLinePoint` should work. Note that by default `AvalancheMicroscopic` doesn’t store every single collision but only every 100th. You can change that using `SetCollisionSteps`.

---

<div class="post-metadata">

**Author:** ![WAQ](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/e95f7d/32.png) [@WAQ](https://root-forum.cern.ch/u/WAQ)\
**Post date:** [March 9, 2022, 7:24am UTC](https://root-forum.cern.ch/t/how-to-get-information-about-the-arbitrary-position-of-an-electron-in-the-track-of-a-drifting-avalanche-process/49071/5 "2022-03-09T07:24:00Z")

</div>

Hi,  
Thank you for your note.  
I try the function aval.SetUserHandleInelastic(userHandle), but I have some uncertainty of the z-coordinates getting form that function . Can you give it a explanation?  
Best wishes!  
Anqi

---

<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, 2022, 12:14pm UTC](https://root-forum.cern.ch/t/how-to-get-information-about-the-arbitrary-position-of-an-electron-in-the-track-of-a-drifting-avalanche-process/49071/6 "2022-03-09T12:14:23Z")

</div>

It’s the z coordinate (in cm) where the inelastic collision occurred.

PS: the [example](https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/Examples/Electroluminescence/userHandle.C) I linked to in my previous reply was only meant as an illustration. You’ll probably need to adapt it to your needs…

---

<div class="post-metadata">

**Author:** ![WAQ](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/e95f7d/32.png) [@WAQ](https://root-forum.cern.ch/u/WAQ)\
**Post date:** [March 9, 2022, 1:02pm UTC](https://root-forum.cern.ch/t/how-to-get-information-about-the-arbitrary-position-of-an-electron-in-the-track-of-a-drifting-avalanche-process/49071/7 "2022-03-09T13:02:39Z")

</div>

Hi,  
Thank you for your reply. Now I understand its usage.

Thank you again！  
Best wishes!  
Anqi

---

<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, 2022, 1:02pm UTC](https://root-forum.cern.ch/t/how-to-get-information-about-the-arbitrary-position-of-an-electron-in-the-track-of-a-drifting-avalanche-process/49071/8 "2022-03-23T13:02:51Z")

</div>

Closed on March 23, 2022, 1:02pm UTC

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