anchor.diff:    end if
     if(nSplit == 0) return
   
  +  select case(lnSplit(1))
  +
  +  case("DOCOLL")
  +    do_coll = .true.
  +
  +  case("ENERGY")
  +    if(nSplit /= 2) then
  +      write(lout,"(a,i0)") "COLL> ERROR ENERGY expects 1 value, got ",nSplit-1
  +      iErr = .true.
  +      return
  +    end if
  +    call chr_cast(lnSplit(2), myenom, iErr)
  +
  +  case("DIST_TYPE")
  +    if(nSplit /= 2) then
  +      write(lout,"(a,i0)") "COLL> ERROR DIST_TYPE expects 1 value, got ",nSplit-1
  +      iErr = .true.
  +      return
  +    end if
  +    call chr_cast(lnSplit(2), do_thisdis, iErr)
  +    if(do_thisdis < 0 .or. do_thisdis > 6) then
  +      write(lout,"(a,i0)") "COLL> ERROR DIST_TYPE must be between 0 and 6, got ",do_thisdis
  +      iErr = .true.
  +      return
  +    end if
  +
  +  case("DIST_PARAM")
  +    if(nSplit /= 5 .and. nSplit /= 7) then
  +      write(lout,"(a,i0)") "COLL> ERROR DIST_PARAM expects 4 or 6 values, got ",nSplit-1
  +      iErr = .true.
  +      return
  +    end if
  +    if(nSplit > 1)  call chr_cast(lnSplit(2), mynex,       iErr)
  +    if(nSplit > 2)  call chr_cast(lnSplit(3), mdex,        iErr)
  +    if(nSplit > 3)  call chr_cast(lnSplit(4), myney,       iErr)
  +    if(nSplit > 4)  call chr_cast(lnSplit(5), mdey,        iErr)
  +    if(nSplit > 5)  call chr_cast(lnSplit(6), enerror,     iErr)
  +    if(nSplit > 6)  call chr_cast(lnSplit(7), bunchlength, iErr)
  +
  +  case("DIST_FILE")
  +    if(nSplit /= 2) then
  +      write(lout,"(a,i0)") "COLL> ERROR DIST_FILE expects 1 value, got ",nSplit-1
  +      iErr = .true.
  +      return
  +    end if
  +    filename_dis = lnSplit(2)
  +
  +  case("NSIG_FAM")
  +    if(nSplit /= 3) then
  +      write(lout,"(a,i0)") "COLL> ERROR NSIG_FAM expects 2 values, got ",nSplit-1
  +      write(lout,"(a)")    "COLL>       NSIG_FAM name nsig"
  +      iErr = .true.
  +      return
  +    end if
  +    if(len_trim(lnSplit(2)) > cdb_fNameLen) then
  +      write(lout,"(2(a,i0))") "COLL> ERROR NSIG_FAM family name can be maximum ",cdb_fNameLen,&
  +        " characters, got ",len_trim(lnSplit(2))
  +      iErr = .true.
  +      return
  +    end if
  +    call chr_cast(lnSplit(3),rTmp,iErr)
  +    call cdb_addFamily(lnSplit(2),rTmp,famID,fErr)
  +    if(fErr) then
  +      write(lout,"(a,i0)") "COLL> ERROR NSIG_FAM family '"//trim(lnSplit(2))//"' defined more than once"
  +      iErr = .true.
  +      return
  +    end if
  +
  +  case("JAW_SLICE")
  +    if(nSplit /= 6) then
  +      write(lout,"(a,i0)") "COLL> ERROR JAW_SLICE expects 5 values, got ",nSplit-1
  +      write(lout,"(a)")    "COLL>       JAW_SLICE n_slices smin smax recenter1 recenter2"
  +      iErr = .true.
  +      return
  +    end if
  +    call chr_cast(lnSplit(2), n_slices,   iErr)
  +    call chr_cast(lnSplit(3), smin_slices,iErr)
  +    call chr_cast(lnSplit(4), smax_slices,iErr)
  +    call chr_cast(lnSplit(5), recenter1,  iErr)
  +    call chr_cast(lnSplit(6), recenter2,  iErr)
  +
  +  case("JAW_FIT1")
  +    if(nSplit /= 8) then
  +      write(lout,"(a,i0)") "COLL> ERROR JAW_FIT1 expects 7 values, got ",nSplit-1
  +      write(lout,"(a)")    "COLL>       JAW_FIT1 fit1.1 fit1.2 fit1.3 fit1.4 fit1.5 fit1.6 scale"
  +      iErr = .true.
  +      return
  +    end if
  +    call chr_cast(lnSplit(2), jaw_fit(1,1),iErr)
  +    call chr_cast(lnSplit(3), jaw_fit(1,2),iErr)
  +    call chr_cast(lnSplit(4), jaw_fit(1,3),iErr)
  +    call chr_cast(lnSplit(5), jaw_fit(1,4),iErr)
  +    call chr_cast(lnSplit(6), jaw_fit(1,5),iErr)
  +    call chr_cast(lnSplit(7), jaw_fit(1,6),iErr)
  +    call chr_cast(lnSplit(8), jaw_ssf(1),  iErr)
  +
  +  case("JAW_FIT2")
  +    if(nSplit /= 8) then
  +      write(lout,"(a,i0)") "COLL> ERROR JAW_FIT2 expects 7 values, got ",nSplit-1
  +      write(lout,"(a)")    "COLL>       JAW_FIT2 fit2.1 fit2.2 fit2.3 fit2.4 fit2.5 fit2.6 scale"
  +      iErr = .true.
  +      return
  +    end if
  +    call chr_cast(lnSplit(2), jaw_fit(2,1),iErr)
  +    call chr_cast(lnSplit(3), jaw_fit(2,2),iErr)
  +    call chr_cast(lnSplit(4), jaw_fit(2,3),iErr)
  +    call chr_cast(lnSplit(5), jaw_fit(2,4),iErr)
  +    call chr_cast(lnSplit(6), jaw_fit(2,5),iErr)
  +    call chr_cast(lnSplit(7), jaw_fit(2,6),iErr)
  +    call chr_cast(lnSplit(8), jaw_ssf(2),  iErr)
  +
  +  case("EMIT","EMITTANCE")
  +    if(nSplit /= 5) then
  +      write(lout,"(a,i0)") "COLL> ERROR EMIT expects 4 values, got ",nSplit-1
  +      write(lout,"(a)")    "COLL>       EMIT ex_dist ey_dist ex_colgap ey_colgap"
  +      iErr = .true.
  +      return
  +    end if
  +    call chr_cast(lnSplit(2), emitnx0_dist,   iErr)
  +    call chr_cast(lnSplit(3), emitny0_dist,   iErr)
  +    call chr_cast(lnSplit(4), emitnx0_collgap,iErr)
  +    call chr_cast(lnSplit(5), emitny0_collgap,iErr)
  +
  +  case default
  +    ! If we reached this point, we probably have an old style collimation block
  +    goto 10
  +
  +  end select
  +
  +  return
  +
  +  !  Parse old style COLL block
  +  ! ============================
  +10 continue
  +
     select case(iLine)
   
     case(1)
  
positive.code:   remity_dist    = emitny0_dist*gammar
    remitx_collgap = emitnx0_collgap*gammar
    remity_collgap = emitny0_collgap*gammar
  
  end subroutine collimate_postInput
  
  
negative.code:     call cdb_addFamily("tcryo",nSigIn(23),famID,fErr)
  
    case(6)
      if(nSplit > 0)  call chr_cast(lnSplit(1), n_slices,   iErr)
      if(nSplit > 1)  call chr_cast(lnSplit(2), smin_slices,iErr)
      if(nSplit > 2)  call chr_cast(lnSplit(3), smax_slices,iErr)
      if(nSplit > 3)  call chr_cast(lnSplit(4), recenter1,  iErr)
      if(nSplit > 4)  call chr_cast(lnSplit(5), recenter2,  iErr)
  
    case(7)
      if(nSplit > 0)  call chr_cast(lnSplit(1), jaw_fit(1,1),iErr)
      if(nSplit > 1)  call chr_cast(lnSplit(2), jaw_fit(1,2),iErr)
      if(nSplit > 2)  call chr_cast(lnSplit(3), jaw_fit(1,3),iErr)
      if(nSplit > 3)  call chr_cast(lnSplit(4), jaw_fit(1,4),iErr)
      if(nSplit > 4)  call chr_cast(lnSplit(5), jaw_fit(1,5),iErr)
      if(nSplit > 5)  call chr_cast(lnSplit(6), jaw_fit(1,6),iErr)
      if(nSplit > 6)  call chr_cast(lnSplit(7), jaw_ssf(1),  iErr)
  
    case(8)
      if(nSplit > 0)  call chr_cast(lnSplit(1), jaw_fit(2,1),iErr)
      if(nSplit > 1)  call chr_cast(lnSplit(2), jaw_fit(2,2),iErr)
      if(nSplit > 2)  call chr_cast(lnSplit(3), jaw_fit(2,3),iErr)
      if(nSplit > 3)  call chr_cast(lnSplit(4), jaw_fit(2,4),iErr)
      if(nSplit > 4)  call chr_cast(lnSplit(5), jaw_fit(2,5),iErr)
      if(nSplit > 5)  call chr_cast(lnSplit(6), jaw_fit(2,6),iErr)
      if(nSplit > 6)  call chr_cast(lnSplit(7), jaw_ssf(2),  iErr)
  
    case(9)
      if(nSplit > 0)  call chr_cast(lnSplit(1), emitnx0_dist,   iErr)
      if(nSplit > 1)  call chr_cast(lnSplit(2), emitny0_dist,   iErr)
      if(nSplit > 2)  call chr_cast(lnSplit(3), emitnx0_collgap,iErr)
      if(nSplit > 3)  call chr_cast(lnSplit(4), emitny0_collgap,iErr)
  
    case(10)
      if(nSplit > 0)  call chr_cast(lnSplit(1), do_select,        iErr)
      if(nSplit > 1)  call chr_cast(lnSplit(2), do_nominal,       iErr)
      if(nSplit > 2)  call chr_cast(lnSplit(3), rnd_seed,         iErr)
      if(nSplit > 3)  call chr_cast(lnSplit(4), dowrite_dist,     iErr)
      if(nSplit > 4)  name_sel = lnSplit(5)
      if(nSplit > 5)  call chr_cast(lnSplit(6), do_oneside,       iErr)
      if(nSplit > 6)  call chr_cast(lnSplit(7), dowrite_impact,   iErr)
      if(nSplit > 7)  call chr_cast(lnSplit(8), dowrite_secondary,iErr)
      if(nSplit > 8)  call chr_cast(lnSplit(9), dowrite_amplitude,iErr)
  
    case(11)
      if(nSplit > 0)  call chr_cast(lnSplit(1), xbeat,     iErr)
      if(nSplit > 1)  call chr_cast(lnSplit(2), xbeatphase,iErr)
      if(nSplit > 2)  call chr_cast(lnSplit(3), ybeat,     iErr)
      if(nSplit > 3)  call chr_cast(lnSplit(4), ybeatphase,iErr)
  
    case(12)
      if(nSplit > 0)  call chr_cast(lnSplit(1), c_rmstilt_prim,   iErr)
      if(nSplit > 1)  call chr_cast(lnSplit(2), c_rmstilt_sec,    iErr)
      if(nSplit > 2)  call chr_cast(lnSplit(3), c_systilt_prim,   iErr)
      if(nSplit > 3)  call chr_cast(lnSplit(4), c_systilt_sec,    iErr)
      if(nSplit > 4)  call chr_cast(lnSplit(5), c_rmsoffset_prim, iErr)
      if(nSplit > 5)  call chr_cast(lnSplit(6), c_rmsoffset_sec,  iErr)
      if(nSplit > 6)  call chr_cast(lnSplit(7), c_sysoffset_prim, iErr)
      if(nSplit > 7)  call chr_cast(lnSplit(8), c_sysoffset_sec,  iErr)
      if(nSplit > 8)  call chr_cast(lnSplit(9), c_offsettilt_seed,iErr)
      if(nSplit > 9)  call chr_cast(lnSplit(10),c_rmserror_gap,   iErr)
      if(nSplit > 10) call chr_cast(lnSplit(11),do_mingap,        iErr)
  
    case(13)
      if(nSplit > 0)  call chr_cast(lnSplit(1), radial,iErr)
      if(nSplit > 1)  call chr_cast(lnSplit(2), nr,    iErr)
      if(nSplit > 2)  call chr_cast(lnSplit(3), ndr,   iErr)
  
    case(14)
      if(nSplit > 0)  call chr_cast(lnSplit(1), driftsx,         iErr)
      if(nSplit > 1)  call chr_cast(lnSplit(2), driftsy,         iErr)
      if(nSplit > 2)  call chr_cast(lnSplit(3), cut_input,       iErr)
      if(nSplit > 3)  call chr_cast(lnSplit(4), systilt_antisymm,iErr)
  
    case(15)
      if(nSplit > 0)  call chr_cast(lnSplit(1), ipencil,      iErr)
      if(nSplit > 1)  call chr_cast(lnSplit(2), pencil_offset,iErr)
      if(nSplit > 2)  call chr_cast(lnSplit(3), pencil_rmsx,  iErr)
      if(nSplit > 3)  call chr_cast(lnSplit(4), pencil_rmsy,  iErr)
      if(nSplit > 4)  call chr_cast(lnSplit(5), pencil_distr, iErr)
  #ifdef G4COLLIMAT
      if(ipencil > 0) then
        write(lout,"(a)") "COLL> ERROR Pencil distribution not supported with geant4"
  