Obtaining particle energy at beginning and end of step

Fluka team,

In my user routine, I added “trackr.inc” which allows me to obtain the particle position at the beginning and end of the step via XTRACK(0) XTRACK(NTRACK), and the same with YTRACK and ZTRACK.

I can access the kinetic energy using Etrack - AM(Jtrack). However, it seems to be the kinetic energy at the end of the step. How can I get the kinetic energy at the beginning of the step?

Thanks.
Thomas

Dear Thomas,

To get the energy at the beginning of the step you can use the DTRACK(MTRACK) variable, what prints the energy deposition at each deposition event. Therefore, by adding to the kinetic energy at the end of the step the energy deposited along the step, you will be able to retrieve the kinetic energy at the beginning of the step:
Etrack - AM(Jtrack) + DTRACK(MTRACK)

Important: be sure that you are calling this variable in the main body of the mgdraw.f routine, i.e., at the MGDRAW entry since it is the sub-function that writes the collision tape.

Thank you Marta for your response.
As I am using USIMBS routine, I am now considering the kinetic energy at the beginning of the step being ETRACK - AM(JTRACK) + DTRACK(1). I am not using DTRACK(MTRACK) because USIMBS is called at each step hence, only 1 value exists in DTRACK. It seems to work in most of the cases.

However, I’ve observed an unusual behavior in rare instances, particularly when dealing with photons. To illustrate this behavior, I have provided a table below that presents the results of 15 successive steps for a single photon.

In each step, you will notice that the photon’s final position (Xf, Yf, Zf) coincides with its initial position (Xi, Yi, Zi) for subsequent step, suggesting that these steps are indeed consecutive. To further analyze the situation, I have included the polar and azimuthal angles (Thetai, Thetaf, Phii, Phif, in degrees) for the direction of the photon. Interestingly, we observe a pattern where steps 2 to 6 share the same initial direction, and steps 7 to 15 also share a common initial direction. However, despite this pattern, the final direction in each step does not align with the initial direction of the next step. This could be coming from multiple scattering maybe but it is not the real issue here.

Also note the steplength being always the same.

The real issue is the following: the energy values at the beginning and end of each step appear to be very strange. It seems as though the photon is regaining energy at each step, as the final energy does not match the initial energy of the subsequent step. This raises a significant question: Why is this behavior occurring, and is there a plausible explanation for it?

iEvt idPartFluka Xi Xf Yi Yf Zi Zf stepLength Ei Ef Thetai Thetaf Phii Phif
50209 7 7.10592031 6.83517504 -217.807922 -217.327774 81.7028732 81.5859299 0.563501894 5.1403E-05 4.9938E-05 55.5143166 31.5585861 29.6727982 -113.360283
50209 7 6.83517504 6.56442976 -217.327774 -216.84761 81.5859299 81.4689941 0.563501894 5.0022E-05 4.9938E-05 139.410751 31.5585861 143.194321 -113.360283
50209 7 6.56442976 6.29368448 -216.84761 -216.367447 81.4689941 81.3520508 0.563501894 5.0022E-05 4.9938E-05 139.410751 31.5585861 143.194321 -113.360283
50209 7 6.29368448 6.02293873 -216.367447 -215.887283 81.3520508 81.2351151 0.563501894 5.0022E-05 4.9938E-05 139.410751 31.5585861 143.194321 -113.360283
50209 7 6.02293873 5.75219345 -215.887283 -215.40712 81.2351151 81.1181717 0.563501894 5.0022E-05 4.9938E-05 139.410751 31.5585861 143.194321 -113.360283
50209 7 5.75219345 5.48144817 -215.40712 -214.926956 81.1181717 81.001236 0.563501894 5.0022E-05 4.9938E-05 139.410751 31.5585861 143.194321 -113.360283
50209 7 5.48144817 5.2107029 -214.926956 -214.446793 81.001236 80.8842926 0.563501894 5.0208E-05 4.9938E-05 51.2272224 31.5585861 -106.334908 -113.360283
50209 7 5.2107029 4.93995714 -214.446793 -213.966629 80.8842926 80.7673569 0.563501894 5.0208E-05 4.9938E-05 51.2272224 31.5585861 -106.334908 -113.360283
50209 7 4.93995714 4.66921186 -213.966629 -213.486465 80.7673569 80.6504135 0.563501894 5.0208E-05 4.9938E-05 51.2272224 31.5585861 -106.334908 -113.360283
50209 7 4.66921186 4.39846659 -213.486465 -213.006302 80.6504135 80.5334778 0.563501894 5.0208E-05 4.9938E-05 51.2272224 31.5585861 -106.334908 -113.360283
50209 7 4.39846659 4.12772131 -213.006302 -212.526138 80.5334778 80.4165421 0.563501894 5.0208E-05 4.9938E-05 51.2272224 31.5585861 -106.334908 -113.360283
50209 7 4.12772131 3.85697579 -212.526138 -212.045975 80.4165421 80.2995987 0.563501894 5.0208E-05 4.9938E-05 51.2272224 31.5585861 -106.334908 -113.360283
50209 7 3.85697579 3.58623052 -212.045975 -211.565811 80.2995987 80.182663 0.563501894 5.0208E-05 4.9938E-05 51.2272224 31.5585861 -106.334908 -113.360283
50209 7 3.58623052 3.315485 -211.565811 -211.085648 80.182663 80.0657196 0.563501894 5.0208E-05 4.9938E-05 51.2272224 31.5585861 -106.334908 -113.360283
50209 7 3.315485 3.04473972 -211.085648 -210.605484 80.0657196 79.9487839 0.563501894 5.0208E-05 4.9938E-05 51.2272224 31.5585861 -106.334908 -113.360283

Dear Thomas,

The issue you observe is due to the fact that photons have no charge, they do not lose energy when taking a particle step (there’s no “dE/dx” for neutral particles).

Therefore, there is no point in calling DTRACK for photons. In this case, the value of DTRACK remains from the last value of the last call for charged particles, which is completely unrelated to that photon. In your routine, you may restrict the use of DTRACK only to charged particles.

Dear Marta,

Thank you for your clarification regarding the use of DTRACK for photons. I know that photons do not experience energy loss due to dE/dx, as they are neutral particles. However, photons can indeed undergo energy-altering processes such as Compton scattering, the photoelectric effect, pair production, inelastic scattering, bremsstrahlung, and Cherenkov radiation.

What I understand:

  1. When photons undergo processes that modify their energy (such as the ones mentioned above), DTRACK becomes relevant, and ETRACK + DTRACK can be used to determine the photon’s energy at the beginning of the step.
  2. For steps where photons do not experience any energy changes, the energy at the beginning of the step remains the same as the energy at the end of the previous step. In this case, the correct value to use is ETRACK for energy at the beginning and end of the step. However, I am wondering why DTRACK is not 0.

To identify whether a step involves an energy change or not, how can I proceed in my routine? How can I evaluate the photon’s energy change during the step and then decide whether to add DTRACK to ETRACK based on the outcome of this evaluation?

Also, could you please provide an explanation of why the steplength is the same for groups of photons and the directions of photons at the end of a step do not coincide with the direction at the beginning of the next step? I have been thinking the interaction occurs at the end of the step in the code and then the direction at the beginning of the subsequent step should be the same?

Thank you.

Hi Thomas,

no, these processes - as any discrete process, opposite to ionization (DTRACK refers to) and multiple scattering, which apply only to charged particles - do no take place along the step, rather at the end of the step. The photon direction may change as a result of them.
In case of neutral particles, you should not use DTRACK (photons do not regain energy).

Thank you Marta and Francesco. That helps a lot.

Is there a way in USIMBS to differentiate a step with discrete processes and a step with continuous processes ?

What about the strange behavior I noticed for the direction angles? Is the direction from UOLD/VOLD/WOLD also refering to a previous continuous step when the current one describes a discrete process ?

Thanks again

USIMBS is not called at the end of a particle step if a discrete process is going to take place there (otherwise, instead of leading to particle splitting, it should lead to multiply its interaction).
Therefore, you should not care about discrete processes, rather consider that a charged particle may have lost energy along the step due to continuous processes, while a neutral particle did not.
Concerning the direction of the photon, which naturally did not undergo multiple scattering either, you refer to inappropriate variables (as earlier with DTRACK). Through trackr.inc, you can find the final direction in CX/Y/ZTRCK and you can retrieve the initial one from the knowledge of the initial and final point coordinates.