Optimization of beam shaping assembly and thermal neutron flux measurement for BNCT