anchor.diff:    real(kind=fPrec) x, y, aprx, apry, apex, apey, apxx, apyy, apxy, m, q
   
     checkTR = checkRL(x,y,aprx,apry,apxx,apyy,apxy).or.checkOC(x,y,aprx,apry,m,q)
  -  if(aprx-apex.gt.zero.and.apry-apey.gt.zero) checkTR=checkTR.or.checkRT(x,y,aprx,apry,apex,apxx)
  +  if(aprx-apex.gt.zero.and.apry-apey.gt.zero) then
  +    checkTR=checkTR.or.checkRT(x,y,aprx,apry,apex,apey,apxx,apyy,apxy)
  +  end if
     return
   end function checkTR
   
  
positive.code: logical function checkTR( x, y, aprx, apry, apex, apey, apxx, apyy, apxy, m, q )
  !-----------------------------------------------------------------------
  !     A.Mereghetti (CERN, BE/ABP-HSS)
  !     last modified: 22-03-2018
  !     check particle position against Transition aperture
  !     always in main code
  !-----------------------------------------------------------------------
  
negative.code:     call chr_cast(lnSplit(3),tmpflts(1),iErr)
      call chr_cast(lnSplit(4),tmpflts(2),iErr)
      call chr_cast(lnSplit(5),tmpflts(3),iErr)
      if(nSplit >=6) then
         chr_cast(lnSplit(6),tmpflts(4),iErr)
         call aperture_initRT(iElem,tmpflts(1),tmpflts(2),tmpflts(3),tmpflts(4))
      else
         call aperture_initRT(iElem,tmpflts(1),tmpflts(2),tmpflts(3),tmpflts(3))
      endif
  
    case(apeName(-1)) ! Transition
      if(nSplit < 8) then
  