About USRMED routine- kill all electrons!

Dear Users
My simulations involve pair production and transport of low energy positrons. I would like to record positrons upto the lowest KE possible (1 keV, born or after transport). Since such simulations take lot of time, I was thinking about terminating the electrons which are produced along with the positrons. As suggested in the FLUKA discussion forum, one way is to use USRMED routine. I could not find any example of the routine, so I wrote one from the template available from the FLAIR database. The code compiles and I can turn off electron transport in any region I wish. But since my programming skills are not that good, can some one please take a look at the code and see if everything is alright? Also, is this the proper way to go and I am I making some mistakes? Please suggest any better alternative.
test_usrmed.inp (1.8 KB) test_usrmed.flair (2.1 KB) usrmed_electronKILL.f (2.5 KB)

Dear Saurabh,

Yes, USRMED is the way to go. By the way, your two calls to GEOR2N appear superfluous.

If you kill all electrons I’m afraid you will miss positrons produced from future generations in the EM shower, which might be a problem in your example.

Your 5-MeV primary photons in W will predominantly undergo either Compton scattering or pair production. In either process there will be an e- among the final-state particles. This electron’s kinetic energy might attain a few MeV. At these energies, radiative stopping is not quite negligible vis-a-vis electronic stopping in W: Bremsstrahlung still matters. If a Bremsstrahlung photon is produced with energy above the pair-production threshold you would lose the eventual positron in your analysis. The number of such positrons will most likely be small, but maybe not negligible in your global positron count.

To be on the safe side, I’d further restrict your electron killing to those satisfying EKSCO.LT.1.0D-03 (an electron with kinetic energy below 1 MeV cannot lead to Bremmstrahlung photons exceeding 1 MeV so no risk of eventually producing positrons).


Dear Cesc
thank you very much! The point about only killing electrons below the pair production threshold is very well made.
I have one last question. The code does not seem to accept region name and accepts only region number. I actually had GEOR2N because i wanted to use region name and not number. Is there a way to do that- use region name and not number in the code? BTW I am fine with either.


Sorry for the belated response.

You can proceed either way, but I’d tend to set up the logics in terms of integers (should be faster to compare than strings).

Note that SUBROUTINE GEOR2N (NREG, REGNAM, IERR) converts the input region number NREG to a region name REGNAM (an 8-character string).

You probably want the complementary SUBROUTINE GEON2R (REGNAM, NREG, IERR), which converts the input region name REGNAM (an 8-character string) into a region number NREG.

In either case, make sure IERR=0 at the end of the call (otherwise it implies something went wrong when attempting to convert).


thank you for the suggestion.