Re: [fluka-discuss]: EVENTBIN OUTPUT readout

From: Mikhail Polkovnikov <>
Date: Tue, 1 Sep 2015 11:12:59 +0300

Dear YANG Tao,

On 01.09.2015 05:59, YANG Tao wrote:
> *Q1*:As shown in the attachment "binout.bmp", the results of the
> output are printed on the screen. When I am prompted to input a file
> name, I input the file name "**_fort.21", the results print
> immediately, but I am not prompted to save the output into a new file
> as the USBREA (readout of USRBIN) does. So what should be added to the
> "readbin.f" code to save the output to a new file?
1. Easy way is just redirect all the standard linux output into another
file, e.g. "./readbin > output.txt". After executing such command just
input an eventbin file name and all the output will be redirected.

2. Hard way if you need specific output data is to open another file in
readBIN.f and write data into this new file.
       OPEN ( UNIT=80, FILE='output.txt', STATUS='OLD', FORM='FORMATTED')
       WRITE( 80, *) 'MY DATA'
> *Q2*:As shown in the attachment "binout.bmp", the first three columns
> of an event out is the hit position ( Data follow in a matrix
> A(ix,iy,iz), format (1(5x,1p,10(1x,e11.4)))). The number may relate to
> the cell no. How can I know the concrete hit position?
Because your EVENTBINs are "Non-Zero Cells" the part of the code which
does majority of the output is:

                DO J=1,NHITS
                   NDIM (1) = NXBIN (NB)
                   NDIM (2) = NYBIN (NB)
                   NDIM (3) = NZBIN (NB)
                   CALL ARRNDX ( IHELP(J), 3, NDIM, IDIM )
c this is COOLER and FASTER (by Vasilis)
                   WRITE(*,*) (IDIM(I),I=1,3), GMHELP(J)
                   IF (GMHELP(J).GT.0.) THEN
                      ETOT = ETOT + GMHELP(J)
                END DO
                WRITE(*,*) 'NumHits in this event : ',NUMHITS
                WRITE(*,*) 'Edep in this event (GeV) : ',ETOT
                WRITE(*,*) '===== ALL NON ZERO CELLS ARE READ ====='

The line "WRITE(*,*) (IDIM(I),I=1,3), GMHELP(J)" prints out the cells
ID and energy like X, Y, Z, ENERGY.
Variables responsible for coordinates in phase space are:

(description taken from usrsuw.f in flutil directory).

* nxbin = number of x (r for RZ) intervals *
* nybin = number of y (1 for RZ) intervals *
* nzbin = number of z intervals *
* xlow/high = minimum and maximum x (r for R-Phi-Z) *
* ylow/high = minimum and maximum y (phi for R-Phi-Z) *
* zlow/high = minimum and maximum z *
* dxusbn = x (r) bin width *
* dyusbn = y bin width *
* dzusbn = z bin width *

So XLOW(NB), XHIGH(NB) are minimum and maximum X coordinates in cm of
the EVENTBIN, and so on. I think that would help you a little bit.

Best regards,

You can manage unsubscription from this mailing list at
Received on Tue Sep 01 2015 - 11:33:26 CEST

This archive was generated by hypermail 2.3.0 : Tue Sep 01 2015 - 11:33:27 CEST