fennel package

Submodules

fennel.config module

class fennel.config.ConfigClass(*args, **kwargs)

Bases: dict

The configuration class. This is used by the package for all parameter settings. If something goes wrong its usually here.

Parameters

config (dic) – The config dictionary

Returns

Return type

None

from_dict(user_dict: Dict[Any, Any]) None

Creates a config from dictionary

Parameters

user_dict (dic) – The user dictionary

Returns

Return type

None

from_yaml(yaml_file: str) None

Update config with yaml file

Parameters

yaml_file (str) – path to yaml file

Returns

Return type

None

fennel.em_cascades module

class fennel.em_cascades.EM_Cascade

Bases: object

Constructs the em cascade object.

Parameters

None

Returns

Return type

None

_a_energy_fetch(E: float, name: int) numpy.array

Parametrizes the energy dependence of the a parameter for the longitudinal profiles. This is for a single energy.

Parameters
  • E (float) – The energy in GeV

  • name (int) – The particle of interest

Returns

a – The values for the energies of interest

Return type

np.array

Notes

The analytical form of the parametrization is:

\[\alpha + \beta log_{10}(E)\]
_a_energy_fetch_jax(E: float, name: int) float

Parametrizes the energy dependence of the a parameter for the longitudinal profiles. This is for a single energy.

Parameters
  • E (float) – The energy in GeV

  • name (int) – The particle of interest

Returns

a – The values for the energies of interest

Return type

float

Notes

The analytical form of the parametrization is:

\[\alpha + \beta log_{10}(E)\]
_b_energy_fetch(name: int) numpy.array

Parametrizes the energy dependence of the b parameter for the longitudinal profiles. Currently assumed to be constant. This is for a single energy.

Parameters

name (int) – The particle of interest

Returns

b – The values for the energies of interest

Return type

np.array

Notes

The analytical form of the parametrization is:

\[b = b\]
_b_energy_fetch_jax(name: int) float

Parametrizes the energy dependence of the b parameter for the longitudinal profiles. Currently assumed to be constant. This is for a single energy.

Parameters

particle (Particle) – The particle of interest

Returns

b – The values for the energies of interest

Return type

float

Notes

The analytical form of the parametrization is:

\[b = b\]
_log_profile_func_fetcher(E, z: numpy.array, name: int) numpy.array

Parametrization of the longitudinal profile for a single energy. This still needs work

Parameters
  • E (float/np.array) – The energy in GeV

  • z (np.array) – The cascade depth in cm

  • name (int) – The particle of interest

Returns

res – Is equal to l^(-1) * dl/dt. The result will be 2 dimensional, with cm defined along the first axis and energies along the second

Return type

np.array

Notes

The analytical form of the parametrization is:

\[b\times \frac{(tb)^{a-1}e^{-tb}}{\Gamma(a)}\]
_log_profile_func_fetcher_jax(E: float, z: float, name: int) float

Parametrization of the longitudinal profile for a single energy. This still needs work. JAX implementation

Parameters
  • E (float) – The energy in GeV

  • z (float) – The cascade depth in cm

  • name (int) – The particle of interest

Returns

res – Is equal to l^(-1) * dl/dt

Return type

float

Notes

The analytical form of the parametrization is:

\[b\times \frac{(tb)^{a-1}e^{-tb}}{\Gamma(a)}\]
_symmetric_angle_distro(phi: numpy.array, n: float, name: int) numpy.array

Calculates the symmetric angular distribution of the Cherenkov emission. The error should lie below 10%

Parameters
  • phi (np.array) – The angles of interest in degrees

  • n (float) – The refractive index

  • name (int) – The particle of interest

Returns

distro – The distribution of emitted photons given the angle

Return type

np.array

Notes

The analytical form of the parametrization is:

\[a e^{b (1/n - cos(\phi))^c} + d\]
_symmetric_angle_distro_jax(phi: float, n: float, name: int) float

Calculates the symmetric angular distribution of the Cherenkov emission. The error should lie below 10%

Parameters
  • phi (float) – The angles of interest in degrees

  • n (float) – The refractive index

  • name (int) – The particle of interest

Returns

distro – The distribution of emitted photons given the angle

Return type

float

Notes

The analytical form of the parametrization is:

\[a e^{b (1/n - cos(\phi))^c} + d\]
_track_lengths_fetcher(E, name: int)

Parametrization for the energy dependence of the tracks. This is the fetcher function for a single energy

Parameters
  • E (float/np.array) – The energy of interest

  • name (int) – The particle of interest

Returns

  • track_length (np.array) – The track lengths for different energies

  • track_length_dev (np.array) – The track lengths deviations for different energies

Notes

The analytical form of the parametrization is:

\[\alpha E^{\beta}\]
_track_lengths_fetcher_jax(E: float, name: int)

Parametrization for the energy dependence of the tracks. This is the fetcher function for a single energy. JAX implementation

Parameters
  • E (float) – The energy of interest

  • name (int) – The particle of interest

Returns

  • track_length (float) – The track lengths for different energies

  • track_length_dev (float) – The track lengths deviations for different energies

Notes

The analytical form of the parametrization is:

\[\alpha E^{\beta}\]

fennel.fennel module

class fennel.fennel.Fennel(userconfig=None)

Bases: object

class: Fennel Interace to the fennel package. This class stores all methods required to run the simulation of the particle light yields :param config: Configuration dictionary for the simulation :type config: dic

Returns

Return type

None

auto_yields(energy, particle: int, interaction='total', wavelengths=config['advanced']['wavelengths'], angle_grid=config['advanced']['angles'], n=config['mediums'][config['scenario']['medium']]['refractive index'], z_grid=config['advanced']['z grid'], function=False)

Auto fetcher function for a given particle and energy. This will fetch/evaluate the functions corresponding to the given particle. Some of the output will be none depending on the constructed object

Parameters
  • energy (float) – The energy(ies) of the particle in GeV

  • particle (int) – The pdg id of the particle of interest

  • wavelengths (np.array) – Optional: The desired wavelengths

  • interaction (str) – Optional: The interaction which should produce the light. This is used during track construction.

  • angle_grid (np.array) – Optional: The desired angles in degress

  • n (float) – Optional: The refractive index of the medium.

  • z_grid (np.array) – Optional: The grid in cm for the long. distributions. Used when modeling cascades.

  • function (bool) – Optional: returns the functional form instead of the evaluation

Returns

  • differential_counts (function/float/np.array) – dN/dlambda The differential photon counts per track length (in cm). The shape of the array is (len(wavelengths), len(deltaL)).

  • differential_counts_sample (float/np.array) – A sample of the differential counts distribution. Same shape as the differential counts

  • em_fraction_mean (float/np.array) – The fraction of em particles

  • em_fraction_sample (float/np.array) – A sample of the em_fraction

  • long_profile (function/float/np.array) – The distribution along the shower axis for cm

  • angles (function/float/np.array) – The angular distribution in degrees

close()

Wraps up the program

Parameters

None

Returns

Return type

None

definitions()

Write the definitions file

Parameters

None

Returns

Return type

None

em_yields(energy, particle: int, wavelengths=config['advanced']['wavelengths'], angle_grid=config['advanced']['angles'], n=config['mediums'][config['scenario']['medium']]['refractive index'], z_grid=config['advanced']['z grid'], function=False)

Fetcher function for a specific particle and energy. This is for em cascades.

Parameters
  • energy (float) – The energy(ies) of the particle in GeV

  • particle (int) – The pdg id of the particle of interest

  • wavelengths (np.array) – Optional: The desired wavelengths

  • angle_grid (np.array) – Optional: The desired angles in degress

  • n (float) – Optional: The refractive index of the medium.

  • z_grid (np.array) – Optional: The grid in cm for the long. distributions

  • function (bool) – Optional: returns the functional form instead of the evaluation

Returns

  • differential_counts (function/float/np.array) – dN/dlambda The differential photon counts per track length (in cm). The shape of the array is (len(wavelengths), len(deltaL)).

  • differential_counts_sample (float/np.array) – A sample of the differential counts distribution. Same shape as the differential counts

  • long_profile (function/float/np.array) – The distribution along the shower axis for cm

  • angles (function/float/np.array) – The angular distribution in degrees

hadron_yields(energy, particle: int, wavelengths=config['advanced']['wavelengths'], angle_grid=config['advanced']['angles'], n=config['mediums'][config['scenario']['medium']]['refractive index'], z_grid=config['advanced']['z grid'], function=False)

Fetcher function for a specific particle and energy. This is for hadron cascades.

Parameters
  • energy (float) – The energy(ies) of the particle in GeV

  • particle (int) – The pdg id of the particle of interest

  • wavelengths (np.array) – Optional: The desired wavelengths

  • angle_grid (np.array) – Optional: The desired angles in degress

  • n (float) – Optional: The refractive index of the medium.

  • z_grid (np.array) – Optional: The grid in cm for the long. distributions

  • function (bool) – Optional: returns the functional form instead of the evaluation

Returns

  • differential_counts (function/float/np.array) – dN/dlambda The differential photon counts per track length (in cm). The shape of the array is (len(wavelengths), len(deltaL)).

  • differential_counts_sample (float/np.array) – A sample of the differential counts distribution. Same shape as the differential counts

  • em_fraction_mean (float/np.array) – The fraction of em particles

  • em_fraction_sample (float/np.array) – A sample of the em_fraction

  • long_profile (function/float/np.array) – The distribution along the shower axis for cm

  • angles (function/float/np.array) – The angular distribution in degrees

hidden_function()

Yaha! You found me!

pars2csv()

Write the parameters to a csv file

Parameters

None

Returns

Return type

None

track_yields(energy: float, wavelengths=config['advanced']['wavelengths'], angle_grid=config['advanced']['angles'], n=config['mediums'][config['scenario']['medium']]['refractive index'], interaction='total', function=False)

Fetcher function for a specific energy and wavelength. This is for tracks and currently only for muons. Note in JAX mode the functions only take scalars!

Parameters
  • energy (float) – The energy(ies) of the particle in GeV

  • wavelengths (np.array) – Optional: The desired wavelengths

  • angle_grid (np.array) – Optional: The desired angles

  • n (float) – The refractive index of the medium.

  • interaction (str) – Optional: The interaction which should produce the light

  • function (bool) – returns the functional form instead of the evaluation

Returns

  • differential_counts (np.array/function) – dN/dlambda The differential photon counts per track length (in cm). The shape of the array is len(wavelengths).

  • angles (np.array/function) – The angular distribution in degrees

fennel.hadron_cascades module

class fennel.hadron_cascades.Hadron_Cascade

Bases: object

Constructs the hadron cascade object.

Parameters

None

Returns

Return type

None

_a_energy_fetcher(E: float, particle: int) numpy.array

Parametrizes the energy dependence of the a parameter for the longitudinal profiles

Parameters
  • E (float) – The energy of interest in GeV

  • particle (int) – The particle of interest

Returns

a – The values for the energies of interest

Return type

np.array

Notes

The analytical form of the parametrization is:

\[\alpha + \beta log_{10}(E)\]
_a_energy_fetcher_jax(E: float, particle: int) float

Parametrizes the energy dependence of the a parameter for the longitudinal profiles

Parameters
  • E (float) – The energy of interest in GeV

  • particle (Particle) – The particle of interest

Returns

a – The values for the energies of interest

Return type

float

Notes

The analytical form of the parametrization is:

\[\alpha + \beta log_{10}(E)\]
_b_energy_fetcher(particle: int) numpy.array

Parametrizes the energy dependence of the b parameter for the longitudinal profiles. Currently assumed to be constant

Parameters
  • E (float) – The energy of interest in GeV

  • particle (int) – The particle of interest

Returns

b – The values for the energies of interest

Return type

np.array

Notes

The analytical form of the parametrization is:

\[b = b\]
_b_energy_fetcher_jax(particle: int) int

Parametrizes the energy dependence of the b parameter for the longitudinal profiles. Currently assumed to be constant

Parameters

particle (int) – The particle of interest

Returns

b – The values for the energies of interest

Return type

int

Notes

The analytical form of the parametrization is:

\[b = b\]
_em_fraction_fetcher(E, particle: int)

Parametrization of the EM contribution in a hadronic shower

Parameters
  • E (float/np.array) – The energy of interest in GeV

  • particle (int) – The particle of interest

Returns

  • em_fraction (np.array) – The fraction for the given energies

  • em_fraction_sd (np.array) – The standard deviation

Notes

The analytical form of the parametrization is:

\[1 - (1 - f_0)\left(\frac{E}{E_s}\right)^{-m}\]
_em_fraction_fetcher_jax(E: float, particle: int)

Parametrization of the EM contribution in a hadronic shower

Parameters
  • E (float) – The energy of interest in GeV

  • particle (int) – The particle of interest

Returns

  • em_fraction (float) – The fraction for the given energies

  • em_fraction_sd (float) – The standard deviation

Notes

The analytical form of the parametrization is:

\[1 - (1 - f_0)\left(\frac{E}{E_s}\right)^{-m}\]
_energy_dependence_angle_pars(E, particle: int)

Parametrizes the energy dependence of the angular distribution parameters

Parameters
  • E (float/np.array) – The energy(ies) of interest

  • particle (Particle) – The particle of interest

Returns

  • a (np.array) – The first parameter values for the given energies

  • b (np.array) – The second parameter values for the given energies

  • c (np.array) – The third parameter values for the given energies

  • d (np.array) – The fourth parameter values for the given energies

Notes

The analytical form of the parametrization is:

\[par = par_0 log(E) par_1\]
_energy_dependence_angle_pars_jax(E: float, particle: int)

Parametrizes the energy dependence of the angular distribution parameters

Parameters
  • E (float) – The energy of interest

  • particle (iny) – The particle of interest

Returns

  • a (float) – The first parameter value for the given energy

  • b (float) – The second parameter value for the given energy

  • c (float) – The third parameter value for the given energy

  • d (float) – The fourth parameter value for the given energy

Notes

The analytical form of the parametrization is:

\[par = par_0 log(E) par_1\]
_log_profile_func_fetcher(E, z: numpy.array, particle: fennel.particle.Particle) numpy.array

Parametrization of the longitudinal profile. This still needs work

Parameters
  • E (float/np.array) – The energy of interest in GeV

  • z (np.array) – The cascade depth in cm

  • particle (Particle) – The particle of interest

Returns

res – Is equal to l^(-1) * dl/dt. The result will be 2 dimensional, with cm defined along the first axis and energies along the second

Return type

np.array

Notes

The analytical form of the parametrization is:

\[b\times \frac{(tb)^{a-1}e^{-tb}}{\Gamma(a)}\]
_log_profile_func_fetcher_jax(E: float, z: float, particle: int) float

Parametrization of the longitudinal profile. This still needs work

Parameters
  • E (float) – The energy of interest in GeV

  • z (float) – The cascade depth in cm

  • particle (int) – The particle of interest

Returns

res – Is equal to l^(-1) * dl/dt.

Return type

int

Notes

The analytical form of the parametrization is:

\[b\times \frac{(tb)^{a-1}e^{-tb}}{\Gamma(a)}\]
_muon_production_fetcher(Eprim, Emu, particle: fennel.particle.Particle)

Parametrizes the production of muons in hadronic cascades

Parameters
  • Eprim (float/np.array) – The energy(ies) of the primary particle

  • Emu (float/np.array) – The energy(ies) of the muons

  • particle (Particle) – The particle of interest

Returns

distro – The distribution/value of the produced muons

Return type

float/np.array

Notes

The analytical form of the parametrization is:

\[-\alpha + \beta\left(\frac{E}{GeV}\right)^{-\gamma}\]
_muon_production_fetcher_jax(Eprim: float, Emu: float, particle: int) float

Parametrizes the production of muons in hadronic cascades

Parameters
  • Eprim (float) – The energy of the primary particle

  • Emu (float) – The energy of the muons

  • particle (int) – The particle of interest

Returns

distro – The distribution/value of the produced muons

Return type

float

Notes

The analytical form of the parametrization is:

\[-\alpha + \beta\left(\frac{E}{GeV}\right)^{-\gamma}\]
_muon_production_pars(E, particle: fennel.particle.Particle)

Constructs the parametrization values for the energies of interest.

Parameters
  • E (float/np.array) – The energy(ies) of interest

  • particle (Particle) – The particle of interest

Returns

  • alpha (float/np.array) – The first parameter values for the given energies

  • beta (float/np.array) – The second parameter values for the given energies

  • gamma (float/np.array) – The third parameter values for the given energies

_muon_production_pars_jax(E: float, particle: int)

Constructs the parametrization values for the energies of interest.

Parameters
  • E (float) – The energy(ies) of interest

  • particle (int) – The particle of interest

Returns

  • alpha (float) – The first parameter values for the given energy

  • beta (float) – The second parameter values for the given energy

  • gamma (float) – The third parameter values for the given energy

_symmetric_angle_distro(E, phi: numpy.array, n: float, particle: fennel.particle.Particle) numpy.array

Calculates the symmetric angular distribution of the Cherenkov emission. The error should lie below 10%

Parameters
  • E (float/np.array) – The energy of interest in GeV

  • phi (np.array) – The angles of interest in degrees

  • n (float) – The refractive index

  • particle (Particle) – The particle of interest

Returns

distro – The distribution of emitted photons given the angle. The result is a 2d array with the first axis for the angles and the second for the energies.

Return type

np.array

Notes

The analytical form of the parametrization is:

\[a e^{b (1/n - cos(\phi))^c} + d\]
_symmetric_angle_distro_jax(E: float, phi: float, n: float, particle: int) float

Calculates the symmetric angular distribution of the Cherenkov emission. The error should lie below 10%

Parameters
  • E (float) – The energy of interest in GeV

  • phi (float) – The angles of interest in degrees

  • n (float) – The refractive index

  • particle (int) – The particle of interest

Returns

distro – The distribution of emitted photons given the angle. The result is a 2d array with the first axis for the angles and the second for the energies.

Return type

float

Notes

The analytical form of the parametrization is:

\[a e^{b (1/n - cos(\phi))^c} + d\]
_track_lengths_fetcher(E, particle: int)

Parametrization for the energy dependence of the tracks

Parameters
  • E (float/np.array) – The energy of interest in GeV

  • particle (int) – The particle of interest

Returns

  • track_length (np.array) – The track lengths for different energies

  • track_length_dev (np.array) – The track lengths deviations for different energies

Notes

The analytical form of the parametrization is:

\[\alpha E^{\beta}\]
_track_lengths_fetcher_jax(E: float, particle: int)

Parametrization for the energy dependence of the tracks

Parameters
  • E (float) – The energy of interest in GeV

  • particle (int) – The particle of interest

Returns

  • track_length (float) – The track lengths for different energies

  • track_length_dev (float) – The track lengths deviations for different energies

Notes

The analytical form of the parametrization is:

\[\alpha E^{\beta}\]

fennel.particle module

class fennel.particle.Particle(pdg_id: int)

Bases: object

Constructs the particle object.

Parameters

None

Returns

Return type

None

fennel.photons module

class fennel.photons.Photon(particle, track: fennel.tracks.Track, em_cascade: fennel.em_cascades.EM_Cascade, hadron_cascade: fennel.hadron_cascades.Hadron_Cascade)

Bases: object

Constructs the Photon object.

Parameters

None

Returns

Return type

None

_cherenkov_counts(wavelengths: numpy.array, track_length: float) numpy.array

Calculates the differential number of photons for the given wavelengths and track-lengths assuming a constant velocity with beta=1.

Parameters
  • wavelengths (np.array) – The wavelengths of interest

  • track_lengths (float) – The track lengths of interest in cm

Returns

counts – A array filled witht the produced photons.

Return type

np.array

_cherenkov_counts_jax(wavelengths: float, track_lengths: float) float

Calculates the differential number of photons for the given wavelengths and track-lengths assuming a constant velocity with beta=1.

Parameters
  • wavelengths (float) – The wavelengths of interest

  • track_lengths (float) – The track lengths of interest in cm

Returns

counts – The counts (differential)

Return type

float

_em_cascade_builder()

Builder function for a the cascade functions. This is for em cascades.

Returns

Return type

None

_em_cascade_fetcher(energy, particle: int, wavelengths=config['advanced']['wavelengths'], angle_grid=config['advanced']['angles'], n=config['mediums'][config['scenario']['medium']]['refractive index'], z_grid=config['advanced']['z grid'], function=False)
Fetcher function for a specific particle and energy. This is for

em cascades.

Parameters
energyfloat

The energy(ies) of the particle in GeV

particleint

The pdg id of the particle of interest

wavelengthsnp.array

Optional: The desired wavelengths

angle_gridnp.array

Optional: The desired angles in degress

nfloat

Optional: The refractive index of the medium.

z_gridnp.array

Optional: The grid in cm for the long. distributions

functionbool

Optional: returns the functional form instead of the evaluation

differential_countsfunction/float/np.array

dN/dlambda The differential photon counts per track length (in cm). The shape of the array is (len(wavelengths), len(deltaL)).

differential_counts_samplefloat/np.array

A sample of the differential counts distribution. Same shape as the differential counts

long_profilefunction/float/np.array

The distribution along the shower axis for cm

anglesfunction/float/np.array

The angular distribution in degrees

_hadron_cascade_builder()

Builder function for a hadronic cascades.

Parameters

None

Returns

Return type

None

_hadron_cascade_fetcher(energy, particle: int, wavelengths=config['advanced']['wavelengths'], angle_grid=config['advanced']['angles'], n=config['mediums'][config['scenario']['medium']]['refractive index'], z_grid=config['advanced']['z grid'], function=False)
Fetcher function for a specific particle and energy. This is for

hadron cascades.

Parameters
energyfloat

The energy(ies) of the particle in GeV

particleint

The pdg id of the particle of interest

wavelengthsnp.array

Optional: The desired wavelengths

angle_gridnp.array

Optional: The desired angles in degress

nfloat

Optional: The refractive index of the medium.

z_gridnp.array

Optional: The grid in cm for the long. distributions

functionbool

Optional: returns the functional form instead of the evaluation

differential_countsfunction/float/np.array

dN/dlambda The differential photon counts per track length (in cm). The shape of the array is (len(wavelengths), len(deltaL)).

differential_counts_samplefloat/np.array

A sample of the differential counts distribution. Same shape as the differential counts

em_fraction_meanfloat/np.array

The fraction of em particles

em_fraction_samplefloat/np.array

A sample of the em_fraction

long_profilefunction/float/np.array

The distribution along the shower axis for cm

anglesfunction/float/np.array

The angular distribution in degrees

_track_builder()

Builder function for the track functions.

Parameters

interaction (str) – Optional: The interaction(s) which should produce the light

Returns

Return type

None

_track_fetcher(energy, wavelengths=config['advanced']['wavelengths'], angle_grid=config['advanced']['angles'], n=config['mediums'][config['scenario']['medium']]['refractive index'], interaction='total', function=False)

Fetcher function for a specific energy and wavelength. This is for tracks and currently only for muons. Note in JAX mode the functions only take scalars!

Parameters
  • energy (float) – The energy(ies) of the particle in GeV

  • wavelengths (np.array) – Optional: The desired wavelengths

  • angle_grid (np.array) – Optional: The desired angles

  • n (float) – The refractive index of the medium.

  • interaction (str) – Optional: The interaction which should produce the light

  • function (bool) – Optional: returns the functional form instead of the evaluation

Returns

  • differential_counts (np.array/function) – dN/dlambda The differential photon counts per track length (in cm). The shape of the array is len(wavelengths).

  • angles (np.array/function) – The angular distribution in degrees

fennel.tracks module

class fennel.tracks.Track

Bases: object

Constructs the track object.

Parameters

None

Returns

Return type

None

_additional_track_ratio_fetcher(E, interaction: str) numpy.array

Calculates the ratio between the additional track length and the original for a single energy.

Parameters
  • E (float/np.array) – The energy of the particle in GeV

  • interaction (str) – Name of the interaction

Returns

ratio – The resulting ratio

Return type

np.array

Notes

The analytical form of the parametrization is:

\[\lambda + \kappa log(E)\]
_additional_track_ratio_fetcher_jax(E: float, interaction: str) float

Calculates the ratio between the additional track length and the original for a single energy. JAX implementation

Parameters
  • E (float) – The energy of the particle in GeV

  • interaction (str) – Name of the interaction

Returns

ratio – The resulting ratio

Return type

float

Notes

The analytical form of the parametrization is:

\[\lambda + \kappa log(E)\]
_energy_dependence_angle_pars(E)

Parametrizes the energy dependence of the angular distribution parameters

Parameters

E (float / np.array) – The energies of interest

Returns

  • a (np.array) – The first parameter values for the given energies

  • b (np.array) – The second parameter values for the given energies

  • c (np.array) – The third parameter values for the given energies

_energy_dependence_angle_pars_jax(E: float) float

Parametrizes the energy dependence of the angular distribution parameters. JAX implementation

Parameters

E (jnp.array) – The energies of interest

Returns

  • a (float) – The first parameter value for the given energy

  • b (float) – The second parameter value for the given energy

  • c (float) – The third parameter value for the given energy

Notes

The analytical form of the parametrization is:

\[par = par_0 log(E) par_1\]
_symmetric_angle_distro_fetcher(phi: numpy.array, n: float, E) numpy.array

Calculates the symmetric angular distribution of the Cherenkov emission for a single energy. The error should lie below 10%

Parameters
  • phi (np.array) – The angles of interest in degrees

  • n (float) – The refractive index

  • E (float/np.array) – The energy of interest

Returns

distro – The distribution of emitted photons given the angle. The result is a 2d array with the first axis for the angles and the second for the energies.

Return type

np.array

Notes

The analytical form of the parametrization is:

\[a e^{b (1/n - cos(\phi))^c}\]
_symmetric_angle_distro_fetcher_jax(phi: float, n: float, E: float) float

Calculates the symmetric angular distribution of the Cherenkov emission for a single energy. The error should lie below 10%. JAX implementation

Parameters
  • phi (float) – The angles of interest in degrees

  • n (float) – The refractive index

  • E (float) – The energy of interest

Returns

distro – The distribution of emitted photons given the angle. The result is a 2d array with the first axis for the angles and the second for the energies.

Return type

float

Notes

The analytical form of the parametrization is:

\[a e^{b (1/n - cos(\phi))^c}\]

fennel.definition_generator module

class fennel.definition_generator.Definitions_Generator(track: fennel.tracks.Track, em_cascade: fennel.em_cascades.EM_Cascade, hadron_cascade: fennel.hadron_cascades.Hadron_Cascade)

Bases: object

Helps with the construction of a definitions file.

Parameters
  • track (Track) – The particle for which the tracks should be generated

  • em_cascade (Particle) – The particle for which the tracks should be generated

  • hadron_cascades (Hadron_Cascade) – The particle for which the tracks should be generated

Returns

Return type

None

_flatten(d: Dict, parent_key='', sep='_')

Helper function to flatten a dictionary of dictionaries

Parameters
  • d (Dict) – The dictionary to flatten

  • parent_key (str) – Optional: Key in the parent dictionary

  • sep (str) – The seperator used

Returns

flattened_dic – The flattened dictionary

Return type

dic

_pars2csv()

Converts the calculation parameters to a csv file

Parameters

None

Returns

Return type

None

_write()

Write the definitions file

Parameters

None

Returns

Return type

None

Module contents