# Is it a mistake in garfieldpp's source code?

**URL:** <https://root-forum.cern.ch/t/is-it-a-mistake-in-garfieldpps-source-code/61609>\
**Category:** Garfield++\
**Created:** [September 8, 2024, 5:21pm UTC](https://root-forum.cern.ch/t/is-it-a-mistake-in-garfieldpps-source-code/61609 "2024-09-08T17:21:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alksndr.volkov](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/alksndr.volkov/32/36212_2.png) [@alksndr.volkov](https://root-forum.cern.ch/u/alksndr.volkov)\
**Post date:** [September 8, 2024, 5:21pm UTC](https://root-forum.cern.ch/t/is-it-a-mistake-in-garfieldpps-source-code/61609/1 "2024-09-08T17:21:03Z")

</div>

Hello. I tried to understand how AvalancheMicroscopic works in Garfieldpp. It uses function “GetElectronEnergy” in “AvalancheMicroscopic.cc” (look at photo):

 ![photo_2024-09-08_20-12-40](https://root-forum.cern.ch/uploads/default/original/3X/c/3/c3d83ee135a856f0cbf3c734c950b070b7f5f3b0.jpeg)

I think that vx1,vx2,vx3 have dimension of velocity, because they used in calculation dx (change of coordinate). If we look at “Medium.cc” and find the function “GetElectronEnergy”, we can see the definiton of vx1, vx2, vx3:

 ![photo_2024-09-08_20-15-42](https://root-forum.cern.ch/uploads/default/original/3X/a/1/a17127b62ad70b38cc23d505b51b02e2334e9df3.jpeg)

But here the dimension of vx,vy,vz is velocity^2:

 ![photo_2024-09-08_20-17-14](https://root-forum.cern.ch/uploads/default/original/3X/9/9/999c098ac855a9b9ccd4d73d34499518885b2e63.jpeg)

So could you explain the dimensions problem?

---

<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:** [September 8, 2024, 8:03pm UTC](https://root-forum.cern.ch/t/is-it-a-mistake-in-garfieldpps-source-code/61609/2 "2024-09-08T20:03:07Z")

</div>

Hi,  
`GetElectronEnergy` is used in a specialised version of the function `TransportElectron` (in `AvalancheMicroscopic`) which is meant to deal with transport in semiconductors; this function has not been used/tested much in recent years. It’s entirely possible/likely that there are mistakes. But I think the dimensions are correct in this case; the constant `ElectronMass` is in eV, and the momentum vector is also in eV; but I’ll double-check…

---

<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:** [September 22, 2024, 8:03pm UTC](https://root-forum.cern.ch/t/is-it-a-mistake-in-garfieldpps-source-code/61609/3 "2024-09-22T20:03:49Z")

</div>

Closed on September 22, 2024, 8:03pm UTC

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