*********************************************************************** * subroutine skipevents() * * skips events reading from input file(s) based on IDEVT initial value * created on: 14/02/2002 by R. Holzmann * * last modified on 21/04/2005 by R. Holzmann * *********************************************************************** implicit none #include "geant321/gcflag.inc" #include "geaevent.inc" real Etot, p(3), weight, dv(3), ebeam, bpar, tof integer i, ifile, itr, itrack, itype, npart, idsrc, idpar, ixpar integer icharge, iweight, eventID logical has_weight if (idevt.le.1) return ! nothing to skip do i=1,idevt-1 do ifile=1,NEvFiles ! loop over files and read events eventID=0 npart=0 read (23+ifile,*,end=900) eventID,npart,ebeam,bpar,iweight if (eventId.eq.0 .and. npart.eq.0) return ! end of file *--------------------------------------------------------- * Check for weighted particles * *--------------------------------------------------------- if (iweight.eq.0) then has_weight = .false. else has_weight = .true. endif *----------------------------------------------------------------------- * Loop over particles in file ifile *----------------------------------------------------------------------- do itr=1,npart if (has_weight) then if(iweight.eq.1) then read(23+ifile,*) Etot,p,itype,weight endif if(iweight.eq.2) then read(23+ifile,*) Etot,p,itype,idsrc,idpar,weight endif if(iweight.eq.-2) then read(23+ifile,*) Etot,p,itype,idsrc,idpar,ixpar,weight end if if(iweight.eq.3) then read(23+ifile,*) Etot,p,dv,itype,idsrc,idpar,weight end if if(iweight.eq.-3) then read(23+ifile,*) + Etot,p,dv,itype,idsrc,idpar,ixpar,weight end if if(iweight.eq.4) then read(23+ifile,*) Etot,p,tof,dv,itype,idsrc,idpar,weight end if if(iweight.eq.-4) then read(23+ifile,*) + Etot,p,tof,dv,itype,idsrc,idpar,ixpar,weight end if else read(23+ifile,*) Etot, p, itype endif enddo ! end loop over particles in event enddo ! end loop over event files enddo ! end loop over events to skip 900 return end