# Problem about EnableElectricField()

**URL:** <https://root-forum.cern.ch/t/problem-about-enableelectricfield/54241>\
**Category:** Garfield++\
**Created:** [March 27, 2023, 2:58pm UTC](https://root-forum.cern.ch/t/problem-about-enableelectricfield/54241 "2023-03-27T14:58:59Z")\
**Posts on this page:** 4\
**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:** [March 27, 2023, 2:59pm UTC](https://root-forum.cern.ch/t/problem-about-enableelectricfield/54241/1 "2023-03-27T14:59:00Z")

</div>

In examples/gem, the unit model of gem is established by apdl command, voltage is applied to cathode and anode, and then the result is output to lis file. garfield + + imports these lis files  
My question is :  
1.Will the electric field set in ansys be used when calculating electron drift or avalanche ?  
2.When using TrackHeed, will you use the electric field set in ansys ? Because I found that TrackHeed has a member function EnableElectricField ( ) ; i don 't know under what circumstances this function will be used.  
3.When calculating electron drift or avalanche, what should I do if I want to set the magnetic field ?  
I would appreciate it if you could give some help.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [March 27, 2023, 3:04pm UTC](https://root-forum.cern.ch/t/problem-about-enableelectricfield/54241/2 "2023-03-27T15:04:03Z")

</div>

I guess @hschindl can 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 27, 2023, 3:43pm UTC](https://root-forum.cern.ch/t/problem-about-enableelectricfield/54241/3 "2023-03-27T15:43:45Z")

</div>

Hi,

1. Yes, in the GEM example, the field map calculated using Ansys is used when simulating the electron drift/avalanche.
2. By default, TrackHeed does not take electric fields into account. If you call `EnableElectricField` it will use the electric field in the stepping. But I don’t recommend doing that; the electric field normally does not have a significant influence on the primary charged particle nor the delta electrons.
3. If you have a constant magnetic field, you can simply set the three components of the B-field (in units of Tesla) using `SetMagneticField` (this function is available in every `Component` class).

---

<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 10, 2023, 3:44pm UTC](https://root-forum.cern.ch/t/problem-about-enableelectricfield/54241/4 "2023-04-10T15:44:39Z")

</div>

Closed on April 10, 2023, 3:44pm UTC

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