# Questions about Geant4GarfieldInterface/GarfieldPhysics.cc

**URL:** <https://root-forum.cern.ch/t/questions-about-geant4garfieldinterface-garfieldphysics-cc/53727>\
**Category:** Garfield++\
**Created:** [February 22, 2023, 8:43am UTC](https://root-forum.cern.ch/t/questions-about-geant4garfieldinterface-garfieldphysics-cc/53727 "2023-02-22T08:43:14Z")\
**Posts on this page:** 3\
**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:** [February 22, 2023, 8:43am UTC](https://root-forum.cern.ch/t/questions-about-geant4garfieldinterface-garfieldphysics-cc/53727/1 "2023-02-22T08:43:14Z")

</div>

Hello！@hschindl Sorry to disturb you.  
The codes below are from Geant4GarfieldInterface/GarfieldPhysics.cc and I have some questions:

① Can you explain in detail about SetDistanceSteps()?  
② What does ’ nsum ’ mean here ( nsum++;)  
③ How does the W value in TrackHeed come from ? Is it from the gas file ? (fTrackHeed-\>GetW()  
④ Why ze, xe, ye multiplied by 10：FillH3(1, ze \* 10, xe \* 10, ye \* 10);  
⑤ What do ’ newtime ’ and ’ time ’ mean here？： double newTime = te; if (newTime \< time){newTime += time;}  
⑥ If the position of ’ ElectronEndpoint ’ is in rWire, what is the purpose of xe2 + = 2 \* rWire  
⑦ Under what circumstances do we need to enable transport delta electron ? Can you give me some examples

```auto
if (fIonizationModel != "Heed" || particleName == "gamma")
  { if (particleName == "gamma")
    {fTrackHeed->TransportPhoton(x_cm, y_cm, z_cm, time, eKin_eV, dx, dy, dz,nc);}
    else
    { fTrackHeed->TransportDeltaElectron(x_cm, y_cm, z_cm, time, eKin_eV, dx,dy, dz, nc);
      fEnergyDeposit = eKin_eV;
    }
    for (int cl = 0; cl < nc; cl++)
    { double xe, ye, ze, te;
      double ee, dxe, dye, dze;
      fTrackHeed->GetElectron(cl, xe, ye, ze, te, ee, dxe, dye, dze);
      if (ze < lTube && ze > -lTube && sqrt(xe * xe + ye * ye) < rTube)
      { nsum++;
        if (particleName == "gamma")
        { fEnergyDeposit += fTrackHeed->GetW();}
        analysisManager->FillH3(1, ze * 10, xe * 10, ye * 10);
        if (createSecondariesInGeant4)
        {double newTime = te;
          if (newTime < time)
          { newTime += time;}
          fSecondaryParticles->push_back(new GarfieldParticle( "e-", ee, newTime, xe, ye, ze, dxe, dye, dze)); }
        drift.DriftElectron(xe, ye, ze, te);
        double xe1, ye1, ze1, te1;
        double xe2, ye2, ze2, te2;
        int status;
        drift.GetElectronEndpoint(0, xe1, ye1, ze1, te1, xe2, ye2, ze2, te2,status);
        if (0 < xe2 && xe2 < rWire)
        { xe2 += 2 * rWire;}
        else if (0 > xe2 && xe2 > -rWire)
        {xe2 += -2 * rWire;}
        if (0 < ye2 && ye2 < rWire)
        { ye2 += 2 * rWire;}
        else if (0 > ye2 && ye2 > -rWire)
        {ye2 += -2 * rWire;}

```

---

<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:** [February 27, 2023, 5:14pm UTC](https://root-forum.cern.ch/t/questions-about-geant4garfieldinterface-garfieldphysics-cc/53727/2 "2023-02-27T17:14:00Z")

</div>

> [@Question about Geant4GarfieldInterface](https://root-forum.cern.ch/t/question-about-geant4garfieldinterface/53796):
>
> Hello！experts! The codes below are from Geant4GarfieldInterface/GarfieldPhysics.cc and I have some questions: ① Can you explain in detail about SetDistanceSteps()? ② What does ’ nsum ’ mean here ( nsum++;) ③ How does the W value in TrackHeed come from ? Is it from the gas file ? (fTrackHeed-\>GetW() ④ Why ze, xe, ye multiplied by 10：FillH3(1, ze \* 10, xe \* 10, ye \* 10); ⑤ What do ’ newtime ’ and ’ time ’ mean here？： double newTime = te; if (newTime \< time){newTime += time;} ⑥ If the positi…

---

<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:** [March 13, 2023, 5:14pm UTC](https://root-forum.cern.ch/t/questions-about-geant4garfieldinterface-garfieldphysics-cc/53727/3 "2023-03-13T17:14:36Z")

</div>

Closed on March 13, 2023, 5:14pm UTC

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