# Questions with trackPAI in Garfield++

**URL:** <https://root-forum.cern.ch/t/questions-with-trackpai-in-garfield/62599>\
**Category:** Garfield++\
**Created:** [January 7, 2025, 3:21pm UTC](https://root-forum.cern.ch/t/questions-with-trackpai-in-garfield/62599 "2025-01-07T15:21:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Linnuo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/439d5e/32.png) [@Linnuo](https://root-forum.cern.ch/u/Linnuo)\
**Post date:** [January 7, 2025, 3:21pm UTC](https://root-forum.cern.ch/t/questions-with-trackpai-in-garfield/62599/1 "2025-01-07T15:21:19Z")

</div>

Dear experts,

I want to use trackPAI to simulate process in the gas detector. However, I face problems when I try to define a trackPAI variable.

The error is shown as the following:

> TrackPAI::SetupMedium:  
> Could not load optical data for medium .  
> TrackPAI::NewTrack:  
> Properties of medium He/iC4H10 are not available.

The error happened when I defined a new track. I looked through the script and it seemed that fuction **GetOpticalDataRange** would always return false. I wonder if I have any mistakes about the use of trackPAI. I attached the related part in Garfield ++ here.

```auto
bool TrackPAI::SetupMedium(Medium* medium) {

...
  // Get the dielectric function.
  double emin, emax;
  if (!medium->GetOpticalDataRange(emin, emax)) {
    std::cerr << m_className << "::SetupMedium:\n";
    std::cerr << " Could not load optical data for medium " << m_mediumName
              << ".\n";
    return false;
  }
...
}

```

```auto
bool Medium::GetOpticalDataRange(double& emin, double& emax,
                                 const unsigned int i) {
  if (i >= m_nComponents) {
    std::cerr << m_className << "::GetOpticalDataRange: Index out of range.\n";
    return false;
  }

  if (m_debug) PrintNotImplemented(m_className, "GetOpticalDataRange");
  emin = emax = 0.;
  return false;
}

```

Best,  
Linnuo

---

<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:** [January 7, 2025, 3:30pm UTC](https://root-forum.cern.ch/t/questions-with-trackpai-in-garfield/62599/2 "2025-01-07T15:30:10Z")

</div>

I’m sure @hschindl can help you

---

<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:** [January 7, 2025, 4:06pm UTC](https://root-forum.cern.ch/t/questions-with-trackpai-in-garfield/62599/3 "2025-01-07T16:06:06Z")

</div>

Hi,  
many thanks for your message! Please use `TrackHeed` instead of `TrackPAI`.

`TrackPAI` is a bit of an experimental development; I used it at some point to compare different implementations of the PAI model (which is also what is used in HEED), specifically for silicon. I should probably remove it from the main branch.

---

<div class="post-metadata">

**Author:** ![Linnuo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/439d5e/32.png) [@Linnuo](https://root-forum.cern.ch/u/Linnuo)\
**Post date:** [January 7, 2025, 4:27pm UTC](https://root-forum.cern.ch/t/questions-with-trackpai-in-garfield/62599/4 "2025-01-07T16:27:57Z")

</div>

Thank you very much!

---

<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:** [January 21, 2025, 4:28pm UTC](https://root-forum.cern.ch/t/questions-with-trackpai-in-garfield/62599/5 "2025-01-21T16:28:52Z")

</div>

Closed on January 21, 2025, 4:28pm UTC

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