integrate ray dection