After following some of the existing posts we have tried to create our own .f source based on the files and posts already on the forum in order to compute the dose-averaged LET and Absorbed Dose. The main idea would be to extract these two values for protons of 14 MeV irradiating 10um of water which represent our cells.
The problems that we have encountered are the following:
somehow it seems that the source file is affecting all USRBIN files not only the FLUE, LET1 and LET2.
the values from the 3 USRBIN files (60,61,62) are identical…
And a question that we also have is: is there any possibility to do the usrbin62/usrbin61 inside the flair interface or just old fashioned origin(etc)? I am asking this because I know that if we would like to superimpose two 2D plots we could use the gnuplots commands and magically do the summations
First of all, thank you for the way the code was written. It is well-commented and easy to read.
I noticed that the routine has no effect. This is because you request scoring for LET1 and LET2 in the input file, whereas in the fluscw.f file (lines 136 and 141), you state:
IF (TITUSB(JSCRNG)(1:4) .EQ. "LETd") THEN
...
ELSEIF (TITUSB(JSCRNG)(1:4) .EQ. "LETt") THEN
I encourage you to modify this aspect and try again. Regarding your questions, there is currently no capability to perform operations on multiple .bnn files directly within Flair. You have two options:
Manipulate the .bnn files externally and then use Flair for plotting. (This is what I do when I want to display results in the Flair geometry tab.)
Postprocess and plot each file in the Flair plot tab with Gnuplot, and then manipulate the generated files afterward. This approach is easier and is what I typically use for simpler plots.
Finally, a quick comment: I noticed that a massive number of bins have been requested in the simulations. I recommend limiting the number of bins, as this can significantly degrade performance.
The code itself was not written by me, I just tried to adapt it from another post.
The mix-up with the lines is probably from trying to combine two routines and my utter innexperience.
I will try and modify according to your remarks and hopefully it will work
I feared that flair does not have something built in but its ok we can manage externally.
The number of bins is a bit extreme but the user requested precision of 1 um (X_X)
I see indeed some issues with you routine. Let’s start with GETLET: it requries the following variables. In particular, we invoke it the following way:
GETLET ( IJ, EKIN, PLA, TDELTA, MATLET )
* Ij = particle index (Paprop) *
* Ekin = particle kinetic energy (GeV) *
* Pla = particle momentum (GeV/c) *
* Tdelta = maximum secondary electron energy (GeV) *
* (unrestricted if =< 0) *
* Matlet = material index for which LET is requested *
In your code, you did not correctly set up your material, leaving it as 1. This will immediately crash the execution of the code as soon as you enter the function. You perhaps want to do the following:
! Material index
MATNO = MEDFLK(NREG, 1)
MATERIAL = MEDFLK(NREG, 1)
...
ENDLET = GETLET(JTRACK,EKIN,PLA,ZERZER,MATERIAL)
Also, I see that you want to exclude non protons, or secondary protons using LTRACK. I suggest you to explicitly do that at the beginning of the code in the following way:
! Avoid non primary protons or vacuum
IF ( JTRACK .NE. 1 .OR. LTRACK .NE. 1 .OR. MATERIAL .EQ. 2) THEN
FLUSCW = ZERZER
RETURN
ENDIF
Then, the LET given by GETLET is calculated per unit density of material. You might want to multiply it by the material density, in the same way of the example routine from the other post.
I tried to reshape you routine a bit, but please triple check that the code is effectively behaving the way you want! fluscw_LET.f (5.5 KB)