A Computing and Detector Simulation Framework for the HIBEAM/NNBAR Experimental Program at the ESS

The HIBEAM/NNBAR program is a proposed two-stage experiment at the European Spallation Source focusing on searches for baryon number violation via processes in which neutrons convert to antineutrons. This paper outlines the computing and detector simulation framework for the HIBEAM/NNBAR program. The simulation is based on predictions of neutron flux and neutronics together with signal and background generation. A range of diverse simulation packages are incorporated, including Monte Carlo transport codes, neutron ray-tracing simulation packages, and detector simulation software. The common simulation package in which these elements are interfaced together is discussed. Data management plans and triggers are also described.


Introduction
The HIBEAM/NNBAR program [1] for the European Spallation Source (ESS) is a future sequence of experiments to search for beyond Standard Model (BSM) physics appearing as baryon number violation (BNV).The primary goal of the experiment is to look for free neutron-antineutron transformations (n → n) 1 .It is a two-stage program, the first stage being that of HIBEAM, which plans to utilize a fundamental physics beamline, ANNI [2], soon after ESS commissioning and without full beam power.A high precision phase would follow with a dedicated high-flux beamline at the already appropriated Large Beam Port.The HIBEAM/NNBAR experiment has an active collaboration [1], and is currently focused on research for a Conceptual Design Report (CDR) to be published by the end of 2023 as a part of a EU Horizon2020 infrastructure design program [3].The HIBEAM/NNBAR program will ultimately give a sensitivity increase of three orders of magnitude compared with previous neutron transformation searches [1,4,5].
The HIBEAM/NNBAR experimental program is particularly interesting from a computational and simulation perspective as it is a cross-disciplinary experiment with a diverse membership.For example, the collaboration encompasses physicists from both the high-energy hadron collider and low-energy nuclear physics experiments, as well as scientists specializing in neutronics and magnetics.As such, synergies between the communities are continuing to foster solutions to technical problems, including in the computing area, focused upon the common goal of discovering physics beyond the Standard Model via the observation of neutron conversions.
Presently under construction in Lund, Sweden, the ESS is a next-generation high-flux spallation neutron source.The spallation source of the ESS will emit relatively long 2.8 ms neutron pulses with an integrated flux which will greatly exceed that of current facilities once commissioned to its full planned operating power of 5 MW.The neutron flux on target for the initial HIBEAM stage at an inaugural power of ∼ 2 MW is expected to be ∼ 10 11 n/s [1,2] soon after commissioning, and the ESS is foreseen to achieve a flux around two orders of magnitude larger for the second stage NNBAR experiment by virtue of the purpose-built Large Beamport which encompasses an opening angle near that of three nominal beamports [1,6].
This paper is organized as follows.Section 2 describes the expected rates of signal and background processes.Section 3 then gives an overview of the simulation chain, describing the various component programs.Following this, Section 4 outlines the neutron focusing planned for the experiment and simulation thereof.Section 5 describes the simulation of the signal and background processes.Section 6 describes the MCPL simulation format [7] which is used in this work but is not well known in the high energy physics (HEP) community.Section 7 outlines the planned detector for the measurement of the signal annihilation process together with its simulation.Section 8 then outlines trigger strategy.Section 9 then describes the data management plan for the work.This is followed by a short summary of the paper.Finally, an Appendix is provided which gives an overview of the various component software packages used in the HIBEAM/NNBAR simulation framework.
As the HIBEAM/NNBAR program is searching for a rare process, the average data taking trigger rate is mainly driven by natural and neutron beam-generated backgrounds.The target foil material will likely be carbon, a choice driven by its low neutron capture cross section within the expected cold neutron velocity range of the experimental program (averaging to ∼ 1000 m/s for the HIBEAM/ANNI beamline [2]).Given the high neutron fluxes reaching the target of the experiments, one still expects around 10 5 and 10 7 photons/s from neutron capture for HIBEAM and NNBAR, respectively.Such rates are quite manageable for a modern trigger system, but it can provide high counting rates within sub-detector elements, and can be a potential source of background to the signal in random coincidence with fast neutrons released during the spallation process, along with cosmic rays.Cosmic ray events were the dominant backgrounds for all previous free neutron transformation experiments [4,5], alone accounting for the 3 Hz trigger rate, with 2.7 Hz coming from cosmic ray muons which evaded the veto (an efficiency of ∼ 99.5%), and 0.3 Hz due to neutral cosmic rays.Alongside the signal process, all of these components are key simulation and computation drivers within the HIBEAM/NNBAR program.

Simulation chain
In order to simulate the final expected n → n signature in the annihilation detector, a consistent and connected chain of different simulations codes must be implemented.
A graphical overview of the chain can be seen in the work-flow shown in Fig. 1, with details given in Sections 4 and 5.An overview of the programs is also given in the Appendix.
The chain consists of a number of components, each corresponding to separable aspects of the beamline.The chain begins with the simulation of the ESS' neutron source, following which the reflection and focusing of neutrons must be modelled prior to the simulation of the gravitational propagation of neutrons along a vacuum tube.A detector to observe nN annihilations 2 , which give a multi-pion final state, must also be simulated, as must this and other interactions on the carbon foil which the detector encloses.Cosmic rays are an external background which require estimation with a dedicated program.Energy and tracking reconstruction software are being developed by the HIBEAM/NNBAR collaboration.The simulation allows the quantification of the experiment's sensitivity to different assumed values of the n → n oscillation time.

Neutronics and neutronics simulations
Neutron source simulation studies for NNBAR are performed via the radiation transport code MCNP6 [10] and currently focus on the optimization of the neutron intensity of the source, useful both to the standard mission of the ESS as well as the HIBEAM/NNBAR program.A geometric description of the ESS target and moderator system with the baseline concept for the high-intensity liquid deuterium moderator as implemented within MCNP6 can be seen in cross section in Fig. 2. Several moderator designs and configurations are currently being tested in order to provide the highest possible flux; this is a key output of the Horizon2020 HighNESS program [3].The source yields from MCNP6 are then fed into the neutron raytracing code McStas [11], thus allowing one to simulate and optimize the performance of various reflector geometries.The interface between the MCNP6 simulation and McStas is obtained via MCPL, a binary format which lists particle state (neutron trajectory) information and allows for interchanging of trajectories, particles, or entire events across various Monte

Simulation of signal and background processes
The characteristic semi-spherical topology generated from an nA annihilation following extranuclear n → n can retain up to ∼ 1.88 GeV of total invariant mass and a rather low total momentum (up to the Fermi momentum) across an average of 4-5 pions expected to be emitted from an event [8,9].With the presence of final state interactions (nuclear rescattering and absorption processes taking place during the intranuclear cascade), these can become much fuzzier in reality; see [9] for a detailed discussion.The simulation of this signal is a crucial first step in establishing the detector geometry and material requirements in order that one may reconstruct such an event above any background levels, enabling a definitive discovery.Thus, one must understand the effects of both high and low multiplicities, the tracking efficiency of charged pions, the reconstruction of quickly decaying neutral pions, and the possibility of tracking light, highly ionizing nuclear remnants such as protons or deuterons.
The simulation used by the HIBEAM/NNBAR collaboration for these studies was developed over decades [15], culminating in recent work [8,9].Antineutron annihilation data is rather difficult to come by; see [16] for a rather robust review of available data.Only a small portion of all possible nN annihilation channels have been measured; therefore, the initial nN annihilation branching fractions are taken from experimentally measured channels from available nN and (charge-conjugated) pN data; for some, connected channels were inferred via isotopic relations, while the rest were taken from a statistical S U(3) model [8].The model for NA interaction was systematically tested on available pA data, largely from LEAR and other antimatter experiments [8].Thus, one may now simulate extranuclear and intranuclear nA annihilations resulting from an n → n process for a free or bound neutron.
The simulation uses proprietary Monte Carlo code and Fortran libraries.In principle, with foreknowledge of the radial dependence of the annihilation near the surface of the nucleus [17], such events may be simulated for any nucleus, though validation as well as data or model signal comparisons have only been considered for a few species, such as 12 C [8] (useful for HIBEAM/NNBAR) and 40 Ar [9] (useful in DUNE [18]).This is possible given the universal microscopic nA annihilation dynamics taken into account within the simulation.The event record can be easily reformatted for consistent integration with a GEANT4 simulation using MCPL (see Section 6); universal PDG Monte Carlo particle codes have been adopted [19].As a cross check, independent analysis comparisons between original signal files and reformatted MCPL event files show identical behavior.Event samples of ∼100,000 events or more are available or can be rather quickly produced upon reasonable request from the authors of [8,9].
There are different sources of backgrounds which must similarly be simulated, eventually accounting for any of their malicious effects on n → n signal efficiency.Depending on the background source, the simulation's methodology can vary: • A spallation-generated background, composed of charged and neutral particles, emanates directly from the ESS target.As explained in Section 4, such simulations must make use of Monte Carlo radiation transport codes like MCNP6 or PHITS since the particles need to be transported over a long distance; to avoid untenably large amounts of processing, such codes also maintain several variance reductions features which can aid in the propagation of particles in the absence of high statistics.• The gamma background due to interaction of the cold neutron beam with the annihilation target (see Section 7).Such backgrounds have been simulated with PHITS but do not require any kind of variance reduction.• The cosmic background due to charged and neutral cosmic rays can be simulated with the CRY software library [20] (see Section 7).

Utilizing MCPL
The use of MCPL as the common format for interfacing between different simulation codes deserves a special mention since it is not so well-known within the HEP) community.In the case of the HIBEAM/NNBAR experimental program, one of the main advantages MCPL provides is an easy way to interface neutron transport codes' results obtained in PHITS, MCNP6, or neutron optics simulations performed with the neutron ray-tracing code McStas [11].It is equally simple to convert proprietary code results to an MCPL format via the use of simple loops and functions, most of which are directly provided within the MCPL documentation.MCPL can, therefore, be used to interface a large variety of codes, including many general purpose Monte Carlo simulation codes commonly used throughout HEP.Though arguably not necessary, having various codes and their output interfaced across a practically universal software tool is both pragmatic and efficient.

Detector components and simulation
The simulation needs for the HIBEAM/NNBAR program are mostly driven by the reconstruction of the annihilation event in a detector, as well as computing of topological, kinematic, and timing characteristics of any backgrounds for their comparative rejection; neutron optics (for instance, the reflection of neutrons downbeam from reflective ellipsoidal mirrors), as well as magnetic and radiation shielding along the beamline, are also major contributors to the overall computational scheme.Detector design is guided by the need for a high signal efficiency for antineutron detection via a high multiplicity pion reconstruction, along with the ability to maintain a low background yield.The main detector components are: • An annihilation target, likely a 100 µm thick carbon disk, with a 1 m diameter for the initial HIBEAM stage, and 2 m diameter for the full NNBAR second stage.• A charged particle tracker, necessary for the determination of pion momenta and the annihilation vertex.• A calorimeter for photon and pion energy measurement.The current baseline proposal is a hybrid design, with the innermost part composed of multiple layers of plastic scintillator staves for measuring the energy of soft hadrons, behind which lies a layer of lead glass counters to measure the energy deposited by charged particles via Cherenkov radiation.The novel design is in response to the challenging energy range.It is possible the energy resolution in traditional sampling calorimeters commonly used in high energy physics experiments would be too poor due to statistical fluctuations in energy deposits.A simulation of a sandwich calorimeter with alternating sheets of lead and scintillator with thicknesses optimized for hadrons and photons with energies below 500 MeV will be used to benchmark the proposed baseline design.
• A selective trigger system to gather signal and signal-like background candidate events.
• A cosmic ray background veto system.
In order to simulate annihilation signal events in the detector, along with any background sources, a coherent software chain was developed for the HIBEAM/NNBAR program.Expanding on the flowchart of Figs.1: 1. Signal events are provided by the authors of Ref. [8,9] and converted into a MCPLcompatible text format [7].
2. The MCPL events are then interfaced with the NNBAR GEANT4 detector simulation.
3. The neutron beam, which is used as the source in PHITS [21], is simulated in McStas.For HIBEAM, the ANNI beam simulation is provided by the authors of Ref. [2] and interfaced with PHITS via MCPL.It should be noted that this versatility allows for any other Monte Carlo transport code to be used, including MCNP6 [10].
4. Prompt gamma emission from neutron capture processes with a 12 C target are simulated with PHITS and also interfaced with the GEANT4 detector via MCPL.
5. Cosmic ray events are interfaced with the detector simulation directly using the CRY [20] library, but externally produced cosmic ray sources may also be used, including those of real measured data.
The energy ranges of the physical processes involved in n → n are far below the typical energy ranges of a high energy collider experiment, but the readout systems are expected to be typical of a high energy experiment.Furthermore, external tracking is planned to be accomplished via a Time Projection Chamber (TPC), while internal tracking is planned to be carried out with silicon strips (though this is still under investigation).Given these, GEANT4 appears as natural choice for detector simulation, material inquiry, geometric testing, and optimization.
Fig. 3 shows an event display of a n12 C annihilation signal within GEANT4, as provided by the authors of Ref. [8,9].The interaction of annihilation-generated particles with the lead glass blocks of a box detector, shown on the outer edges in purple, are due to Cherenkov light production, wherein a neutral pion is visible through its decay products (two γs).A nuclear fragment ( 11 C) is also shown in the event, but does not have enough kinetic energy to leave any visible signal within the lead glass.The detector design is merely illustrative -other detector designs are being considered by the collaboration, each attempting to study potential optimizations for signal efficiency, cost, ease of construction and modularity, serviceability and maintenance, as well as long-term replacement of components.

Trigger
A two-level trigger is planned for the the second stage full NNBAR experiment.The first level will be hardware based, with self-triggered readout of individual calorimeter and cosmic veto sensors when they detect a particle hit.The readout of each channel will include a global time stamp along with several digitized samples of the shaped analog pulses, allowing both the pulse amplitude and timing to be reconstructed (the latter to ns-level precision).
The second level of the trigger will be implemented off-detector in a CPU farm that will receive the time-stamped readout of the hardware trigger, identify event candidates, and select the corresponding TPC data frames for further event reconstruction and storage.
Precise global timing measurements are expected to be one of the main tools for event reconstruction, signal event selection, and background rejection.Important timing applications will include: 1. Setting short coincidence windows for multiple pion hits with the same origin.
2. Estimating hit positions in the long scintillator staves from the timing of pulses at opposite ends.
3. Hit coincidences to accurately match event data from different subdetectors, for instance, the scintillator and the lead glass calorimeter layers.
4. Cosmic background rejection using time-of-flight measurements from calorimeter and veto data, to reject particle tracks originating outside the inner detector volume.
5. TPC frame selection for matching recorded tracks to calorimeter hits, using the precise calorimeter timing measurements.
Pulse shaping and digitization of the calorimeter and veto front-end electronics are foreseen to be implemented with commercial amplifier and ADC devices, along with programmable logic devices (FPGAs) to provide the digital timing, and self-triggered readout to the off-detector systems.All on-detector components will need to be radiation qualified for the expected particle fluences over the lifetime of the experiment.
By reading out only self-triggered calorimeter and veto channels, the required readout bandwidth for these subdetectors is expected to be relatively modest.This may allow the use of a commercial network switch for connecting the front-end readout with the off-detector processor farm, with PMT samples and timestamp data encoded in compatible network packet formats.

Data Management
The NNBAR experiment plans to make use of the open-source distributed data management system Rucio [22], originally developed for the ATLAS experiment at CERN.Rucio facilitates data storage, management, and processing in a heterogeneous distributed environment.This will be particularly important for the second stage NNBAR experiment, as the scientific data of the experiment is to be shared between the participating institutes3 .Moreover, there is plenty of experience within the NNBAR collaboration using Rucio, given that several members of NNBAR are either active or former members of ATLAS, including both co-spokespersons.

Summary
The HIBEAM/NNBAR experiment is an active experimental program for the European Spallation Source to search for baryon number violation via free neutron-antineutron transformations.The program is currently focused on a series of simulations that will make up a critical part of its CDR that will be delivered by the end of 2023.The full simulation chain is dependent on different components which come together under a consistent framework, which has been described in this paper.

Figure 1 :
Figure 1: Top: A schematic view of the overall design of the NNBAR experiment, also informative for any BNV searches during the initial HIBEAM stage.Bottom: A HI-BEAM/NNBAR simulation flowchart; for the ESS NNBAR Large Beam Port source, the moderator is simulated and optimized with MCNP6.All MCNP6 simulation results are passed to McStas with MCPL (see Section 6).

Figure 2 :
Figure 2: Conceptual design of the neutron source for the NNBAR experiment at the Large Beam Port.A large liquid deuterium moderator (blue) is placed below the tungsten spallation target (red), and is surrounded by a beryllium reflector (light blue).This design is the first concept for the source, and is presently under study as part of the HighNESS project.

Figure 3 :
Figure 3: An event display using GEANT4 of a nn annihilation process within a 12 C nucleus in a target foil surrounded by an annihilation detector, as modelled with GEANT4.Front (left) and side (centre) views are shown.The truth-level particle identities and kinematic energies of the outgoing annihilation products are given in the box to the right.