# Re: Re: [fluka-discuss]: EVENTBIN OUTPUT readout

From: YANG Tao <yangt_at_ihep.ac.cn>
Date: Tue, 1 Sep 2015 20:47:55 +0800 (GMT+08:00)

Dear Mikhail,

Thanks. They are shown in the readbin.f, but what do the item "DXUSBN(NB)" and "XLOW(NB)" mean in the expression

XMIN = (IDIM(1) - 1) * DXUSBN(NB) + XLOW(NB)? Whether or not the DXUSBN(NB) is the meaning of x intervals, XLOW(NB) the meaning of minimum x coordinate? What about NB?

regards,
Tao Yang

-----原始邮件-----

On 01.09.2015 12:15, YANG Tao wrote:

Dear Mikhail,

Thanks for your suggestion, the problem is going to be solved under your help. The first three columns are nxbin, nybin, nzbin, as shown below, the first line "10 10 1 0.00204809173", but where is the origin ID (0,0,0)? Does it mean the coordinate is (10*nxbin,10*nybin,1*nzbin)? Or the No. of x intervals is numbered from the minim x coordinate value? I don't find the numbering strategy of the cell ID.

10 10 1 0.00204809173
10 11 1 0.00217934861
10 10 2 0.000723655685
11 10 2 0.00176233263
10 11 2 0.00191097055
11 10 3 0.00438322034
11 10 4 0.00501045724
11 10 5 0.00506131118
10 10 6 0.00272820261

nxbin = number of x (r for RZ) intervals nybin = number of y (1 for RZ) intervals nzbin = number of z intervals.

-----原始邮件-----

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.
E.g.
OPEN ( UNIT=80, FILE='output.txt', STATUS='OLD', FORM='FORMATTED')
.....
WRITE( 80, *) 'MY DATA'
.....
CLOSE(80)

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)
ENDIF
END DO
WRITE(*,*) 'NumHits in this event : ',NUMHITS
WRITE(*,*) 'Edep in this event (GeV) : ',ETOT
WRITE(*,*)
WRITE(*,*) '===== ALL NON ZERO CELLS ARE READ ====='
WRITE(*,*)

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,
Mkhail

Dear YANG Tao,

I think minimum and maximum coordinates of the cell should me calculated as:

C minimum and maximum X,Y,Z position
C coordinates of the current cell in cm
REAL*8 XMIN, XMAX, YMIN, YMAX, ZMIN, ZMAX

XMIN = (IDIM(1) - 1) * DXUSBN(NB) + XLOW(NB)
XMAX = IDIM(1) * DXUSBN(NB) + XLOW(NB)

YMIN = (IDIM(2) - 1) * DXUSBN(NB) + YLOW(NB)
YMAX = IDIM(2) * DXUSBN(NB) + YLOW(NB)

ZMIN = (IDIM(3) - 1) * DXUSBN(NB) + ZLOW(NB)
ZMAX = IDIM(3) * DXUSBN(NB) + ZLOW(NB)

Best regards,
Mikhail

__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info
Received on Tue Sep 01 2015 - 17:15:25 CEST

This archive was generated by hypermail 2.3.0 : Tue Sep 01 2015 - 17:15:50 CEST