! GeInitTrigger.f90 ! ! Calculates the parent particles from nch, allocates the tree- and ! resultList and fills the former according to pt- and eta-distributions. ! Returns the number of actually produced parent particles. ! ! Detlef Irmscher, Thomas Ullrich, Uni Heidelberg, September 1993 ! Last update: 16.3.95 tu ! subroutine GeInitTrigger (nch,bpar) use f90_kind use genesis_m, self=>GeInitTrigger implicit none integer, intent(in) :: nch real :: bpar integer :: ipart, ifill, partn, istat real(kind=double) :: pt, y, weight ! check if treelist is already allocated if (associated(treeList)) deallocate (treeList) ! allocate treeList maxtree = 4*nch lasttree = 0 allocate (treeList(maxtree), stat=istat) ! get room for treeList if (istat /= 0) then call GeErrorMessage ("GeInitTrigger", "not enough room for treeList", & fatal=.true.) endif do ipart = 1, size(particleList) ! # of particles of each kind partn = GePartProd (ipart, int(nch/central_over_total_pion0)) do ifill = 1, partn call GeAppendTree ! increases lasttree treeList(lasttree)%parttype => particleList(ipart) ! setup part. pt = GeGetPt(ipart, weight) ! get pt and eta ! ! change 27-6-96 AD include Carlos function GeGetRapidity ! ! eta = GeGetEta(ipart) if (particleList(ipart)%mass.gt.0) then y = GeGetRapidity(ipart,bpar,pt) else y = GeGetEta(ipart) endif call GeFillTree (lasttree, pt, y, weight) enddo enddo end subroutine GeInitTrigger