COSMOS v7.655  COSMOSv7655
(AirShowerMC)
ascii2bin.f
Go to the documentation of this file.
1 ! don't touch next
2 #define FNODATDEF 33
3 ! convert ascii output file made by FleshHist into binary file
4 ! input; filename is from stdin; let it be, say, xyz.dat
5 ! output: fiename for binary is xyz.bdat
6 ! echo xyz.dat | ascii2bin
7 #include "../FleshHist/Zprivate1.h"
8 #include "../FleshHist/Zprivate3.h"
9  character*120 file, fileo
10  real*8 Et, wx, wy, wz
11  character*3 id
12  integer EventNo
13  integer*2 code
14  integer loc, fnodat2
15  fnodat2=34
16 
17  read(*,'(a)') file
18  write(0,*) ' file name is '
19  write(0,*) file
20  open(fnodat, file=file, form="formatted",action="read")
21 
22 ! form output format
23  loc = index(file, ".dat")
24  fileo=file(1:loc)//"bdat"
25  write(0,*) ' output filename='
26  write(0,*) fileo
27  open(fnodat2, file=fileo, form="unformatted")
28 
29 
30  read(fnodat,*)
31  * id, eventno, code, et, wx, wy, wz
32  write(0,*) " id etc=",
33  * id, eventno, code, et, wx, wy, wz
34  write(fnodat2)
35  * eventno, code, et, wx, wy, wz
36 
37  bufc = 0
38  do while(.true.)
39  i = bufc + 1
40 #if KeepWeight != yes
41  read(fnodat, *, end=100)
42  * buf(i).ldep, buf(i).code, buf(i).subcode,
43  * buf(i).charge, buf(i).ridx, buf(i).faiidx,
44  * buf(i).rinmu, buf(i).fai, buf(i).ek,
45  * buf(i).t, buf(i).wx, buf(i).wy, buf(i).wz
46 #else
47  read(fnodat, *, end=100)
48  * buf(i).ldep, buf(i).code, buf(i).subcode,
49  * buf(i).charge, buf(i).ridx, buf(i).faiidx,
50  * buf(i).rinmu, buf(i).fai, buf(i).ek,
51  * buf(i).t, buf(i).wx, buf(i).wy, buf(i).wz,
52  * buf(i).wgt
53 #endif
54  bufc = i
55  if(bufc .eq. bufsize) then
56  write(fnodat2) bufc, buf
57  bufc=0
58  endif
59  enddo
60  100 continue
61  if(bufc .gt. 0) then
62  write(fnodat2) bufc, buf
63  bufc=0
64  endif
65  end
nodes i
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon true
Definition: cblkElemag.h:7
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p charge
Definition: ZavoidUnionMap.h:1
nodes t
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos Zfirst pos *Zfirst pos *Zfirst Zfirst vec w *Zfirst vec w Zfirst vec *Zfirst wgt
Definition: ZavoidUnionMap.h:1
*Zfirst p fm *Zfirst p Zfirst p Zfirst p subcode
Definition: ZavoidUnionMap.h:1