program writehbook implicit none integer nsize parameter (nsize=1500000) real h(nsize) common/pawc/h integer ierr,icycle integer i,j integer nmxhep parameter (nmxhep=3950) C block HEPEVT integer nevhep integer nhep integer idhep(nmxhep) integer jsmhep(nmxhep) integer jsdhep(nmxhep) real phep(5,nmxhep) real vhep(4,nmxhep) common/HEPEVT/nevhep,nhep,idhep,jsmhep,jsdhep,phep,vhep integer nmxpar parameter (nmxpar=200) C block MC_PARAM integer irun integer ievt real weight real xsecn integer ifilter integer nparam real param(nmxpar) common/MC_PARAM/irun,ievt,weight,xsecn,ifilter,nparam,param call hlimit(nsize) call hropen(1,'HEPEVT','test.ntpl','N',4096,ierr) call hcdir('//HEPEVT',' ') call hbnt(101,'HEPEVT','D') call hbname(101,'HEPEVT',nevhep, + 'NEVHEP:I,'// + 'NHEP:I::[0,3950],'// + 'IDHEP(NHEP):I,'// + 'JSMHEP(NHEP):I,'// + 'JSDHEP(NHEP):I,'// + 'PHEP(5,NHEP):R,'// + 'VHEP(4,NHEP):R') call hbname(101,'MC_PARAM',irun, + 'IRUN:I,'// + 'IEVT:I,'// + 'WEIGHT:R,'// + 'XSECN:R,'// + 'IFILTER:I,'// + 'NPARAM:I::[0,200],'// + 'PARAM(NPARAM):R') C nullify, just for sure nevhep=0 nhep=0 do i=1,nmxhep idhep(i)=0 jsmhep(i)=0 jsdhep(i)=0 do j=1,4 phep(j,i)=0.0 vhep(j,i)=0.0 enddo phep(5,i)=0.0 enddo irun=0 ievt=0 weight=0.0 xsecn=0.0 ifilter=0 nparam=0 do i=1,nmxpar param(i)=0.0 enddo C event loop: write anything you want into ntuple. C items marked with ! ## are mandatory, do not change these! do i=1,10 nevhep=i ! ## nhep=1 ! number of particles in event idhep(1)=321 ! PID jsmhep(1)=4000*4000 ! black magic jsdhep(1)=0 ! " phep(1,1)=1.0 ! px phep(2,1)=0.0 ! py phep(3,1)=0.0 ! pz phep(5,1)=0.493667 ! mass phep(4,1)=sqrt(phep(1,1)**2+phep(2,1)**2+ + phep(3,1)**2+phep(5,1)**2) ! E vhep(1,1)=0.0 ! ## OSCAR do not care about vhep vhep(2,1)=0.0 vhep(3,1)=0.0 vhep(4,1)=0.0 C for now it is pretty safe to leave MC_PARAM block intact irun=1 ievt=i weight=1.0 xsecn=1.0 ifilter=0 nparam=10 do j=1,nparam param(j)=0.0 enddo C write data into ntuple call hcdir('//HEPEVT',' ') call hfnt(101) enddo call hcdir('//HEPEVT',' ') call hrout(101,icycle,' ') call hrend('HEPEVT') close(1) end