logo

Machine learning based parametrization of the resolution function for the first experimental area of the n_TOF facility at CERN

NUCLEAR PHYSICS AND INTERDISCIPLINARY RESEARCH

Machine learning based parametrization of the resolution function for the first experimental area of the n_TOF facility at CERN

Petar Žugec
Marta Sabaté-Gilarte
Michael Bacak
Vasilis Vlachoudis
Adria Casanovas
Francisco García-Infantes
Nuclear Science and TechniquesVol.36, No.12Article number 235Published in print Dec 2025Available online 09 Oct 2025
12407

This study addresses a challenge of parametrizing a resolution function of a neutron beam from the neutron time of flight facility n_TOF at CERN. A difficulty stems from a fact that a resolution function exhibits rather strong variations in shape, over approximately ten orders of magnitude in neutron energy. To avoid a need for a manual identification of the appropriate analytical forms – hindering past attempts at its parametrization – we take advantage of the versatile machine learning techniques. Specifically, we parametrized it by training a multilayer feedforward neural network, relying on a key idea that such network acts as a universal approximator. The proof of concept is presented for a resolution function for the first experimental area of the n_TOF facility from the third phase of its operation. We propose an optimal network structure for a resolution function in question, which is also expected to be optimal or near-optimal for other experimental areas and for different phases of n_TOF operation. To reconstruct several resolution function forms in common use from a single parametrized form, we provide a practical tool in the form of a specialized C++ class encapsulating the computationally efficient procedures suited to the task.

n_TOF facilityResolution functionMachine learningNeutron time of flight
1

Introduction

Neutron time of flight facility n_TOF at CERN is a neutron production facility specializing in high-resolution measurements of the neutron induced reactions [1, 2]. In use since 2001, it is currently in the fourth major phase of its operation [3, 4]. Currently, it features three distinct experimental areas. The first and the second experimental area – EAR1 [2] and EAR2 [5-7] – are well established and have long since been in use. A new NEAR [8-10] experimental area is the most recent feature, characterizing the latest n_TOF phase.

The facility relies on a 20 GeV proton beam from the CERN Proton Synchrotron, which irradiates a massive Pb spallation target as a primary source of a neutron beam. The pulsed proton beam – 7 ns wide (RMS), with a minimum repetition period of 1.2 s – delivers an average of 8.5×1012 protons per pulse. All experimental areas connect to the same spallation target. EAR1 is at a horizontal distance of approximately 185 m from the target, EAR2 is 20 m above the target, while NEAR is at the short horizontal distance of only 1.5 m from the target. The primary spallation products consist of an intense burst of γ-rays, highly energetic neutrons and the other neutral and charged particles. On their way toward EAR1 and EAR2 the charged particles are swept away by the strong electromagnets. No such magnet is used for NEAR because of its proximity to the target. Remaining ultrarelativistic spallation products reach the experimental areas as an intense burst known as the γ-flash.

Initially, fast spallation neutrons are moderated by passing through a spallation target itself, through a layer of demineralized water from a cooling system, and through an additional layer of borated water from a separate moderation system around the target. This yields a white neutron spectrum spanning more than 10 orders of magnitude in energy, from thermal (10 meV) up to 1 GeV (up to the order of magnitude, depending on the experimental area [11, 12]). The beam production, moderation, and transport mechanisms are well understood [13, 14].

An inevitable by-product of the neutron production and moderation is a finite spread of neutron arrival times at the measuring station from a given experimental area, even for the neutrons of the same kinetic energy. These arrival times are measured and treated as the neutron times of flight, relative to the single initial moment of the primary proton beam hitting the spallation target. There are three major effects causing the variations in times of flight: (1) a time width (7 ns RMS) of the primary proton beam; (2) a distribution of neutron moderation times inside the target-moderator assembly; (3) a geometry of neutron transport along the beamline of finite length and breadth. This spread in neutron arrival times gives rise to a distribution known as the resolution function of the neutron beam. It causes the smearing of the experimental spectra in the cross section measurements based on the time of flight technique. As such, it must be accounted for during the analysis of the experimental time of flight data. At n_TOF the resolution function considerations have been pursued ever since the initial conception of the facility [1] and continue to be followed since the start of its operation [15, 16] to the present day [2, 4, 5, 13, 14].

The only practical means of obtaining a detailed evaluation of the resolution function are the dedicated simulations of the neutron production and moderation. Because of the complexity of the target-moderator assembly at n_TOF, these simulations are so computationally intensive that their output needs additional post-processing by the so-called optical transport code [13, 14, 17]. The purpose of this code is to propagate the outgoing neutrons towards the measuring station and to refine the raw statistics from the primary simulations in a meaningful and computationally efficient way. However, the final output of this code is still subject to statistical fluctuations, which are detrimental to the quality of the experimental data analysis. Furthermore, the raw numerical format of the resolution function is rather cumbersome to deal with, requiring users to implement their own interpolation and smoothing procedures. For this reason, a smooth parametrization of the resolution function is highly desirable. A difficulty arises from the fact that the shape of the resolution function varies significantly over a wide energy range of the n_TOF beam, covering more than 10 orders of magnitude in neutron energy. Attempts have been made in the past to identify the appropriate analytical form, as in Ref. [2]. But this form is a rather complicated function of two variables: the neutron energy and the time of flight. As such, it is exceedingly difficult to identify, only to be invalidated after each modification of the neutron production system at n_TOF, for example, after the occasional upgrades of the spallation target, moderator assembly, beam collimation system, etc.

In this work, we present an efficient and streamlined method for a parametrization of the n_TOF resolution function by means of the machine learning techniques, together with a user-friendly interface for its evaluation. The interface consists of a dedicated C++ class centred around the neural network implementation from a widely used programming package ROOT [18]. As a proof of concept, we apply the methodology to the resolution function of the first experimental area (EAR1) from the third phase (Phase-3) of the n_TOF operation (2014–2018 [19, 20]; Phase-4 is in effect since 2021 [3, 19], after a long shutdown in 2019–2021). We disclose an optimal network structure for this particular resolution function, which should also serve as the optimal or near-optimal structure for its re-parametrization after any alteration of the resolution function, or even for the parametrization of a resolution function for a different experimental area. As such, a repeated neural network training procedure requires very little user input regarding a selection of the appropriate parametrization form (realized through a selection of hyperparameters defining a neural network structure).

Section 2 establishes a basic formalism behind the resolution function. Section 3 presents its parametrization by means of a trained neural network, together with a procedure for a numerical reconstruction of the various resolution function forms from a single parametrization. Section 4 summarizes the main conclusions of this work. The appendix addresses an apparent norm violation in applying the resolution function.

2

Resolution function formalism

A detailed resolution function formalism may be found in Ref. [21]. In this section, we summarize the most important points. For readability of expressions, we will use compact notations E and E for two different types of kinetic energy parameters. The first is a true neutron energy E. The second is a reconstructed neutron energy E, calculated from a relativistic kinetic energy relation: E=mc2{[1(LcT)2]1/21}, (1) with m as the neutron mass, c as the speed of light in vacuum, L as a nominal neutron flight path (a length of an evacuated beamline) and, crucially, T as a neutron time of flight. Let us parameterize the neutrons irradiating the sample by some kinematic parameter X. For the moment, X may be a neutron time of flight T or a reconstructed energy E. Let dPX(E,X) be the probability for a neutron of true kinetic energy E to arrive at the sample with the specific value X’ of a selected parameter X, that is, with a value within an interval DX’. By definition, the resolution function RX(E,X) is a differential quantity: RX(E,X)dPX(E,X)dX. (2) It is normalized such that: RX(E,X)dX=1for every E. (3) The time of flight T is the most natural variable for a resolution function, due to it being directly measured in the time of flight experiments. However, both T and E are somewhat inconvenient for a comprehensive representation of a resolution function for two reasons. One is that E closely follows a true neutron energy E, thus also affecting T via Eq. (1). As a consequence, the mean values of resolution functions RE and RT, at given E, are closely dependent on E. This is inconvenient for the neutron beams spanning multiple orders of magnitude in energy, as the relevant portion of a resolution function is “stretched out” in both directions throughout the parameter space. This is clearly shown in Fig. 1, which shows both forms RT(E,T) and RE(E,E) of the same resolution function.

Fig. 1
(Color online) Resolution function for the first experimental area (EAR1) of the n_TOF facility from the third phase (Phase-3) of its operation. Top (a): a form RT(E,T) dependent on the neutron time of flight T. Bottom (b): a form RE(E,E) dependent on the reconstructed neutron energy E
pic

The other reason for a cumbersome nature of RT and RE is the fact that the neutron time of flight directly depends on a neutron flight path L, that is, on a sample distance from a neutron source, which often changes between experiments. Thus, with every change of L, both RT and RE should be recalculated from the start. Therefore, it would be highly desirable to introduce an alternative kinematic parameter satisfying the following requirements: (1) its span of values over the entire range of neutron energies is weakly dependent on E, being localized around some meaningful value; (2) a resolution function in this parameter is independent of a trivial scaling1 with L, making it representative only of a neutron production process and of the nontrivial, physically meaningful effects of L; (3) preferably, a new parameter should have at least approximate physical interpretation, rather than just being an artificial mathematical transformation. This parameter has long since been identified as an effective moderation length λ. The idea is to separate the time of flight of monoenergetic neutrons – that fluctuates owing to the statistical nature of a neutron production and transport process – into a contribution from a nominal flight path L and a “corrective” contribution λ, encoding the effects of fluctuations: vET=L+λ, (4) with vE as a true neutron speed upon leaving a neutron source (a spallation target). At this point, we introduce the following expression: βε=ε(ε+2mc2)ε+mc2, (5) because it is relevant here and will be useful in subsequent calculations. It represents a standard relativistic factor βε=vε/c for neutrons of kinetic energy ε. Thus, a true neutron speed from Eq. (4) is given by a true neutron energy as vE=cβE.

It should be noted that the effective moderation length λ is not the real path length of a neutron inside a spallation target, for multiple reasons: (1) a neutron inside a spallation target does not propagate the entire time with speed vE; (2) production of separate neutrons is initiated at different initial moments owing to a finite time spread of the proton beam irradiating a spallation target, while the time of flight T for all neutrons corresponding to the same proton pulse is measured relative to a unique, fixed moment; (3) even after leaving the spallation target, a contribution to the total T from a neutron propagation inside an evacuated beamline is not necessarily L/vE. This may be because a neutron is emitted at some slight angle θ relative to the beamline axis, making a real flight path L/cos θ. It may also scatter off the beamline walls, which increases its flight path and alters its speed.

Figure 2 shows a resolution function Rλ(E,λ) dependent on the effective moderation length. The top form (σT=0) does not take into account the time width σT of the primary proton beam (explained later), and perfectly corresponds to the earlier forms from Fig. 1. For convenience, we immediately show a resolution function smeared by the proton beam RMS of σT=7 ns, which will soon be elaborated.

Fig. 2
(Color online) A resolution function Rλ(E,λ) dependent on the effective neutron moderation length λ. The top form (a) corresponds to those from Fig. 1, coming directly from the FLUKA+MNCP simulations of the neutron production and transport. In the subsequent sections – starting with Eq. (10) – denoted by Rλ. The bottom form (b), smeared by the proton beam width σT=7 ns, corresponds to the real experimental situation and is later denoted as
pic

We now have a set of three kinematic parameters to be found in common use: X{T,E,λ}. The transformation of a resolution function between these parameters follows from a conservation of probability: RT(E,T)|dT|=RE(E,E)|dE'|=Rλ(E,λ)|dλ|. (6) It is shown in Ref. [21] that the resolution function transforms a differential spectrum of counts NE(E) dependent on a true neutron energy into a differential spectrum of counts NX(X) dependent on a selected kinematic parameter as: dNX(X)dX=0dNE(E)dERX(E,X)dE. (7)

3

Resolution function parametrization by means of machine learning

3.1
Resolution function fitting

It was shown in Ref. [17] that the raw resolution function (obtained by the optical code) can not be used for a reliable resonance analysis. The reason is that the residual statistical fluctuations from the computationally intensive FLUKA+MNCP simulations of the neutron production and transport through the spallation target are not negligible relative to the fluctuations in the experimental data. Thus, using the raw resolution function in the analysis of the experimental data artificially and unnecessarily increases the involved statistical uncertainties. (Examples of smearing the initially smooth spectra by the raw resolution function may be found in later Figs. 5 and 6.) Clearly, a smoothed form of the resolution function is necessary, so as to avoid this adverse effect. It is also highly desirable that the smoothed form be efficiently parameterized, that is, that it is more compact than just a densely interpolated resolution function matrix filled with the values of a smoothed function (a matrix such as those from Figs. 1 and 2).

One way of proceeding would be to identify an analytical parametrization of the entire resolution function matrix. An example of such parametrization for a resolution function of EAR1 from Phase-1 of the n_TOF operation can be found in Ref. [2]. However, such an analytical form is difficult to identify and may no longer be appropriate when the alterations are introduced to the neutron production process. For example, the replacement of a spallation target between Phase-1 and Phase-2 of the n_TOF operation [4] notably affected the shape of a resolution function, rendering previous parametrization invalid. Furthermore, a resolution function for EAR2 differs from the one for EAR1 and requires its own dedicated parametrization. To avoid a tedious manual identification of new analytical forms, we take advantage of the machine learning techniques, in particular of the deep feedforward neural networks. The idea stems from a fact that the multilayer feedforward neural networks act as the universal approximators, capable of approximating any sufficiently well behaved function to any desired degree of accuracy [22, 23]. In other words, such networks can be thought of as “black box” fitting functions capable of modeling any function of practical importance. The application of neural networks to this task is a part of ongoing efforts to introduce the machine learning techniques into a widespread practice at n_TOF [24-26]. The possibility of applying the convolutional neural networks in unfolding the effects of the resolution function is also being investigated, with very promising results on the horizon [27].

We demonstrate the proof-of-concept by fitting a resolution function of EAR1, from Phase-3 of the n_TOF operation. To this end, we used the neural network training capabilities of the TMultiLayerPerceptron class [28] from root. Using root allows for a seamless integration of the end result (a trained neural network) within a vast majority of the data analysis codes from n_TOF. We provide a basic example of the code usage among the openly available data files [29].

Our goal is to fit a single form of a resolution function (either RT, RE or ) and reconstruct all other forms from this single fit by applying the appropriate transformations. This will ensure a perfect consistency between all forms of a resolution function, which would not necessarily be satisfied by fitting each form separately. Because of the described advantages of the representation (a uniformity of relevant λ values and insensitivity to a nominal flight path L), it is an obvious choice for fitting.

There is another consideration to be taken into account, that will allow for a greater flexibility in reconstructing particular forms of a resolution function. The resolution functions of the n_TOF facility (for different experimental areas) are affected by two separable contributions: (1) a neutron production and transport process inside a spallation target, as well as a neutron transport outside of it; and (2) a time distribution (a finite time width) of the primary proton beam from the CERN Proton Synchrotron irradiating the spallation target. The proton beam time distribution is Gaussian in shape with a standard deviation of σT=7 ns. Let RT designate a resolution function in time of flight, without the effects of the proton beam width (as if σT=0). RT is easily extracted from the raw results of the FLUKA+MNCP simulations processed by an optical transport code. A resolution function RT affected by the proton beam width is then obtained by a simple convolution with a temporal proton beam profile (a normalized Gaussian): RT(E,T)=1σT2πRT(E,τ)exp[(Tτ)22σT2]dτ. (8) On account of a linear relationship between T and λ from Eq. (4), a representation of a resolution function affected by a proton beam width may still be expressed as a convolution of a resolution function Rλ with an instantaneous proton beam, and a λ-equivalent of a temporal beam profile. From Eq. (4), it follows that the λ-width of this profile is dependent on a true neutron energy, as σλ(E)=vEσT. Using Eq. (5) this dependence can be expressed as: σλ(E)=cβEσT=E(E+2mc2)E+mc2cσT. (9) Thus, the required convolution takes the following form: Rλ(E,λ)=1σλ(E)2πRλ(E,Λ)exp[(λΛ)22σλ2(E)]dΛ. (10) Equations (6) and (10) constitute all the transformation rules required for reconstructing any desired form of a resolution function from a proton-beam-width-free form Rλ. Therefore, we apply a neural network fitting precisely to this, which is the most convenient representation Rλ. The arguments E and λ of a two-dimensional resolution function Rλ(E,λ) play a role of the network inputs. A single scalar-function value for each pair of arguments plays a role of a single network output. However, since the true neutron energies E and the resolution function values Rλ span multiple orders of magnitude, for reasons of numerical stability we take the logarithms of these quantities for the input and output neutrons.

Here, we describe a neural network training and optimization procedure. First, the 450×60 numerical resolution function matrix was constructed, spanning 450 uniformly distributed λ values between -2 m and 7 m (2 cm steps), together with 60 isolethargically distributed log10E values between 10-3 eV and 109 eV (five points per decade), creating a dataset of 27 000 points. It should be noted that the trained neural network is not be used for any kind of extrapolation outside of the range. It serves only as a smooth and compact parametrization throughout the physically meaningful range, to be used only for the resolution function reconstruction within a range entirely covered by the numerical matrix being fitted. Therefore, no cross-validation was required during a training procedure. In other words, all 27 000 entries could be used as training counts, without needing to reserve any of them for separate testing. Thus the quality of the trained network could be entirely assessed against the training data. We used a few simple and effective steps: we observed the saturation rate of a loss function during the training, and visually compared the agreement between the final fit and the raw data (see Fig. 4, soon to be discussed). We also closely monitored a distribution of fitting residuals.

We tested several training methods available in the TMultiLayerPerceptron class, using a few preliminary network structures. We did not observe any significant improvement– either in the computational efficiency or in the quality of the final results – over the default Broyden-Fletcher-Goldfarb-Shanno (BFGS) method with the default hyperparameter values [28]. Hence, we opted for the default training parameters, employing the sigmoid activation function. In TMultiLayerPerceptron, the binary cross-entropy is the only loss function associated with the sigmoid activation function. By testing a range of network structures, we identified an optimal structure consisting of three hidden layers, each composed of 15 neurons. The optimal structure was easily identified. Less than three hidden layers do not seem to have enough flexibility to recover the quick variations in the resolution function, even with highly increased number of neurons. Aside from the visually obvious overfitting, more than three hidden layers do not bring any further improvement in the resolution function reconstruction. Once the optimal three-layer structure was identified, the number of neurons was varied in steps of five, in different combinations throughout the layers (e.g. 15-10-20). By searching for the simplest structure providing a satisfactory resolution function reconstruction – without further improvement with an increasing number of neutrons – we quickly converged upon the optimal 15-15-15 structure, which is shown in Fig. 3. The network inputs are x=λ/(1 cm) and y=log10[E/(1eV)], with a single output z=log10[Rλ/(1cm1)]. In general, the final state of a trained neural network depends on a particular training run owing to a random initialization of its weights and biases. With the optimal network structure and after a sufficient number of training epoch, these variations are essentially negligible. For the final training we used 104 training epochs. A single-threaded training on AMD Ryzen 7 7735HS (3.2 GHz) CPU under Linux Mint 21.2 Cinnamon takes 1 min per 100 epochs, making a total of 100 min for 104 epochs.

Fig. 3
Neural network structure used for modeling a resolution function of EAR1 from Phase-3 of n_TOF operation. Each fully connected hidden layer consists of 15 neurons. The inputs correspond to x=λ/(1 cm) and y=log10[E/(1eV)]. A single output is z=log10[Rλ/(1 cm1)]
pic

Figure 4 compares a raw resolution function with a fitted one, for several values of a true neutron energy E. The effect of a proton beam width is negligible below σλ=1 cm. As per Eq. (9), a time width of σT=7 ns implies an equivalent energy limit of E=10 keV (corresponding, for EAR1 flight path of L=180 m, to the times of flight below 0.13 ms). Hence, at lower neutron energies the proton beam width of 7 ns does not have any significant effect upon the resolution function. For this reason a resolution function smeared by means of a numerical convolution from Eq. (10) is shown only at energies higher than 10 keV.

Fig. 4
(Color online) Raw resolution function fitted by a single neural network, at neutron energies of (a) 40 meV, (b) 10 keV and (c) 2 MeV. A raw and fitted function correspond to an instantaneous proton beam irradiating a spallation target. A beam width of 7 ns does not have a notable effect below 10 keV
pic
3.2
Numerical resolution function reconstruction

To reconstruct the resolution function forms RT and RE smeared by a proton beam width, one relies on the transformation rules from Eq. (6). In the general case, a smeared resolution function should first be obtained from an unsmeared fit Rλ – by means of Eq. (10) – and only then should a required transformation from Eq. (6) be applied. The reason is this. Combining Eqs. (1) and (4) yields a nonlinear relation between E and λ: E=mc2{[1(vEcLL+λ)2]1/21}. (11) Because of this nonlinearity, the transformation between an unsmeared resolution function RE and a smeared RE can no longer be expressed as a formal convolution, which bears upon the questions of computational complexity in applying a smearing transformation. We address these questions in Sect. 3.3.

Because of a simple relation between λ and T from Eq. (4), a transformation rule for RT from Eq. (6) involves a very simple derivative Dλ/DT=vE, yielding: RT(E,T)=cβE×Rλ(E,cβETL), (12) with βE being defined by Eq. (5). A transformation for RE is slightly more complex. By first obtaining λ(E) and dλ/dE from Eq. (11), we obtain: RE(E,E)=Lm2c4(E+mc2)3βEβE3×Rλ[E,L(βEβE1)], (13) where λ(E)=L(βE/βE1). By construction, these transformations preserve a norm of a resolution function.

We use a transformed resolution function from Eq. (13) to demonstrate the effect upon and an agreement with the n_TOF experimental data. Figure 5 shows two selected resonances from a recent measurement of the 53Cr(n,γ) reaction in EAR1 [30]. Although the measurement was performed during n_TOF Phase-4, for presentation purposes, we use here a resolution function from Phase-3 as a first approximation of the resolution function from Phase-4. The plot shows a resolution-function-free reaction yield – manually constructed by appropriately scaling a neutron capture cross section from ENDF/B-VIII.0 database [31] – together with two resolution resolution-function-smeared yields, compared with the experimental data. (The preliminary experimental data are shown, as their analysis is not yet complete. The region between the resonances is still affected by the residual background contributions, not all of which have yet been subtracted. The relative background contribution inside the resonances is negligible for visual purposes, so that a meaningful visual comparison with the ENDF resonances can still be made.) Smeared yields have been obtained either by applying the raw, unparameterized resolution function or the one fitted by the neural network. Reaction yields (Y) transform precisely as the differential spectra from Eq. (7) and have been obtained by a transformation: YE(E)=0YE(E)RE(E,E)dE, (14) wherein YE is a yield constructed from ENDF/B-VIII.0 data. Resolution function RE was calculated according to Eq. (13), starting either from the raw or the fitted resolution function . The difference between two smeared yields illustrates our initial claim that the raw resolution function should not be used in the accurate data analysis, as it unnecessarily introduces artificial fluctuations into otherwise smooth data, or enhances the existing ones.

Fig. 5
(Color online) Selected resonances from n_TOF measurement of the 53Cr(n,γ) reaction, compared to the reaction yields based on ENDF/B-VIII.0 data, with of without the resolution function having been applied
pic

A simple and comprehensive insight into effects of applying either the raw or the smoothed resolution function may be obtained by applying them to a constant spectrum of unit height. Figure 6 shows these results for the E-spectrum spanning 10 orders of magnitude in neutron energy, completely analogously to a resonant yield from Fig. 5. A detrimental effect of applying the raw resolution function is immediately evident, as opposed to a smooth end-result from the fitted resolution function. In that, Figure 6 shows the result of applying a resolution function unsmeared by a proton beam width (as if σT=0). The reason is that smearing the raw resolution function smooths a high energy part, thus obscuring the statistical fluctuations inherent in the simulated data, while these fluctuations are precisely what we are trying to exhibit here. Other than smoothing a high energy part of the spectrum obtained with the raw resolution function, a realistic value of σT=7 ns does not affect the shape of the folded spectra in a visible way (as they are displayed in Fig. 6). It should be taken into account that the data from Fig. 6 are displayed in 100 bins per decade. With finer binning, the fluctuations from the raw resolution function become even more pronounced. We note in passing that the n_TOF data are often analyzed in thousands of bins per decade (see, for example, Refs.[32, 33] for 5000 bins per decade applied to the neutron capture data or Ref. [34] for 2000 bins per decade applied to the fission data). While the resonance plots like those from Fig. 5 show how the underlying data are locally deformed by a resolution function, a plot from Fig. 6 clearly shows that the global data trend may also be affected.

Fig. 6
(Color online) Effect of applying either the raw or the fitted resolution function to a unit spectrum spanning 10 orders of magnitude in neutron energy. The data are shown in 100 bins per decade. A level of fluctuations introduced by the raw resolution function increases with denser binning
pic

The resolution function affected spectra from Fig. 6 seem to be systematically higher than unity. This might suggest that the application of a resolution function violates a norm preservation, that is, it violates a conservation of the total number of underlying counts. This violation is only apparent and is addressed in the Appendix.

3.3
Resolution function class

To facilitate the use of a newly fitted resolution function at n_TOF, we have written a self-contained C++ class [35], serving as a simple interface for the evaluation of any desired resolution function form (, RT or RE), starting from a fitted proton-beam-width-free form Rλ* (not necessarily normalized, as denoted by asterisk). The class serves the following functions:

(1) initialization of a trained neural network (Rλ*);

(2) numerical normalization (Rλ);

(3) smearing due to a proton beam width (Rλ);

(4) transformation to alternative forms (RT or RE);

(5) computationally efficient implementation of the above operations.

The class houses the parameters of a trained neural network and initializes a TMultiLayerPerceptron object, allowing for a direct evaluation of a fitted, proton-beam-width-free (unnormalized) resolution function Rλ*.

In evaluating any form of a resolution function, the first operation to be performed is a numerical normalization such that Rλ(E,λ)dλ=1, for any required value of E. The reason for performing a normalization at all is the fact that a fitting function without a priori imposed norm does not necessarily preserve a norm of the fitted data. Therefore, even if already-normalized data were fitted, the end-result needs to be a posteriori normalized. This also allows for the unnormalized raw data to be fitted, which may improve the quality of the fit, since the raw data may be unnormalized not only by a constant factor, but by an arbitrary E-dependent function, affecting a global twodimensional trend that the trained neural network needs to reproduce. The reason for a numerical normalization to be performed first is a computational efficiency, owing to the fact that both the convolutional smearing from Eq. (10) and the kinematic parameter transformations from Eqs. (12) and (13) preserve the norm. To clarify the point, let TX denote a total transformation (a composition of smearing and kinematic-parameter-transformation operations) acting on unnormalized Rλ* so as to produce an unnormalized, smeared and transformed resolution function RX*, in a sense: RX*=TX{Rλ*}. Owing to a norm preserving property of all operations from TX, a normalized resolution function can be obtained in two ways: RX(E,X)==TX{ Rλ*[ E,λ(X) ]ΛRλ*(E,Λ)ΔΛ }=TX{ Rλ*[ E,λ(X) ] } xTX{ Rλ*[ E,λ(x) ] }Δx, (15) where the sum from either denominator represents a discrete numerical integration. When the normalization is performed first, as in the first expression, the computationally expensive operations from TX need to be performed only once in order to obtain a single point from RX. If, on the other hand, the normalization was performed last (the second expression), then the same computationally expensive operations need to be performed unnecessarily many times during the norm calculation by means of a discrete summation. Furthermore, evaluating a trained network with many neural links (Fig. 3) is also moderately expensive. For this reason, we trigger a fresh normalization only when a new value of E is registered, which is different from a previous one requested by the user. This avoids the unnecessary repetitions of the same summation from Eq. (15).

For a user-supplied value of a temporal proton beam width σT, a normalized resolution function is smeared by performing a discrete version of a convolution from Eq. (10). This is the most significant bottle-neck of the numerical calculations, since a naive convolution algorithm is computationally expensive. When users request single points of a resolution function (one point at a time), little can be done to speed up a convolution algorithm itself. In this case, our class offers a possibility of a bilinear interpolation, which will soon be described. However, significant algorithmic improvements are available when a convolution needs to be calculated (i.e. smearing needs to be performed) over a grid of uniformly spaced λ-points. While a naive convolution algorithm is of excessive O(N2) computational complexity – N being a number of required points – the famous Fast Fourier Transform algorithm manages a job in only O(Nlog2N) steps [36]. In this case, we employ an efficient Fast Fourier Transform implementation from Ref. [37], keeping the overall computational workload at a manageable level.

Having thus obtained a smeared , only a kinematic parameter transformation from Eq. (12) or (13) remains to be performed whenever the resolution function forms RT or RE is requested. If the evaluation of RT over a grid of uniformly spaced T-points is needed, the computational advantages of the Fast Fourier Transform may again be relied on. This is because the smeared RT may still be expressed as a formal convolution. In fact, it is the original convolution from Eq. (8). At the same time, due to a linearity between λ and T from Eq. (4), a uniform grid of T-points corresponds to a uniform grid of λ-points, allowing for the Fast Fourier Transform to be applied. However, due to the n_TOF beam spanning more than 10 orders of magnitude in neutron energy, the measured time of flight spectra are spread over the multiple orders of magnitude. Therefore, the isolethargic spacing of T-points is commonly used, corresponding to an isolethargic spacing of λ-points (at a given E), for which a regular Fast Fourier Transform algorithm can no longer be used. On the other hand, whether a uniform of isolethargic spacing of E-points is used (as is common practice), neither corresponds to a uniform spacing of λ-points, owing to a nonlinear relationship from Eq. (11). To extend a computational efficiency to all cases, our class allows users to activate the interpolation mode, allowing any form of the resolution function to be evaluated by means of a bilinear interpolation between pre-calculated resolution function points. Thus, a smeared and normalized resolution function is evaluated on a dense (E, λ) grid, allowing all the normalization and smearing operations to be performed in a single go, without later repetitions. This grid is isolethargically spaced over E and, more importantly, uniformly spaced over λ, so that the Fast Fourier Transform can be taken full advantage of during a smearing stage. The user-requested values of a resolution function are calculated by first obtaining a required Rλ(E,λ) point by a bilinear interpolation between four closest points from a pre-calculated grid (a simple bilinear interpolation algorithm may also be found in Ref. [37]). If necessary, a kinematic parameter transformation from Eq. (12) or (13) is then performed. For a sufficiently dense grid of pre-evaluated points it makes little numerical difference whether the kinematic parameter transformation is performed before or after the interpolation. However, prior to interpolation it has to be executed at four grid-points; after the interpolation it needs to be applied only once. We have selected a computationally efficient procedure.

4

Conclusion

We have provided an efficient way of parametrizing a resolution function of a neutron beam from the n_TOF facility, thus solving a long-standing problem of facilitating its use among the users requiring a resolution function in their data analyses. The method takes advantage of the machine learning techniques. Specifically, the resolution function is fitted by training a multilayer feedforward neural network, due to the fact that such networks act as the universal approximators. We have applied the method to the resolution function for the first experimental area of the n_TOF facility, from the third phase of its operation. In order to re-parametrize the resolution function after any alteration – or to parametrize a resolution function for a different experimental area – one only needs to retrain a neural network by using the readily available streamlined procedures. In this work, we have used the neural network training capabilities of the TMultiLayerPerceptron class from a C++ based programming package root.

We have parametrized a single most appropriate form of the resolution function – one dependent on the so-called effective neutron-moderation length, and unaffected by the temporal spread of the primary proton beam from a neutron production process at n_TOF. To efficiently reconstruct several other resolution function forms in common use – those dependent on the neutron time of flight or the so-called reconstructed neutron energy – and to apply the effects of the proton beam width, we have supplied a specialized C++ class. The class is immediately applicable to any reparameterization of the resolution function, as the involved reconstruction procedures are independent of the underlying network structure. We have applied a reconstructed resolution function to the pre-established neutron capture resonances in the 53Cr(n,γ) reaction. We found an excellent agreement with the preliminary experimental data from n_TOF, thus providing a proof of concept that the resolution function parametrization proposed here is indeed feasible.

Unlike the resolution function for the first experimental area (EAR1) of the n_TOF facility, the one for the second experimental area (EAR2) features a strong nontrivial dependence on the sample position, that is, the distance from a neutron source (a Pb spallation target). Therefore, one could parametrize several separate EAR2 resolution functions at different sample positions of interest. On the other hand, a parametrization procedure proposed here could be easily extended so as to include a sample position as an additional input parameter, alongside a true neutron energy and an effective neutron-moderation length. By extending (reoptimizing) the network structure, a comprehensive parametrization of the EAR2 resolution function – particularly its variation along the neutron beam – could be achieved in a single go, for a wide range of sample positions.

References
1. C. Rubbia, S. Andriamonje, D. Bouvet-Bensimon et al.,

A high resolution spallation driven facility at the CERN-PS to measure neutron cross sections in the interval from 1 eV to 250 MeV. (CERN/LHC/98-02 and CERN/LHC/98-02-Add.1, 1998)

, https://cds.cern.ch/record/363828. Accessed 14 March 2025
Baidu ScholarGoogle Scholar
2. C. Guerrero, A. Tsinganis, E. Berthoumieux et al.,

Performance of the neutron time-of-flight facility n_TOF at CERN

. Eur. Phys. J. A 49, 27 (2013). https://doi.org/10.1140/epja/i2013-13027-6
Baidu ScholarGoogle Scholar
3. N. Patronis, A. Mengoni, S. Goula et al.,

Status report of the n_TOF facility after the 2nd CERN long shutdown period

. EPJ Tech. Instrum. 10, 13 (2023). https://doi.org/10.1140/epjti/s40485-023-00100-w
Baidu ScholarGoogle Scholar
4. R. Esposito, M. Calviani, O. Aberle et al.,

Design of the third-generation lead-based neutron spallation target for the neutron time-of-flight facility at CERN

. Phys. Rev. Accel. Beams 24, 093001 (2021). https://doi.org/10.1103/PhysRevAccelBeams.24.093001
Baidu ScholarGoogle Scholar
5. C. Weiß, E. Chiaveri, S. Girod et al.,

The new vertical neutron beam line at the CERN n_TOF facility design and outlook on the performance

. Nucl. Instrum. Methods Phys. Res. A 799, 90-98 (2015). https://doi.org/10.1016/j.nima.2015.07.027
Baidu ScholarGoogle Scholar
6. N. Colonna, E. Chiaveri, F. Gunsing,

The Second Beam-Line and Experimental Area at n_TOF: A New Opportunity for Challenging Neutron Measurements at CERN

. Nucl. Phys. News 25(4) 19-23 (2015). https://doi.org/10.1080/10619127.2015.1035930
Baidu ScholarGoogle Scholar
7. S. Barros, I. Bergström, V. Vlachoudis, C. Weiß,

Optimization of n_TOF-EAR2 using FLUKA

. J. Instrum. 10, P09003 (2015). https://doi.org/10.1088/1748-0221/10/09/P09003
Baidu ScholarGoogle Scholar
8. M. Ferrari, D. Senajova, O. Aberle et al.,

Design development and implementation of an irradiation station at the neutron time-of-flight facility at CERN

. Phys. Rev. Accel. Beams 25, 103001 (2022). https://doi.org/10.1103/PhysRevAccelBeams.25.103001
Baidu ScholarGoogle Scholar
9. N. Patronis, A. Mengoni, N. Colonna et al.,

The CERN n_TOF NEAR station for astrophysics- and application-related neutron activation measurements

. (arXiv:2209.04443 [physics.ins-det], 2022), https://arxiv.org/abs/2209.04443. Accessed 14 March 2025
Baidu ScholarGoogle Scholar
10. M. E. Stamati, P. Torres-Sánchez, P. Pérez-Maroto et al.,

The n_TOF NEAR Station Commissioning and first physics case

. EPJ Web Conf. 284, 06009 (2023). https://doi.org/10.1051/epjconf/202328406009
Baidu ScholarGoogle Scholar
11. M. Barbagallo, C. Guerrero, A. Tsinganis et al.,

High-accuracy determination of the neutron flux at n_TOF

. Eur. Phys. J. A 49, 156 (2013). https://doi.org/10.1140/epja/i2013-13156-x
Baidu ScholarGoogle Scholar
12. M. Sabaté-Gilarte, M. Barbagallo, N. Colonna et al.,

High-accuracy determination of the neutron flux in the new experimental area n_TOF-EAR2 at CERN

. Eur. Phys. J. A 53, 210 (2017). https://doi.org/10.1140/epja/i2017-12392-4
Baidu ScholarGoogle Scholar
13. S. Lo Meo, M. A. Cortés-Giraldo, C. Massimi et al.,

GEANT4 simulations of the n_TOF spallation source and their benchmarking

. Eur. Phys. J. A 51, 160 (2015). https://doi.org/10.1140/epja/i2015-15160-6
Baidu ScholarGoogle Scholar
14. J. Lerendegui-Marco, S. Lo Meo, C. Guerrero et al.,

Geant4 simulation of the n_TOF-EAR2 neutron beam: Characteristics and prospects

. Eur. Phys. J. A 52, 100 (2016). https://doi.org/10.1140/epja/i2016-16100-8
Baidu ScholarGoogle Scholar
15. C. Coceva, M. Frisoni, M. Magnani, A. Mengoni,

On the figure of merit in neutron time-of-flight measurements

. Nucl. Instrum. Methods Phys. Res. A 489, 346-356 (2002). https://doi.org/10.1016/S0168-9002(02)00903-8
Baidu ScholarGoogle Scholar
16. C. Borcea, P. Cennini, M. Dahlfors et al.,

Results from the commissioning of the n_TOF spallation neutron source at CERN

. Nucl. Instrum. Methods Phys. Res. A 513, 524-537 (2003). https://doi.org/10.1016/S0168-9002(03)02072-2
Baidu ScholarGoogle Scholar
17. V. Vlachoudis, M. Sabate-Gilarte, V. Alcayne et al.,

On the resolution function of the n_TOF facility: a comprehensive study and user guide. (n_TOF-PUB-2021-001, 2021)

, https://cds.cern.ch/record/2764434. Accessed 14 March 2025
Baidu ScholarGoogle Scholar
18. Rene Brun, Fons Rademakers,

ROOT – An object oriented data analysis framework

. Nucl. Instrum. Methods Phys. Res. A 389, 81-86 (1997). https://doi.org/10.1016/S0168-9002(97)00048-X
Baidu ScholarGoogle Scholar
19. C. Domingo-Pardo, O. Aberle, V. Alcayne et al.,

The neutron time-of-flight facility n_TOF at CERN Recent facility upgrades and detector developments

. J. Phys. Conf. Ser. 2586, 012150 (2023). https://doi.org/10.1088/1742-6596/2586/1/012150
Baidu ScholarGoogle Scholar
20. E. Dupont, N. Otuka, D. Rochman et al.,

Overview of the dissemination of n_TOF experimental data and resonance parameters

. EPJ Web Conf. 284, 18001 (2023). https://doi.org/10.1051/epjconf/202328418001
Baidu ScholarGoogle Scholar
21. P. Žugec, N. Colonna, M. Sabate-Gilarte et al.,

A direct method for unfolding the resolution function from measurements of neutron induced reactions

. Nucl. Instrum. Methods Phys. Res. A 875, 41-50 (2017). https://doi.org/10.1016/j.nima.2017.09.004
Baidu ScholarGoogle Scholar
22. K. Hornik, M. Stinchcombe, H. White,

Multilayer feedforward networks are universal approximators

. Neural Netw. 2, 359-366 (1989). https://doi.org/10.1016/0893-6080(89)90020-8
Baidu ScholarGoogle Scholar
23. M. Leshno, V. Ya. Lin, A. Pinkus, S. Schocken,

Multilayer feedforward networks with a nonpolynomial activation function can approximate any function

. Neural Netw. 6, 861-867 (1993). https://doi.org/10.1016/S0893-6080(05)80131-5
Baidu ScholarGoogle Scholar
24. V. Babiano-Suárez, J. Lerendegui-Marco, J. Balibrea-Correa et al.,

Imaging neutron capture cross sections: i-TED proof-of-concept and future prospects based on Machine-Learning techniques

. Eur. Phys. J. A 57, 197 (2021). https://doi.org/10.1140/epja/s10050-021-00507-7
Baidu ScholarGoogle Scholar
25. P. Žugec, M. Barbagallo, J. Andrzejewski et al.,

Machine learning based event classification for the energy-differential measurement of the natC(n, p) and natC(n, d) reactions

. Nucl. Instrum. Methods Phys. Res. A 1033, 166686 (2022). https://doi.org/10.1016/j.nima.2022.166686
Baidu ScholarGoogle Scholar
26. A. Sanchez-Caballero, V. Alcayne, D. Cano-Ott et al.,

A Case Study on Deep Learning applied to Capture Cross Section Data Analysis

. EPJ Web Conf. 284, 16001 (2023). https://doi.org/10.1051/epjconf/202328416001
Baidu ScholarGoogle Scholar
27. T. Cavagna,

n_TOF Transport Code Update and RF Deconvolution. (CERN-STUDENTS-Note-2023-101, 2023)

, https://cds.cern.ch/record/2869067. Accessed 14 March 2025
Baidu ScholarGoogle Scholar
28.

CERN ROOT: TMultiLayerPerceptron Class Reference

, https://root.cern/doc/master/classTMultiLayerPerceptron.html. Accessed 14 March 2025
Baidu ScholarGoogle Scholar
29. P. Žugec, M. Sabate Gilarte, M. Bacak et al.,

Resolution function data for n_TOF EAR1 Phase-3

[DS/OL]. V2. Science Data Bank, 2025 [2025-05-23]. https://doi.org/10.57760/sciencedb.j00186.00697. Accessed 23 May 2025
Baidu ScholarGoogle Scholar
30. P. Pérez-Maroto, C. Guerrero, A. Casanovas et al.,

Description and outlook of the 50,53Cr(n,γ) cross section measurement at n_TOF and HiSPANoS

. EPJ Web Conf. 294, 01004 (2024). https://doi.org/10.1051/epjconf/202429401004
Baidu ScholarGoogle Scholar
31. D. A. Brown, M. B. Chadwick, R. Capote et al.,

ENDF/B-VIII.0: The 8th Major Release of the Nuclear Reaction Data Library with CIELO-project Cross Sections, New Standards and Thermal Scattering Data

. Nucl. Data Sheets 148, 1-142 (2018). https://doi.org/10.1016/j.nds.2018.02.001
Baidu ScholarGoogle Scholar
32. K. Fraval, F. Gunsing, S. Altstadt et al.,

Measurement and analysis of the 241Am(n,γ) cross section with liquid scintillator detectors using time-of-flight spectroscopy at the n_TOF facility at CERN

. Phys. Rev. C 89, 044609 (2014). https://doi.org/10.1103/PhysRevC.89.044609
Baidu ScholarGoogle Scholar
33. F. Mingrone, C. Massimi, G. Vannini et al.,

Neutron capture cross section measurement of 238U at the CERN n_TOF facility in the energy region from 1 eV to 700 keV

. Phys. Rev. C 95, 034604 (2017). https://doi.org/10.1103/PhysRevC.95.034604
Baidu ScholarGoogle Scholar
34. V. Michalopoulou, A. Stamatopoulos, M. Diakaki et al.,

Measurement of the neutron-induced fission cross section of 230Th at the CERN n_TOF facility

. Phys. Rev. C 108, 014616 (2023). https://doi.org/10.1103/PhysRevC.108.014616
Baidu ScholarGoogle Scholar
35. P. Žugec,

User guide through Resolution Function class. (n_TOF-PUB-2025-001, 2025)

, http://cds.cern.ch/record/2926718. Accessed 14 March 2025
Baidu ScholarGoogle Scholar
36. J. W. Cooley, J. W. Tukey,

An algorithm for the machine calculation of complex Fourier series

. Math. Comput. 19, 297-301 (1965). https://doi.org/10.1090/S0025-5718-1965-0178586-1
Baidu ScholarGoogle Scholar
37. W. H. Press, S. A. Teukolsky, W. T. Vetterling, B. P. Flannery, Numerical Recipes in C: The Art of Scientific Computing, 3rd edn. (Cambridge University Press, Cambridge New York Melbourne Madrid Cape Town Singapore São Paulo, 2007), pp. 132-133, 608-620
Footnote

The online version contains supplementary material available at https://doi.org/10.1007/s41365-025-01820-2.