anchor.diff:  
     logical, save :: aperture_debug=.false.          ! Enable/disable debugging output for the aperture code
   
  +  ! aperture types  -- kape
  +  ! no aperture     -- 0
  +  ! circle          -- 1
  +  ! rectangle       -- 2
  +  ! ellipse         -- 3
  +  ! rectellipse     -- 4
  +  ! octagon         -- 5
  +  ! racetrack       -- 6
  +  ! transition      -- 7
     integer, allocatable, save :: kape(:)            ! type of aperture (nele)
  +  character(len=2), parameter, dimension(-1:6) :: apeName=(/'TR','NA','CR','RE','EL','RL','OC','RT'/)
  +
     ! aperture parameteres ape(9,nele)
     ! ape(1,:): hor dimension (RECT/RECTELLIPSE/OCT) [mm]
     ! ape(2,:): ver dimension (RECT/RECTELLIPSE/OCT) [mm]
  
positive.code:           else
              call roffpos(xv1(j),xv2(j),xchk(1),xchk(2),ape(7,ix),ape(8,ix),ape(9,ix))
            end if
            llostp(j)=checkRT(xchk(1),xchk(2),ape(1,ix),ape(2,ix),ape(3,ix),apxy).or. &
              isnan_mb(xchk(1)).or.isnan_mb(xchk(2))
          else
            if(lbacktracking) then
              llostp(j)=checkRT(xLast(1,j),xLast(2,j),ape(1,ix),ape(2,ix),ape(3,ix),apxy).or. &
                isnan_mb(xLast(1,j)).or.isnan_mb(xLast(2,j))
            else
              llostp(j)=checkRT(xv1(j),xv2(j),ape(1,ix),ape(2,ix),ape(3,ix),apxy).or. &
                isnan_mb(xv1(j)).or.isnan_mb(xv2(j))
            end if
          end if
  
negative.code: logical function checkTR( x, y, aprx, apry, apex, apey, apxx, apyy, apxy, m, q )
  !-----------------------------------------------------------------------
  !     A.Mereghetti (CERN, BE/ABP-HSS)
  !     last modified: 16-01-2019
  !     check particle position against Transition aperture
  !     always in main code
  !-----------------------------------------------------------------------
  