CORSIKA modifications for faster background generation

CORSIKA is a simulation program for extensive air showers initiated by high energy cosmic particles. These air showers create the majority of the muons and neutrinos which neutrino that telescopes detect and are considered a background signature in searches for astrophysical neutrinos. This contribution will discuss changes to CORSIKA which allow for faster high energy background simulation. The theory, implementation, application, and performance of these modifications will be presented.


Introduction
When estimating the background from air showers present in neutrino telescopes it is necessary to use simulations.Often the air shower simulation CORSIKA [1] is used.To accurately model the final products of an air shower, CORSIKA must track every interaction, decay, and particle present in these fabricated air showers.Since the number of secondary particles increases with energy this leads to a computation time which rises with the energy of the initial incident particle.The computation time required increases even more if rare showers are required, such as in [2].
In the specific case of [2] high energy neutrinos with no accompanying muons were the focus of study.Because neutrinos and muons are largely the decay products of secondary particles in air showers, they tend to be produced one power steeper than the cosmic ray spectrum.This makes obtaining statistics for high energy neutrinos difficult because showers which could produce a relevant neutrino often do not.Herein however, also lies an advantage.Since these neutrinos are the byproduct of secondary hadronic particles, the maximum neutrino energy obtainable in a given shower is limited by the highest energy hadronic particle.Thus, if, at any point in shower development no hadron or neutrino above an energy of interest exists, then the shower being simulated is not relevant.Such showers do not need to be simulated to completion.

Modifications
When CORSIKA was developed in 1985 it was designed to handle primaries of all energies on contemporary systems.This meant keeping the memory footprint low was important.As such, a last in first out (LIFO) buffer was implemented.In this configuration, after the initial secondaries were produced, the most recently generated secondary was simulated next.Since new particles are always a e-mail: kjero@icecube.wisc.eduThis is an Open Access article distributed under the terms of the Creative Commons Attribution License 4.0, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
EPJ Web of Conferences placed at the front of the buffer, the most recently generated child was simulated next.This process continues repeatedly until no new particles are added to the buffer after the simulation of an existing particle.At this point, a sibling of the previously simulated particle is simulated.Again, the generation of children repeats until no new particles are created.This process repeats until the shower completes.Effectively what is happening is the complete simulation of one branch of the shower before another begins.This completes the shower in a depth-first manner.However, this type of shower development is not optimal for searching for the highest energy hadron since most energetic hadron could not be simulated until nearly the end of the simulation of the shower.
Another option that exists for memory management is the first in first out (FIFO) buffer.In such a configuration, after the direct secondaries are generated, the first direct secondary would be simulated and its children placed at the end of the buffer.This continues until all the direct secondaries have been simulated.At this point the children of the direct secondaries, which are now at the front of the buffer, would be simulated and their children would be placed at the end of the buffer.This process would continue until all particles in the buffer have been simulated.A shower simulated in this way is propagated breadth-first and keeps particles in the buffer which are roughly the same number of decays/interactions after the primary particle.While this type of shower development requires more memory than a LIFO to complete the same task, it is near optimal for searching for the highest energy hadron.This is because every particle is kept at the same stage of shower development.Further, high energy neutrinos appear soon after the initial interaction since it is difficult for hadrons to keep large amounts of energy through decays/interactions.
The only way to make the process of finding these neutrinos faster is to first simulate the hadrons which can create a neutrino above threshold.This can be done simply by operating the buffer as a dual ended insert and single ended removal buffer, making it a hybrid between the FIFO and LIFO.By putting particles which are above threshold at the front of the buffer and particles which are below threshold at the end of the buffer the relevant hadrons are inspected first while the rest of the shower is held.If a neutrino above threshold is produced, then the full shower can be completed.In this way only the necessary computations are completed to find out if the shower is relevant or not.
A version of CORSIKA with the implementation of the hybrid buffer and a threshold energy was the final outcome of the modifications.The threshold works by stopping showers and starting the next if no particles are above the energy threshold are in the buffer and no neutrino above threshold has been created.Showers which are stopped save the primary particles information to the output file, while fully propagated showers appear as normal output.This modification has been submitted to and accepted by the CORSIKA maintainers.It will appear in the next major release of CORSIKA.

Performance
By stopping showers once they have crossed a threshold energy for neutrino production and saving their full output only if they posses a relevant neutrino we improve the run time and file size requirements of our simulation.Since the reduction truncates events and does not change the underlying algorithms, the savings are proportional to the amount of truncation achieved.This can be seen in Fig. 1 on top of a minimum floor value.

Applications
This modification was first used to obtain statistics at high neutrino energy for [2].Here, a dataset of showers with neutrinos above 100 TeV allowed a model fit of suppressed atmospheric neutrino sources as well as a confirmation of the conventional atmospheric neutrino veto.
One detail about neutrino vetos that was not in the scope of [2] is the question of what primaries create neutrinos which are not accompanied by enough muon energy at depth to consider them vetoed.
Very Large Volume Neutrino Telescope (VLVnT-2015) Figure 1.The file size (left) and run time (right) as a function of the fraction of events above a threshold energy.Both show a linear dependence with an increasing fraction of events on top of a minimum floor value to run and save basic information when no events meet the criterion.

Figure 2.
The cumulative response(solid) and passing fraction(dashed) of 50 to 55 TeV neutrinos from various primaries are presented for two different zenith bands, 1<Cos( )<.8 (left) and .8<Cos()<.6 (right).The cumulative response shows how much a given primary type and energy contributes to the flux of neutrinos between 50 and 55 TeV in the zenith band.The passing fraction shows how often a shower of a given type and energy contributes has a neutrino between 50 and 55 TeV in the zenith band but less than 1 TeV of muons at the depth of IceCube.The largest contribution to the passing fraction always comes from primaries near the neutrino energy.This question is particularly relevant for surface vetos of neutrinos since it gives the relevant energy of primaries one must be able to reliably detect at the surface to reject the background of atmospheric neutrinos [3,4].To do this requires a connection between a neutrino and its parent primary, thus the question must be answered using Monte Carlo.Using the modification, a simulation sample was produced with a neutrino energy threshold of 50 TeV and the SIBYLL 2.1 interaction model [4].From this data, the cumulative response to a given neutrino energy from possible parent primary types and energies was calculated assuming the composition model of [5] and is shown in the plots of Fig. 2.
These plots show that most of the contribution to neutrinos from 50-55 TeV comes from hydrogen primaries between 1-2 PeV.Additionally plotted is the fraction of neutrinos which have less than 300 GeV of accompanying muons (the passing fraction).For nearly vertical events, the largest contribution comes from neutrinos which take nearly all their parent's energy.As the zenith angle increases the muon energy decreases due to increased overburden leading to more events from higher energy primaries contributing to the passing fraction.
Another interesting potential use for these simulations is to determine the significance of events with a contained vertex from IceCube's high energy starting event search [6].In the most recently released starting event data [7] a very vertical muon neutrino was found.This event starts after passing through 02003-p.3EPJ Web of Conferences more than 10 layers of DOMs and deposits 400 TeV of energy in the detector.Because of energy and zenith only charmed decays could potentially produce this event.Producing a target simulation with the modification and the DPMJET II.5 [8] hadronic model a background of one event per 391 years was found to be accompanied by a muon bundle with less than 300 GeV of total energy.This gives the event a conservative estimate of a 3 deviation from background since DPMJET II.5 is known to exceed the limits on charmed atmospheric muons and neutrinos [9,10].

Conclusion
Modifications to CORSIKA's memory management were made which make "breadth-first" shower propagation possible.With this it is possible to stop showers when particles in the shower have dropped below a threshold energy.In the case of this modification neutrinos were the focus, and a neutrino energy threshold was also implemented.The modified code will be available for use in the next public release of CORSIKA.Already this modification has assisted in determining the significance of a starting event from IceCube's high energy starting event sample and can play a role in determining the backgrounds for a possible surface veto above IceCube.