NuRadioMC.utilities.inelasticities module
- NuRadioMC.utilities.inelasticities.get_neutrino_inelasticity(n_events, rnd=None)[source]
Standard inelasticity for deep inelastic scattering used so far. Ported from ShelfMC
- Parameters:
- n_events: int
Number of events to be returned
- rnd: random generator object
if None is provided, a new default random generator object is initialized
- Returns
- ——-
- inelasticies: array
Array with the inelasticities
- NuRadioMC.utilities.inelasticities.get_ccnc(n_events, rnd=None)[source]
Get the nature of the interaction current: cc or nc Ported from Shelf MC
- Parameters:
- n_events: int
Number of events to be returned
- rnd: random generator object
if None is provided, a new default random generator object is initialized
- Returns:
- ccnc: array
Array with ‘cc’ or ‘nc’
- NuRadioMC.utilities.inelasticities.random_tau_branch(rnd=None)[source]
Calculates a random tau branch decay See http://dx.doi.org/10.1016/j.cpc.2013.04.001
- rnd: random generator object
if None is provided, a new default random generator object is initialized
- Returns:
- branch: string
The corresponding decay branch
- NuRadioMC.utilities.inelasticities.inelasticity_tau_decay(tau_energy, branch, rnd=None)[source]
Returns the hadronic or electromagnetic inelasticity for the tau decay See http://dx.doi.org/10.1016/j.cpc.2013.04.001 and https://arxiv.org/pdf/1607.00193.pdf
- Parameters:
- tau_energy: float
Tau energy at the moment of decay
- branch: string
Type of tau decay: ‘tau_mu’, ‘tau_e’, ‘tau_had’
- rnd: random generator object
if None is provided, a new default random generator object is initialized
- Returns:
- inelasticity: float
The fraction of energy carried by the leptonic or hadronic products
- NuRadioMC.utilities.inelasticities.rejection_sampling(f, xmin, xmax, ymax, rnd=None)[source]
Draws a random number following a given distribution using a rejection sampling algorithm.
- Parameters:
- f: function
Random distribution
- xmin: float
Minimum value of the argument
- xmax: float
Maximum value of the argument
- ymax: float
Maximum function value to use for the rejection sample (e.g., the maximum of the function)
- rnd: random generator object
if None is provided, a new default random generator object is initialized
- Returns:
- x: float
Random value from the distribution