Energy Losses

group Energy Loss Processes

Energy losses of candidates.

Functions

EMPairProduction(ref_ptr<PhotonField> photonField, bool haveElectrons = false, double thinning = 0, double limit = 0.1, ref_ptr<Surface> surface = nullptr)

Constructor The object used to load, store and access to the interaction rates of the process is the interactionRates pointer.

Parameters:
  • photonField – target photon field

  • haveElectrons – if true, add secondary electrons as candidates

  • thinning – weighted sampling of secondaries (0: all particles are tracked; 1: maximum thinning)

  • limit – step size limit as fraction of mean free path

  • surfaceGrid will be confined to surface->distance(pos)<0, so for example inside a closed surface

void setPhotonField(ref_ptr<PhotonField> photonField)
void setHaveElectrons(bool haveElectrons)
void setLimit(double limit)

Limit the propagation step to a fraction of the mean free path

Parameters:

limit – fraction of the mean free path

void setThinning(double thinning)

Apply thinning with a given thinning factor

Parameters:

thinning – factor of thinning (0: no thinning, 1: maximum thinning)

void setSurface(ref_ptr<Surface> surface)

Apply a surface that confine the position dependent photon field region. The rates are initialized only for distances smaller then 0, so surface->distance(pos)<0

Parameters:

surfaceGrid will be confined to surface->distance(pos)<0, so for example inside a closed surface

ref_ptr<Surface> getSurface() const
void setInteractionTag(std::string tag)

set a custom interaction tag to trace back this interaction

Parameters:

tag – string that will be added to the candidate and output

std::string getInteractionTag() const
void setInteractionRates(ref_ptr<InteractionRates> intRates)

set a custom interaction rate With this function you can change the type of interaction rate, if you would for example like to change from a homogeneous to a position dependent interaction rate.

Parameters:

intRatesref_ptr to a InteractionRates class

ref_ptr<InteractionRates> getInteractionRates() const
void initRate(std::string path)

Loads the interaction rate This function loads the interaction rate from a given file/folder.

Parameters:

path – The name of the file/folder containing the interaction rates

void initCumulativeRate(std::string path)

Loads the cumulative interaction rate This function loads the interaction rate from a given file/folder.

Parameters:

path – The name of the file/folder containing the interaction rates

void performInteraction(Candidate *candidate) const
virtual void process(Candidate *candidate) const

Process function This is the main function to work with, it is called during every ModuleList::run step. Derived functions need to override this overload of process!

Parameters:

candidateCandidate raw pointer

Variables

ref_ptr<PhotonField> photonField
bool haveElectrons
double limit
double thinning
ref_ptr<Surface> surface
std::string interactionTag = "EMPP"
ref_ptr<InteractionRates> interactionRates
class AdiabaticCooling : public Module
#include <AdiabaticCooling.h>

Implements adiabatic cooling/heating due to advection.

class ElectronPairProduction : public Module
#include <ElectronPairProduction.h>

Electron-pair production of charged nuclei with background photons.

This module simulates electron-pair production as a continuous energy loss.

Several photon fields can be selected.

The production of secondary e+/e- pairs and photons can by activated.

By default, the module limits the step size to 10% of the energy loss length of the particle.

class EMDoublePairProduction : public Module
#include <EMDoublePairProduction.h>

Electron double pair production of photons with background photons.

This module simulates electron double pair production of photons with background photons for several photon fields. The secondary electrons from this interaction are optionally created (default = false). The module limits the propagation step size to a fraction of the mean free path (default = 0.1). Thinning is available. A thinning of 0 means that all particles are tracked. For the maximum thinning of 1, only a few representative particles are added to the list of secondaries. Note that for thinning>0 the output must contain the column “weights”, which should be included in the post-processing. The surface is defined to include the nodes of the grid contained within.

class EMInverseComptonScattering : public Module
#include <EMInverseComptonScattering.h>

Inverse Compton scattering of electrons with background photons.

This module simulates inverse Compton scattering of electrons with background photons for several photon fields. The upscattered photons are optionally created as secondary particles (default = false). The module limits the propagation step size to a fraction of the mean free path (default = 0.1). Thinning is available. A thinning of 0 means that all particles are tracked. For the maximum thinning of 1, only a few representative particles are added to the list of secondaries. Note that for thinning>0 the output must contain the column “weights”, which should be included in the post-processing. The surface is defined to include the nodes of the grid contained within.

class EMPairProduction : public Module
#include <EMPairProduction.h>

Electron-pair production of photons with background photons.

This module simulates electron-pair production of cosmic ray photons with background photons: gamma + gamma_b –> e+ + e- (Breit-Wheeler process). The resulting electron positron pair is optionally created (default = false). The module limits the propagation step size to a fraction of the mean free path (default = 0.1). Thinning is available. A thinning of 0 means that all particles are tracked. For the maximum thinning of 1, only a few representative particles are added to the list of secondaries. Note that for thinning>0 the output must contain the column “weights”, which should be included in the post-processing. The surface is defined to include the nodes of the grid contained within.

class EMTripletPairProduction : public Module
#include <EMTripletPairProduction.h>

Electron triplet pair production of electrons with background photons.

This module simulates electron triplet pair production of electrons with background photons for several photon fields. The secondary electrons from this interaction are optionally created (default = false). The module limits the propagation step size to a fraction of the mean free path (default = 0.1). Thinning is available. A thinning of 0 means that all particles are tracked. For the maximum thinning of 1, only a few representative particles are added to the list of secondaries. Note that for thinning>0 the output must contain the column “weights”, which should be included in the post-processing. The surface is defined to include the nodes of the grid contained within.

class ConstantMomentumDiffusion : public Module
#include <MomentumDiffusion.h>

Simplest model for diffusion in momentum space

class NuclearDecay : public Module
#include <NuclearDecay.h>

Nuclear decay of unstable nuclei.

This module simulates the nuclear decay of unstable nuclei using data from NuDat2. All decay modes are considered: alpha, beta+- and gamma decay, as well as proton- and neutron dripping. The resulting non-hadronic secondary particles (e+, e-, neutrinos, gamma) can optionally be created.

For details on the preprocessing of the NuDat2 data refer to “CRPropa3-data/calc_decay.py”.

class PhotoDisintegration : public Module
#include <PhotoDisintegration.h>

Photodisintegration of nuclei by background photons.

struct SophiaEventOutput
class PhotoPionProduction : public Module
#include <PhotoPionProduction.h>

Photo-pion interactions of nuclei with background photons.

class Redshift : public Module
#include <Redshift.h>

Updates redshift and applies adiabatic energy loss according to the traveled distance.

class FutureRedshift : public Module
#include <Redshift.h>

Updates redshift and applies adiabatic energy loss according to the traveled distance. Extends to negative redshift values to allow for symmetric time windows around z=0.

class SynchrotronRadiation : public Module
#include <SynchrotronRadiation.h>

Synchrotron radiation of charged particles in magnetic fields.

This module simulates the continuous energy loss of charged particles in magnetic fields, c.f. Jackson. The magnetic field is specified either by a MagneticField or by a RMS field strength value. The module limits the next step size to ensure a fractional energy loss dE/E < limit (default = 0.1). Optionally, synchrotron photons above a threshold (default E > 10^6 eV) are created as secondary particles. Note that the large number of secondary photons per propagation can cause memory problems. To mitigate this, use thinning. However, this still does not solve the problem completely. For this reason, a break-condition stops tracking secondary photons and reweights the current ones.