**5. Conclusions and perspectives**

This chapter deals with a topic of pivotal interest for scattering experiments at large-scale research infrastructures, as the optimal use of the usually short beamtime allocated for the measurement. The analysis of simulated measurements presented here demonstrates that the assistance of a Bayesian inference protocol can provide a decisive advantage in the decision making and time optimization processes of routine inelastic scattering experiments, and, more in general, of any scattering or diffraction measurement. Specifically, we considered a prototypical neutron scattering study split into shorter acquisition runs; Bayesian inference is used to analyze partial acquisitions obtained by summing an increasing number of individual runs to ultimately guide the investigator in his/her difficult decision on when to stop the beam counting. Such a decision is based upon previously established success criteria, as the achieved evidence for a physical phenomenon affecting the spectral shape, or the met targets in the experimental uncertainties associated with a given lineshape modeling. In this perspective, the development of a dedicated Measurement Integration Time Optimizer protocol could be especially beneficial, as it would provide conventional neutron or X-ray investigations with real-time Bayesian inference assistance. We believe that the availability of a similar on-the-fly data analysis tool can drastically minimize the time wasted in beamtime measurement, also holding the potential for a drastic revision of the beamtime allocation process. In fact, with this novel data analysis tool, decisions on beamtime assignment can be taken on the ground of spectral simulations in which the spectra to be successively measured can be analyzed as obtained with

different integration times. We anticipate that these novel inference tool can mark a discontinuity in the workflow of typical scattering experiments at large-scale research facilities.
