Dear Yasser,
You should be able to see the tracks from Flair. I tell you the steps:
1 - Go to the Geometry tab.
2 - On your left you will see the subtabs (Geometry, layers, errors) Go to layers and select one of them ( e.g. Media)
3 - Press → Userdump
4 - Below, you will see the Userdump window. From there you can choose the file that you obtained and select the events and particles that you want to see.
#Comment: ‘Start’ means the event from where you want to see your tracks, and ‘# events’ is How many events you want to see, after the one you chose in ‘Start’.
Only one correction to your input:
USERDUMP 100. 21. 2. 0. OutFile
Here with ‘0.’ you are telling FLUKA that you want to use the default MGDRAW. In case you want to use your routine, It should be ‘1.’
Now, for the simulation that you already did, you should be able to plot the tracks with the previous steps.
Finally, I saw yout mgdraw_yas.f. It looks good, but the problem is that you should add the code in the BXDRAW routine.
I propose you 4 options to continue:
1 - Try to see if you can see your tracks with the simulation that you did already. Maybe with that you can solve your doubt
2 - Change the USERDUMP card: 0. → 1. (for user defined routine) Try to run again just doing this
3 - Move the part of code that you use in the BXDRAW subroutine
4 - Delete the part of code that you have in MGDRAW and add the following in BXDRAW:
ENTRY BXDRAW ( ICODE, MREG, NEWREG, XSCO, YSCO, ZSCO )
IF( .NOT. LFCOPF ) THEN
REGNAM='REGMG1'
CALL GEON2R ( REGNAM, NSCOREG1, IERR )
REGNAM='REGMG2'
CALL GEON2R ( REGNAM, NSCOREG2, IERR )
FILNAM = CFDRAW
OPEN ( UNIT = IODRAW, FILE = FILNAM, STATUS = 'REPLACE',
& FORM = 'FORMATTED' )
WRITE (IODRAW, *) '#Boundary crossing at the beginning'
WRITE (IODRAW, *) '#Region 1: ',NSCOREG1
WRITE (IODRAW, *) '#Region 2: ',NSCOREG2
LFCOPF=.TRUE.
END IF
IF ( MREG.EQ.NSCOREG1.AND.NEWREG.EQ.NSCOREG2.AND.
& JTRACK.EQ.1 ) THEN
WRITE(IODRAW,'(I8, I7, 8(1PE24.16))') NCASE,
& JTRACK, XTRACK(NTRACK),YTRACK(NTRACK),ZTRACK(NTRACK),
& CXTRCK,CYTRCK,CZTRCK,ETRACK,PTRACK
RETURN
END IF
With this 4th option you will get an ASCII file with:
JTRACK->Type of particle
[X,Y,Z]TRACK → Position where the particle cross bet
C[X,Y,Z]TRCK-> Angle
ETRACK-> Energy
PTRACK->Momentum
This will be printed in your output file when a particle of type JTRACK crosses from MREG to NEWREG.
#Comments:
JTRACK=1 (protons). You must change that for your case.
Also ‘REGMG1’ and ‘REGMG2’ must be changed to your regions.
I hope it can help.
Let me know if there is something not clear.
Cheers!
André