# Trying to make a TPC with a D2 type symmetry

**URL:** <https://root-forum.cern.ch/t/trying-to-make-a-tpc-with-a-d2-type-symmetry/39850>\
**Category:** Garfield++\
**Created:** [June 9, 2020, 5:31pm UTC](https://root-forum.cern.ch/t/trying-to-make-a-tpc-with-a-d2-type-symmetry/39850 "2020-06-09T17:31:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bugs\_Bunny](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/97f17d/32.png) [@Bugs\_Bunny](https://root-forum.cern.ch/u/Bugs_Bunny)\
**Post date:** [June 9, 2020, 5:31pm UTC](https://root-forum.cern.ch/t/trying-to-make-a-tpc-with-a-d2-type-symmetry/39850/1 "2020-06-09T17:31:17Z")

</div>

I’m currently trying to simulate a TPC which has concentrically placed wires inside a grounded tube. From what I can see this corresponds to the D2 type symmetry in the Garfield++ documentation. I have tried to use the SetPeriodicityPhi class, but this did not work. I’ve just recently started working with Garfield, I would be very grateful if any of you could guide me in this regard. Thanks a lot!

---

<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:** [June 9, 2020, 5:46pm UTC](https://root-forum.cern.ch/t/trying-to-make-a-tpc-with-a-d2-type-symmetry/39850/2 "2020-06-09T17:46:08Z")

</div>

I think @hschindl can most probably help you solving your issue

---

<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:** [June 9, 2020, 6:19pm UTC](https://root-forum.cern.ch/t/trying-to-make-a-tpc-with-a-d2-type-symmetry/39850/3 "2020-06-09T18:19:29Z")

</div>

Hi,  
I think you have two options to model your layout:

(1) You can work in Cartesian coordinates, create a (cylindrical) tube, and then place each of the wires separately inside the tube (you cannot exploit phi-periodicity in this case).

(2) You can use polar coordinates. Then you can create an equipotential plane at constant radius (i. e your tube), add a wire, and set the phi periodicity.

I’ve attached a little example that illustrates the two solutions.  
[polar.C](https://root-forum.cern.ch/uploads/short-url/oVgUG8JFnP6j3WgAD28A6IOo7ED.C) (1.3 KB)

---

<div class="post-metadata">

**Author:** ![Bugs\_Bunny](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/97f17d/32.png) [@Bugs\_Bunny](https://root-forum.cern.ch/u/Bugs_Bunny)\
**Post date:** [June 9, 2020, 7:36pm UTC](https://root-forum.cern.ch/t/trying-to-make-a-tpc-with-a-d2-type-symmetry/39850/4 "2020-06-09T19:36:10Z")

</div>

Thank you so much. This helped a lot! So I had a further question regarding this, can I use the sensor.SetArea function with the second setup? My searches showed a manual showing a call Polar\_to\_Cartesian function. This being a Fortran function, I was wondering if I could achieve something similar in Garfield++ or if I should just add the the wires manually in Cartesian.  
Again Thank you so much 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:** [June 9, 2020, 9:13pm UTC](https://root-forum.cern.ch/t/trying-to-make-a-tpc-with-a-d2-type-symmetry/39850/5 "2020-06-09T21:13:38Z")

</div>

Yes, you can still set a drift region (box) in the sensor using SetArea, irrespective of the coordinate system you are using in the ComponentAnalyticField class.

---

<div class="post-metadata">

**Author:** ![Bugs\_Bunny](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/97f17d/32.png) [@Bugs\_Bunny](https://root-forum.cern.ch/u/Bugs_Bunny)\
**Post date:** [June 10, 2020, 3:36pm UTC](https://root-forum.cern.ch/t/trying-to-make-a-tpc-with-a-d2-type-symmetry/39850/6 "2020-06-10T15:36:16Z")

</div>

Thank you so much for your help!

---

<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:** [June 24, 2020, 3:36pm UTC](https://root-forum.cern.ch/t/trying-to-make-a-tpc-with-a-d2-type-symmetry/39850/7 "2020-06-24T15:36:20Z")

</div>

Closed on June 24, 2020, 3:36pm UTC

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