End-To-End Optimization of LiDAR Beam Configuration for 3D Object Detection and Localization