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 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

``````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;}
``````

(1) The function `SetDistanceSteps` requests `AvalancheMC` to used fixed-distance steps and sets the step size (in cm).

(2) It’s a counter for the number of ionisation electrons.

(3) For gases, the default value is set in `MediumMagboltz`.

(4) It’s to convert from cm to mm.

(5) Not sure if this line is actually needed. If the time coordinate returned by `GetElectron` is smaller than the starting time of the track (`time`), then the starting time of the track is added to it.

(6) The line `drift.DriftElectron(xe, ye, ze, te);` transports the electron without simulating the avalanche development. If the electron ends up inside a wire, then it’s moved back by a distance `2 * rWire` and the avalanche close to the wire is simulated starting from this point.

(7) By default, delta electron transport is enabled such that you get the coordinates of all “conduction” electrons produced by a charged particle track (and not just the “delta” electrons, i. e. the electrons directly knocked out in a charged-particle collision with the gas).

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