program uwfunc *-------------------------------------------------------------------- * Generates the FORTRAN skeleton of the selection function and * writes it into the file uwfunc.inc in the current directory. * * Pavel Kapinos March 10, 1997 * * PK Sep 25, 97 Allow a skeleton file name to be entered; * set a default for nid and a skeleton file name * *-------------------------------------------------------------------- parameter (mpawc=5000000) common /PAWC/ ipawc(mpawc) character*80 file, incf, incf_def data nid_def/ 1/ data incf_def/'uwfunc'/ character*1 tab data tab /o'11'/ print 1000, 'Enter ntuple file name: ' 1000 format (1x, a, $) ! $ is SGI specific read (*,'(a)',end=999,err=999) file print 1010, nid_def 1010 format (1x,'Enter ntuple # [',i2,']:', $) read (*,'(i)',end=999,err=999) nid if (nid.eq.0.) nid = nid_def print 1000, 'Enter generated file name [uwfunc]: ' read (*,'(a)',end=999,err=999) incf if (incf.eq.' ') incf = incf_def do j=1,120 if (incf(j:j).eq.' ' .or. incf(j:j).eq.tab) goto 100 enddo 100 jmax = j-1 call hlimit(mpawc) call hcdir('//PAWC',' ') call hropen (2,'lun2',file,' ',4096,istat) if (istat.ne.0) then print *, 'HROPEN error, istat =', istat call hrend('lun2') go to 999 else print '('' Open input file: '',a)', file endif call hcdir('//lun2',' ') call hrin (nid,9999,0) call hnoent (nid,nev) ** print 1001, nid, nev ** 1001 format (' ntuple', i3, ' contains ', i6, ' events') if (nev.eq.0.) goto 999 ** call hprnt (nid) ** open (21,file=incf,status='new') ** print '('' Open output file: '',a)', incf open (21,file=incf(1:jmax)//'.P',status='unknown') open (22,file=incf(1:jmax)//'.B',status='unknown') call huwfun (21, nid, 'dummy', 0, 'P') call huwfun (22, nid, 'dummy', 0, 'B') call hrend('lun2') 999 end