! GeCheckResources.f90 ! ! Performs consistency checks on the resources loaded ! in routine 'getResources'. ! ! Detlef Irmscher, Thomas Ullrich, Uni Heidelberg, September 1993 ! Last update: 16.3.95 tu ! subroutine GeCheckResources use genesis_m, self=>GeCheckResources implicit none integer :: i, j, k real :: sumBR logical :: noParent, noChild type(particle) :: refPart type(decay) :: refDecay ! ! First check collision type declarations ! if (target%Z <= 0) & call GeErrorMessage("GeCheckResources","illegal value for target%Z", & rc=target%Z) if (target%A <= 0) & call GeErrorMessage("GeCheckResources","illegal value for target%A", & rc=target%A) if (projectile%Z <= 0) & call GeErrorMessage("GeCheckResources","illegal value for projectile%Z", & rc=projectile%Z) if (projectile%A <= 0) & call GeErrorMessage("GeCheckResources","illegal value for projectile%A", & rc=projectile%A) if (projectile%p%p%pz <= 0) & call GeErrorMessage("GeCheckResources","illegal value for projectile%p") ! ! Check run resources: ! if (pion0_over_nch > 1 .or. pion0_over_nch < 0) & call GeErrorMessage("GeCheckResources", & "illegal value for run%pion0_over_nch") if (central_rapidity < 0 .or. central_rapidity > 6 ) & call GeErrorMessage("GeCheckResources", & "illegal value for run%central_rapidity") if (central_over_total_pion0 <= 0. .or. central_over_total_pion0 >= 1.) & call GeErrorMessage("GeCheckResources", & "illegal value for run%central_over_total_pion0") ! ! Now check prototype particle lists. ! Look for multiple declarations and illegal values. ! if (size(particleList) == 0) & call GeErrorMessage("GeCheckResources","no particles in list") particleListLoop: do i = 1, size(particleList) refPart = particleList(i) multipleParticles: do j = i+1, size(particleList) if (particleList(j) == refPart) & call GeErrorMessage("GeCheckResources", & "multiple declaration of particle "// & "'"//trim(refPart%name)//"'") if (particleList(j)%name == refPart%name) & call GeErrorMessage("GeCheckResources", & "multiple declaration of particle%name "// & "'"//trim(refPart%name)//"'") if (particleList(j)%id == refPart%id) & call GeErrorMessage("GeCheckResources", & "multiple declaration of particle%id", & rc=refPart%id) enddo multipleParticles if (refPart%mass < 0) & call GeErrorMessage("GeCheckResources", & "illegal value for particle%mass at "// & "'"//trim(refPart%name)//"'") if (refPart%width < 0) & call GeErrorMessage("GeCheckResources", & "illegal value for particle%width at "// & "'"//trim(refPart%name)//"'") if (abs(refPart%charge) > 1) & call GeErrorMessage("GeCheckResources", & "illegal value for particle%charge at "// & "'"//trim(refPart%name)//"'") if (refPart%spin > 2 .or. refPart%spin < 0) & call GeErrorMessage("GeCheckResources", & "illegal value for particle%spin at "// & "'"//trim(refPart%name)//"'") if (refPart%relSigmaTotal > 1 .or. refPart%relSigmaTotal < 0) & call GeErrorMessage("GeCheckResources", & "illegal value for particle%relSigmaTotal at "// & "'"//trim(refPart%name)//"'") if (refPart%relSigmaCentral > 1 .or. refPart%relSigmaCentral < 0) & call GeErrorMessage("GeCheckResources", & "illegal value for particle%relSigmaCentral at "// & "'"//trim(refPart%name)//"'") if (refPart%ptHbookId < 0) then call GeErrorMessage("GeCheckResources", & "illegal value for particle%ptHbookId at "// & "'"//trim(refPart%name)//"'", & rc=refPart%ptHbookId, fatal = .true.) else if (refPart%ptHbookId > 0 ) then if (.not.hexist(refPart%ptHbookId)) & call GeErrorMessage("GeCheckResources", & "pt histogram doesn't exist for particle "// & "'"//trim(refPart%name)//"'", & rc=refPart%ptHbookId, fatal = .true.) endif if (refPart%yHbookId < 0) then call GeErrorMessage("GeCheckResources", & "illegal value for particle%yHbookId at "// & "'"//trim(refPart%name)//"'", & rc=refPart%yHbookId, fatal = .true.) else if (refPart%yHbookId > 0 ) then if (.not.hexist(refPart%yHbookId)) & call GeErrorMessage("GeCheckResources", & "y histogram doesn't exist for particle "// & "'"//trim(refPart%name)//"'", & rc=refPart%yHbookId, fatal = .true.) endif enddo particleListLoop ! ! Now check prototype decay lists. ! Look for multiple declarations, illegal values ! and parent/child particles. ! if (size(decayList) == 0) & call GeErrorMessage("GeCheckResources","no decays in list") decayListLoop: do i = 1, size(decayList) refDecay = decayList(i) sumBR = refDecay%branchingRatio multipleDecays: do j = i+1, size(decayList) if (decayList(j)%name == refDecay%name) & call GeErrorMessage("GeCheckResources", & "multiple declaration of decay%name "// & "'"//trim(refDecay%name)//"'") if (decayList(j)%parent == refDecay%parent) & sumBR = sumBR + decayList(j)%branchingRatio enddo multipleDecays if (sumBR > 1) & call GeErrorMessage("GeCheckResources", & "sum of branching ratios for "// & "'"//trim(refDecay%parent%name)//"' "// & "exceeds 1") if (refDecay%nBody < 2) & call GeErrorMessage("GeCheckResources", & "illegal value for decay%nBody of "// & "'"//trim(refDecay%name)//"'", & rc=refDecay%nBody) if (refDecay%branchingRatio < 0 .or. refDecay%branchingRatio > 1) & call GeErrorMessage("GeCheckResources", & "illegal value for decay%branchingRatio of "// & "'"//trim(refDecay%name)//"'") if (refDecay%formFactor == ERROR) & call GeErrorMessage("GeCheckResources", & "illegal value for decay%formFactor of "// & "'"//trim(refDecay%name)//"'") noParent = .true. parentScan: do j = 1, size(particleList) if (particleList(j) == refDecay%parent) then noParent = .false. exit endif enddo parentScan if (noParent) & call GeErrorMessage("GeCheckResources", & "no parent particle defined for "// & "'"//trim(refDecay%name)//"'") childrenScan: do k = 1, refDecay%nBody noChild = .true. childScan: do j = 1, size(particleList) if (particleList(j) == refDecay%child(k)) then noChild = .false. exit endif enddo childScan if (noChild) & call GeErrorMessage("GeCheckResources", & "child particle missing "// & "'"//trim(refDecay%name)//"'", & rc=k) enddo childrenScan enddo decayListLoop end subroutine GeCheckResources