Physical models¶
The cascade equation can be applied whenever particles interact and decay. The
main purpose of the current program version is to calculate inclusive fluxes
of leptons () in the Earth’s
atmosphere. The calculation requires a spherical model of the Earth’s atmosphere
which on hand is based on its MCEq.geometry
and on the other hand parameterizations
or numerical models of the MCEq.density_profiles
.
Alternatiely, this code could be used for calculations of the high energy hadron and lepton flux in astrophysical environments, where the gas density and the (re-)interaction probability are very low. Prediction of detailed photon spectra is possible but additional extensions.
At very high energies, i.e. beyond 100 TeV, the decays of very short-lived particles
become an important contribution to the flux. However, heavy-flavor production at these
energies is not well known and it can not be consitently predicted within theoretical
frameworks. Some of the default interaction models (SIBYLL-2.3
or SIBYLL-2.3c
)
contain models of charmed particle production but they represent only hypotheses based
on experimental data and phenomenology. Other MCEq.charm_models
exist, such as
the MCEq.charm_models.MRS_charm
, which can be coupled with any other interaction
model for normal hadron production. In practice any kind of model which predicts a
distribution can be employed in this code as extension of the
MCEq.charm_models
module.
MCEq.density_profiles
- models of the Earth’s atmosphere¶
This module includes classes and functions modeling the Earth’s atmosphere. Currently, two different types models are supported:
- Linsley-type/CORSIKA-style parameterization
- Numerical atmosphere via external routine (NRLMSISE-00)
Both implementations have to inherit from the abstract class
EarthAtmosphere
, which provides the functions for other parts of
the program. In particular the function EarthAtmosphere.get_density()
Typical interaction:
$ atm_object = CorsikaAtmosphere("BK_USStd")
$ atm_object.set_theta(90)
$ print 'density at X=100', atm_object.X2rho(100.)
- The class
MCEqRun
will only the following routines::
If you are extending this module make sure to provide these functions without breaking compatibility.
Example
An example can be run by executing the module:
$ python MCEq/atmospheres.py
-
class
MCEq.density_profiles.
AIRSAtmosphere
(location, season, extrapolate=True, *args, **kwargs)[source]¶ Interpolation class for tabulated atmospheres.
This class is intended to read preprocessed AIRS Satellite data.
Parameters: - location (str) – see
init_parameters()
- season (str,optional) – see
init_parameters()
- location (str) – see
-
class
MCEq.density_profiles.
CorsikaAtmosphere
(location, season=None)[source]¶ Class, holding the parameters of a Linsley type parameterization similar to the Air-Shower Monte Carlo CORSIKA.
The parameters pre-defined parameters are taken from the CORSIKA manual. If new sets of parameters are added to
init_parameters()
, the array _thickl can be calculated usingcalc_thickl()
.-
_atm_param
¶ numpy.array – (5x5) Stores 5 atmospheric parameters _aatm, _batm, _catm, _thickl, _hlay for each of the 5 layers
Parameters: - location (str) – see
init_parameters()
- season (str,optional) – see
init_parameters()
-
calc_thickl
()[source]¶ Calculates thickness layers for
depth2height()
The analytical inversion of the CORSIKA parameterization relies on the knowledge about the depth , where trasitions between layers/exponentials occur.
Example
Create a new set of parameters in
init_parameters()
inserting arbitrary values in the _thikl array:$ cor_atm = CorsikaAtmosphere(new_location, new_season) $ cor_atm.calc_thickl()
Replace _thickl values with printout.
-
depth2height
(x_v)[source]¶ Converts column/vertical depth to height.
Parameters: x_v (float) – column depth in g/cm**2 Returns: height in cm Return type: float
-
get_density
(h_cm)[source]¶ Returns the density of air in g/cm**3.
Uses the optimized module function
corsika_get_density_jit()
.Parameters: h_cm (float) – height in cm Returns: density in g/cm**3 Return type: float
-
get_mass_overburden
(h_cm)[source]¶ Returns the mass overburden in atmosphere in g/cm**2.
Uses the optimized module function
corsika_get_m_overburden_jit()
.Parameters: h_cm (float) – height in cm Returns: column depth in g/cm**2 Return type: float
-
init_parameters
(location, season)[source]¶ Initializes
_atm_param
.location CORSIKA Table Description/season “USStd” 1 US Standard atmosphere “BK_USStd” 31 Bianca Keilhauer’s USStd “Karlsruhe” 18 AT115 / Karlsruhe “SouthPole” 26 and 28 MSIS-90-E for Dec and June “PL_SouthPole” 29 and 30 - Lipari’s Jan and Aug
Parameters: Raises: Exception
– if parameter set not available
-
-
class
MCEq.density_profiles.
EarthAtmosphere
(*args, **kwargs)[source]¶ Abstract class containing common methods on atmosphere. You have to inherit from this class and implement the virtual method
get_density()
.Note
Do not instantiate this class directly.
-
thrad
¶ float – current zenith angle in radiants
-
theta_deg
¶ float – current zenith angle in degrees
-
max_X
¶ float – Slant depth at the surface according to the geometry defined in the
MCEq.geometry
-
X2rho
(X)[source]¶ Returns the density .
The spline s_X2rho is used, which was calculated or retrieved from cache during the
set_theta()
call.Parameters: X (float) – slant depth in g/cm**2 Returns: in cm**3/g Return type: float
-
calculate_density_spline
(n_steps=2000)[source]¶ Calculates and stores a spline of .
Parameters: n_steps (int, optional) – number of values to use for interpolation Raises: Exception
– ifset_theta()
was not called before.
-
gamma_cherenkov_air
(h_cm)[source]¶ Returns the Lorentz factor gamma of Cherenkov threshold in air (MeV).
-
get_density
(h_cm)[source]¶ Abstract method which implementation should return the density in g/cm**3.
Parameters: h_cm (float) – height in cm Returns: density in g/cm**3 Return type: float Raises: NotImplementedError
-
h2X
(h)[source]¶ Returns the depth along path as function of height above surface.
The spline s_X2rho is used, which was calculated or retrieved from cache during the
set_theta()
call.Parameters: h (float) – vertical height above surface in cm Returns: X slant depth in g/cm**2 Return type: float
-
nref_rel_air
(h_cm)[source]¶ Returns the refractive index - 1 in air (density parametrization as in CORSIKA).
-
r_X2rho
(X)[source]¶ Returns the inverse density .
The spline s_X2rho is used, which was calculated or retrieved from cache during the
set_theta()
call.Parameters: X (float) – slant depth in g/cm**2 Returns: in cm**3/g Return type: float
-
set_theta
(theta_deg, force_spline_calc=False)[source]¶ Configures geometry and initiates spline calculation for .
If the option ‘use_atm_cache’ is enabled in the config, the function will check, if a corresponding spline is available in the cache and use it. Otherwise it will call
calculate_density_spline()
, make the functionr_X2rho()
available to the core code and store the spline in the cache.Parameters:
-
-
class
MCEq.density_profiles.
IsothermalAtmosphere
(location, season, hiso_km=6.3, X0=1300.0)[source]¶ Isothermal model of the atmosphere.
This model is widely used in semi-analytical calculations. The isothermal approximation is valid in a certain range of altitudes and usually one adjust the parameters to match a more realistic density profile at altitudes between 10 - 30 km, where the high energy muon production rate peaks. Such parametrizations are given in the book “Cosmic Rays and Particle Physics”, Gaisser, Engel and Resconi (2016). The default values are from M. Thunman, G. Ingelman, and P. Gondolo, Astropart. Physics 5, 309 (1996).
Parameters:
-
class
MCEq.density_profiles.
MSIS00Atmosphere
(location, season)[source]¶ Wrapper class for a python interface to the NRLMSISE-00 model.
NRLMSISE-00 is an empirical model of the Earth’s atmosphere. It is available as a FORTRAN 77 code or as a verson traslated into C by Dominik Borodowski. Here a PYTHON wrapper has been used.
-
_msis
¶ NRLMSISE-00 python wrapper object handler
Parameters: - location (str) – see
init_parameters()
- season (str,optional) – see
init_parameters()
-
-
class
MCEq.density_profiles.
MSIS00IceCubeCentered
(location, season)[source]¶ Extension of
MSIS00Atmosphere
which couples the latitude setting with the zenith angle of the detector.Parameters: -
latitude
(det_zenith_deg)[source]¶ Returns the geographic latitude of the shower impact point.
Assumes a spherical earth. The detector is 1948m under the surface.
Credits: geometry fomulae by Jakob van Santen, DESY Zeuthen.
Parameters: det_zenith_deg (float) – zenith angle at detector in degrees Returns: latitude of the impact point in degrees Return type: float
-
MCEq.geometry
— Extensive-Air-Shower geometry¶
This module includes classes and functions modeling the geometry of the cascade trajectory.
-
class
MCEq.geometry.
EarthGeometry
[source]¶ - A model of the Earth’s geometry, approximating it
- by a sphere. The figure below illustrates the meaning of the parameters.
Example
The plots below will be produced by executing the module:
$ python geometry.py
The module currently contains only module level functions. To implement a different geometry, e.g. in an astrophysical content, you can create a new module providing similar functions or place the current content into a class.
-
h_obs
¶ float – observation level height [cm]
-
h_atm
¶ float – top of the atmosphere [cm]
-
r_E
¶ float – radius Earth [cm]
-
r_top
¶ float – radius at top of the atmosphere [cm]
-
r_obs
¶ float – radius at observation level [cm]
-
cos_th_star
(theta)[source]¶ Returns the zenith angle at atmospheric boarder in [rad] as a function of zenith at detector.
-
MCEq.geometry.
chirkin_cos_theta_star
(costheta)[source]¶ parameterization.
This function returns the equivalent zenith angle for for very inclined showers. It is based on a CORSIKA study by D. Chirkin, hep-ph/0407078v1, 2004.
Parameters: costheta (float) – in [rad] Returns: in [rad] Return type: float
MCEq.charm_models
— charmed particle production¶
This module includes classes for custom charmed particle
production. Currently only the MRS model is implemented
as the class MRS_charm
. The abstract class
CharmModel
guides the implementation of custom
classes.
The Yields
instantiates derived classes of
CharmModel
and calls CharmModel.get_yield_matrix()
when overwriting a model yield file in
Yields.set_custom_charm_model()
.
-
class
MCEq.charm_models.
CharmModel
[source]¶ Abstract class, from which implemeted charm models can inherit.
Note
Do not instantiate this class directly.
-
class
MCEq.charm_models.
MRS_charm
(e_grid, csm)[source]¶ Martin-Ryskin-Stasto charm model.
The model is described in A. D. Martin, M. G. Ryskin, and A. M. Stasto, Acta Physica Polonica B 34, 3273 (2003). The parameterization of the inclusive cross-section is given in the appendix of the paper. This formula provides the behavior of the cross-section, while fragmentation functions and certain scales are needed to obtain meson and baryon fluxes as a function of the kinematic variable . At high energies and , where this model is valid, . Here, these fragmentation functions are used:
- -mesons
- -baryons
The production ratios between the different types of -mesons are stored in the attribute
cs_scales
andD0_scale
, whereD0_scale
is the to ratio andcs_scales
stores the production ratios of , and .Since the model employs only perturbartive production of charm, the charge conjugates are symmetric, i.e. etc.
Parameters: - e_grid (np.array) – energy grid as it is defined in
MCEqRun
. - csm (np.array) – inelastic cross-sections as used in
MCEqRun
.
-
D_dist
(x, E, mes)[source]¶ Returns the Feynman- distribution of in mb
Parameters: Returns: in mb
Return type:
-
LambdaC_dist
(x, E)[source]¶ Returns the Feynman- distribution of in mb
Parameters: Returns: in mb
Return type:
-
dsig_dx
(x, E)[source]¶ Returns the Feynman- distribution of in mb
Parameters: Returns: in mb
Return type:
-
get_yield_matrix
(proj, sec)[source]¶ Returns the yield matrix in proper format for
MCEqRun
.Parameters: Returns: - yield matrix if (proj,sec) combination allowed,
else zero matrix
Return type: np.array
-
sigma_cc
(E)[source]¶ Returns the integrated ccbar cross-section in mb.
Note
Integration is not going over complete phase-space due to limitations of the parameterization.
-
D0_scale
= 0.47619047619047616¶ D0 cross-section wrt to the ccbar cross-section
-
allowed_proj
= [2212, -2212, 2112, -2112, 211, -211, 321, -321]¶ hadron projectiles, which are allowed to produce charm
-
allowed_sec
= [411, 421, 431, 4122]¶ charm secondaries, which are predicted by this model
-
cs_scales
= {4122: 0.45, 411: 0.5, 421: 1.0, 431: 0.15}¶ fractions of cross-section wrt to D0 cross-section
-
class
MCEq.charm_models.
WHR_charm
(e_grid, csm)[source]¶ Logan Wille, Francis Halzen, Hall Reno.
The approach is the same as in A. D. Martin, M. G. Ryskin, and A. M. Stasto, Acta Physica Polonica B 34, 3273 (2003). The parameterization of the inclusive cross-section is replaced by interpolated tables from the calculation. Fragmentation functions and certain scales are needed to obtain meson and baryon fluxes as a function of the kinematic variable . At high energies and , where this model is valid, . Here, these fragmentation functions are used:
- -mesons
- -baryons
The production ratios between the different types of -mesons are stored in the attribute
cs_scales
andD0_scale
, whereD0_scale
is the to ratio andcs_scales
stores the production ratios of , and .Since the model employs only perturbartive production of charm, the charge conjugates are symmetric, i.e. etc.
Parameters: - e_grid (np.array) – energy grid as it is defined in
MCEqRun
. - csm (np.array) – inelastic cross-sections as used in
MCEqRun
.