# Why 2 ComponentAnalyticField objects are used in the example AliceTPC?

**URL:** <https://root-forum.cern.ch/t/why-2-componentanalyticfield-objects-are-used-in-the-example-alicetpc/64382>\
**Category:** Garfield++\
**Created:** [November 7, 2025, 8:13am UTC](https://root-forum.cern.ch/t/why-2-componentanalyticfield-objects-are-used-in-the-example-alicetpc/64382 "2025-11-07T08:13:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![newconcept1979](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/newconcept1979/32/26349_2.png) [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Post date:** [November 7, 2025, 8:13am UTC](https://root-forum.cern.ch/t/why-2-componentanalyticfield-objects-are-used-in-the-example-alicetpc/64382/1 "2025-11-07T08:13:59Z")

</div>

As the title, Why 2 ComponentAnalyticField objects are used in the example AliceTPC?

```auto
ComponentAnalyticField cmpe;
ComponentAnalyticField cmpi;

```

---

<div class="post-metadata">

**Author:** ![djjansse](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/8baadc/32.png) [@djjansse](https://root-forum.cern.ch/u/djjansse)\
**Post date:** [November 7, 2025, 8:32am UTC](https://root-forum.cern.ch/t/why-2-componentanalyticfield-objects-are-used-in-the-example-alicetpc/64382/2 "2025-11-07T08:32:35Z")

</div>

Dear @newconcept1979,

Maybe [the corresponding example](https://garfieldpp.web.cern.ch/tutorials/alicetpc/) of the webpage might help.

Let us know if this clarifies it.

Kind regards,

Djunes

---

<div class="post-metadata">

**Author:** ![newconcept1979](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/newconcept1979/32/26349_2.png) [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Post date:** [November 8, 2025, 7:07am UTC](https://root-forum.cern.ch/t/why-2-componentanalyticfield-objects-are-used-in-the-example-alicetpc/64382/3 "2025-11-08T07:07:56Z")

</div>

@djjansse, i viewed the introduction of the webpage for this example, there is no information about why two ComponentAnalyticField objects are used.

but i think “cmpe“ is used for electron drift and “cmpi“ is used for ion drift. and the electric field is different for electron drift and ion drift.

---

<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:** [November 8, 2025, 7:23am UTC](https://root-forum.cern.ch/t/why-2-componentanalyticfield-objects-are-used-in-the-example-alicetpc/64382/4 "2025-11-08T07:23:42Z")

</div>

Hi,  
your understanding is correct. You can find the explanation under the heading “III - Defining the MWPC layout” of the page that @djjansse pointed you to:

> We start with the component describing the electric field used for the drifting of electrons, which pass through the open gating. Later on, we will use another component for ions, which drift under closed gating.

---

<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:** [November 22, 2025, 7:24am UTC](https://root-forum.cern.ch/t/why-2-componentanalyticfield-objects-are-used-in-the-example-alicetpc/64382/5 "2025-11-22T07:24:21Z")

</div>

Closed on November 22, 2025, 7:24am UTC

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