Detector simulations

Common HiSPARC station response simulations

These are some common simulations for HiSPARC detectors.

class sapphire.simulations.detector.HiSPARCSimulation(*args, **kwargs)
simulate_and_store_offsets()

Simulate and store station and detector offsets

classmethod simulate_detector_offsets(n_detectors)

Get multiple detector offsets

Parameters:

n_detectors – number of offsets to return.

Returns:

list of detector timing offsets in ns.

classmethod simulate_detector_offset()

Simulate time offsets between detectors in one station

This offset should be fixed for each detector for a simulation run.

Returns:

detector timing offset in ns.

classmethod simulate_station_offset()

Simulate time offsets between different stations

This offset should be fixed for each station for a simulation run. The actual distribution is not yet very clear. We assume it is gaussian for convenience. Then the stddev is about 16 ns.

Returns:

station timing offset in ns.

classmethod simulate_gps_uncertainty()

Simulate uncertainty from GPS receiver

classmethod simulate_adc_sampling(t)

Simulate ADC time binning due to the sampling frequency

Parameters:

t – time to be binned.

Returns:

time ceiled in 2.5 ns base.

classmethod simulate_signal_transport_time(n=1)

Simulate transport times of scintillation light to the PMT

Generates random transit times within a given distribution and adds it to the times the particles passed the detector.

Distribution based on Fokkema2012 sec 4.2, figure 4.3

Be careful when editting this function, be sure to check both the single and vectorized part.

Parameters:

n – number of times to simulate

Returns:

list of signal transport times

classmethod simulate_detector_mips(n, theta)

Simulate the detector signal for particles

Simulation of convoluted distribution of electron and muon energy losses with the scintillator response

The detector response (energy loss and detector efficiency) is derived in Montanus2014.

The energy loss is taken from the Bethe-Bloch equation. The detector response is statistically modelled. The effect of particle angle of incidence is accounted for. The resulting probability distribution is used below.

The statistics can be simulated by taking a random number y between 0 and 1, and convert it to a signal s in MIP using the probablity distribution.

Montanus2014: J.C.M. Montanus, The Landau distribution,

Internal note (Nikhef), 22 may 2014

Be careful when editting this function, be sure to check both the single and vectorized part.

Parameters:
  • n – number of particles.

  • theta – angle of incidence of the particles. Either a single value valid for all particles, or an array with an angle for each particle.

Returns:

signal strength in number of mips.

classmethod generate_core_position(r_max)

Generate a random core position within a circle

DF: This is the fastest implementation I could come up with. I timed several permutations of numpy / math, and tried a Monte Carlo method in which I pick x and y in a square (fast) and then determine if they fall inside a circle or not (surprisingly slow, because of an if-statement, and despite some optimizations suggested by HM).

Parameters:

r – Maximum core distance, in meters.

Returns:

Random x, y position in the disc with radius r_max.

classmethod generate_zenith(min=0, max=1.0471975511965976)

Generate a random zenith

Generate a random zenith for a uniform distribution on a sphere. For a random position on a sphere the zenith should not be chosen from a uniform [0, pi/2] distribution.

Source: http://mathworld.wolfram.com/SpherePointPicking.html

This fuction does not account for attenuation due to the extra path length, nor for the reduced effective surface of the detectors due to the angle. CORSIKA simulated showers already contain the atmospheric attenuation and precise positions for each particle.

Parameters:

min,max – minimum and maximum zenith angles, in radians.

Returns:

random zenith position on a sphere, in radians.

classmethod generate_attenuated_zenith()

Generate a random zenith

Pick from the expected zenith distribution.

There is a difference between expected shower zeniths detected on the ground and at the top of the atmosphere. This distribution takes the attenuation of air showers due to the extra path length in the atmosphere into account.

Returns:

random zenith angle, in radians.

classmethod inverse_zenith_probability(p)

Inverse cumulative probability distribution for zenith

Derrived from Schultheiss “The acceptancy of the HiSPARC Network”, (internal note), eq 2.4 from Rossi.

Parameters:

p – probability value between 0 and 1.

Returns:

zenith with corresponding cumulative probability, in radians.

classmethod generate_azimuth()

Generate a random azimuth

Showers from each azimuth have equal probability

Returns:

shower azimuth angle, in radians.

classmethod generate_energy(e_min=100000000000000.0, e_max=1e+21, alpha=-2.75)

Generate a random shower energy

Source: http://mathworld.wolfram.com/RandomNumber.html

Simple approximation of the cosmic-ray energy spectrum. Showers with higher energy occur less often, following a power law.

Parameters:
  • e_min,e_max – Energy bounds for the distribution (in eV).

  • alpha – Steepness of the power law distribution.

Returns:

primary particle energy, in eV.

class sapphire.simulations.detector.ErrorlessSimulation(*args, **kwargs)
classmethod simulate_detector_offsets(n_detectors)

Get multiple detector offsets

Parameters:

n_detectors – number of offsets to return.

Returns:

list of detector timing offsets in ns.

classmethod simulate_detector_offset()

Simulate time offsets between detectors in one station

This offset should be fixed for each detector for a simulation run.

Returns:

detector timing offset in ns.

classmethod simulate_station_offset()

Simulate time offsets between different stations

This offset should be fixed for each station for a simulation run. The actual distribution is not yet very clear. We assume it is gaussian for convenience. Then the stddev is about 16 ns.

Returns:

station timing offset in ns.

classmethod simulate_gps_uncertainty()

Simulate uncertainty from GPS receiver

classmethod simulate_adc_sampling(t)

Simulate ADC time binning due to the sampling frequency

Parameters:

t – time to be binned.

Returns:

time ceiled in 2.5 ns base.

classmethod simulate_signal_transport_time(n=1)

Simulate transport times of scintillation light to the PMT

Generates random transit times within a given distribution and adds it to the times the particles passed the detector.

Distribution based on Fokkema2012 sec 4.2, figure 4.3

Be careful when editting this function, be sure to check both the single and vectorized part.

Parameters:

n – number of times to simulate

Returns:

list of signal transport times

classmethod simulate_detector_mips(n, theta)

Simulate the detector signal for particles

Simulation of convoluted distribution of electron and muon energy losses with the scintillator response

The detector response (energy loss and detector efficiency) is derived in Montanus2014.

The energy loss is taken from the Bethe-Bloch equation. The detector response is statistically modelled. The effect of particle angle of incidence is accounted for. The resulting probability distribution is used below.

The statistics can be simulated by taking a random number y between 0 and 1, and convert it to a signal s in MIP using the probablity distribution.

Montanus2014: J.C.M. Montanus, The Landau distribution,

Internal note (Nikhef), 22 may 2014

Be careful when editting this function, be sure to check both the single and vectorized part.

Parameters:
  • n – number of particles.

  • theta – angle of incidence of the particles. Either a single value valid for all particles, or an array with an angle for each particle.

Returns:

signal strength in number of mips.